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

Support mu namespaced in lookup string in glimmer wrapper #216

Closed

Conversation

iezer
Copy link
Contributor

@iezer iezer commented Dec 14, 2017

This supports module unification namespaces by passing them in the lookup string. This an alternative to #215. Doing it this way reduces the number of changes required in ember.js and here as well.

A new version of glimmer-resolver has to be released in order for these tests to pass. Issue: glimmerjs/glimmer-resolver#24

Examples:

  • If this resolver is called with resolver.resolve('template:components/other-namespace::my-component') it will pass template:/other-namespace/components/my-component to the glimmer resolver.
  • If this resolver is called with resolver.resolve('service:/other-namespace/services/i18n') it will pass service:other-namespace::i18n to the glimmer resolver.

See emberjs/ember.js#15967 for results of end-to-end test.

Related PRs:

resolver.resolve now takes a third argument `rawString` which is the
string used at the invocation site of the lookup. For example for:

```
{{ember-power-select::option}}
```

The lookup should be:

```
resolver.resolve('template:component/', null, 'ember-power-select::option')
``

And for a service example:

```
Ember.service.inject('auth-addon::main-service')
```

The lookup would be:

```
resolver.resolve('service', null, 'auth-addon::main-service')
```

Refs: ember-cli#214
Refs: emberjs/ember.js#15350 (comment)
resolver.resolve can accept a namespace denoted by a double colon in the first argument, for example: 
 - `service:other-namespace::i18n`
 - `template:components/other-namespace::my-component`

For example for:

```
{{ember-power-select::option}}
```

The lookup should be:

```
resolver.resolve('template:component/ember-power-select::option’)
``

And for a service example:

```
Ember.service.inject('auth-addon::main-service')
```

The lookup would be:

```
resolver.resolve('service:auth-addon::main-service’)
```

Refs: ember-cli#214
Refs: emberjs/ember.js#15350 (comment)
@iezer iezer force-pushed the namespace-in-lookup-string branch from 6fbfa33 to 871065f Compare December 14, 2017 04:50
@cibernox
Copy link
Contributor

This may be related with what I'm seeing. I am making a port of http://ember-basic-dropdown.com to the module unification and when I try to resolve the route public-pages.docs it fails because routes defined inside src/ui are namespaced.

I probably can come up with a reproduction if needed, but seems you are already aware of the problem.

@iezer iezer closed this Jan 19, 2018
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.

3 participants