Expose createComponentInstance and setupComponent for reactive objects not mounted #9291
Unanswered
bdiz
asked this question in
Help/Questions
Replies: 1 comment
-
What does the Vue team propose for Vue 3 upgrade for our 250+ Vue objects which are not mounted? |
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
-
In Vue 2 we created an application that makes extensive use of Vue.extend({}) to create reactive objects that are not directly mounted to the DOM. Collectively these objects generate mountains of source code in a C-like language for the hardware engineering world that we reactively generate and display in the DOM based on user input. If user input only causes a change on one line in one file of the generated code, then Vue magic will just recompute the C-like code that needs changing. We have more than 250+ js files that use the Options API / Vue.extend to make this work. We have a component called FileViewer, which is mounted like a standard component for each source code file we display and they get the C-like source code from the reactive object models.
We're trying to upgrade to Vue 3. We are very pleased that Vue 3 supports the Options API however we are having to needlessly mount the instances of our reactive objects to the DOM and then set the elements display property to none in order to get a handle to the object instance from
mount()
. In addition to this feeling hacky, this is causing us an issue in unit testing of our reactive object models because now they depend ondocument.createElement
, something node doesn't know about.We would much prefer to get the same behavior we had before and I think exposing the createComponentInstance and setupComponent from core would pretty much get us there.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions