-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[QUEST] Module Unification: Final Cut #16373
Comments
@mixonic The task that has a lock and my handle is also done. |
Thanks @cibernox I’ve noted that |
@acorncom You can also check |
@cibernox done. As other items get done, feel free to ping me here or on Slack to help keep the ball rolling 👍 |
The checkbox about |
@rwjblue I looked at the 2nd migrator issue: "The migrator currently renames template-only components to not have a folder, like src/ui/components/name.hbs." And I'm not sure that it's a real issue. More context here: ember-codemods/ember-module-migrator#72 Do you know if there is a specific case where this is an issue? |
No, it was likely something fixed when pods support was added to the migrator... |
Cool in that case that box can also be checked. |
The first migrator task is fixed by this PR ember-codemods/ember-module-migrator#73 |
It is fixed in the latest |
Thanks @iezer for the fix and @ivanvotti for adjusting the ember-svg-jar codebase for the greater ecosystem 👏 🕺 |
@mixonic ember-cli/ember-load-initializers#47 should also be tracked here. I have a precursory PR that would need to be merged before taking a stab to fix this. I will try to verify this still happens today. |
@efx added! |
Myself and @iezer may have solved both items in the "Ember Template Compiler" section above 🤔 I think we may have skipped the first checkbox and moved straight onto the auto-interpretation ember-cli/babel-plugin-htmlbars-inline-precompile#33 |
@mixonic ember-cli/ember-load-initializers#47 should be fixed now thanks to @GavinJoyce . |
The instructions for creating a MU app have changed, @mixonic perhaps you could update the quest issue description with these instructions? Creating a new module unification appInstall Ember CLI master:
Generate a new app with the module unification env variables:
Generate a component:
Run the app:
|
^ I've updated the instructions to create and run a MU app ( |
So, a Blueprint's "module unification mode" is currently determined by the root Project's Edit: Simplified. |
@mixonic Can you please update the issue description for I didn't read after the description and missed @GavinJoyce comment. Thanks. |
@karthiicksiva yeah I (or someone else) needs to re-confirm all the instructions above in light of the new options. |
Some questions about the outstanding tasks -
What is involved in doing something at build time? where does this happen in ember.js? Where is the current parsing of
is this actionable? or is this just a thing to make sure we're doing later on?
what all does this involve?
this one I've looked at before, and I could not figure out where / how the entry point worked. layout = hbs`{{some-template}}` and I know there is some connection with the babel transform for htmlbars. :) also, should we use a github project for managing remaining to-dos? |
Hmm, not sure where to put these, but for me writing "scripts": {
"build": "EMBER_CLI_MODULE_UNIFICATION=true ember build",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "EMBER_CLI_MODULE_UNIFICATION=true ember serve",
"g": "EMBER_CLI_MODULE_UNIFICATION=true ember g",
"d": "EMBER_CLI_MODULE_UNIFICATION=true ember d",
"test": "EMBER_CLI_MODULE_UNIFICATION=true ember test"
}, and now I can just run |
those can all be removed now. check this out: https://github.com/ember-cli/ember-cli/pull/8157/files |
Some work on multiple dummy apps / isModuleUnification detection here: ember-cli/ember-cli#8158 |
@NullVoxPopuli #16373 (comment):
The OP includes a link to the PR and file that implements this. Very relevant RFC: #367: "Module Unification Packages (MU with Ember Addons)" |
I found a bug with nested routes. You can't go deeper than two levels: #17217 |
Found another one: #17224. Addon tests are hoisted into the consuming host application and run by |
I hope that's related to an issue I saw the other day. Where tests remain in the prod build |
In light of the updates at these links:
...I don't believe this quest issue is sure to be a valid work list. I'm closing it and I'm sure we will create new issue at the appropriate time. |
Throughout 2017 a small crew has pushed forward the implementation of Ember's new filesystem layout for applications and addons. This was described in RFC 143 and we've lovingly called the effort "module unification".
Much of the effort up to now has been either design or exploration-heavy. It wasn't plausible to reduce the work list into things that individual contributors could pick up without context.
But in the last weeks we have turned a corner. Our effort is behind three feature flags in Ember, Ember CLI, and ember-resolver. In order to enable these flags by default for new applications, we need your help. In this quest issue I've outlined the current list of known blockers as well as guidance for how to test the new features in new and migrated codebases.
Several contributors have been huddled in
#st-module-unification
on the Ember.js Community Slack in recent months. Please join us there when you start to pick up one of these tasks.The Issue List
Ember.js
{{namespace::name}}
strings at runtime. This implementation should be improved to have this work happen at Ember app build time.Ember CLI
src/
to configure the return value ofisModuleUnification()
. This works well for apps and addons. The detection fails for a classic dummy app in a module unification addon, however. Although a dummy app may be intests/dummy/app/
with notests/dummy/src/
directory, the addon's root levelsrc/
confuses our logic and the dummy app is incorrectly treated as a module unification app.src/
app and a classicapp/
app. Their acceptance tests would run with both apps, or they could have two acceptance test suites.test_helper.js
files for module unification addons (https://github.com/ember-cli/ember-cli/blob/master/blueprints/module-unification-addon/files/tests/test-helper.js#L1) should import from../src/main
.resolver.js
and classic initializers support viamain.js
. Before we remove the feature flag, we need to convert each addon these apps are dependent upon to be a module unification addon. Then we should remove the fallback setup for newly generated apps and addon dummy apps.src/
directory)must have a way a) fail gracefully or b) bring the reexport logic we use in ember-cli with it to the old version of ember-cli.app/
for classic apps. This allows an addon author to use asrc/
directory and still have their addon work for either kind of app. We would like to provide addons a build-time way to configure this re-export logic. It would permit them to re-name components and services to match legacy classic APIs while they adopt new APIs for module unification apps.lib/models/project.js
'sisModuleUnification
method to not only rely on presence of top levelsrc
as "the project is module unification format". Specifically, an addon may be in module unification format, but have its dummy app be in classic format.Ember Template Compiler
hbs
helpers should accept asource
argument like templates in a running app do. In: https://github.com/ember-cli/ember-cli-htmlbars-inline-precompilehbs
AST transform should be to inline thesource
value. However test files for a private collection, local lookup component might not be able to use the "easy" value of their filename and still have access to resolve their subject. For example insrc/ui/routes/application/-component/foo-bar/component-test.js
templates created withhbs
will not be able to access the{{foo-bar}}
component. The simplest solution here is to pass asource
to thesehbs
templates that is "one level up", for example the source for templates in the test file would besrc/ui/routes/application
. There are some tradeoffs in taking this or other approaches, but it seems like a good place to start. Allowing you to test templates from MU co-located tests ember-cli/babel-plugin-htmlbars-inline-precompile#33Ember Resolver
project.isModuleUnification()
value. The build-time flagging means classic Ember app's don't get a larger JS payload for a feature (module unification) that they are not using. Use build-timeproject.isModuleUnification()
instead of feature flag. ember-cli/ember-resolver#228Migrator
test_helper.js
file to import the app from../src/main
. Currently this mentioned in the fallback documentation but it should just be part of the conversion.src/ui/components/name.hbs
. The resolver doesn't yet support this, and instead always expects a folder, for example:src/ui/components/name/template.hbs
. The ember-resolver can probably be tweaked to fix this at runtime, but alternatively the migrator should simply not do this flattening in the near-term.helper
, but also imports a thing with the namehelper
. Conflict between JS module API and Module Unification #16361ember-svg-jar
src/
directory that is not used for module unification. We need to update it for compatibility: Module Unification Incompatibilities evoactivity/ember-svg-jar#56ember-load-initializers
ce it would break
/tests/
on the dev server, but we can easily have the initializer ignore them. Tracked at module unification: initializer test files are included forember serve
ember-cli/ember-load-initializers#47Several contributors have been huddled in
#st-module-unification
on the Ember.js Community Slack in recent months. Please join us there when you start to pick up one of these tasks.Creating a new module unification app
Install Ember CLI master:
Generate a new app with the module unification env variable:
Out of the box a newly generated application will use the ember-resolver "fallback" resolver. This allows the module unification app to use classic
app/
addons. Much later, once we've converted the default addons that ship with new Ember apps, we can drop the "fallback" resolver and use the MU-only "glimmer wrapper" resolver.The implementation of module unification uses a configuration of collections and types. In the classic addon
app/
layout, addons could define new types of factories without any explicit definition. Before removing the feature flags we need an API for them to explicitly do so against the module unification config. Temporarily you may want to mutate the config for your app to add a type, for example in src/resolver.js.If you have an issue after generating a new application you can likely find or file an issue:
EMBER_CLI_MODULE_UNIFICATION=true ember g component x-button
. If there is an issue using a generator, you can find or file it at https://github.com/emberjs/ember.js/issuesMigrating an existing Ember app
Install the module migrator:
Run the migrator on your app codebase:
Install Ember CLI master:
And update your files to match the latest blueprint, similar to what you do for any upgrade:
You'll want to:
config/environment.js
.config/environment.js
.package.json
.loadInitializers
insrc/main.js
. There are two of these lines, one forsrc/
and one for classic addons exporting intoapp/
.src/resolver.js
.../src/main
intest-helper.js
.If you have an issue after migrating an application you can likely find or file an issue:
Creating a new module unification addon
Install Ember CLI master:
Generate a new app with the module unification env variable:
You can find a file issues for the experience of building an addon:
The text was updated successfully, but these errors were encountered: