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

Add fetch API globals #898

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

bobisjan
Copy link
Contributor

@bobisjan bobisjan commented Jul 5, 2022

This is an attempt to follow ember-cli/ember-fetch#656 (comment)

@bobisjan bobisjan force-pushed the fetch branch 8 times, most recently from 30d6ac7 to fe45dbd Compare July 5, 2022 11:34
@gilest
Copy link

gilest commented Jul 6, 2022

Nice work picking this up @bobisjan . Let me know if there's anything I can help with

@bobisjan bobisjan force-pushed the fetch branch 5 times, most recently from 3d22481 to 88fbb08 Compare July 7, 2022 17:56
`Using fetch with relative URL ${url}, but application instance has not been initialized yet.`
);
}
// Old Prember version is not sending protocol
Copy link
Contributor Author

@bobisjan bobisjan Jul 7, 2022

Choose a reason for hiding this comment

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

@gilest, should be old versions of prember still supported? Based on the changelog the 1.0.2+ send protocol correctly https://github.com/ef4/prember/blob/master/CHANGELOG.md#102---2019-01-06

Copy link

Choose a reason for hiding this comment

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

I see. Is that patch incompatible with the changes you are making?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, this workaround should still work for prember < 1.0.2, hence it can stay here if it make sense 🙌

Copy link

Choose a reason for hiding this comment

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

I would guess most prember users are on the latest version but if the workaround can stay that is ideal

@bobisjan bobisjan force-pushed the fetch branch 9 times, most recently from f405ce6 to 24aba7b Compare July 8, 2022 05:35
pkg.dependencies['fastboot-express-middleware'] =
process.env.npm_package_dependencies_fastboot_express_middleware;
pkg.dependencies['fastboot'] = `file:${path.resolve(__dirname, '../../fastboot')}`
pkg.dependencies['fastboot-express-middleware'] = `file:${path.resolve(__dirname, '../../fastboot-express-middleware')}`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes Legacy Mocha Tests, where fetch was undefined during initialisation.

@bobisjan
Copy link
Contributor Author

bobisjan commented Jul 8, 2022

CI is ✅ except tests related to embroider, which are already failing on master 🙈

@bobisjan bobisjan marked this pull request as ready for review July 8, 2022 08:12
}

export default {
name: 'fastboot:fetch', // `ember-fetch` addon registers as `fetch`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be ember-fetch add-on also removed from test apps in the PR?

Copy link

Choose a reason for hiding this comment

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

Since we're providing fetch directly now I think maybe the ember-fetch package should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, tests are passing now 🤞

@bobisjan bobisjan force-pushed the fetch branch 2 times, most recently from 639dd38 to 653ac1c Compare July 8, 2022 13:37
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

2 participants