Live data from Hacker News

Webpack 5

webpack.js.org

61–70 of 182 posts

Re: Webpack 5

#61
post #3

Next.js 9.5 added opt-in support for Webpack 5: https://nextjs.org/blog/next-9-5 and looks like Create-React-App plans to support Webpack 5 in an upcoming CRA 4.1 release (4.0 is in alpha now): https://github.com/facebook/create-react-app/issues/9613#iss...

I believe the opt-in support only works if you use yarn, is that right? I didn't think npm supported resolutions.

Re: Webpack 5

#62
post #53

Earlier quoted context omitted.

Why? What on Earth do you imagine that having to do with this?

It was a new version (with significant nasty surprises), albeit .7.0 instead of .0.0.

It was a new minor version, of a totally different package, which was version-tagged in such a way that some distro packagers picked it up when they shouldn't have, and which happened to contain a bug affecting a use case that's been deprecated for at least half a decade now.

Look, I get that there's a lot of hate for modern JS, and it's hardly as if there is any lack of basis for criticism, just as there is with every other highly active, heavily adopted, and fast-evolving software ecosystem. But mistaking this kind of uninformed slagging for meaningful commentary says more about the person who does it than about the subject of their ire.

Re: Webpack 5

#63
post #30

Earlier quoted context omitted.

I frequently have to rerun `npm i` when it fails for seemingly spurious reasons. We used to laugh at Windows years ago, when the solution was so often "turn it off and on again", but it's basically what you need to constantly do with tools like npm and webpack.

Yarn is much better in this regard. I'd thoroughly recommend it. It's drop-in compatible (except it will generate it's own lock file), so it's pretty easy to try it.

Yarn also gives much cleaner output. NPM is extremely verbose, but it seems that "verbosity" doesn't really confer any benefit. And yarn is also generally much faster.

Re: Webpack 5

#65
post #22

Earlier quoted context omitted.

Configuring the modern JS toolkit (webpack, Babel, your framework of choice, Jest, etc) is such a pain. I’ve been doing front-end for 10+ years. You’re probably not a bozo.

Same, and it's just layer on layer of extra tooling and complexity. Typescript, Babel, Webpack, JSX, TSX, etc, etc. It gets in the way of development as much as it helps.

Deno does away with most of the tooling configuration. You get linter, bundler, docs generator, formatter, watcher, version manager, std library, inbuilt tests, and many things that you would otherwise source from third parties in node ecosystem.

Support for webgpu and local storage incoming. Makes it a delight to write scripts. You can also scope them by permission.

https://deno.land/

Great community: https://discord.gg/deno

Re: Webpack 5

#66
post #2

"There is a good chance that upgrading fails and you would need to give it a second or 3rd try." Sad that this has almost become the norm when developing in the modern javascript ecosystem. I dread touching those projects and creating one even more because stuff just rots away and your app might break in days, weeks or If you are lucky months. I'm sure there are better developers out there that can handle all of this…

jQuery and full-page postbacks are my go-to, unless there is an actual need to introduce something else (React, etc).

I'm usually conservative in the tools I choose, but I have to be especially conservative with js.

Re: Webpack 5

#67
post #34

I've been putting off learning Webpack for far too long. Can anyone provide some kind of a syllabus to help me figure out what there is to learn about it, starting from almost no knowledge at all? I feel like it's a critical enough piece of modern web infrastructure that it's worth me taking the time to fully understand how to use it and what it's capable of.

Honestly, if your day job hasn't forced you into using a bundler, I'd recommend avoiding it if you can. For modularity, I start with native ES modules. If things got complicated enough that I thought a bundler would offer me some sort of a benefit, I'd reach for rollup first.

Re: Webpack 5

#68
post #2

"There is a good chance that upgrading fails and you would need to give it a second or 3rd try." Sad that this has almost become the norm when developing in the modern javascript ecosystem. I dread touching those projects and creating one even more because stuff just rots away and your app might break in days, weeks or If you are lucky months. I'm sure there are better developers out there that can handle all of this…

It's specifically the frontend ecosystem. A problem caused by the numerous languages, assets, and formats that have to come together, the lack of JS standard library, poor module system, and the disaster of browser compatibility mixed with transpilers, polyfills.

Webpack has already had zero/very-little config required by default. That's what most should use, and that's if you even need to use Webpack directly. Otherwise I recommend sticking to the major site frameworks like Next/Nuxt/Gatsby and let those do all the config wiring for you.

Re: Webpack 5

#69
post #2

"There is a good chance that upgrading fails and you would need to give it a second or 3rd try." Sad that this has almost become the norm when developing in the modern javascript ecosystem. I dread touching those projects and creating one even more because stuff just rots away and your app might break in days, weeks or If you are lucky months. I'm sure there are better developers out there that can handle all of this…

Started my first React Native app some time ago and I can totally confirm that. It feels like a jungle of very fragile dependencies and mechanisms between code and output.

Re: Webpack 5

#70
I saw this headline and kind of winced because I just finished doing battle with our webpack config(s), but top-level await, automatic Worker entry points, cjs tree shaking, and import.meta support are huge! I'm also grateful for the removal of Node polyfilling -- it tends to just add confusion when you're testing across different environments.
Post reply on HN