Shouldn't Components be marked with ReactiveFlag.SKIP? And script setup. #357
jods4
started this conversation in
RFC Discussions
Replies: 1 comment
-
This is a major pain point for migrating 800+ Vue 2 sfcs to Vue 3. A common pattern for us is:
Marking every component is... not ideal. The warning For now, we're hijacking the webpack resolver before the page initializes.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Today I saw this warning on my console:
Source: https://github.com/vuejs/vue-next/blob/c0db807844194a227f6d0dad6cc3e1e8f148770f/packages/runtime-core/src/vnode.ts#L412-L418
It's a good warning because deep reactivity is insidious and can sometimes insert itself in unexpected places.
What happen here was that I have a datagrid that takes reactive
columns
definition, which contain arender
option and I put a component in there.This component is a
<script setup>
kind of component. I tried to add a second script block just to doexport default markRaw({})
but it doesn't do the trick. I couldmarkRaw
where it's used but it's in a lot of places and that's weird. Remaining solution: a JS module to import the.vue
component, mark it raw, and re-export? Quite overkill.This all makes me wonder: does it even make any sense that Components can become reactive objects like that?
Instead of the warning, shouldn't Vue consider all Components as
ReactiveFlag.SKIP
by default?Beta Was this translation helpful? Give feedback.
All reactions