-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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: cross domain SVG sprites #16244
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
export function IconSprites() { | ||
return ( | ||
<SVG | ||
src={`${process.env.NEXT_PUBLIC_WEBAPP_URL}/icons/sprite.svg?v=${process.env.NEXT_PUBLIC_CALCOM_VERSION}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will help caching aggressively between releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (08/16/24)1 reviewer was added to this PR based on Keith Williams's automation. |
E2E results are ready! |
Can confirm this works for atoms as well! @zomars YOU ARE A LEGEND! ❤️ |
What does this PR do?
Follow up to #16135
Implemented icon sprite fetching to avoid CORS issues in Atoms, Embeds and Orgs subdomains.
What changed?
IconSprites
component to render SVG sprites inlineIcon
component to use local references instead of external SVG filesreact-inlinesvg
library for efficient SVG handlingIconSprites
andCacheProvider
How to test?
Why make this change?
This change optimizes icon loading by using SVG sprites, which reduces the number of HTTP requests and improves overall page load performance. By rendering icons inline and utilizing a cache provider, we enhance the efficiency of SVG handling across the application.
More info on the SVG CORS subject:
https://oreillymedia.github.io/Using_SVG/extras/ch10-cors.html
Mandatory Tasks (DO NOT REMOVE)