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

[BUGFIX release] Fix fetch detection in FastBoot. #6092

Merged
merged 1 commit into from
May 8, 2019

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented May 8, 2019

The prior detection of when to use fetch vs when to use jQuery was not properly accounting for the fastboot case when ember-fetch is not present and a fetch global is not present. In that scenario, najax would be present (provided by fastboot itself).

We already had the correct logic in _ajax, however the useFetch computed was returning true which prevented the najax supported branch from being used.

The prior detection of when to use fetch vs when to use jQuery was not
properly acounting for the `fastboot` case when `ember-fetch` is not
present and a `fetch` global is not present. In that scenario, `najax`
would be present (provided by `fastboot` itself).

We already had the correct logic in `_ajax`, however the `useFetch`
computed was returning `true` which prevented the `najax` supported
branch from being used.
@rwjblue rwjblue added the Bug label May 8, 2019
@rwjblue rwjblue requested a review from runspired May 8, 2019 14:07
rwjblue added a commit to rwjblue/ember-data-fastboot-bug that referenced this pull request May 8, 2019
@rwjblue
Copy link
Member Author

rwjblue commented May 8, 2019

Tested this linked against the reproduction app by @mansona and it fixes the latest regression. Test out in mansona/ember-data-fastboot-bug#1.

@mansona
Copy link
Member

mansona commented May 8, 2019

I've tested this locally and I'm 👍 that it has fixed this particular bug

let shouldUseFetch = (ENV && ENV._JQUERY_INTEGRATION) === false || jQ === undefined;

return shouldUseFetch;
// TODO: migrate to static build time detection ala https://github.com/embroider-build/embroider/issues/162
Copy link
Member

Choose a reason for hiding this comment

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

Can you please file an issue

Copy link
Member Author

Choose a reason for hiding this comment

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

@igorT igorT merged commit ab45d35 into emberjs:release May 8, 2019
@rwjblue rwjblue deleted the fixup-fastboot branch May 8, 2019 18:34
@runspired runspired added 🏷️ bug This PR primarily fixes a reported issue and removed Bug labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bug This PR primarily fixes a reported issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants