3 ms·
I was a big advocate for “just use jQuery” amidst the JS framework hype ~10 years ago, but nowadays I agree that plain Vue hits a similar mark quite well. Even
by macNchz 3y ago
I was a big advocate for “just use jQuery” amidst the JS framework hype ~10 years ago, but nowadays I agree that plain Vue hits a similar mark quite well.
Even just a naive approach of plopping a whole page in one big component or enhancing a page rendered elsewhere by mounting a few self-contained widgets on it is nicer than manually keeping track of state with events. Even my best an most concerted efforts at jQuery frontends eventually had many bugs that simply don’t happen with a declarative approach.
- arp242 3y agoOne downside of Vue is that you need a build system for it; I really like the ability to "just" serve files, or build things on-demand when needed (even with cache that's 20 lines of code or so). It's just too slow and convoluted to do that (I tried), and this gets even worse with TypeScript because tsc is so darn slow to startup. The closest I've gotten is running the JavaScript build system as a subprocess in the application itself, but meh...
- macNchz 3y agoYou can run it with just a script tag: https://vuejs.org/guide/extras/ways-of-using-vue.html#standalone-script https://vuejs.org/guide/extras/ways-of-using-vue.html#standa... They even describe it as a "declarative replacement for jQuery" in the docs!
- arp242 3y agoHow do you include all the pages and components with that? e.g. I have about 60 .vue pages and 10 .vue components. Last time I looked at this everything seemed pretty hacky and came with some pretty serious trade-offs.
- codegeek 3y agoI have come across this: https://github.com/FranckFreiburger/vue3-sfc-loader https://github.com/FranckFreiburger/vue3-sfc-loader Might be worth trying. The problem is that these 3rd party libraries may work but you may end up needing a build system for a new library that you may need in the future. I tried but for complex applications with JS, you unfortunately cannot get away from the build system.