Skip to content

Fix: Migrate off legacy JS/HTML APIs #750

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

Merged
merged 10 commits into from
Feb 18, 2025

Conversation

aran
Copy link
Contributor

@aran aran commented Dec 4, 2024

Fixes #715.

This includes a rebase of @minoic's #730 onto the latest master, along with a couple updates.

It also updates client_xhr_transport_test to avoid dart:html, performing some ceremony to work around the unavailability of the previous mock strategy.

Copy link

github-actions bot commented Dec 4, 2024

PR Health

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
grpc Breaking 4.0.1 4.0.2-wip 5.0.0
Got "4.0.2-wip" expected >= "5.0.0" (breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ⚠️
File Coverage
lib/grpc_or_grpcweb.dart 💚 57 %
lib/src/client/transport/xhr_transport.dart 💔 Not covered

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ⚠️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
grpc $1.Duration
Any

This check can be disabled by tagging the PR with skip-leaking-check.

@aran
Copy link
Contributor Author

aran commented Dec 4, 2024

RFC. There's quite a lot of boilerplate to work around the extension type extern for XMLHttpRequest. More work may be needed here to reimplement some of XMLHttpRequest for the test's expectations, if using this approach.

Help needed: the tests don't pass. I'm not sure how they're supposed to be run, since I run dart test -p chrome I still see errors about the unavailability of dart:js_interop, which is surprising, so something is broken in my mental model.

@aran
Copy link
Contributor Author

aran commented Dec 14, 2024

@Moseum - anyone on maintainer side who could help shepherd this?

@mosuem
Copy link
Contributor

mosuem commented Dec 16, 2024

I think we need to land #747 first, which has some failures at the moment. Happy to see this go through in general, thanks a lot for the initiative!

@aran aran force-pushed the client_xhr_transport_test branch from 05eea0d to c7b9125 Compare December 16, 2024 17:16
@aran
Copy link
Contributor Author

aran commented Dec 16, 2024

@mosuem - should I temporarily remove this test from #747? I see that there is a CI failure in #747 that is related to this test.

@mosuem
Copy link
Contributor

mosuem commented Dec 17, 2024

Help needed: the tests don't pass. I'm not sure how they're supposed to be run, since I run dart test -p chrome I still see errors about the unavailability of dart:js_interop, which is surprising, so something is broken in my mental model.

I see different failures locally - TypeError: null: type 'JSNull' is not a subtype of type 'JSObject'

@mosuem
Copy link
Contributor

mosuem commented Dec 17, 2024

@mosuem - should I temporarily remove this test from #747? I see that there is a CI failure in #747 that is related to this test.

I would suggest to close #747 in favor of this PR, to fix the tests in the same PR as the other changes.

@aran
Copy link
Contributor Author

aran commented Jan 8, 2025

Happy new year! Please let me know if there's anything else I can do to assist here.

@aran
Copy link
Contributor Author

aran commented Feb 14, 2025

Gentle reminder this is here. Anyone who wants to use grpc + wasm mode needs this.

@mikebosland
Copy link

Aran, did you get the tests passing and your RFC addressed from your #750 (comment) above? I really appreciate all the work on this. Looking forward to being able to upgrade to WASM!

@mosuem
Copy link
Contributor

mosuem commented Feb 14, 2025

Sorry for the long wait @aran ...

I tried to refactor the test to use the mocking as described in https://dart.dev/interop/js-interop/mock, but the lack of analyzer support for overrides and other small problems makes this not a nice solution IMO. So this LGTM! Please do adapt the PR title and description, and rebase the PR. Then we can merge it ASAP

@aran aran changed the title Client xhr transport test Fix: Migrate off legacy JS/HTML APIs Feb 14, 2025
@aran aran force-pushed the client_xhr_transport_test branch from 5fee651 to b39a6ff Compare February 14, 2025 17:02
@aran
Copy link
Contributor Author

aran commented Feb 14, 2025

@mosuem updated. Let me know if there's anything else.

@mosuem mosuem merged commit 8406614 into grpc:master Feb 18, 2025
20 checks passed
@mosuem
Copy link
Contributor

mosuem commented Feb 18, 2025

Thanks for seeing this through!

@kevmoo
Copy link
Contributor

kevmoo commented Feb 18, 2025

Thank you!

@aran aran deleted the client_xhr_transport_test branch February 20, 2025 18:57
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.

Migrate off legacy JS/HTML apis
5 participants