Rendering the marketing pages of the site -> HTML+CSS
Need to add the tiniest bit of interactivity -> jQuery
Have a "module" of functionality that -> SPA
I disagree. They are whole frameworks taking a completely different approach than jQuery, which is basically just a helper library.
jQuery is useful as a tool for operating within an externally organized application (or otherwise mostly static DOM tree). It simplifies low-level operations like DOM element manipulation.
Frameworks like React or Vue take a top-down, more declarative approach on how the DOM is built and updated. It's in many regards more powerful and more productive, but comes at a certain cost (setup complexity, total page size, certain aspects of performance).
So, which tool is best for your project really depends on the individual use case.
It ain't new and shiny but you can build anything with it. In fact, today jQuery is used on 97% of websites* while React and Vue are around 0.2%. I imagine that will change over time.
* Top 10M Alexa ranked: https://w3techs.com/technologies/overview/javascript_library...
Granted I've only deployed one SPA to prod and that was an Ember application but I'm not feeling the love based on that project.
The new paradigm is using data binding with the latest language features.
Share code between your SPAs, for example, utilities?
What if your SPAs have large dependencies (React, Vue), should every SPA come with their own?
Should every SPA have its own build tools?
What if there's an update to a library, should it be allowed that one SPA runs on an older library?
> Share code between your SPAs, for example, utilities?
We alias a common folder for our utils with webpack which allows all our code to use the same utilities. We actually have two. One for shared frontend and backend, and one for just shared frontend
> What if your SPAs have large dependencies (React, Vue), should every SPA come with their own?
Webpack code splitting is how we split our apps. We also build into multiple bundles to keep bundle size small. That does mean that React does get bundled with each, but if you split thing appropriately, you can potentially save off a few MB with caching each bundle from page to page.
> Should every SPA have its own build tools?
With webpack, you can build all your bundles with one config / command
> What if there's an update to a library, should it be allowed that one SPA runs on an older library?
We have a root package.json for all of our react apps. This means that we don't update a library unless we can update it across the board. It takes more time to test upgrades, but it also means smaller bundles, easier package management and easier maintenance in the long run.
I'm super excited to see WebComponents support. It'll be (and already is if you don't care about IE support) possible to implement this without any frameworks/libraries/etc :)
"Web Components" is a great name IMO.
Let's take a CMS as an example. The "Edit blog post/page" function can be its own SPA avoiding page reload when the post is modified. Managing the list of posts/pages can be another. A page reload in between steps is fine. Nowadays internet speed is fast and latency is pretty low. Browsers are also very efficient and vive caching. If you keep your SPAs small, the user won't see the lag going from one page to another.
Multiple SPAs also allows you to keep things modular. Different teams can own different parts.
Do not however bundle the entire CMS into a single SPA. It will most likely contain a lot of code and resources to load. That will kill performance and slow down development over time.