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

Allow to use native promises instead of RSVP #623

Merged
merged 1 commit into from
Jun 15, 2021

Conversation

mydea
Copy link
Contributor

@mydea mydea commented Jun 10, 2021

I initially tried to get it to work with using require('rsvp') when building with Embroider.
However, I couldn't get it to run. I tried adding rsvp as a dedicated dependency, as well as ember-auto-import, and importing RSVP in an initializer, but nothing made it available under require('rsvp') in my embroider app.

I ended up adding an option that allows to opt out of using the RSVP wrapper at all. I think this is an acceptable and backwards compatible opt-out option that should be OK for apps that target only browsers that do not target IE11 anymore.

Let me know if you think this works, or if a different approach would work better.

Closes #622

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.

Seems good to me overall. I'd like to make a follow up after this lands to issue a deprecation when not using preferNative and nativePromise options.

index.js Outdated Show resolved Hide resolved
@mydea mydea force-pushed the fn/allow-native-promise branch from 3c81b4d to ad8be4e Compare June 14, 2021 06:03
@mydea
Copy link
Contributor Author

mydea commented Jun 14, 2021

I have removed the var Promise = originalGlobal.Promise part, and also added a NATIVE_PROMISE=true yarn test step to travis to make sure this is covered.

@rwjblue rwjblue merged commit 1684f2f into ember-cli:master Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not find module rsvp imported from fetch
2 participants