-
Notifications
You must be signed in to change notification settings - Fork 683
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
[5.0] [JIRA-262] Robust HTML update checking. #2086
Merged
dpatil-magento
merged 10 commits into
release/5.0
from
revanth/release5.0_sw_html_update_fix
Jan 8, 2020
Merged
[5.0] [JIRA-262] Robust HTML update checking. #2086
dpatil-magento
merged 10 commits into
release/5.0
from
revanth/release5.0_sw_html_update_fix
Jan 8, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
revanth0212
added
the
version: Minor
This changeset includes functionality added in a backwards compatible manner.
label
Jan 8, 2020
|
@supernova-at Need your approval on this. Its copy of #2059 but base branch is |
supernova-at
approved these changes
Jan 8, 2020
This was referenced Jan 8, 2020
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
pkg:venia-concept
version: Minor
This changeset includes functionality added in a backwards compatible manner.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Robust HTML update checking using Node HTML Parser.
The issue with current HTML checking is, it is a simple byte to byte comparison. Even if there is a change to an unrelated part of the HTML file that does not affect the App, SW will send a message to UI to show the update toast.
With this change, we can define what the comparison checker needs to compare to deduce if an update is needed.
As of now, this checker tracks,
style
,link
,script
andtitle
tags along withdata-media-backend
anddata-image-optimizing-origin
attributes of thehtml
tag.We can add new validation functions as we go along.
This approach uses
node-html-parser
which adds 28KB to the bundle size before zipping.Related Issue
Closes JIRA-262
Verification Steps
Can only be tested in local.
yarn build && yarn stage:venia
venia-concept/dist/index.html
and changetitle
ordata-media-backend
or anystyle
.index.html
file and change any entity that is not tracked, likemeta
tag.Checklist
yarn watch:venia
.