Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Webpack 3 with module concatenation #3912

Merged
merged 1 commit into from
Jun 23, 2017

Conversation

nolanlawson
Copy link
Contributor

@nolanlawson nolanlawson commented Jun 23, 2017

This reduces the size of application.js from 670196 bytes to 655404 bytes (14.8kB saved). The other bundles are roughly the same size as before.

You can read more about how module concatenation (aka scope hoisting) works here. Essentially this will just take all of our modules inside of application.js and squash them into a single function scope instead of having multiple function(){} wrappers around each one. It de-penalizes us for having multiple small modules.

Interestingly this actually increases the gzip size of application.js slightly (171181 to 173646, 2.46kB) but I think the tradeoff is worth it given that the ungzipped size is what the browser has to parse, and less JS to parse is always good.

@nolanlawson
Copy link
Contributor Author

/cc @sorin-davidoi

Copy link
Contributor

@sorin-davidoi sorin-davidoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Love it that we have all our dependencies up-to-date and can take advantage of new features almost right away!

@Gargron Gargron merged commit e078919 into mastodon:master Jun 23, 2017
@sorin-davidoi
Copy link
Contributor

Appears to break webpack-dev-server: webpack/webpack-dev-server#947

@nolanlawson
Copy link
Contributor Author

Hm should we roll back or can we just fork webpack-dev-server until they fix it? From the discussion, sounds like it's a fairly easy fix on their end.

@sorin-davidoi
Copy link
Contributor

sorin-davidoi commented Jun 23, 2017

I don't mind fixing it locally but other people might run into trouble. There is a PR open to fix it webpack/webpack-dev-server#946, hope they merge it soon.

@nolanlawson
Copy link
Contributor Author

In that case we can just change our dependency in package.json to "webpack-dev-server": "lencioni/webpack-dev-server#patch-1" while we wait for a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants