From 5e211025318972bd96668d4ff1965a90813e96ea Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 28 Jul 2026 17:40:55 -0400 Subject: [PATCH 1/3] fix(ui_oauth): use dart.library.js_interop for Wasm-compatible imports 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. --- packages/firebase_ui_oauth/lib/src/oauth_provider.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/firebase_ui_oauth/lib/src/oauth_provider.dart b/packages/firebase_ui_oauth/lib/src/oauth_provider.dart index fa965830..8a6b9b16 100644 --- a/packages/firebase_ui_oauth/lib/src/oauth_provider.dart +++ b/packages/firebase_ui_oauth/lib/src/oauth_provider.dart @@ -7,7 +7,7 @@ import 'package:firebase_ui_auth/firebase_ui_auth.dart'; import 'package:firebase_ui_oauth/firebase_ui_oauth.dart'; import 'platform_oauth_sign_in.dart' - if (dart.library.html) 'platform_oauth_sign_in_web.dart'; + if (dart.library.js_interop) 'platform_oauth_sign_in_web.dart'; /// A listener of the [OAuthProvider]. /// See also: From 5773cd1a109b2f842b49ebf498e978c654387931 Mon Sep 17 00:00:00 2001 From: Rexios Date: Fri, 14 Aug 2026 13:21:47 -0400 Subject: [PATCH 2/3] fix(ui_oauth): keep desktop_webview_auth out of the Wasm import graph 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. --- .../lib/firebase_ui_oauth.dart | 7 +-- .../lib/src/desktop_oauth_exports.dart | 9 +++ .../lib/src/desktop_oauth_exports_web.dart | 63 +++++++++++++++++++ 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart create mode 100644 packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart diff --git a/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart b/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart index 97a93ea1..1572d47f 100644 --- a/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart +++ b/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart @@ -3,11 +3,8 @@ // BSD-style license that can be found in the LICENSE file. export 'package:firebase_auth/firebase_auth.dart' show OAuthCredential; -export 'package:desktop_webview_auth/desktop_webview_auth.dart' - show AuthResult, ProviderArgs; -export 'package:desktop_webview_auth/google.dart'; -export 'package:desktop_webview_auth/facebook.dart'; -export 'package:desktop_webview_auth/twitter.dart'; +export './src/desktop_oauth_exports.dart' + if (dart.library.js_interop) './src/desktop_oauth_exports_web.dart'; export './src/oauth_provider.dart'; export './src/oauth_provider_button_base.dart'; diff --git a/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart b/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart new file mode 100644 index 00000000..f96c568e --- /dev/null +++ b/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart @@ -0,0 +1,9 @@ +// Copyright 2026, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +export 'package:desktop_webview_auth/desktop_webview_auth.dart' + show AuthResult, ProviderArgs; +export 'package:desktop_webview_auth/google.dart'; +export 'package:desktop_webview_auth/facebook.dart'; +export 'package:desktop_webview_auth/twitter.dart'; diff --git a/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart b/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart new file mode 100644 index 00000000..2f0e7a56 --- /dev/null +++ b/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart @@ -0,0 +1,63 @@ +// Copyright 2026, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Desktop OAuth types without importing `desktop_webview_auth`. +// That package's public library imports `dart:io`. If this library re-exported +// it unconditionally, pana's Wasm import graph would include `dart:io` and +// the package would lose the Wasm-ready platform points. + +/// Result of a desktop OAuth webview sign-in. +class AuthResult { + final String? accessToken; + final String? idToken; + final String? tokenSecret; + + const AuthResult({this.accessToken, this.idToken, this.tokenSecret}); +} + +/// Arguments used to start a desktop OAuth webview sign-in. +abstract class ProviderArgs { + String get redirectUri; +} + +/// Google desktop OAuth arguments. +class GoogleSignInArgs implements ProviderArgs { + final String clientId; + @override + final String redirectUri; + final String scope; + final bool immediate; + final String responseType; + + GoogleSignInArgs({ + required this.clientId, + required this.redirectUri, + this.scope = 'https://www.googleapis.com/auth/plus.login', + this.immediate = false, + this.responseType = 'token id_token', + }); +} + +/// Facebook desktop OAuth arguments. +class FacebookSignInArgs implements ProviderArgs { + final String clientId; + @override + final String redirectUri; + + FacebookSignInArgs({required this.clientId, required this.redirectUri}); +} + +/// Twitter desktop OAuth arguments. +class TwitterSignInArgs implements ProviderArgs { + final String apiKey; + final String apiSecretKey; + @override + final String redirectUri; + + TwitterSignInArgs({ + required this.apiKey, + required this.apiSecretKey, + required this.redirectUri, + }); +} From 3113ff82efdad0ae8c3fc0a43b9a60071cd3435e Mon Sep 17 00:00:00 2001 From: Rexios Date: Fri, 14 Aug 2026 13:38:13 -0400 Subject: [PATCH 3/3] fix(ui_oauth): re-export Wasm-safe desktop_webview_auth libraries Drop the web stubs and export the leaf libraries that declare the desktop types, instead of the public library that imports dart:io. --- .../lib/firebase_ui_oauth.dart | 12 +++- .../lib/src/desktop_oauth_exports.dart | 9 --- .../lib/src/desktop_oauth_exports_web.dart | 63 ------------------- 3 files changed, 10 insertions(+), 74 deletions(-) delete mode 100644 packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart delete mode 100644 packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart diff --git a/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart b/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart index 1572d47f..b555dd22 100644 --- a/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart +++ b/packages/firebase_ui_oauth/lib/firebase_ui_oauth.dart @@ -3,8 +3,16 @@ // BSD-style license that can be found in the LICENSE file. export 'package:firebase_auth/firebase_auth.dart' show OAuthCredential; -export './src/desktop_oauth_exports.dart' - if (dart.library.js_interop) './src/desktop_oauth_exports_web.dart'; + +// Re-export Wasm-compatible libraries instead of `desktop_webview_auth`, +// which imports `dart:io`. +// ignore: implementation_imports +export 'package:desktop_webview_auth/src/auth_result.dart' show AuthResult; +// ignore: implementation_imports +export 'package:desktop_webview_auth/src/provider_args.dart' show ProviderArgs; +export 'package:desktop_webview_auth/google.dart'; +export 'package:desktop_webview_auth/facebook.dart'; +export 'package:desktop_webview_auth/twitter.dart'; export './src/oauth_provider.dart'; export './src/oauth_provider_button_base.dart'; diff --git a/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart b/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart deleted file mode 100644 index f96c568e..00000000 --- a/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports.dart +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2026, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -export 'package:desktop_webview_auth/desktop_webview_auth.dart' - show AuthResult, ProviderArgs; -export 'package:desktop_webview_auth/google.dart'; -export 'package:desktop_webview_auth/facebook.dart'; -export 'package:desktop_webview_auth/twitter.dart'; diff --git a/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart b/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart deleted file mode 100644 index 2f0e7a56..00000000 --- a/packages/firebase_ui_oauth/lib/src/desktop_oauth_exports_web.dart +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Desktop OAuth types without importing `desktop_webview_auth`. -// That package's public library imports `dart:io`. If this library re-exported -// it unconditionally, pana's Wasm import graph would include `dart:io` and -// the package would lose the Wasm-ready platform points. - -/// Result of a desktop OAuth webview sign-in. -class AuthResult { - final String? accessToken; - final String? idToken; - final String? tokenSecret; - - const AuthResult({this.accessToken, this.idToken, this.tokenSecret}); -} - -/// Arguments used to start a desktop OAuth webview sign-in. -abstract class ProviderArgs { - String get redirectUri; -} - -/// Google desktop OAuth arguments. -class GoogleSignInArgs implements ProviderArgs { - final String clientId; - @override - final String redirectUri; - final String scope; - final bool immediate; - final String responseType; - - GoogleSignInArgs({ - required this.clientId, - required this.redirectUri, - this.scope = 'https://www.googleapis.com/auth/plus.login', - this.immediate = false, - this.responseType = 'token id_token', - }); -} - -/// Facebook desktop OAuth arguments. -class FacebookSignInArgs implements ProviderArgs { - final String clientId; - @override - final String redirectUri; - - FacebookSignInArgs({required this.clientId, required this.redirectUri}); -} - -/// Twitter desktop OAuth arguments. -class TwitterSignInArgs implements ProviderArgs { - final String apiKey; - final String apiSecretKey; - @override - final String redirectUri; - - TwitterSignInArgs({ - required this.apiKey, - required this.apiSecretKey, - required this.redirectUri, - }); -}