-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 📜 Description Compressed lottie and (as bonus) favicon. Total saved size is ~250kb. ## 💡 Motivation and Context It turns out that some assets are still not optimized in documentation. In this PR I'm adding a check to use optimized lottie. Right now it saves ~100kb (just 3 lottie animations), but I'm planning to add more lottie animations in the future, so it will save even more space 😊 As bonus I uploaded compressed `.ico` file (it saves ~150kb). As a result such optimizations improves page loading (a little bit, but still). `Lighthouse` now gives more stable score than a previous version and slightly higher score (97 vs 96). And as a small chore work I've reorganized `compress-images` script - corrected few job names and stopped to use deprecated actions. ## 📢 Changelog ### Docs - compressed lotties; - compressed `favicon.ico`; - started to use `.lottie.json` file extension for lottie animations instead of `.json`; ### CI - added script that checks, that lottie are always compressed; - update `compress-images` script (slightly changed namings, started to use `checkout@v3`). ## 🤔 How Has This Been Tested? Tested deployed version on preview. Gathered all metrics from deployed version. ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<img width="706" alt="image" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/f4fabf34-2724-4735-899b-e4ca6c1ed635">|<img width="707" alt="image" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/e3193911-3633-4988-ad52-01770b7b1a73">| |<img width="705" alt="image" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/fc32374b-e6a4-4ba6-bfbe-ee510349e03d">|<img width="704" alt="image" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/8550a29a-6e93-49c7-9dd6-b2fbf0749915">| ## 📝 Checklist - [x] CI successfully passed
- Loading branch information
1 parent
756be07
commit c98f420
Showing
12 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 📦 Compress Docs | ||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/compress-lottie.yml' | ||
- '**.lottie.json' | ||
|
||
jobs: | ||
compress-lottie: | ||
name: 🎞 Compress lottie | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Compress Lottie | ||
run: find . -name '*.lottie.json' -exec npx lottie-optim -p 1 -o {} {} \; | ||
|
||
- name: Verify that the lottie hasn't been changed | ||
run: git diff --exit-code HEAD |
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
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
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
docs/src/components/HomepageFeatures/cross-platform.lottie.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.