Skip to content

Namespaces #214

Closed
Closed
@mixonic

Description

Add tests and support for namesapces. Presume resolve is called with three arguments (the third is new).

  • lookupString: This must remain the same for things already supported by the resolver API. Ember cannot change what is passed for this value when looking up {{foo-bar}} for example.
  • referrer: This we've already added in the GlimmerWrapper and in Ember behind a feature flag. We use it to pass a referrer for templates.
  • literalString: This is a new argument that must be added here and behind the Ember feature flag. It is "exactly what the user typed". Ember can pass this argument all the time or only when a namespace is specifier (when :: is in the string).
resolve(lookupString, referrer, literalString);

For inject.service('foo-bar');
glimmerWrapperResolver.resolve('service:foo-bar');
gilmmerResolver.resolve('service:foo-bar');

For inject.service('addon-name::service-name');
glimmerWrapperResolver.resolve('service', null, 'addon-name::service-name');
glimmerResolver.resolve('service:/addon-name/services/service-name')

For {{foo-bar}}
glimmerWrapperResolver.resolve('template:components/foo-bar', referrer)
glimmerResolver.resolve('template:foo-bar', referrer)

for {{addon-name::component-name}}
glimmerWrapperResolver.resolve('template:component/', referrer, 'addon-name::component-name')
glimmerResolver.resolve('template:/addon-name/components/component-name', referrer)

In this repo we should add tests and support this interface on the glimmer wrapper resolver.

Additionally, where the glimmer wrapper is building specifier strings it may make sense to simply build a specifier object instead then serialize it via serializeSpecifier. At least for places where the string manipulation is starting to get complex.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions