Live data from Hacker News

Modern SPAs without bundlers, CDNs, or Node.js

kofi.sexy

111–120 of 170 posts

Re: Modern SPAs without bundlers, CDNs, or Node.js

#111
post #78

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…

Cargo-culting is responsible for the most popular things in development. Not the actual benefits.

Re: Modern SPAs without bundlers, CDNs, or Node.js

#112
post #68

Earlier 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…

Joining this thread to say that I, too, have written a very similar function and also use jsxFactory to have JSX support in personal projects. I find that using it along with an extremely simple implementation of a kind of state listener[0] produces something really nice for small projects.

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

#113

Earlier 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?

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 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

#114
post #78

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…

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…

While you may like having a build step, it is not necessary and some people don't like it. I've been building commercial data warehouse apps for >30 years and am very happy that our apps don't have a build step. Current app is a multi-million dollar Fortune 500 client app. No build step.

Re: Modern SPAs without bundlers, CDNs, or Node.js

#115

Earlier 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.

Figma and Discord come to mind as being exceptionally well implemented front end applications. They're even more HN-friendly because they both use Rust for performance-critical code.

Re: Modern SPAs without bundlers, CDNs, or Node.js

#118
post #65

Earlier 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…

I find it a lot easier to reason about logical chunks of code that are clearly divided. I rarely want to see just a specific function, but a cohesive unit that can be read in sequence and make sense. You can do that in a single file too, but in my experience, large files tends to lead to code being spread out without a narrative determining order because people (myself included) are rarely disciplined enough. Files act as a convenient clear grouping to me. On the other extreme, when people insist on splitting everything up into the smallest little unit, it drives me entirely nuts for the same reason. I want to be able to read through the code without jumping back and forth all the time.

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

#119

Earlier 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…

The web targets every platform. How ambitious is that? Of course it brings some challenges.

Re: Modern SPAs without bundlers, CDNs, or Node.js

#120
post #100
post #78

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…

"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…

> Likewise, Babel isn't important either. You don't need to use some futuristic JS feature on your simple project, you can just stick to well supported ones, thus not needing Babel.

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.

Post reply on HN