Skip to content
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

failing test for looking up in namespace contains a @ sign in module prefix #511

Closed
wants to merge 1 commit into from
Closed

failing test for looking up in namespace contains a @ sign in module prefix #511

wants to merge 1 commit into from

Conversation

nightire
Copy link

@nightire nightire commented Feb 29, 2020

This previously failing test case is for addressing an issue that discussed in discord:

https://discordapp.com/channels/480462759797063690/491905849405472769/682777856446824466

which in short, it is impossible for now to invoke a component from a namespace contains a @ sign in its modulePrefix.

For example, I have an ember add-on that will be published as @org/ui-kit. For naming consistency purposes, I set its modulePrefix to "@org/ui-kit" as well.

However, I can not invoke components in this add-on from any consuming application in this form:

<@org/UiKit@Forms::Input />

Although this PR revealed this issue, I still in doubt personally that this form of invocation is a good idea. People can change the modulePrefix easily to:

<OrgUiKit@Forms::Input />

or re-export it as normal ember add-ons did.

@nightire nightire marked this pull request as ready for review February 29, 2020 04:12
@rwjblue
Copy link
Member

rwjblue commented Apr 11, 2020

I believe this was fixed by #531, @buschtoens can you confirm?

return { default: expected }
})

const component = resolver.resolve('component:@scope/other@component:foo-bar');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const component = resolver.resolve('component:@scope/other@component:foo-bar');
const component = resolver.resolve('component:@scope/other@foo-bar');
Suggested change
const component = resolver.resolve('component:@scope/other@component:foo-bar');
const component = resolver.resolve('@scope/other@component:foo-bar');

@buschtoens
Copy link
Contributor

I ran the test locally and it failed, because it includes the type (component) twice, which is incorrect. I retried both flavors shown in #511 (comment) and it works successfully.

I can't speak for the template syntax though, but the resolver side of things works now. 👍

@rwjblue
Copy link
Member

rwjblue commented Apr 11, 2020

Awesome, thank you for double checking @buschtoens!

@rwjblue rwjblue closed this Apr 11, 2020
@nightire
Copy link
Author

BTW, even though the resolver side of things works, a scoped named component invocation still not possible, I got this error when testing with ember-resolver@8:

Template Compiler Error (broccoli-persistent-filter:TemplateCompiler) in dummy/templates/application.hbs

Invalid end tag: closing tag must not have attributes, in `@choiceform` (on line 38).

However it out of the scope of ember-resolver, just leave a note here.

Copy link
Member

rwjblue commented Apr 13, 2020

I'm curious, what was your invocation syntax that triggered that error?

@nightire
Copy link
Author

@rwjblue something like this:

image

am I doing this right?

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.

None yet

3 participants