fix(ui_oauth): use dart.library.js_interop for Wasm-compatible imports - #675
Open
Rexios80 wants to merge 2 commits into
Open
fix(ui_oauth): use dart.library.js_interop for Wasm-compatible imports#675Rexios80 wants to merge 2 commits into
Rexios80 wants to merge 2 commits into
Conversation
Replace dart.library.html with dart.library.js_interop so the web platform_oauth_sign_in implementation is selected under Wasm, where dart.library.html is unavailable.
Unconditional barrel exports still pulled dart:io into pana's Wasm check after the js_interop conditional import. Re-export those types only on IO, and stub them on web.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
OAuthProviderselects its platform sign-in implementation with a conditional import gated ondart.library.html. That library is unavailable when compiling to Wasm, so pana/pub.dev resolves the default (platform_oauth_sign_in.dart) which pulls indesktop_webview_auth/dart:io, costing the WASM platform points forfirebase_ui_oauthand dependents (e.g.firebase_ui_oauth_oidc).This PR switches that condition to
dart.library.js_interop, which is present for both JS and Wasm web compiles, so the web implementation is selected correctly.The public library also re-exported
desktop_webview_authunconditionally. Pana's Wasm check follows every public export with no pruning, so that barrel export still pulleddart:iointo the graph after the conditional import fix. Desktop types (AuthResult,ProviderArgs, and the Google/Facebook/Twitter sign-in args) are now re-exported only on IO, with web/Wasm stubs that do not importdart:io.Related Issues
N/A — improves Wasm readiness / pub points for
firebase_ui_oauthand packages that depend on it.Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.melos run test:unit:alldoesn't fail).Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?