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(reactivity): introducing persistent Dep #12942

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

Conversation

OnlyWick
Copy link
Contributor

@OnlyWick OnlyWick commented Feb 25, 2025

Fixes: #12924.

<script setup>
import { ref, reactive } from 'vue'

const msg = ref('Hello World!')
function getTestData1() {
  const data = reactive({}); // The issue lies in the fact that each function execution will create a new {}.
  console.log('use in operator', 'label' in data); // Then this will create Dep Links without limits.
  data.label = 'set data after in';
  return data;
}
</script>

<template>
  <h1>{{ msg }}</h1>
  <input v-model="msg" />
  <div>{{ getTestData1() }}</div>
</template>

Copy link

pkg-pr-new bot commented Feb 25, 2025

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/compiler-sfc

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 5216d8c

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (+72 B) 38.1 kB (+30 B) 34.3 kB (+20 B)
vue.global.prod.js 158 kB (+72 B) 58 kB (+33 B) 51.6 kB (-5 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.6 kB (+72 B) 18.3 kB (+37 B) 16.7 kB (+34 B)
createApp 54.6 kB (+72 B) 21.3 kB (+35 B) 19.5 kB (+38 B)
createSSRApp 58.9 kB (+72 B) 23.1 kB (+31 B) 21 kB (+22 B)
defineCustomElement 59.5 kB (+76 B) 22.9 kB (+34 B) 20.9 kB (+23 B)
overall 68.7 kB (+72 B) 26.5 kB (+29 B) 24.1 kB (+42 B)

@edison1105 edison1105 added scope: reactivity need test The PR has missing test cases. labels Feb 25, 2025
@OnlyWick OnlyWick marked this pull request as draft February 25, 2025 10:10
@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Feb 25, 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 failure
vuetify success success
vueuse success success
vue-simple-compiler success success

@OnlyWick
Copy link
Contributor Author

@edison1105 Leave it aside for now, I found that this will cause a certain level of memory usage issue here. I will see how to optimize it. The current implementation cannot solve the problem of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need test The PR has missing test cases. scope: reactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reactive data may trigger recursive updates when created in template render.
3 participants