Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Update build tools #535

Merged
merged 16 commits into from
Nov 16, 2018
Merged

Update build tools #535

merged 16 commits into from
Nov 16, 2018

Conversation

vincentfretin
Copy link
Contributor

@vincentfretin vincentfretin commented Oct 4, 2018

Update to

develop branch:
first build (without uglify cache): 1m54.120s
second build: 0m54.846s
without uglify: 0m38.620s

4M, 4102630 bytes with uglify
10M, 10410066 bytes without uglify

babel7 branch:
first build (without uglify cache): 1m58.283s
second build 0m59.051s
without uglify: 0m44.785s
3,9M 4033232 bytes with uglify
8,5M, 8886172 bytes without uglify

Copy link
Contributor

@ayyazdaniaryan ayyazdaniaryan left a comment

Choose a reason for hiding this comment

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

Looks like a clean update, following along with upgrade guides for babel/webpack. Asking a few questions.TODO : test after merge to ensure all is well (across all browsers)

plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development')
Copy link
Contributor

Choose a reason for hiding this comment

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

['transform-runtime', { helpers: true, polyfill: false }]
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
['@babel/plugin-transform-runtime', { helpers: true }]
Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer polyfill ?

Copy link
Contributor Author

@vincentfretin vincentfretin Oct 8, 2018

Choose a reason for hiding this comment

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

The polyfill option was removed https://babeljs.io/docs/en/babel-plugin-transform-runtime (defaulting to False, see https://github.com/babel/babel/blob/f6643d1804c977cc7e9f769ad24d7baeb8b9a5ed/packages/babel-plugin-transform-runtime/src/index.js#L100 the doc is misleading)
We still include @babel/polyfill in index.jsx that is reduced with babel-preset-env (useBuiltIns=entry)
Here we use transform-runtime with helpers: true to reduce the bundle of some kB.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, good answer. Thank you, it's more clear now.

assembl/static2/yarn.lock Outdated Show resolved Hide resolved
Copy link
Contributor

@cedricmessiant cedricmessiant left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@@ -96,10 +98,6 @@ module.exports = {
exclude: /node_modules/,
use: 'graphql-tag/loader'
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we need this anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

json-loader ? webpack handles json import natively since webpack 2

@vincentfretin
Copy link
Contributor Author

I can rebase and merge when the other big PRs are merged and no big branches are pending, in a few weeks. There is no hurry.

@vincentfretin
Copy link
Contributor Author

I had to update storybook to latest 4.0.0-rc.0 which use webpack 4 and babel 7 to fix tests issue after the rebase. BUT storybook 4 now needs node >= 8.0.0, you can't run npm run storybook with the node 6 currently included in the venv. So this PR is blocked until we update node in the venv I'm afraid.

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

Successfully merging this pull request may close these issues.

None yet

3 participants