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

Live reload on frontend changes #8875

Merged
merged 9 commits into from
Aug 24, 2020
Merged

Conversation

joheriks
Copy link
Contributor

@joheriks joheriks commented Aug 20, 2020

When the webpack dev server finished recompilation, it will notify the Java server over
the watchdog connection. When the Java server notices the message, it in turn sends
the browser reload message over the dedicated live reload web socket connections.

Other changes in this commit:

  • live reload now also works in V14 bootstrapping mode
  • vaadin-devmode-gizmo is bundled separately

Addresses tickets #8852, #8721, #8001, #5617, #607 (and maybe others).

@joheriks joheriks force-pushed the joheriks/webpack-live-reload branch 4 times, most recently from 8eab654 to bb3ced6 Compare August 21, 2020 07:40
When the webpack dev server finished recompilation, it notifies the Java server over
the watchdog connection. When the server notices the message, it sends a browser reload
message over the dedicated live reload web socket connection.

Other changes in this commit:
- live reload support for V14 bootstrapping mode
- vaadin-devmode-gizmo is now bundled separately
@joheriks joheriks force-pushed the joheriks/webpack-live-reload branch from bb3ced6 to 91209f1 Compare August 21, 2020 08:45
@@ -72,18 +73,21 @@
* name of the JS file to update with the Flow project imports
* @param useV14Bootstrapping
* whether the application running with deprecated V14 bootstrapping
* @param flowResourcesFolder
* relative path to `flow-frontend` package
*/
TaskUpdateWebpack(File frontendDirectory, File webpackConfigFolder,
Copy link
Collaborator

Choose a reason for hiding this comment

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

MAJOR Constructor has 8 parameters, which is greater than 7 authorized. rule

Johannes Eriksson added 2 commits August 21, 2020 12:46
@joheriks joheriks marked this pull request as ready for review August 21, 2020 09:48
@@ -79,6 +84,19 @@ private Logger getLogger() {
return LoggerFactory.getLogger(WatchDogServer.class);
}

private void enterReloadMessageReadLoop(Socket accept) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(accept.getInputStream()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

INFO Found reliance on default encoding in com.vaadin.flow.server.DevServerWatchDog$WatchDogServer.enterReloadMessageReadLoop(Socket): new java.io.InputStreamReader(InputStream) rule

@@ -406,6 +406,12 @@
@Deprecated
public static final String SERVLET_PARAMETER_DEVMODE_ENABLE_LIVE_RELOAD = InitParameters.SERVLET_PARAMETER_DEVMODE_ENABLE_LIVE_RELOAD;
Copy link
Collaborator

Choose a reason for hiding this comment

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

INFO Do not forget to remove this deprecated code someday. rule

platosha
platosha previously approved these changes Aug 21, 2020
caalador
caalador previously approved these changes Aug 24, 2020
@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 34 issues

  • MAJOR 2 major
  • INFO 32 info

Watch the comments in this conversation to review them.

Top 10 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MAJOR ApplicationConnection.java#L235: Remove this unused private "addDomSetListener" method. rule
  2. INFO Constants.java#L43: Do not forget to remove this deprecated code someday. rule
  3. INFO Constants.java#L62: Do not forget to remove this deprecated code someday. rule
  4. INFO Constants.java#L69: Do not forget to remove this deprecated code someday. rule
  5. INFO Constants.java#L77: Do not forget to remove this deprecated code someday. rule
  6. INFO Constants.java#L84: Do not forget to remove this deprecated code someday. rule
  7. INFO Constants.java#L91: Do not forget to remove this deprecated code someday. rule
  8. INFO Constants.java#L99: Do not forget to remove this deprecated code someday. rule
  9. INFO Constants.java#L107: Do not forget to remove this deprecated code someday. rule
  10. INFO Constants.java#L115: Do not forget to remove this deprecated code someday. rule

@caalador caalador merged commit 58702c5 into master Aug 24, 2020
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Iteration Reviews to Done - pending release Aug 24, 2020
@caalador caalador deleted the joheriks/webpack-live-reload branch August 24, 2020 10:33
caalador pushed a commit that referenced this pull request Aug 24, 2020
Trigger live reload when webpack recompiles frontend files

When the webpack dev server finished recompilation, it notifies the Java server over
the watchdog connection. When the server notices the message, it sends a browser reload
message over the dedicated live reload web socket connection.

Other changes in this commit:
- live reload support for V14 bootstrapping mode
- vaadin-devmode-gizmo is now bundled separately
- Convert VaadinDevmodeGizmo to TypeScript
pleku pushed a commit that referenced this pull request Aug 24, 2020
Trigger live reload when webpack recompiles frontend files

When the webpack dev server finished recompilation, it notifies the Java server over
the watchdog connection. When the server notices the message, it sends a browser reload
message over the dedicated live reload web socket connection.

Other changes in this commit:
- live reload support for V14 bootstrapping mode
- vaadin-devmode-gizmo is now bundled separately
- Convert VaadinDevmodeGizmo to TypeScript
@joheriks
Copy link
Contributor Author

When/if backporting to 2.3, check compatibility with ES5 transpilation (e.g. findIndex fix #8788 needs to be reapplied)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
OLD Vaadin Flow ongoing work (Vaadin ...
  
Done - pending release
Development

Successfully merging this pull request may close these issues.

None yet

4 participants