Skip to content

fix(assets): make srcset parsing HTML spec compliant (#16323) - #18242

Merged
patak-cat merged 6 commits into
vitejs:mainfrom
rarous:main
Oct 7, 2024
Merged

patak-cat merged 6 commits into
vitejs:mainfrom
rarous:main

Conversation

@rarous

@rarous rarous commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

fixes #16323

Description

Simplifies the spitting of srcset image candidates with descriptors, so it is compliant with spec and not driven by every edge case somebody finds out is not working.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@rarous rarous changed the title fix(assets): Make srcset parsing HTML spec compliant (#16323) fix(assets): make srcset parsing HTML spec compliant (#16323) Sep 30, 2024

@sapphi-red sapphi-red left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread packages/vite/src/node/utils.ts Resolved
Comment thread packages/vite/src/node/utils.ts Resolved
@sapphi-red sapphi-red added feat: html p3-minor-bug An edge case that only affects very specific usage (priority) labels Oct 1, 2024
@rarous

rarous commented Oct 1, 2024 •

Copy link
Copy Markdown
Contributor Author

HMR tests on Node 22 are a bit brittle :-/ The failure is unrelated to my changes and possible race condition/context leaking. I got another error on my machine just in the first run of tests. All consecutive runs were ok.

 FAIL  playground/hmr/__tests__/hmr.spec.ts > soft invalidate
AssertionError: expected 'soft-invalidation/index.js is transfo…' to match 'soft-invalidation/index.js is transfo…'

Expected: "soft-invalidation/index.js is transformed 2 times. child is now updated?"
Received: "soft-invalidation/index.js is transformed 3 times. child is now updated?"

Comment thread packages/vite/src/node/utils.ts Resolved

@patak-cat patak-cat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: html p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vite adds spaces after commas in image url within srcset (HTML files)

3 participants