-
Notifications
You must be signed in to change notification settings - Fork 9
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
Proposal: Use opaque specifiers #24
Comments
👍 I think we would like to see this for Ember when we adopt glimmer-di to replace the container. It will help us avoid creating serialized string versions of specifiers for addon cases. For example when the following is invoked: {{my-addon::foo-bar}} I plan to implement a lookup in ember via an internal private API on the container: container._lookupWithNamespace('template', 'my-addon::foo-bar'); This will avoid us adding public API to the current Ember container for the addon case. However it would be much nicer to pass this to the standard container.lookup({ type: template, rootName: 'my-addon', name: 'foo-bar' }); And this as a public API makes a lot more sense. If we add this functionality here in glimmer-di, when we use it to replace Ember's container the behavior can be introduced. |
In addition to passing specifiers to Instead glimmer-resolver should accept the specifier object, and serialize to a specifier string internally. Ember-resolver would instead serialize into the AMD module paths. |
I closed #22 because it was a bit of a premature optimization. Without benchmarking, it will not be readily apparent the best strategy to use for typing the specifiers used to cache and access factories and instances. @krisselden would like glimmer-di to allow experimentation at a large scale, in real world applications.
In order to achieve this, @krisselden recommends typing specifiers as
Opaque
on public interfaces. We can then support custom dictionaries to be used internally to provide access to registrations and lookups based on these opaque specifiers.The text was updated successfully, but these errors were encountered: