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

fix(compiler-vapor): properly cache variable used in object property shorthand #12815

Open
wants to merge 2 commits into
base: vapor
Choose a base branch
from

Conversation

edison1105
Copy link
Member

No description provided.

Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for vapor-repl ready!

Name Link
🔨 Latest commit 985bec1
🔍 Latest deploy log https://app.netlify.com/sites/vapor-repl/deploys/67a55457ad927e00081628d0
😎 Deploy Preview https://deploy-preview-12815--vapor-repl.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@edison1105 edison1105 added the scope: vapor related to vapor mode label Feb 6, 2025
@edison1105 edison1105 changed the title fix(compiler-vapor): properly cache variable used in object shorthand fix(compiler-vapor): properly cache variable used in object property shorthand Feb 6, 2025
@edison1105 edison1105 force-pushed the edison/fix/propertyShorthand branch from 3048b7a to 1117283 Compare February 7, 2025 00:27
Copy link

pkg-pr-new bot commented Feb 7, 2025

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/compiler-vapor

npm i https://pkg.pr.new/@vue/compiler-vapor@12815

@vue/compiler-sfc

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

npm i https://pkg.pr.new/@vue/runtime-vapor@12815

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 985bec1

@edison1105 edison1105 marked this pull request as draft February 7, 2025 00:46
@edison1105 edison1105 marked this pull request as ready for review February 7, 2025 01:01
@@ -131,7 +131,11 @@ function genIdentifier(
if (idMap && idMap.length) {
const replacement = idMap[0]
if (isString(replacement)) {
return [[replacement, NewlineType.None, loc]]
if (parent && parent.type === 'ObjectProperty' && parent.shorthand) {
Copy link
Member Author

Choose a reason for hiding this comment

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

const frags = context.withId(() => genEffect(effect, context), ids)

this will rewrite identifiers used in the effect with passed in ids (due to #12568), and {foo} should be replaced with {foo:_ctx.foo} instead of {_ctx.foo}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: vapor related to vapor mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant