Skip to content

Identify live reload backend technology on the server and show in browser - #8015

Merged
joheriks merged 10 commits into
masterfrom
joheriks/7845-show-live-reload-backend
Apr 8, 2020
Merged

joheriks merged 10 commits into
masterfrom
joheriks/7845-show-live-reload-backend

Conversation

@joheriks

@joheriks joheriks commented Apr 7, 2020 •

Copy link
Copy Markdown
Contributor

Fixes #7845.


This change is Reviewable

@joheriks
joheriks force-pushed the joheriks/7845-show-live-reload-backend branch from c10c129 to ac26686 Compare April 7, 2020 14:17

@mehdi-vaadin mehdi-vaadin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 5 of 8 files at r1, 1 of 4 files at r3.
Reviewable status: 4 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks and @mehdi-vaadin)


flow-client/src/main/resources/META-INF/resources/frontend/VaadinDevmodeGizmo.js, line 177 at r4 (raw file):

} else {

What if liveReloadBackend is null? Should we try to open a connection anyway?


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReload.java, line 37 at r4 (raw file):

Detect

Trivial: Other methods use third-person verbs.


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReloadImpl.java, line 58 at r4 (raw file):

VaadinService service

Is this needed?

@joheriks joheriks left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewable status: 4 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks and @mehdi-vaadin)


flow-client/src/main/resources/META-INF/resources/frontend/VaadinDevmodeGizmo.js, line 177 at r4 (raw file):

Previously, mehdi-vaadin (Mehdi Javan) wrote…
} else {

What if liveReloadBackend is null? Should we try to open a connection anyway?

Done. Also disabled live-reload toggle when null.


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReload.java, line 37 at r4 (raw file):

Previously, mehdi-vaadin (Mehdi Javan) wrote…
Detect

Trivial: Other methods use third-person verbs.

Done.

@joheriks joheriks left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewable status: 4 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks and @mehdi-vaadin)


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReloadImpl.java, line 58 at r4 (raw file):

Previously, mehdi-vaadin (Mehdi Javan) wrote…
VaadinService service

Is this needed?

It is no longer required by the impl, but we are already passing it from other parts of the code such as HotswapAgent code, so I suggest we keep the parameter as it is a kind of API already.

@mehdi-vaadin mehdi-vaadin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r5.
Reviewable status: 3 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks)


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReload.java, line 44 at r5 (raw file):

Set

Trivial: forgot to mention this one.


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReloadImpl.java, line 58 at r4 (raw file):

Previously, joheriks (Johannes Eriksson) wrote…

It is no longer required by the impl, but we are already passing it from other parts of the code such as HotswapAgent code, so I suggest we keep the parameter as it is a kind of API already.

Does HotswapAgent use BrowserLiveReloadImpl directly? The only usage that I noticed is through BrowserLiveReloadAccess.getLiveReload. If that's the only usage, we can change this class without any problem.

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.1.0 labels Apr 8, 2020

@joheriks joheriks left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @joheriks and @mehdi-vaadin)


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReloadImpl.java, line 58 at r4 (raw file):

Previously, mehdi-vaadin (Mehdi Javan) wrote…

Does HotswapAgent use BrowserLiveReloadImpl directly? The only usage that I noticed is through BrowserLiveReloadAccess.getLiveReload. If that's the only usage, we can change this class without any problem.

Good point, my mistake (I mixed it up with BrowserLiveReloadAccess::getLiveReload which requires the VaadinService parameter). Done.

@joheriks joheriks left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @mehdi-vaadin and @vaadin-bot)


flow-server/src/main/java/com/vaadin/flow/internal/BrowserLiveReloadImpl.java, line 62 at r4 (raw file):

Previously, vaadin-bot (Vaadin Bot) wrote…

MAJOR Remove this unused method parameter "service". rule

Done.

@mehdi-vaadin mehdi-vaadin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r6.
Dismissed @vaadin-bot from a discussion.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@joheriks
joheriks merged commit da0b201 into master Apr 8, 2020
@joheriks
joheriks deleted the joheriks/7845-show-live-reload-backend branch April 8, 2020 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User should be informed that live-reload is active only when actually enabled in the backend

3 participants