-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SvgImage: Bundle spinner.gif properly so it can be resolved with webp…
…ack, etc. (#273) ## Summary: **UPDATE**: I kept running into issue after issue with packaging a `.gif`. Finally, I decided to try a different approach. We have a WB spinner, so why not just use that? We have had a longstanding issue with the `SvgImage` preloader. It references an image (`spinner.gif`) using an absolute path. Even worse, we don't bundle that image with Perseus, expecting this image to live at `/images/spinner.gif` in whatever environment Perseus is used. This PR changes it so that: * we now bundle the spinner.gif with Perseus * we import it using a relative path import (which makes it so webpack, or whatever web build tool you use, can process the image and bundle it however it needs) Issue: LP-11765 ## Test plan: Check out the Storybook story: **Components** >> **SVG Image** >> **Svg Image That Doesn't Load** <img width="500" alt="image" src="https://user-images.githubusercontent.com/77138/175366272-4ff57c66-a28b-428d-b25c-5c35a8f74466.png"> Note: The spinner does not appear in the right place. This appears to be a long-standing, pre-existing bug that I will fix/work on in a separate PR. Author: jeremywiebe Reviewers: jaredly, jeresig, jeremywiebe, kevinbarabash Required Reviewers: Approved By: jaredly, jeresig Checks: ✅ codecov/project, ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ Lint, Flow, and Test (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Cypress Coverage (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ gerald, ✅ Check for .changeset file (ubuntu-latest, 16.x) Pull Request URL: #273
- Loading branch information
1 parent
c48c68a
commit 988726b
Showing
11 changed files
with
331 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/perseus": minor | ||
--- | ||
|
||
Change default "preloader" for `SvgImage` to use a WonderBlocks spinner. This avoids the need to deal with a bundled spinner GIF entirely. |
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 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 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 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
Oops, something went wrong.