-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add dynamic favicon from API #1280
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 25c0324 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
⚡️🏠 Lighthouse reportLighthouse ran against https://catalyst-latest-dl26i8ccb-bigcommerce-platform.vercel.app 🖥️ DesktopWe ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:
📱 MobileWe ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:
|
What/Why?
Uses new favicon node in GraphQL Storefront API to return the store's favicon dynamically. The API will always return something; if there's no favicon, it defaults to the BC logo.
I made this a static route because favicons change so infrequently, but this does mean you need to rebuild the app to see an updated favicon.
Rather than returning a
<link>
to our CDN, I'm proxying the image data and serving it directly; this is faster.Putting
do not merge
on this until the new GraphQL node is fully rolled out.Note: I tried to follow the pattern here and do this in an
icon.ts
file, but it didn't work for some reason.Testing
Preview deployment: