Modern SPAs without bundlers, CDNs, or Node.js
1–10 of 170 posts
Re: Modern SPAs without bundlers, CDNs, or Node.js
#2Re: Modern SPAs without bundlers, CDNs, or Node.js
#3Woah, importmap is a game changer! I didn't know about it until reading this, thanks!
Re: Modern SPAs without bundlers, CDNs, or Node.js
#4Woah, importmap is a game changer! I didn't know about it until reading this, thanks!
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sc...
Re: Modern SPAs without bundlers, CDNs, or Node.js
#5Woah, importmap is a game changer! I didn't know about it until reading this, thanks!
No Safari support seems like a significant hurdle.
Re: Modern SPAs without bundlers, CDNs, or Node.js
#6Re: Modern SPAs without bundlers, CDNs, or Node.js
#7Woah, importmap is a game changer! I didn't know about it until reading this, thanks!
Not yet available on Safari, but still cool! https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sc...
(But it is fairly large: 53KB raw, 15KB gzipped, 32KB minified, 11KB minified+gzipped. It’s providing a lot of likely-unnecessary functionality. I’d prefer a stripped-down and reworked polyfill that can also be lazily-loaded, controlled by a snippet of at most a few hundred bytes that you can drop into the document, only loading the polyfill in the uncommon case that it’s needed—like how five years ago as part of modernising some of the code of Fastmail’s webmail, I had it fetch and execute core-js before loading the rest iff !Object.values (choosing that as a convenient baseline—see https://www.fastmail.com/blog/using-the-modern-web-platform/... for more details), so that the cost to new browsers of supporting old browsers was a single trivial branch, and maybe fifty bytes in added payload. I dislike polyfills slowing down browsers that don’t need them, by adding undue weight or extra requests.)
Re: Modern SPAs without bundlers, CDNs, or Node.js
#8Woah, importmap is a game changer! I didn't know about it until reading this, thanks!
Not yet available on Safari, but still cool! https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sc...
Re: Modern SPAs without bundlers, CDNs, or Node.js
#9Instead of taking the path of starting with DOM manipulation and then going to a framework as necessary, I've kept really trying to make raw web components work, but kept finding that I wanted just a little bit more.
I managed to get the more I wanted -- sensible template interpolation with event binding -- boiled down to a tag function in 481 bytes / 12 lines of (dense) source code, which I feel like is small enough that you can copy/paste it around and not feel to bad about it. It's here if anyone cares to look: https://github.com/dchester/yhtml
Re: Modern SPAs without bundlers, CDNs, or Node.js
#10but bold move cotton
nice to see there is a polyfill
I’ll think about it for my next side project, but I’ll probably just do something I can add to my React + Node portfolio on github because recruiters and employers won’t know about this until 2027