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

Regression: webpack-dev-server re-runs on each java modification. #6274

Closed
manolo opened this issue Aug 19, 2019 · 3 comments · Fixed by #6353
Closed

Regression: webpack-dev-server re-runs on each java modification. #6274

manolo opened this issue Aug 19, 2019 · 3 comments · Fixed by #6353
Assignees
Milestone

Comments

@manolo
Copy link
Member

manolo commented Aug 19, 2019

How to reproduce:

  • Checkout skeleton-starter-flow project
  • Run mvn jetty:run
  • Do a simple modification in java, for instance changing the button text in MainView
Button button = new Button("Click me please", 
  • Wait for a while and you can see in console that jetty is reloaded, and webpack is run
[INFO] Stopped o.e.j.m.p.JettyWebAppContext@3663af34{...}
[INFO] Webapp source directory =.../skeleton-starter-flow/src/main/webapp
[INFO] Reload Mechanic: automatic
[INFO] nonBlocking:false
[INFO] Classes = .../skeleton-starter-flow/target/classes
[INFO] Context path = /
[INFO] Tmp directory = .../skeleton-starter-flow/target/tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] web.xml file = null
[INFO] Webapp directory = .../skeleton-starter-flow/src/main/webapp
[INFO] Scanning elapsed time=163ms
[PathWatcher@31d791c0] INFO com.vaadin.flow.server.startup.DevModeInitializer - Starting dev-mode updaters in .../skeleton-starter-flow folder.
[PathWatcher@31d791c0] INFO dev-updater - Scanning classes to find frontend configurations and dependencies...
[PathWatcher@31d791c0] INFO dev-updater - Visited 657 classes. Took 373 ms.
[PathWatcher@31d791c0] INFO dev-updater - Skipping `npm install`.
[PathWatcher@31d791c0] INFO dev-updater - Copying frontend resources from jar files ...
[PathWatcher@31d791c0] INFO dev-updater - Visited 10 jar files. Took 10 ms.
[PathWatcher@31d791c0] INFO dev-updater - No js modules to update
[PathWatcher@31d791c0] INFO dev-webpack - Reusing webpack-dev-server running at http://localhost:56002
[INFO] Initializing AtmosphereFramework
[PathWatcher@31d791c0] INFO com.vaadin.flow.server.startup.ServletDeployer - Automatically deploying Vaadin servlet with name com.vaadin.flow.server.startup.ServletDeployer to /*
[INFO] Started o.e.j.m.p.JettyWebAppContext@3663af34{/,[...],AVAILABLE}{...}
[INFO] Using Non-Native Java sun.nio.fs.PollingWatchService
[INFO] Restart completed at Mon Aug 19 10:13:25 CEST 2019
[webpack] INFO dev-webpack - ℹ 「wdm」: Compiling...
[webpack] INFO dev-webpack -          Serving the 'stats.json' file dynamically.
[webpack] INFO dev-webpack - ℹ 「wdm」: Hash: 65737e6eb2c548cec2ca
[webpack] INFO dev-webpack - Version: webpack 4.30.0
[webpack] INFO dev-webpack - Time: 56ms
[webpack] INFO dev-webpack - Built at: 08/19/2019 10:13:25 AM
[webpack] INFO dev-webpack -  2 assets
[webpack] INFO dev-webpack - Entrypoint bundle = build/vaadin-bundle-1d20cd048a136e20a519.cache.js
[webpack] INFO dev-webpack - Entrypoint bundle.es5 [big] = build/vaadin-bundle.es5-a81351e0b2a447a3b7b3.cache.js
[webpack] INFO dev-webpack - [../node_modules/@vaadin/flow-frontend/flow-component-renderer.js] 7.34 KiB {bundle.es5} [built]
[webpack] INFO dev-webpack - [../node_modules/@vaadin/flow-frontend/flow-component-renderer.js] 5.08 KiB {bundle} [built]
[webpack] INFO dev-webpack -     + 186 hidden modules
[webpack] INFO dev-webpack - ℹ 「wdm」: Compiled successfully.
[webpack] INFO dev-webpack -
----------------- Frontend compiled successfully. -----------------

Notice that it should not happen because we have not change any annotation that affects the target/frontend/generated-flow-imports.js.

Regression should be introduced after #5938 was fixed because we tested that webpack reload didn't happen on java modification.

@manolo manolo added the bug label Aug 19, 2019
@project-bot project-bot bot added this to Inbox - needs triage in OLD Vaadin Flow ongoing work (Vaadin 10+) Aug 19, 2019
@caalador
Copy link
Contributor

Seems like webpack rebundles after rc6 with Flow 2.0.4
Feeling would be that it probably has something to do with #6075 that copies resources which would touch the files making webpack expect probable changes.

@manolo
Copy link
Member Author

manolo commented Aug 19, 2019

Perhaps we should skip copying files that has the same size, and probably also need to check some hash to see if there were differences.

@pleku pleku added this to Needs triage in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) via automation Aug 23, 2019
@pleku pleku removed this from Inbox - needs triage in OLD Vaadin Flow ongoing work (Vaadin 10+) Aug 23, 2019
@pleku pleku moved this from Needs triage to P1 - High priority in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Aug 23, 2019
@pleku
Copy link
Contributor

pleku commented Aug 23, 2019

There is also a related issue, but reverse, in which the webpack is not run even when the classes have been recompiled and hotswapped by Java in debug mode.
To reproduce this, remove the scanIntervalSeconds and run the jetty:goal in debug mode from IDE.
Then when one tries to add a new component to the view, the changes are not picked up (no webpack build) and console warning is logged for not having scanned the resources:

[qtp77173924-27] WARN com.vaadin.flow.server.startup.DevModeInitializer - Frontend dependencies have not been analyzed for com.vaadin.flow.component.datepicker.DatePicker. To make the component's frontend dependencies work, you must ensure the component class is directly referenced through an application entry point such as a class annotated with @Route.

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

Successfully merging a pull request may close this issue.

5 participants