Repository navigation
Self-host lookaside CDN images under /public - #3973
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsLightbox (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
bd849ba to
bfe3165
Compare
bfe3165 to
52e158d
Compare
52e158d to
ac306eb
Compare
ac306eb to
0319c7d
Compare
0319c7d to
b4d9b87
Compare
b4d9b87 to
27e6e88
Compare
27e6e88 to
453cb79
Compare
|
Deployment failed with the following error: |
453cb79 to
aab3bcc
Compare
| @@ -10,7 +10,7 @@ export default function AspectRatioWidescreen() { | |||
| <Center width={600}> | |||
| <AspectRatio ratio={16 / 9} fit="cover"> | |||
| <img | |||
| src="https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png" | |||
| src="/template-assets/light-scene-horizontal-1.png" | |||
There was a problem hiding this comment.
Yeah for these CLI templates especially we might want absolute URLs. Hmm if we're done with the internal docsite package updates you can try testing by landing this then updating to the canary version. May need to wait for security clearance though (check with Gerard on how long that takes)
There was a problem hiding this comment.
By absolute URL, are you referring to the full URL with domain https://astryx.atmeta.com/? yea i figured out we need that for the internal docsite though i am wondering if it would be better if we keep that URL replacing logic in the internal app itself?
|
I agree with updating this. We should make sure the CLI templates can still display correctly on the internal docsite. That might mean we need absolute URLs to guarantee we're fetching from the docsite CDN |
aab3bcc to
1e6d26d
Compare
1e6d26d to
5048c85
Compare
|
This PR adds <img
alt="My cool picture"
srcset="/template-assets/whatever.png 1x, /template-assets/whatever@2x.png 2x"
src="/template-assets/whatever.png"
/>(the |
5048c85 to
82e8e8b
Compare
|
Deployment failed for project astryx with the following error: |
Template demo imagery and docsite chrome images were streamed from the internal lookaside.facebook.com CDN — invisible to external contributors and unreachable without Meta network access. Self-host them in the repo: - Template demo images -> apps/docsite/public/template-assets/, referenced by root-relative /template-assets/* paths. stripTemplateAssetRefs still swaps these for the inline data: URI placeholder on scaffold (zero-setup, no network dependency; no image is ever copied into a scaffolded project). - Docsite chrome (brand banner, per-theme product photos, theme pickers, avatars) -> apps/docsite/public/images/. - @2x retina variants committed alongside 1x siblings where a retina master exists in Asset Manager. Nature-1.mp4 committed as a normal file. - check-demo-media guard broadened to ban any remote http(s) in Thumbnail examples. README banner kept on lookaside until the PR merges.
82e8e8b to
d7ef690
Compare
Summary
Astryx's demo imagery was streamed from a Meta-internal CDN (
lookaside.facebook.com/assets/astryx/*) — invisible to external contributors and unreachable without Meta network access. An outside contributor couldn't see which images exist, couldn't add a new one, and couldn't run the site with real imagery.This PR self-hosts every one of those images in the repo, downloaded from the internal asset set and committed under
apps/docsite/public/. Nothing is deleted; the images simply move from the CDN into the repo.📄 Asset mapping (every image → original Asset Manager source + 2x asset ids): https://gist.github.com/imdreamrunner/1574db95a724d793e703036ee625e665
Two homes, by consumer
Images land in one of two directories based on who uses them — matching the repo's existing conventions:
apps/docsite/public/template-assets/packages/cli/templates/**)template-assets/is the pre-existing convention.apps/docsite/public/images/apps/docsite/src/**)matcha/ butter/ stone/ gothic/ y2k/), theme*-picker.pngtiles,avatars/. Mirrors the existingneutral/preview-*.pngslot convention (per-theme folders avoidpreview-watch.pngcollisions).What changed
1. Template demo images → self-hosted at
/template-assets/apps/docsite/public/template-assets/.Lightbox.doc.mjsfromlookaside.facebook.com/assets/astryx/*to root-relative/template-assets/*.CDN/NEUTRAL_CDNbase-path variables in favor of literal/template-assets/...paths.2. Scaffold behavior fully preserved — still inlines base64
The CLI's
stripTemplateAssetRefs(run onastryx add) still swaps demo image references for a self-contained inlinedata:URI placeholder — a generated project renders with zero setup / zero network dependency, exactly as before. Only the path segment the regex matches changed (/template-assets/, excludingplaceholder.svg). No image is ever copied into a scaffolded project. Test suite 10/10.3. Docsite chrome → self-hosted at
/images/apps/docsite/public/images/and repointed there (theme showcase, hero, OG/blog metadata). Under/images/(not the public root) so theme-name folders can't shadow Next.js app routes.4. Retina variants ready for later
@2xvariants alongside their 1x siblings wherever the asset set provides adensity=2source. Each@2xis exactly 2× its 1x sibling. Not referenced yet — ready for a futuresrcset/next/imagepass without re-fetching.5. Guardrail
check-demo-media.mjs: image-backed Thumbnail examples must inline a same-origin, samplabledata:URI (required byuseImageMode's CORS pixel-sampling).Result: zero
lookaside.facebook.comreferences remain except the README banner (READMEs render on GitHub and need an absolute URL — will switch tohttps://astryx.atmeta.com/images/Astryx-Banner.pngafter merge) and a mocked, never-fetched URL inuseImageMode.test.ts.6. Changeset
[chore]changeset is included for the@astryxdesign/clipackage (the scaffold-strip path change). The demo videoNature-1.mp4(8.4 MB) is committed directly as a normal file alongside the images.Verification
stripTemplateAssetRefstests 10/10; CLI template-integration 10/10; full docsite suite 238/238; coreuseImageMode5/5;check:demo-mediapass.next dev): all self-hosted assets 200, old CDN paths gone.dev:sandbox): template-assets mirror topublic/template-assets/(gitignored), template previews render.