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

Extract ember related blueprints into ember proper #12412

Closed
wants to merge 14 commits into from

Conversation

stefanpenner
Copy link
Member

This aims to decouple features of ember-cli that are actually tied to ember, this should ease upgrades and also prevent the various blueprints from getting widely out of sync.

This lays the work that will eventually allow us transpose ember repo itself into a well formed add-on.

  • pull ember.js related blueprints into ember
  • decouple most of the blueprints from ember-cli
  • confirm all the blueprints already decoupled work
  • bundle shims (eventually they wont be needed at all)

Several pieces of blueprint functionality are still coupled to ember-cli, they depend on:

  • decouple all blueprints from ember-cli
    • ../../lib/valid-component-name
    • ../addon-import
    • models/blueprint

There are some bootstraping issues, when it comes to app and addonthemselves due to the cyclic nature of this flow. I do believe the simplest is for them to be part of this repo, but that assumption may prove to be wrong.

  • deal with the cyclic nature of ember-cli -> ember -> app blueprint -> ember-cli, likely just by improving the mechanism by which we bootstrap the whole thing
  • app.import the various parts of dist (@rwjblue mind tackling this item?)
  • blueprint test-harness so they can be tested outside of ember-cli themselves
  • ... ?
  • release ember as an npm module

@rwjblue
Copy link
Member

rwjblue commented Sep 30, 2015

The following blueprints should not be moved into Ember itself:

  • app - This is the default folder structure/scaffolding for an app, and contains little or no Ember version specific information.
  • addon - Same as app.
  • adapter - This is an Ember Data blueprint (not an Ember one).
  • model - Ember Data
  • view - This should likely be in ember-legacy-views

If we do need to defer some of the file contents for app/addon (perhaps things like app/router.js) we can make a custom blueprint for it (in blueprints/router/) and that can move into Ember...

@stefanpenner
Copy link
Member Author

app - This is the default folder structure/scaffolding for an app, and contains little or no Ember version specific information.
addon - Same as app.

I am unclear about these. As parts of them are somewhat dictated by ember.

Maybe the right course of action for those, is to to split them apart.

@rwjblue
Copy link
Member

rwjblue commented Sep 30, 2015

Maybe the right course of action for those, is to to split them apart.

Yep, agreed (I mentioned that in #12412 (comment)).

@stefanpenner
Copy link
Member Author

another thing is, the pod-layout vs not pod-layout stuff is somewhat dictate by our ember docs. I suspect this is another case where we can parametrize.


let App;

Ember.MODEL_FACTORY_INJECTIONS = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

@rwjblue for example this line (and this whole file) kinda wants to be in both

Copy link
Member

Choose a reason for hiding this comment

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

Sure, as I mentioned in #12412 (comment) we will need to make a blueprint for this (and likely router.js) then invoke that blueprint from app. The app.js blueprint lives in Ember, but the app structure blueprint lives in ember-cli...

@stefanpenner
Copy link
Member Author

Drawing the boundaries is kinda hard... hmm

@@ -0,0 +1,17 @@
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
Copy link
Member Author

Choose a reason for hiding this comment

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

i wonder if ember-addon and ember-app really want to be seperate modules... This hole NPM crap makes this so tricky

stefanpenner added a commit to ember-cli/ember-cli that referenced this pull request Sep 30, 2015
stefanpenner added a commit to ember-cli/ember-cli that referenced this pull request Oct 2, 2015
stefanpenner added a commit to ember-cli/ember-cli that referenced this pull request Oct 2, 2015
@stefanpenner stefanpenner mentioned this pull request Oct 6, 2015
7 tasks
@mmun mmun self-assigned this Dec 22, 2015
@mmun mmun force-pushed the addonified branch 2 times, most recently from 4a853ca to dd4630d Compare December 24, 2015 21:02
return path.join(__dirname, 'blueprints');
},

treeFor: function(type) {
Copy link
Member

Choose a reason for hiding this comment

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

Use treeForVendor instead of treeFor + guard for type === 'vendor'.

@rwjblue
Copy link
Member

rwjblue commented Dec 27, 2015

This is looking very good, I left a few minor inline comments. My main concerns at this point are:

  • Should the *-test blueprints be moved into ember-cli-qunit instead of Ember itself? It seems to me that this is the right choice and it would be unfortunate to have to move them twice (into Ember then out into ember-cli-qunit later).
  • Can you provide a demo/test repo with the required setup to play with this? How does it work with various ember-cli versions?
  • We are defining our own shims here (which is good), does that have negative interaction on using ember-cli-shims also? Which one wins if you have both?

@homu
Copy link
Contributor

homu commented Dec 28, 2015

☔ The latest upstream changes (presumably #12757) made this pull request unmergeable. Please resolve the merge conflicts.

@Turbo87
Copy link
Member

Turbo87 commented Feb 19, 2016

Should the *-test blueprints be moved into ember-cli-qunit instead of Ember itself? It seems to me that this is the right choice and it would be unfortunate to have to move them twice (into Ember then out into ember-cli-qunit later).

IMHO this project should use the same approach as taken in emberjs/data#4167. i.e. providing both qunit and mocha blueprints from this repo.

@rwjblue
Copy link
Member

rwjblue commented Feb 19, 2016

Yes, agreed (we had come to the same conclusion but forgot to update here).

@Turbo87
Copy link
Member

Turbo87 commented Mar 15, 2016

@rwjblue @stefanpenner I think this can be closed now that #13029 has been merged

@rwjblue rwjblue closed this Mar 15, 2016
@rwjblue rwjblue deleted the addonified branch March 15, 2016 11:22
@rwjblue
Copy link
Member

rwjblue commented Mar 15, 2016

Thanks for the reminder

@stefanpenner
Copy link
Member Author

👍

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.

5 participants