-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
implement namespaced components #2743
Conversation
Aside from the test failures, this also does not update the |
Well caught, thanks. Fixed |
@@ -23,8 +23,9 @@ export default class InlineComponent extends Node { | |||
super(component, parent, scope, info); | |||
|
|||
if (info.name !== 'svelte:component' && info.name !== 'svelte:self') { | |||
component.warn_if_undefined(info, scope); | |||
component.add_reference(info.name); | |||
const name = info.name.split('.')[0]; // accommodate namespaces |
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.
Did it not seem safe to just roll this logic into warn_if_undefined
itself instead?
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.
Eh, I guess you need to add_reference
here with it anyway. It might be nice though if warn_if_undefined
didn't require an extra name
arg as well as the info
arg.
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.
It's silly to let this hold up the PR actually, gonna go ahead an approve
This allows components to be member expressions — so instead of this...
...you can do this: