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

Do not run BabelMultitargetPlugin in dev mode by default to speedup initial webpack build #7434

Closed
6 tasks done
pleku opened this issue Jan 27, 2020 · 4 comments
Closed
6 tasks done
Assignees
Milestone

Comments

@pleku
Copy link
Contributor

pleku commented Jan 27, 2020

On a fast laptop:

If I run 14.1 with the multitarget plugin without a node_modules folder, webpack takes about 22 seconds.
If I run the same thing without the multitarget plugin, it takes 6 seconds (edited)

The difference for later compilations is not as huge though. 7.1s vs 9.7s

Thus for development mode, we should make BabelMultiTargetPlugin to be only run on request when the developer wants to test with older browsers.
For production mode, it should stay as always run by default, but probably could make sense to (in a separate step) make that also configurable (separately to development build).

Acceptance Criteria

@pleku
Copy link
Contributor Author

pleku commented Jan 27, 2020

In practice, we need to push the plugin to be run only when a given parameter is set for the webpack plugin. It is not worthwhile to generate another webpack config based on this because that is part of the prepare-frontend goal and thus not feasible. Also then the same webpack config is used for both development mode and production mode, but it will just be run with the different parameter setting.

Currently reported ES6 support https://caniuse.com/#feat=es6

This feature is unnecessary for Flow 3.0 because it doesn't have the plugin anymore, so it should be targeted tot 2.2 branch.

@pleku pleku moved this from Inbox - needs triage to Product backlog in OLD Vaadin Flow ongoing work (Vaadin 10+) Jan 27, 2020
@pleku pleku moved this from Product backlog to Ready To Go in OLD Vaadin Flow ongoing work (Vaadin 10+) Jan 29, 2020
@pleku
Copy link
Contributor Author

pleku commented Jan 29, 2020

To see an example on how to pass a parameter to webpack, there is the watchdog server port passed from Java to the webpack configuration.

@Artur-
Copy link
Member

Artur- commented Jan 29, 2020

Does the parameter need to come from Java instead of user’s webpack.config.js?

@pleku
Copy link
Contributor Author

pleku commented Jan 29, 2020

Does the parameter need to come from Java instead of user’s webpack.config.js?

IMO it should be possible to configure it in Java when you decide to run your application server like mvn spring-boot:run -Dvaadin.devmode.transpilation=true. I would not want to touch some webpack config file for this and I'm willing to bet that many users would not too. The cost for adding it such way is not much.

Do you @Artur- see additional benefit in having it explicitly in webpack.config.js also where you can set it ?

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

No branches or pull requests

3 participants