Live data from Hacker News

Pika/web: Web Apps Without the Bundler

pikapkg.com

41–50 of 85 posts

Re: Pika/web: Web Apps Without the Bundler

#41
post #14

Luckily, with native javascript modules, there is no need for any of this anymore. We switched our whole codebase to and it's such a joy now. Never going back to bundlers. Never going back to having a compilation step on the server.

Its a good thought, but you're excluding ~15% of all web users[0] from using your product. [0] https://caniuse.com/#feat=es6-module

15% are only still on IE because it still works. If more devs start doing this you will be excluding 0% of users.

Re: Pika/web: Web Apps Without the Bundler

#42
post #11

Earlier quoted context omitted.

You probably won't end up with a dependency tree . Remember development in 2007? Remember this? Under ESM, each of your dependencies could go back to being a (CDN or /vendor-directory) hosted "release." The release would have been packed together into a single JS file + a single CSS file by its developer, when it was published . There would be no reason to further run a bundler just to turn ~5 such pairs of files int…

That's worse because you lose the ability to "tree-shake". It would go back to importing all of Underscore on a CDN versus bundling the few functions you need into the main bundle.

OTOH, if you use a "standard" library from a CDN, it's quite possible that the end user already has it cached.

Re: Pika/web: Web Apps Without the Bundler

#43

"Today, it’s nearly impossible to build for the web without using a bundler like Webpack." Is it? I've gotten by just fine, and webpack is a pretty all or nothing approach. Did everyone just forget how things were done before webpack and NPM overnight? What memo did I miss?

I think we're in a kind of awkward place right now, where browser support for ES6 is inconsistent, and TypeScript has stepped up to fill the "type gap" left by JavaScript in general.

Sure, if you only use ES5 then you don't need Babel or Webpack - but devs are tired of this shit and really want to use ES6 or Typescript.

So, "nearly impossible" is an exaggeration, but "would rather gouge my own eyes out" is perhaps not.

Re: Pika/web: Web Apps Without the Bundler

#44
post #42

Earlier quoted context omitted.

That's worse because you lose the ability to "tree-shake". It would go back to importing all of Underscore on a CDN versus bundling the few functions you need into the main bundle.

OTOH, if you use a "standard" library from a CDN, it's quite possible that the end user already has it cached.

That never really works out in practice when there's so many versions and then you're at the disposal of a public CDN, which can be the bottleneck, especially when it's critical code.

Sure you can fallback to local copies, but that just means your app hung there for X amount of time, and the added complexity of adding fallback logic.

Plus if you look at the size of these libraries, especially utility libraries (date-fns, underscore, etc) they are huge, and you usually only need a few functions. Relying on cache will never be a bigger benefit than tree-shaking.

Sure you could manually try to extract those functions, but that's a much much worse developer experience.

Re: Pika/web: Web Apps Without the Bundler

#45

Earlier quoted context omitted.

I use rollup with an extremely minimal configuration. No transpilers at all, just standards-based JavaScript.

Sorry if this is a dumb question -- but that means you don't write ES6?

At this point, ES6 support is sufficiently widespread that I don't really have a problem using it natively. Major features like the const, classes, template literals, and async functions are all at least at 90% market penetration.

I can get away with not supporting Internet Explorer, though I understand that it's not a trade-off that everybody is comfortable making.

Re: Pika/web: Web Apps Without the Bundler

#46
post #32

Earlier quoted context omitted.

I've said before and I'll say it again, we wouldn't be in this mess if we had a decent standard library and language to begin with.

We had several other languages once upon a time, but all were proprietary and most only worked through plugins. All were eventally removed from default installs in browsers due to awful security and mobile performance.

I was a Flash dev for some 10 years and I can count with one hand the number of third party libraries I regularly used.

I don't disagree about the security issues, mobile performance, and energy consumption though, but as a dev I preferred the experience of writing AS3 apps by a long shot.

Re: Pika/web: Web Apps Without the Bundler

#47
post #43

"Today, it’s nearly impossible to build for the web without using a bundler like Webpack." Is it? I've gotten by just fine, and webpack is a pretty all or nothing approach. Did everyone just forget how things were done before webpack and NPM overnight? What memo did I miss?

I think we're in a kind of awkward place right now, where browser support for ES6 is inconsistent, and TypeScript has stepped up to fill the "type gap" left by JavaScript in general. Sure, if you only use ES5 then you don't need Babel or Webpack - but devs are tired of this shit and really want to use ES6 or Typescript. So, "nearly impossible" is an exaggeration, but "would rather gouge my own eyes out" is perhaps no…

Tired of what shit exactly, though? typing the word "function"?, hacky workarounds to traditional "classy" style programming? Having to learn what deprecated features to avoid? Is it asynchronous programming? ES6 is nice, but the only real pain point I think it solves is standardising on a module system, which as this article proves, hasn't truly been solved yet, because now we're in the situation where we still have the legacy of competing mutually incompatible module systems hanging around.

Everything else is programmers coming from other languages and believing that actually learning javascript is beneath their dignity, and persistently insisting javascript be more like whatever their fave is.

I will say this though about build systems/bundling systems in general: Combined with linting and type checking, it can stop you from accidntally shipping a large class of bugs/mistakes. An out of place semicolon breaking a build is a better outcome than breaking a production website.

Re: Pika/web: Web Apps Without the Bundler

#48
post #32

This solution pulls in 155 packages from npm, including multiple versions of bullshit packages like "kind-of" that it can't deduplicate. One of the direct dependencies is a library that renders a loading spinner in command line interfaces, which itself pulls in over 20 transitive dependencies. The reason that JavaScript build tooling is so complex and introduces so much overhead is that the ecosystem's culture is fun…

I've said before and I'll say it again, we wouldn't be in this mess if we had a decent standard library and language to begin with.

Agree. JS standard library has been very immature and was so slow to improve as it was primarily targeted for browser and people thought that wasn't the place to do complicated stuff, not even md5.

I still have some array helper methods just to shuffle array or randomly pick one.

I think it's time to put everything in future JS.

Re: Pika/web: Web Apps Without the Bundler

#49
post #32

This solution pulls in 155 packages from npm, including multiple versions of bullshit packages like "kind-of" that it can't deduplicate. One of the direct dependencies is a library that renders a loading spinner in command line interfaces, which itself pulls in over 20 transitive dependencies. The reason that JavaScript build tooling is so complex and introduces so much overhead is that the ecosystem's culture is fun…

I've said before and I'll say it again, we wouldn't be in this mess if we had a decent standard library and language to begin with.

> a decent standard library and language

This is what a lot of people love about Elm: it's a lovely language with a first-rate standard library.

The Elm ecosystem is smaller than the JS ecosystem, but of course that's a hard requirement of a nicer foundation.

More info: https://elm-lang.org

Re: Pika/web: Web Apps Without the Bundler

#50
post #32

This solution pulls in 155 packages from npm, including multiple versions of bullshit packages like "kind-of" that it can't deduplicate. One of the direct dependencies is a library that renders a loading spinner in command line interfaces, which itself pulls in over 20 transitive dependencies. The reason that JavaScript build tooling is so complex and introduces so much overhead is that the ecosystem's culture is fun…

I've said before and I'll say it again, we wouldn't be in this mess if we had a decent standard library and language to begin with.

The way it seems to work with JS is that the community develops a bunch of stuff and the best rises to the top. This then influences the official language spec. ES6 basically made a lot of the popular tools redundant because it was heavily inspired by them.

This is so incredibly important because the main development of the language is so poorly handled.

Post reply on HN