On the same topic, I wrote some articles a while ago. Here is my own approach for making a VanillaJS SPA without using any bundlers or frameworks https://rishav-sharan.com/#/making-a-spa-in-vanilla-js Note that this blog right now converts markdown posts into html at runtime, which is definitely not an efficient way of doing things. But considering that I have just a handful of people landing there, I really haven't…
Modern SPAs without bundlers, CDNs, or Node.js
71–80 of 170 posts
Re: Modern SPAs without bundlers, CDNs, or Node.js
#72What’s the benefit of the custom download-package script over npm install? Why would you want to roll a custom solution here?
Re: Modern SPAs without bundlers, CDNs, or Node.js
#73The problem with writing a shell script to fetch and download NPM packages is that it won't do so in parallel. I'm sure that's fine if you only depend on one or two packages, but dependency explosion is practically a feature of the NPM ecosystem, and that'll stretch the script runtime. Not to mention fetching packages that you already downloaded, and no compatibility with outside tooling like Dependabot for automatic…
Re: Modern SPAs without bundlers, CDNs, or Node.js
#74What’s the benefit of the custom download-package script over npm install? Why would you want to roll a custom solution here?
Re: Modern SPAs without bundlers, CDNs, or Node.js
#75Re: Modern SPAs without bundlers, CDNs, or Node.js
#76Re: Modern SPAs without bundlers, CDNs, or Node.js
#77It warms my heart to see frontend web dev maturing like this, it really does. Kudos to the author for putting this out there, that shell script is nifty. One trick I've used is to `npm install` my dependencies as normal but bundle them with esbuild, while also generating a typescript definition file. This gives me one file I can import in vanilla JS but also lets me check my JS with typescript.
Me too, I left Web development when node and npm were learning to crawl, given how things went in WinRT and Android world, I ended up refocusing on Web. So when I got back I couldn't believe how bad the experience became versus SSR frameworks, and gladly focused on backend and devops stuff instead. It is refreshing to see this starting to happen.
Like frogs in a slowly boiling pot, most full time js devs have no idea the shit they put up with. IMHO modern js frameworks suffer from complexity rot; they are so over engineered it is a sad joke.
Re: Modern SPAs without bundlers, CDNs, or Node.js
#78(Did I mention that import maps was only supported in only Firefox 3 months ago?)
People think they are smart and come up with ideas nobody thought of before. "This seems so simple, why don't people use this?" I'm sorry, that's not the case here. I have been doing web development as a hobby and professionally for well over a decade and have seen too much of this.
Re: Modern SPAs without bundlers, CDNs, or Node.js
#79Re: Modern SPAs without bundlers, CDNs, or Node.js
#80While Safari doesn’t support importmap, it’s possible (and not too hard) to use them as a progressive enhancement so that it’ll still work, and safari users will get the benefit with 16.4. I did a writeup: https://qubyte.codes/blog/progressively-enhanced-caching-of-...