feat: pass the source file name to the preload filter for fonts#16443
feat: pass the source file name to the preload filter for fonts#16443Nic-Polumeyv wants to merge 9 commits into
name to the preload filter for fonts#16443Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/0f6fcc8892a19d7384438ce2eb30b94d7cd8e06eOpen in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 0f6fcc8 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 |
a27e18b to
274fa31
Compare
Assets are emitted as `[name].[hash][extname]`, so the source file name can be recovered from the output path without a manifest lookup. The font and modulepreload paths each branched on `link_header_preload` themselves; a Link header value is the `<link>` attribute list joined with `; ` plus `nopush`, so one helper now covers both.
274fa31 to
be0eacd
Compare
extracts the drive-by improvements in #16443 to reduce the size of that diff (am weighing a slightly different approach, but this change unambiguously makes sense) --------- Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
…ont-name # Conflicts: # packages/kit/src/runtime/server/page/render.js
|
Merged #16445 back in, the diff is feature-only now. |
name to the preload filter for fonts and assetsname to the preload filter for fonts
|
Reworked, |
Implements the
nameproperty from #16424 (comment).nameis looked up from the Vite client manifest where the fonts arrays are built, so the filter receives the exact source file name. Deriving it from the emitted path was wrong two ways, the bundler sanitizes characters (inter+bold.woff2is emitted asinter_bold.<hash>.woff2) and content-identical assets are emitted once under a single name. The union includesnameforfontonly, kit never callspreloadwith typeasset.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits