Skip to content
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

feat(compiler-sfc): transform use href add no-inline query #12550

Closed

Conversation

btea
Copy link
Contributor

@btea btea commented Dec 14, 2024

In vitejs/vite#18581, vite will automatically convert SVGs smaller than assetsInlineLimit into base64, Since loading data: in the use tag in SVG will result in an error, it is more reasonable to add no-inline query when vue converts the href value of the use tag. WDYT? @bluwy

about vitejs/vite-plugin-vue#490
refer https://developer.chrome.com/blog/migrate-way-from-data-urls-in-svg-use

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 37.9 kB 34.2 kB
vue.global.prod.js 158 kB 57.8 kB 51.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.6 kB 18.3 kB 16.7 kB
createApp 54.6 kB 21.3 kB 19.4 kB
createSSRApp 58.7 kB 23 kB 20.9 kB
defineCustomElement 59.4 kB 22.8 kB 20.8 kB
overall 68.4 kB 26.4 kB 24 kB

Copy link

pkg-pr-new bot commented Dec 14, 2024

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12550

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12550

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12550

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12550

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12550

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12550

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12550

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12550

@vue/shared

npm i https://pkg.pr.new/@vue/shared@12550

vue

npm i https://pkg.pr.new/vue@12550

@vue/compat

npm i https://pkg.pr.new/@vue/compat@12550

commit: 2d0d2d9

@bluwy
Copy link

bluwy commented Dec 15, 2024

I don't think Vue should be adding a Vite specific handling here. The issue would also happen in builds before, not only after that PR. I think users would be adding the query themselves instead.

@btea
Copy link
Contributor Author

btea commented Dec 16, 2024

Handle this issue on vite-plugin-vue side, hence closing this PR.

@btea btea closed this Dec 16, 2024
@btea btea deleted the feat/transform-use-href-add-no-inline-query branch December 16, 2024 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants