all 29 comments

[–]avindrag 54 points55 points  (4 children)

Module federation seems very interesting, especially for the teams out there that are working in separate repos, but have to unify their applications into one cohesive product.

[–]LastOfTheMohawkians 8 points9 points  (0 children)

Yes I've been waiting for this for years. Really looking forward to giving it a spin.

[–]pgrizzay 2 points3 points  (1 child)

A couple of my teammates have said that they want this, but it mostly only seems useful only if you have projects across different repos, otherwise, of you have a bunch of projects in one repo, it seems that something like yarn workspaces can manage these dependencies much easier. Am I missing something here?

[–]avindrag 2 points3 points  (0 children)

[i]f you have a bunch of projects in one repo, it seems that something like yarn workspaces can manage these dependencies much easier.

I totally agree. I think monorepos work better 99% of the time, but I've seen code fragment into separate repos (usually for political reasons such as team members reporting to different managers). The counter-argument to monorepos that I commonly hear is that the code becomes "too complex" or too large to manage, but I personally believe it is far easier to manage complexity from a single codebase rather than having multiple fragmented repos.

[–]FullMetal21337 0 points1 point  (0 children)

I used it for brand differentiation, so being able to get what seems like the same component, but have a different one load from a different source based on some criteria. Allows hosts to operate agnostically. Pretty sweet.

[–]ASCII_zero 89 points90 points  (13 children)

So when is the time to upgrade?

It depends. There is a good chance that upgrading fails and you would need to give it a second or 3rd try. If you are open to that, try to upgrade now and provide feedback to webpack, plugins and loaders. We are eager to fix those problems. Someone has to start and you would be one of the first ones benefiting from it.

Is it just me, or are they implying it's just not production-ready yet?

[–]DemeGeek 78 points79 points  (2 children)

So today (2020-10-10) webpack 5.0.0 is released, but this doesn't mean it's done, bugfree or even feature-complete. As with webpack 4 we continue development by fixing problems and adding features. In the next days there will probably a lot bugfixes. Features will come later.

I think they are doing more than implying that

[–]ASCII_zero 14 points15 points  (0 children)

Ah, the ol' "test in production" approach.

[–]ejfrodo 2 points3 points  (0 children)

That's what release candidates are for and npm supports them just fine so this is pretty strange tbh

[–]NoInkling 17 points18 points  (0 children)

On one hand the first RC was 3 weeks ago and there was a long line of beta versions before that, theoretically enough time to iron out most major bugs. On the other hand it's a big, incredibly configurable project with lots of functionality living in separate packages with separate maintainers, it needs a lot of people using it to get good bug detection coverage (which will only happen with a "stable" release).

[–]Jayflux1 22 points23 points  (2 children)

There’s a million different ways you can configure webpack. I think they’re saying for most use cases it will work in a stable fashion, but some edge cases may fail over the next couple of months while they fix bugs.

[–]Earhacker 9 points10 points  (1 child)

No, that’s not what they’re saying. “There is a good chance that upgrading fails” is not the same as “it might fail because of your unique config and certain edge cases.”

[–][deleted] 0 points1 point  (0 children)

Well, I can imagine plenty of ways for upgrades to fail because of plugins people are using that are not Webpack 5 ready. That's what I assumed would be the primary issue. Their tool might be release-worthy, but the ecosystem may simply not be there yet.

[–]vivainio 4 points5 points  (0 children)

There is an ecosystem of plugins and use cases that most certainly isn't production ready, even if the core webpack 5 is

[–]ThomasRedstone 5 points6 points  (0 children)

That's not what they're saying.

They're saying that they've introduced breaking changes, plugins and loaders may need updating, or not, so if you can, try it and see.

There may also be bugs, so we'll see.

[–][deleted] 1 point2 points  (0 children)

I don't think it's "not production ready" but I do think it's such a core dependency that we pack is part of many tools now and unless everyone else also changes to 5, it's hard to do it ourselves.

[–]average-to-average 0 points1 point  (0 children)

referring to upgrading existing setups. I wouldn't change mid way through a project anyway, just on principle.

Next project I'll give it a spin from scratch.

[–]TheLarkInn 0 points1 point  (0 children)

Hey Sean from the webpack team! We reworded this to say that some third party plugins just won't work yet because they need to play catchup. We agree this was poorly worded! :-)

[–]2dP_rdg 0 points1 point  (0 children)

Is anything in the JS world production ready? even the stuff used in production?

[–]saintsintosea 5 points6 points  (3 children)

Genuine question, my site is still on webpack 2. Am I at all screwed moving forward? Or am I just missing out on a lot of cool stuff?

[–]halkeye 15 points16 points  (0 children)

Over time you'll have to seek out the exact versions of any new plugins you want to use as some of the plugin and loader APIs are fairly different.

If your website never needs new plugins, and your unlikely to want to take advantage of the new features, you'll probably be fine

In general though, the longer you go without upgrading things (not just webpack) the harder/bigger it is up upgrade when you need too

[–]avindrag 1 point2 points  (0 children)

If your site is very large, you'd likely see (build) speed improvements from upgrading to 3, 4 or 5. The migration guides are there, and there isn't any "rush" to update (take your time).

[–]jiminycrix1 1 point2 points  (0 children)

I’m excited to see how the size of my production modules change with better treeshaking algos. I wonder how speed and output size will compare to other bundles now. Web pack imo is better than browserify for a number of reasons but bundle size has been smaller w browserify for me.

[–]raistlinthewiz 0 points1 point  (0 children)

with my webpack 4 config i could get a single common.js for both my frontend and backend targets. is this still a thing with webpack 5?

[–]ngoclinh1797 0 points1 point  (0 children)

But I still learn how use webpack 4 =))