-
Notifications
You must be signed in to change notification settings - Fork 157
fix(vue 3): update the implementation of createServerRootMixin #1020
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2ae5bf7:
|
let router; | ||
if (isVue3) { | ||
const Router4 = require('vue-router4'); | ||
router = Router4.createRouter({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
↑ minimal amount of code to create a router that works with no error.
|
||
// there are two renders of App, each with an assertion | ||
expect.assertions(2); | ||
|
||
const App = Vue.component('App', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have to be a registered component.
// At this point, we don't even have the definition of the props. | ||
// So we cannot pass exactly the propsData only. | ||
// FIXME: Maybe we need to get the list of props in `createServerRootMixin`. | ||
app = createSSRApp(appOptions, _objectSpread({}, componentInstance)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may change the signature of createServerRootMixin
for vue 3, but needs more real life examples to verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you expect to be solved in the fixme before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure. We could merge this as-is and I can make some examples to see how they act in real life, and later come back with a solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall these changes look like the wouldn't break vue 2
// At this point, we don't even have the definition of the props. | ||
// So we cannot pass exactly the propsData only. | ||
// FIXME: Maybe we need to get the list of props in `createServerRootMixin`. | ||
app = createSSRApp(appOptions, _objectSpread({}, componentInstance)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you expect to be solved in the fixme before merging?
15c18de
to
2ae5bf7
Compare
Summary
This PR updates the implementation of
createServerRootMixin
.It excludes the test cases for vue 3 about forwarding $root and $slots. I haven't figured it out, and if it's really necessary, etc.
I will try it out separately and if so, I'll probably do it in a separate PR as a fix (because I don't think I'll do it immediately).
It's normal that the CI doesn't pass here. It's fixed in #1021 because
However once it's approved, I will rebase this and merge it as an individual commit to
feat/vue3-compat
(not mixing with the "update tests" PRs).