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

MU addons must generate a MU dummy app #7667

Merged

Conversation

cibernox
Copy link
Contributor

@cibernox cibernox commented Mar 7, 2018

module.exports = {
browsers
browsers: [
Copy link
Contributor Author

@cibernox cibernox Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this diff I've realized that the module-unification-app blueprint is outdate compared with the regular app blueprint. We need to come up with a system that reuses as much as possible from the standard blueprint and only swaps the indispensable files, so the chances of this happening again is lower.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module-unification-app blueprint is outdate compared with the regular app blueprint

#7595 aims to address this by re-using the same config/targets.js fixture for both app and module-unification-app blueprints testing.

Also I've been working on reducing duplication between these blueprints(#7500) but it was blocked due to bad testing story(I believe).

@@ -40,13 +40,12 @@
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.0.0",
"ember-source": "~3.1.0-beta.1",
"ember-source": "http://builds.emberjs.com/canary.tgz",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL is out of date. I don't think we should ever be using it, /cc @rwjblue yes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also at

"ember-source": "http://builds.emberjs.com/canary.tgz<% if (welcome) { %>",
for MU apps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm. We need to fetch the current URL each time (via ember-source-channel-url which returns a promise)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue Any guidance how to get the ember-source-channel-url at build time? Specially about how to handle it in testing, where we shouldn't rely on the network.

@@ -0,0 +1,13 @@
import Resolver from 'ember-resolver/resolvers/fallback';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we should have this use the glimmer wrapper instead of the fallback resolver:

import Resolver from 'ember-resolver/resolvers/glimmer-wrapper';

The glimmer wrapper only implements module unification rules. The fallback is only needed if you have classic addons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all apps have classic addons (literally all addons are “classic” right now).

Copy link
Member

@mixonic mixonic Mar 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dummy app of an brand new module unification addon should not have any classic addons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely seems ideal, but I highly doubt it is the current state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the consensus here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! We had some more discussion. Lets stick with the fallback resolver. We should use the fallback setup as described at https://github.com/rwjblue/ember-module-migrator#running-module-unification-with-fallback-to-classic-app-layout. We want to use this setup for MU apps since there are still classic addons in the default package.json and it is reasonable to expect they work out of the box.

I suggest that we should remove the fallback setup before we remove any feature flags here. I've added that step to our blocker list for removing the feature flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

Resolver
});

loadInitializers(App, config.modulePrefix + "/src/init");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the fallback setup instructions at https://github.com/rwjblue/ember-module-migrator#running-module-unification-with-fallback-to-classic-app-layout another loadInitializers line is needed here that loads addon initializers in the app folder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same addition is needed at

loadInitializers(App, config.modulePrefix + "/src/init");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@mixonic
Copy link
Member

mixonic commented Mar 11, 2018

@cibernox cibernox force-pushed the generate-a-mu-dummy-app-for-mu-addongs branch from d3f60e9 to 49d0b16 Compare March 12, 2018 14:03
@cibernox
Copy link
Contributor Author

This is ready for a second review

@mixonic
Copy link
Member

mixonic commented Mar 12, 2018

@cibernox yesterday @rwjblue was eyeing the ember-source-channel-url stuff. He acknowledged it was non-trivial ;-)

I'm going to merge this as a good incremental improvement but we do need the ember-source-channel-url stuff for it to really work. The ember-canary.tgz file is hopelessly out of date.

@mixonic mixonic merged commit 92a5882 into ember-cli:master Mar 12, 2018
@mixonic
Copy link
Member

mixonic commented Mar 12, 2018

Thank you @cibernox!!

@cibernox cibernox deleted the generate-a-mu-dummy-app-for-mu-addongs branch March 12, 2018 16:46
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.

None yet

4 participants