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

The adapter-registry does not always use a custom index-adapter #65

Open
ghost opened this issue Dec 15, 2014 · 5 comments
Open

The adapter-registry does not always use a custom index-adapter #65

ghost opened this issue Dec 15, 2014 · 5 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Dec 15, 2014

Re: comments on https://github.com/achambers/ember-cli-deploy/pull/47

When installing a custom index-adapter, the adapter-registry will only use the first index-adapter it finds. Depending on the order of dependencies inside an app's package.json, the first index-adapter may be the default ember-cli-deploy-redis-index-adapter.

This makes it difficult to install a custom index-adapter named ember-cli-deploy-***, since npm will usually save dependencies in alphabetical order.

Suggested Solutions
  1. Skip registering the default ember-cli-deploy-redis-index-adapter if another index-adapter exists
  2. Remove ember-cli-deploy-redis-index-adapter from the ember-cli-deploy dependencies

I can create a PR once we decide upon the best solution.

Work around

Move the custom index-adapter above the ember-cli-deploy package in your ember-cli app's package.json.

@achambers
Copy link
Owner

I may be completely wrong here or misunderstanding the problem so please correct me if I am. And I'm writing this at 4am from my iPhone in Thailand so haven't been able to test my thoughts. But anyway...

The adapter registry first goes through this.project.addons to find any adapter you have installed in your ember-cli project. This will not (and this is where my understanding may be incorrect) find the default adapter that has been installed via the package.json in ember-cli-deploy.

If no adapter is found then it will require the default one installed by ember-cli-deploy.

That was the intention anyway. Please let me know where/if this logic is incorrect.

Thanks for your input mate.

@achambers
Copy link
Owner

This is based on my understanding that this.project.addons contains the ember-addon packages installed directly in the ember-cli app and not those installed in it's dependencies. Ie, the default adapter installed in node_modules inside ember-cli-deploy

@ghost
Copy link
Author

ghost commented Dec 16, 2014

Unfortunately, I believe your assumption is incorrect. From my testing, this.project.addons includes the redis-index-adapter which is only listed inside of ember-cli-deploy. I will try to create an example project later on this week to demonstrate this. I am currently using ember-cli 1.2, so maybe the behaviour is different compared to the latest version.

@achambers
Copy link
Owner

Ok mate. I'll have a play with it too over the next couple of days. Thanks for bringing this up.

@achambers
Copy link
Owner

ember-cli-deploy is in the process of merging with ember-deploy. Therefore, no more changes will be made to this repo. Please see the README for more details. /cc @neaket360pi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant