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

fix: re-build production bundle if index.html changes #20729

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

mcollovati
Copy link
Collaborator

Stores index.html hash in stats.json and forces production bundle to be re-built if file contents have changed.
Changes to index.html do not trigger a dev bundle re-generation since in dev mode the file is served directly from the frontend folder.

Fixes #20629

Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629
@mcollovati
Copy link
Collaborator Author

If this change gets merged, we need to check and potentially update the index.html file in starters to match the default contents, to prevent a custom production bundle to be generated if not needed.

For example, skeleton-starter-flow-spring contains a version of index.html whose only difference with default is a removal of a comment.

https://github.com/vaadin/skeleton-starter-flow-spring/blob/v24/src/main/frontend/index.html

Copy link

github-actions bot commented Dec 16, 2024

Test Results

1 159 files  ± 0  1 159 suites  ±0   1h 31m 8s ⏱️ - 3m 49s
7 568 tests + 6  7 512 ✅ + 4  56 💤 +2  0 ❌ ±0 
7 917 runs   - 10  7 852 ✅  - 12  65 💤 +2  0 ❌ ±0 

Results for commit ae55f2e. ± Comparison against base commit 1b58bd5.

♻️ This comment has been updated with latest results.

Copy link

sonarcloud bot commented Dec 16, 2024

@mcollovati
Copy link
Collaborator Author

@caalador I was thinking if we should remove indentation and comments before hashing, to prevent irrelevant changes causing a bundle rebuild. What do you think?

@caalador
Copy link
Contributor

@caalador I was thinking if we should remove indentation and comments before hashing, to prevent irrelevant changes causing a bundle rebuild. What do you think?

removing comments might be a bit too much for running the check and hash creation. trimming might be fine, but it will make it more complex than now when we only read and hash.
Perhaps keep it in mind and add it if someone has a problem big enough that they all the time meet the issue with whitespace or comment updates.

@caalador caalador merged commit fb02577 into main Dec 18, 2024
26 checks passed
@caalador caalador deleted the issues/20629-index_html_prod_bundle branch December 18, 2024 06:13
vaadin-bot pushed a commit that referenced this pull request Dec 18, 2024
Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629
vaadin-bot pushed a commit that referenced this pull request Dec 18, 2024
Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629
vaadin-bot pushed a commit that referenced this pull request Dec 18, 2024
Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629
vaadin-bot added a commit that referenced this pull request Dec 18, 2024
Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629

Co-authored-by: Marco Collovati <[email protected]>
vaadin-bot added a commit that referenced this pull request Dec 18, 2024
Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629

Co-authored-by: Marco Collovati <[email protected]>
vaadin-bot added a commit that referenced this pull request Dec 18, 2024
Stores index.html hash in stats.json and forces production bundle to be
re-built if file contents have changed. Changes to index.html do not
trigger a dev bundle re-generation since in dev mode the file is served
directly from the frontend folder.

Fixes #20629

Co-authored-by: Marco Collovati <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Application Shell Template does not work: index.html does not get used in production
3 participants