-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
perf: shorten file names #13003
perf: shorten file names #13003
Conversation
🦋 Changeset detectedLatest commit: 2e91dab 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 |
preview: https://svelte-dev-git-preview-kit-13003-svelte.vercel.app/ this is an automated message |
ff34d60
to
54a6836
Compare
this could be a breaking change.it's going to bust existing users caches due to the change in output names, and if they used those somewhere without resolution through manifest, those references break too. |
54a6836
to
248da93
Compare
it wouldn't be the first time we've changed it and no one's ever complained before. static assets are incredibly cheap to serve
the filenames already change everytime a single character changes and I don't know what you can do referencing an individual file anyway |
assets don't change that often. this will force all users to download everything again they already had far future cached. images, fonts, everything... how often did we change it? if we offer immutable asset caching as a feature, we should be mindful not to bust that |
Yeah, we've changed it very rarely |
How useful are/were the names before? I remember debugging stuff and it was helpful to have the names there. |
It varies. Asset filenames are very useful, and after discussion this PR keeps them unchanged. Entry filenames are useful and they're also unchanged. Chunk filenames are often actively misleading because they're essentially random. I haven't double-checked that routes are considered entries rather than chunks — I think they are — as long as that's true then I'm in favour of this change |
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.
I just checked, and yes route names are preserved (i.e. it's 0.hash-123
, 1.hash-123
etc), so I'm guessing all other relevant entries will also preserved.
You're right that other chunk names can be misleading because there could be other stuff in there aswell.
This shortens references to JS files in SSR, JS, and HTTP headers. Less bytes referring to these files. Also, the chunks often pick combine multiple files and pick the name of one individual file to use for the chunk, which can be misleading
Reducing the size of asset names reduced the size of the JS on my image-heavy page by 6.5% after brotli compression, but we couldn't come to agreement to shorten those