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

Incorporate addons into EmberApp. #1025

Merged
merged 1 commit into from
Jun 14, 2014
Merged

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Jun 13, 2014

Incorporate the Project models, recent addon support into EmberApp.

Uses the following hooks/functions that are called on each addon (if the method exists):

  • included -- Called at the end of the EmberApp constructor.
  • treesFor -- Called at various points in the building up of the final dist tree. Receives the name of the step that is being processed. The return value is expected to be a Broccoli tree. The following steps are available with this PR:
    • app
    • styles
    • vendor

For a sample addon please take a look at: ember-cli-pretender

ember-cli-pretender can be used (with these changes) via the following steps:

npm install -g ember-cli
ember new some-awesome-app
cd some-awesome-app
npm install --save-dev ember-cli-pretender
ember server

No modifications are needed to the Brocfile.js at all.

@twokul
Copy link
Contributor

twokul commented Jun 13, 2014

👍

@abuiles
Copy link
Member

abuiles commented Jun 13, 2014

woow! 📈

@stefanpenner stefanpenner self-assigned this Jun 13, 2014
@bcardarella
Copy link
Contributor

💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰 💰


EmberApp.prototype.addonTreesFor = function(step) {
Copy link
Contributor

Choose a reason for hiding this comment

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

step is unclear, maybe type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

Incorporate the `Project` models, recent addon support into `EmberApp`.

Uses the following hooks/functions that are called on each addon (if the method exists):

* `included` -- Called at the end of the `EmberApp` constructor.
* `treesFor` -- Called at various points in the building up of the final dist tree. Receives
  the name of the step that is being processed. The return value is expected to be a Broccoli
  tree.  The following steps are available with this PR:
  * `app`
  * `styles`
  * `vendor`

----

For a sample addon please take a look at: [ember-cli-pretender](https://github.com/rjackson/ember-cli-pretender/blob/master/index.js)

`ember-cli-pretender` can be used (with these changes) via the following
steps:

```bash
npm install -g ember-cli
ember new some-awesome-app
cd some-awesome-app
npm install --save-dev ember-cli-pretender
ember server
```

No modifications are needed to the `Brocfile.js` at all.
@stefanpenner
Copy link
Contributor

<3 this is a great start.

stefanpenner added a commit that referenced this pull request Jun 14, 2014
Incorporate addons into EmberApp.
@stefanpenner stefanpenner merged commit d94839d into ember-cli:master Jun 14, 2014
@rwjblue rwjblue deleted the addons branch June 14, 2014 02:15
rwjblue added a commit that referenced this pull request Jun 14, 2014
@rondale-sc
Copy link
Contributor

👍

@ralph
Copy link

ralph commented Jun 15, 2014

Yay! (y)

@chrism
Copy link
Contributor

chrism commented Jun 15, 2014

this is just great! 😆

@jluckyiv
Copy link
Contributor

Forgive my ignorance, but how do I import Pretender into a test file? When I instantiate a new Pretender object, JSHint says 'Pretender' is not defined.

I have tried a variety of imports, but I can't seem to point to the right file.

@rwjblue
Copy link
Member Author

rwjblue commented Jun 20, 2014

This is a JSHint warning. You either need to add Pretender to he predef section in your tests/.jshintrc, or add a file specific comment to whitelist it.

@jluckyiv
Copy link
Contributor

Thanks so much for the quick response. I'll modify the .jshintrc.

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.

9 participants