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

Make configuration work in engines #172

Merged
merged 1 commit into from
Nov 28, 2018
Merged

Conversation

mydea
Copy link
Contributor

@mydea mydea commented Nov 27, 2018

This makes sure that all nested dependencies use the correct application configuration, and that the import/configuration works in nested addons, especially in engines.

This fixes #133.

I tried it in an app of ours with engines & nested dependencies to ember-fetch, and this ensures that it always got the correct options passed.

Note: While investigating this, I also found out that it wasn't even taking the correct options for building. E.g. If, in my engines dummy app, I had preferNative: true specified in the ember-cli-build.js, it never actually got to this value, instead reading the config from ember-fetch's config (somehow? not entirely sure).

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

This LGTM, thoughts @xg-wang / @nlfurniss?

app = current.app || this;
} while (current.parent && current.parent.parent && (current = current.parent));

return app;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this functionality is in cli > 2.17 an this addon uses at least 3.5, seems like we can remove this?

Copy link
Member

Choose a reason for hiding this comment

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

@nlfurniss This supports consumer app whose cli <= 2.17

Copy link
Collaborator

Choose a reason for hiding this comment

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

But given the current version of this addon tests against 3.5, we dont really support < 2.17...

Copy link
Member

Choose a reason for hiding this comment

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

We lack a way to test against different cli versions
tomdale/ember-cli-addon-tests#25

Copy link
Member

@xg-wang xg-wang left a comment

Choose a reason for hiding this comment

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

LGTM, can you rebase?

index.js Show resolved Hide resolved
This makes sure that all nested dependencies use the correct 
application configuration, and that the import/configuration works in 
nested addons, especially in engines.
@mydea
Copy link
Contributor Author

mydea commented Nov 28, 2018

I have rebased 👍

@xg-wang xg-wang merged commit 814f012 into ember-cli:master Nov 28, 2018
@xg-wang xg-wang added the bug label Nov 28, 2018
@mydea mydea deleted the fix-in-engines branch December 11, 2018 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property 'preferNative' of undefined
4 participants