7 ms·
This progressive enhancement is exactly why I prefer Vue and find it so productive. 95% of apps are best built as server-side rendered with reactivity on top of
by manigandham 5y ago
This progressive enhancement is exactly why I prefer Vue and find it so productive. 95% of apps are best built as server-side rendered with reactivity on top of each page as needed (instead of the JS/SPA monstrosities we have today).
Nice to see an even lighter version optimized for this use-case.
- ergo14 5y agoThen maybe look at https://lit.dev/ https://lit.dev/ it might be perfect solution for you, stencil i've heard is also nice. Since its custom-elements you just add custom tags and they will self upgrade.
- brylie 5y agoLit elements looks nice and it's good to see first-class support for WebComponents. I'm just a bit concerned about having to write declarative HTML in JavaScript functions. Mixing declarative and imperative code can lead to some unwieldy templates so I prefer am approach with minimal templating enhancements sprinkled into standard HTML. What would be an approach, similar to Vue, to enforce the separation of imperative business frim declarative layout definitions using LitElement, Polymer, or similar WebComponents frameworks?
- ergo14 5y agoYou could probably separate those with tooling.
- bnt 5y agoFor me, no build step is a huge selling point.
- johnnypangs 5y agoWhere did you get 95% from?
- onion2k 5y agoVue doing this is awesome, but it isn't really a good reason to prefer it. Server side rendering with progressive enhancement is available in pretty much every major JS framework. Heck, the latest version of React can do SSR with late loading and late binding to make content load even faster. https://github.com/reactwg/react-18/discussions/37 https://github.com/reactwg/react-18/discussions/37
- manigandham 5y agoVue is specifically better because it uses HTML-based templates by default, and HTML is what's produced by web frameworks. This means you can use whatever technology you want on the backend and everything works seamlessly. Also the syntax for directives, handlers, and other logic in these templates is much easier than dealing with JSX in the majority of uses-cases. SSR/isometric rendering isn't new, but it's usually hacks around using a frontend JS framework to run the backend and can result in the worst of both worlds. Projects like Blazor (.net) and Livewire (php/laravel) are interesting new solutions to fix this.
- bobmaxup 5y agoWhy are Blazor and Livewire a new solution? It seems like if you are developing solely to meet "SEO friendly" criteria, you aren't exploring many alternative solutions. Does all this framework tooling exist to just avoid inspecting a user agent and serving from a different upstream? Having to maintain a large set of template files, with a dependency on a separate language or framework seems contrary to your premise that Vue is specifically better because it uses "HTML templates by default"
- manigandham 5y ago> "developing solely to meet "SEO friendly"" Never said I was. In fact that's just another nice benefit of traditional server-side frameworks rather than something you have to worry about implementing all over again. Blazor specifically is the first non-JS component-based UI framework for the web with multiple modes that bridges backend and frontend as a single service without any impedance mismatch. It's an entirely new way to approach web UIs and interactivity without all the plumbing and frontend-to-backend-for-the-frontend-to-the-backend nonsense. Livewire is not quite as polished but shows how far you can go with tight integration on the JS side.
- pier25 5y agoUsing Vue kinda as a jQuery replacement is its strongest feature IMO. For anything else I would most likely use Svelte or maybe React given the right circumstances.