Skip to content

Instantly share code, notes, and snippets.

@iheanyi
Last active August 29, 2015 14:21
Show Gist options
  • Save iheanyi/7442f31b7fa1a2e1cfca to your computer and use it in GitHub Desktop.
Save iheanyi/7442f31b7fa1a2e1cfca to your computer and use it in GitHub Desktop.
Outline for when to use a JS MVC Framework

Main Question

When should I start using a JS MVC framework for my front-end applications over a server-rendered application?

Ideas

When the UI/UX is somewhat complex

This means that you have nested routes or various components on your website that depend on data retrieved from the back-end. I found it harder to build maintable, ambitious UIs using only JQuery without losing my sanity.

State Management and Information Sharing

In certain applications, you might want to persist certain information across different views. It is kind of harder to persist information such as the "Current User" that is logged in and that information is needed across all views.

Microservices / Fragmented Architectures

All your services may not exist on one server, you may have to make posts to different URLs/services for different functions of your application . . .

You aren't using server-rendered views

If you are trying to build a front-end application using only JQuery and you find yourself setting a lot of pushStates or manually updating the window.location.hash within your front-end code, you might want to consider using a front-end framework or library such as React.

Comatosing due to JQuery Spaghetti

If your front-end makes multiple queries to an API and has to update your front-end according, rather than having to dynamically remove and recreate the nodes using JQuery, it'd be better to just abstract the relevant data/information and their actions in the Controller and leverage the strength of front-end templating in the View layer to present said information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment