-
-
Notifications
You must be signed in to change notification settings - Fork 7
perf(web): optimize PWA startup #184
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b5aef58
fix(web): eliminate white screen on PWA startup
stritti f7948a6
fix(web): resolve cached response before chaining in service worker
stritti f735d47
fix(web): keep service worker alive during background revalidation
stritti cefd262
style(web): add missing final newline to service worker
stritti 3ccc493
fix(web): restrict app-shell fallback to dashboard routes
stritti eb5e751
perf(web): lazy-load config and sensors on tab activation
stritti 64b510b
perf(web): serve pre-compressed gzip web assets
stritti a68e161
fix(web): drop duplicate Content-Encoding header for gzip assets
stritti bc02bd7
style(web): fix shfmt formatting in gzip script
stritti f230280
style(web): apply clang-format and fix script final newline
stritti ddd989d
fix(web): invalidate stale gzip variant on plain asset upload
stritti bdcbb29
fix(web): disable config saves while config is loading
stritti bf9e2ad
fix(web): use c_str() for LittleFS exists/remove in upload handler
stritti fc21fc8
fix(web): keep config saves disabled across telemetry refreshes
stritti 742cc5f
fix(web): retry config load on failure and keep saves disabled
stritti b79e63e
fix(web): disable config fields while config is loading
stritti ddc90e3
fix(web): allow sensor loading to retry after failures
stritti ad25b3f
fix(web): keep failed config loads disabled across telemetry polls
stritti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
| # Pre-compress web assets for LittleFS upload. | ||
| # | ||
| # The firmware serves the .gz variants with Content-Encoding: gzip when they | ||
| # are present (see WebPortal::serveWebFile), cutting the first-visit transfer | ||
| # from ~104 KB to ~35 KB. Run this before deploying web assets: | ||
| # | ||
| # scripts/gzip-web-assets.sh | ||
| # pio run --target uploadfs # serial | ||
| # # or the OTA /api/fs/upload flow # network | ||
| # | ||
| # Deployments without this step keep working — the firmware falls back to the | ||
| # uncompressed files. Generated .gz files are gitignored. | ||
| set -euo pipefail | ||
|
|
||
| cd "$(dirname "$0")/../data/web" | ||
|
|
||
| for f in index.html style.css app.js sw.js manifest.json icon.svg; do | ||
| if [ ! -f "$f" ]; then | ||
| echo "skip $f (missing)" | ||
| continue | ||
| fi | ||
| gzip -n -9 -c "$f" >"$f.gz" | ||
| echo "gzipped $f ($(wc -c <"$f") -> $(wc -c <"$f.gz") bytes)" | ||
| done |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.