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

Use an addon to bring in ic-ajax & ember-data. #1047

Merged
merged 2 commits into from
Jun 17, 2014

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Jun 15, 2014

Uses https://github.com/rjackson/ember-cli-ic-ajax to provide ic-ajax, and https://github.com/twokul/ember-cli-ember-data to provide embe-data as addons.

There are at least a couple of benefits here:

  • Adding/removing ic-ajax is now a one step operation (npm install --save ember-cli-ic-ajax).
  • We have a logical place to put custom logic (in the future) to ensure $.ajax is not used (as it is not test friendly).

@stefanpenner
Copy link
Contributor

is it possible for npm install ic-ajax to also do this?

@rwjblue
Copy link
Member Author

rwjblue commented Jun 15, 2014

Not as it exists today, no. The main export for their package would have to be changed (so that when we require it and pass the project instance, it knows what to do).

Take a look at the ic-ajax main export here: https://github.com/instructure/ic-ajax/blob/master/dist/cjs/main.js#L24

@rwjblue
Copy link
Member Author

rwjblue commented Jun 15, 2014

I think that it will be common to wrap other tools with Ember CLI specific addons.

@jakecraige
Copy link
Member

@rjackson is there a way when developing these wrappers to either submodule it or include it as a dependency so the files are not just copied in and have to be maintained? It seems tedious to have to do that

@rwjblue
Copy link
Member Author

rwjblue commented Jun 15, 2014

@jakecraige - Yep, updated and published ember-cli-ic-ajax 0.0.2 that uses npm to pull in ic-ajax (instead of vendoring). Also, take a look at ember-cli-esnext which also uses NPM (note: ember-cli-pretender addon could not do this, since pretender is not published to NPM).

@rwjblue
Copy link
Member Author

rwjblue commented Jun 15, 2014

The way that the vendored asset is appended, has the pleasant benefit of allowing the user to customize their own version, by simply adding ic-ajax to bower.json (since the actual vendor/ic-ajax/ folder will take precedence).

@rwjblue rwjblue changed the title Use an addon to bring in ic-ajax. Use an addon to bring in ic-ajax & ember-data. Jun 16, 2014
@rwjblue
Copy link
Member Author

rwjblue commented Jun 16, 2014

Updated to include ember-data as an addon also.

@tonycoco
Copy link

@rjackson this is badass. Cheers. 🍻

@tonycoco
Copy link

Should we have a list of known addons somewhere? Otherwise everyone is going to create their own ember-data-addon repos. Maybe even have a ember-cli org and put all the canonical repos for addons and things in it? /cc @stefanpenner @rjackson

@stefanpenner
Copy link
Contributor

@tonycoco -> https://www.npmjs.org/browse/keyword/ember-cli-addon – we should likely put this on the site/readme.

It might be fun to augment emberaddons.com to merely pull from NPM's API on a perf keyword basis.

stefanpenner added a commit that referenced this pull request Jun 17, 2014
Use an addon to bring in ic-ajax & ember-data.
@stefanpenner stefanpenner merged commit 50393ea into ember-cli:master Jun 17, 2014
@stefanpenner stefanpenner deleted the use-addon-for-ember-cli branch June 17, 2014 16:00
@ndreckshage
Copy link

@rjackson im seeing this: npm WARN package.json ember-cli-ic-ajax@0.1.0 No repository field.

Not sure I understand benefit of using npm over bower for all of this

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

6 participants