-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds
<InlinedSvg>
to @rules_prerender/preact
.
This required some refactoring to perform relative path resolution using `import.meta` like `includeScript` and `inlineStyle` do. This improves performance and changes the styling story of SVGs, as they respect or don't respect certain styles based on whether they are inlined, loaded via an `<img>`, or embedded through an `<object>`, `<embed>`, or `<iframe>` (see https://css-tricks.com/scale-svg/). I opted to use `readFileSync` for now to avoid making everything `async`. It's annoying and makes me feel dirty, but it's not the end of the world. In the future, it might be worth looking into adding some kind of "inlining" pass to the bundler, so `<InlinedSvg>` could emit an annotation which gets processed by the bundler to inline the file at the right location. Not sure if that's worth the effort right now.
- Loading branch information
Showing
9 changed files
with
288 additions
and
22 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
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.