Skip to content

Conversation

cexbrayat
Copy link
Member

Each commit explains the reasoning behind the changes, but TL;DR: we had some compilation issue easy to fix, and a small refactor to do after the component resolution changes that Evan did in rc.5.

`devtools` is no longer available in `AppConfig`
We now have proper inference in `defineComponent`, so extra properties need to be declared as `attrs` (as we initially hoped)
Vue 3.0.0-rc.5 introduced a refactoring of the component resolution (see vuejs/core@a75b8a2)

This simply fixes our implementation by using `type.components` instead of `.components` that no longer exist.
The implementation in `stubs` was already fine as I used `type.components` there.
Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this is way better than how I was trying to fix it. Thanks!

// if a name is missing, then check the locally registered components in the parent
if (node.component.parent) {
const registry = (node.component.parent as any).components
const registry = (node.component.parent as any).type.components
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, do we need a check to see if type is not null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question but it is not marked as nullable in the TS definition of ComponentInternalInstance, so I think we're good (but I do agree we would feel safer if we had strict: true)

props: { a: 'Hello', c: 2 }
})
// can not receive extra props
expectError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@lmiller1990 lmiller1990 merged commit 4c7c9dc into vuejs:master Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants