Skip to content

fix(compiler-sfc): Compilation of expose removes inlineTemplate restriction #9159

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

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

Conversation

baiwusanyu-c
Copy link
Member

@baiwusanyu-c baiwusanyu-c commented Sep 7, 2023

fix: #9136

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 98.7 kB 37.4 kB 33.7 kB
vue.global.prod.js 156 kB 57.2 kB 50.8 kB

Usages

Name Size Gzip Brotli
createApp 54.1 kB 21 kB 19.1 kB
createSSRApp 58.1 kB 22.6 kB 20.6 kB
defineCustomElement 58.8 kB 22.5 kB 20.5 kB
overall 67.7 kB 26 kB 23.7 kB

@baiwusanyu-c
Copy link
Member Author

baiwusanyu-c commented Sep 7, 2023

In fact, I think it is not perfect to fix this bug in the compiler, because it will call expose anyway. Maybe there are other ways to modify it at runtime.

@baiwusanyu-c baiwusanyu-c marked this pull request as draft September 7, 2023 02:15
@baiwusanyu-c baiwusanyu-c marked this pull request as ready for review September 7, 2023 03:22
@baiwusanyu-c
Copy link
Member Author

According to the documentation, a component using <script setup> is private, so in prod mode, expose() should also be used to ensure that its properties will not be accessed by the outside world, unless the user defines expose to specify those properties or Methods need to be exposed to the outside world

@baiwusanyu-c baiwusanyu-c requested a review from sxzz September 7, 2023 03:24
@edison1105
Copy link
Member

edison1105 commented Sep 7, 2023

@baiwusanyu-c is this a breaking change?
it seems not.

@baiwusanyu-c
Copy link
Member Author

@baiwusanyu-c is this a breaking change? it seems not.

Probably not. In dev mode, the component is closed, and the properties cannot be accessed at this time. Developers should not ignore these

@sxzz
Copy link
Member

sxzz commented Sep 7, 2023

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Sep 7, 2023

📝 Ran ecosystem CI: Open

suite result
nuxt ❌ failure
pinia ✅ success
quasar ❌ failure
router ✅ success
test-utils ✅ success
vant ✅ success
vite-plugin-vue ✅ success
vitepress ✅ success
vue-i18n ✅ success
vue-macros ❌ failure
vuetify ✅ success
vueuse ✅ success
vue-simple-compiler ✅ success

@sxzz
Copy link
Member

sxzz commented Sep 8, 2023

Looks like it's a breaking change...

# Conflicts:
#	packages/compiler-sfc/__tests__/compileScript/__snapshots__/hoistStatic.spec.ts.snap
@danbirle
Copy link

@sxzz bruv. we need this. approved when? i can't fix my bug unless i pass a ref returning method but that looks so much uglier. pls eye this 👀

@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Aug 14, 2024

📝 Ran ecosystem CI: Open

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Inconsistent component ref when using defineExpose
5 participants