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

refactor(sfc): directly use import bindings without adding prefix #11319

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Jul 9, 2024

close #11273

The underlying issue is that user import bindings are rewritten to $setup.Color in non-inline mode and Color is not returned in the setup function.

  • Solution 1: Return Color in __return__, which requires modifying isImportUsed to check if the import var is used in cssVars.
  • Solution 2: Introduce SETUP_IMPORTED_MAYBE_REF to handle user import bindings specially (the approach taken in the current PR).

Copy link

github-actions bot commented Jul 9, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 37.7 kB 33.9 kB
vue.global.prod.js 159 kB (+101 B) 57.6 kB (+47 B) 51.3 kB (+159 B)

Usages

Name Size Gzip Brotli
createApp 55.1 kB 21.2 kB 19.3 kB
createSSRApp 59.1 kB 22.9 kB 20.8 kB
defineCustomElement 59.8 kB 22.7 kB 20.7 kB
overall 68.8 kB 26.3 kB 23.9 kB

@edison1105 edison1105 marked this pull request as draft July 10, 2024 01:41
@edison1105 edison1105 changed the title fix(compile-sfc): check import usage in cssVars fix(ssr): properly rewrite ssr cssVars Jul 10, 2024
@edison1105
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Jul 10, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success failure
pinia success success
primevue success success
quasar success success
radix-vue success success
router success failure
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 marked this pull request as ready for review July 10, 2024 05:03
@vue-bot
Copy link
Contributor

vue-bot commented Jul 10, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt failure success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 marked this pull request as draft July 10, 2024 05:12
@edison1105
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Jul 10, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt failure success
pinia success success
primevue success success
quasar failure success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue failure success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 changed the title fix(ssr): properly rewrite ssr cssVars fix(ssr): properly rewrite user import bindings Jul 10, 2024
@edison1105 edison1105 marked this pull request as ready for review July 10, 2024 08:04
@edison1105 edison1105 marked this pull request as draft July 10, 2024 09:23
@edison1105
Copy link
Member Author

/ecosystem-ci run

@edison1105 edison1105 changed the title fix(ssr): properly rewrite user import bindings refactor(sfc): codegen for user import bindings Jul 17, 2024
@vue-bot
Copy link
Contributor

vue-bot commented Jul 17, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt failure success
pinia success success
primevue success success
quasar failure success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue failure success
vitepress success success
vue-i18n failure success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 marked this pull request as ready for review July 17, 2024 01:46
Copy link

netlify bot commented Jul 17, 2024

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 54485ff
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/66976318b9f3ca0008ebd073

Copy link

pkg-pr-new bot commented Aug 30, 2024

commit: 9a14e9d

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@11319

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@11319

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@11319

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@11319

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@11319

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@11319

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@11319

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@11319

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@11319

vue

pnpm add https://pkg.pr.new/vue@11319

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@11319

Open in Stackblitz

@edison1105
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Aug 30, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt failure success
pinia success success
primevue success success
quasar failure success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue failure success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 changed the title refactor(sfc): codegen for user import bindings refactor(sfc): directly use import bindings without adding prefix Sep 2, 2024
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.

v-bind in SSR with dev server fails to resolve imported objects
2 participants