The Module Unification RFC is all but merged. So this week @iezer @mitchlloyd @bantic and I tried to get the ball rolling. And rolling it is! Two important links:
This implementation works for a proof of concept, however there are several next steps that need to happen before this work is really production ready. Our list, surely missing many important items, follows:
Additionally there are a few items needed before actual release:
Would love thorough review by @dgeb and @rwjblue and others, and I'm sure we should set up some further meetings to figure out a plan.
The Module Unification RFC is all but merged. So this week @iezer @mitchlloyd @bantic and I tried to get the ball rolling. And rolling it is! Two important links:
unified-resolverhas been added. You can view a diff of the work. This addon both implements a 100% dynamic version of the module unification rules and gets ember-cli building thesrc/dir.npm linkthedangerously-set-unified-resolveraddon into place). Again you can view a diff of this work, note that the application isn't really doing much.This implementation works for a proof of concept, however there are several next steps that need to happen before this work is really production ready. Our list, surely missing many important items, follows:
The addon as written is 100% dynamic. This is probably not going to be great for production, and we will want to do part of this work at compile time on the server.This is changed by picking an appropriateModuleResolver. It seems ok to ship with theRequireJSModuleResolverand to adopt the precompiled one later.Should the resolver simply fail to resolve unknown types silently, or should they be explicitly defined? We've explicitly defined several Ember types (for exampleThese issues have been teased out in glimmer-di-view-registrythat seem like they could be handled with general fallback behavior.Ember-CLI requires theThis is tracked in Several fixes for the module unification feature flag #6908app/stylesdirectory be present per ember-app.js. This needs to change upstream.In Ember-CLIThis is tracked in Several fixes for the module unification feature flag #6908this.trees.appis too contstraining- it only permits us to look in a single place forindex.htmlfor example, when the new resolver rules suggest we should look insrc/ui/first.The new resolver should be used when an Ember app has aTracked at Implement a fallback resolver ember-resolver#188srcdir present, however the new resolver should also fall back to the currentember-resolverimplementation so you can migrate from theapp/dir to thesrc/dir incrementally.Templates currently compile with atracked at GlimmerWrapper: Resolve modules without a default export ember-resolver#189defaultexport, meaning you can only name them${name}/${type}.hbs. The compiler needs to know it can exporttemplatewhen the file is just named${name}(or that it should output to the${name}/${type}module path).expandLocalLookuptests should probably be refactored to be more DRY, akin to the basic-dynamic-tests.Additionally there are a few items needed before actual release:
Would love thorough review by @dgeb and @rwjblue and others, and I'm sure we should set up some further meetings to figure out a plan.