Sigh... Another post like this. Sure, it works well enough for the example shown in the article, but won't work well beyond this. Bundlers, package managers and other tools were created to address problems people saw in medium-large projects for websites with a lot of traffic. And as soon as the project has dozens of files and even just two or three external libraries, this becomes unmaintainable. Not to mention mini…
The last couple days there's been a lot of negativity towards the build step, but it's like everyone's forgotten the historical context that made the build step so popular to begin with. I'll give credit to the post about the fragility of certain build tools long-term in the npm ecosystem, but I don't think that's a reason to shrug off build tools period. We just need better, more stable ones (and I think we're start…
Modern SPAs without bundlers, CDNs, or Node.js
111–120 of 170 posts
Re: Modern SPAs without bundlers, CDNs, or Node.js
#112Earlier quoted context omitted.
An even simpler bit of sugar over the DOM that I embed whenever I need just a little bit of JS: function $E(t,p,c) { const el=document.createElement(t) Object.assign(el,p) el.append(...c) return el } Usage: const button = $E('button', {onclick: () => alert('click!')}, [ $E('img', {src: '/assets/icon-lightbulb.png'}, []), 'Ding!', ]) (With thanks to 'goranmoomin: https://news.ycombinator.com/item?id=23590750 )
Wow! What a coincidence! I literally have something extremely similar which I called `$e`. I think one crucial thing you did not mention is that this conforms to the signature of jsxFactory, meaning if you run some kind of transpiler that supports jsx, you can literally do: parent.append( Hello ); (Mine has slightly more functionalities, such as allowing passing in styles as a object, auto concatenate array of string…
It's a bit like a jquery for the '20s.
[0] https://github.com/curlywurlycraig/vdom-util/blob/master/src...
Re: Modern SPAs without bundlers, CDNs, or Node.js
#113Earlier quoted context omitted.
I have never ever in my lifetime seen a front end application that was enjoyable to use.
Is there a reason you decided to come into a Javascript thread just to tell everyone how much you dislike Javascript?
That person then wrote "But for anything real, hell yes, give me a good build mechanism." which implies that he creates real, high quality applications.
But my experience is that all front end web applications are all sub-par, so it doesn't really matter if a SPA uses a bundler or not, it doesn't affect quality when it is all shit anyway. So more power to the guy who decides to not use the bundler.
In the end, I agree with Alan Kay, the web was created by a bunch of amateurs
Re: Modern SPAs without bundlers, CDNs, or Node.js
#114Sigh... Another post like this. Sure, it works well enough for the example shown in the article, but won't work well beyond this. Bundlers, package managers and other tools were created to address problems people saw in medium-large projects for websites with a lot of traffic. And as soon as the project has dozens of files and even just two or three external libraries, this becomes unmaintainable. Not to mention mini…
I’ve been doing it professionally for 20 years, and I agree. Modern front end development with TypeScript, Vite, Preact, and even the much maligned npm are so much better than anything that preceded them for building complex front end applications. I like having a build step for code that I write. I build C, I build Go, I build C#. I don’t ship debug builds of those things. I don’t know why I’d want to forego all of…
Re: Modern SPAs without bundlers, CDNs, or Node.js
#115Earlier quoted context omitted.
I’ve been doing it professionally for 20 years, and I agree. Modern front end development with TypeScript, Vite, Preact, and even the much maligned npm are so much better than anything that preceded them for building complex front end applications. I like having a build step for code that I write. I build C, I build Go, I build C#. I don’t ship debug builds of those things. I don’t know why I’d want to forego all of…
I have never ever in my lifetime seen a front end application that was enjoyable to use.
Re: Modern SPAs without bundlers, CDNs, or Node.js
#116Haven't used NodeJS in a while and my current projects have no build step. But I'd like to hear some opinions on what specific threshold of complexity would lead one to add NodeJS.
Re: Modern SPAs without bundlers, CDNs, or Node.js
#117Re: Modern SPAs without bundlers, CDNs, or Node.js
#118Earlier quoted context omitted.
There is no clear project structure if you don't write down what the expected project structure is . Which you really need even with a framework, because the frameworks only provide really rough high level structure. While I loathe files thousands of lines long, I also loathe the endless chasing of things from file to file that tends to be the result of applying big frameworks to tiny projects.
Really? It has been well over a decade since I cared about file length or number of files. Any number of code editors has search, multi-file search, and "go to definition". I've got one personal project that is a three.js character creator, where my js is one file of somewhere north of 200K lines. Who cares? I sure don't. If another were to join the project, sure, I'd break it up into smaller files so others can work…
But when it's just you it's all down to preference, so do what works for you.
Re: Modern SPAs without bundlers, CDNs, or Node.js
#119Earlier quoted context omitted.
Is there a reason you decided to come into a Javascript thread just to tell everyone how much you dislike Javascript?
The person I was responding to wrote "Modern front end development with TypeScript, Vite, Preact, and even the much maligned npm are so much better than anything that preceded them for building complex front end applications." which implies that modern front end is an improvement over what previously existed. That person then wrote "But for anything real, hell yes, give me a good build mechanism." which implies that…
Re: Modern SPAs without bundlers, CDNs, or Node.js
#120Sigh... Another post like this. Sure, it works well enough for the example shown in the article, but won't work well beyond this. Bundlers, package managers and other tools were created to address problems people saw in medium-large projects for websites with a lot of traffic. And as soon as the project has dozens of files and even just two or three external libraries, this becomes unmaintainable. Not to mention mini…
"Sure, it works well enough for the example shown in the article, but won't work well beyond this." Sigh...the entire bloody point of the author is to use this for light projects, to scale the sophistication of the setup gracefully. With very obvious benefits: easy to understand, not linked to any setup so it works forever, interoperable and transferable. Typescript isn't universally important for development. It has…
I would say even many moderately complex sites/apps have no need for [shiny new feature X]. These days new JS features tend more towards nice-to-have than they do essential. Back in the days when jQuery was ubiquitous it was a different story but things have improved quite a bit.