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

chore(shared): change PatchFlagNames[PatchFlags.CACHED] from 'HOISTED' to 'CACHED' #12831

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Arman19941113
Copy link

I'm not sure why PR #11067 didn't update the value of PatchFlagNames[PatchFlags.CACHED].

I attempted to change its value from 'HOISTED' to 'CACHED'.

Alternatively, should we update codegen.ts instead?

const patchFlagName = patchFlag === PatchFlags.CACHED ? 'CACHED' : PatchFlagNames[patchFlag]
patchFlagString = patchFlag + ` /* ${patchFlagName} */`

Given the template:

<template>
  <p>hello</p>
  <p>world</p>
</template>

Before:

export function render(_ctx, _cache) {
  return (_openBlock(), _createElementBlock("template", null, _cache[0] || (_cache[0] = [
    _createElementVNode("p", null, "hello", -1 /* HOISTED */),
    _createElementVNode("p", null, "world", -1 /* HOISTED */)
  ])))
}

After:

export function render(_ctx, _cache) {
  return (_openBlock(), _createElementBlock("template", null, _cache[0] || (_cache[0] = [
    _createElementVNode("p", null, "hello", -1 /* CACHED */),
    _createElementVNode("p", null, "world", -1 /* CACHED */)
  ])))
}

@edison1105 edison1105 added ready to merge The PR is ready to be merged. 🧹 p1-chore Priority 1: this doesn't change code behavior. labels Feb 10, 2025
Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38 kB 34.3 kB
vue.global.prod.js 158 kB 57.8 kB 51.5 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.4 kB 18.2 kB 16.6 kB
createApp 54.3 kB 21.2 kB 19.3 kB
createSSRApp 58.5 kB 22.9 kB 20.9 kB
defineCustomElement 59.2 kB 22.8 kB 20.7 kB
overall 68.4 kB 26.3 kB 24 kB

Copy link

pkg-pr-new bot commented Feb 10, 2025

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-ssr

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/runtime-core

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

@vue/reactivity

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: e322941

@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Feb 10, 2025

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt success 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 failure success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 changed the title chore(shared): update patchFlagName chore(shared): change PatchFlagNames[PatchFlags.CACHED] from 'HOISTED' to 'CACHED' Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. ready to merge The PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants