flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

feat(web): update to `web: ^1.0.0`

Open Lyokone opened this issue 1 year ago • 6 comments

Description

If you want to use this PR early, you can use latest version of FlutterFire CLI

dart pub global activate flutterfire_cli 1.0.1-dev.4 --overwrite
flutterfire install git:feat/update-web100

Related Issues

closes #13190

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.yaml and changelogs is not required.

  • [ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • [ ] All existing and new tests are passing.
  • [ ] I updated/added relevant documentation (doc comments with ///).
  • [ ] The analyzer (melos run analyze) does not report any problems on my PR.
  • [ ] I read and followed the Flutter Style Guide.
  • [ ] I signed the CLA.
  • [ ] I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • [ ] Yes, this is a breaking change.
  • [ ] No, this is not a breaking change.

Lyokone avatar Aug 20 '24 07:08 Lyokone

Hello @Lyokone, thank you for creating this PR! I tested it out and encountered an issue with phone number authentication:

Type '_TypeError' is not a subtype of type 'JSValue' in type cast.

After some investigation, I found that changing line 103 of packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart to this resolved the issue for me:

    _delegate = auth_interop.RecaptchaVerifier(
-      element,
+      element.toJS,
      parameters,
      auth.delegate,
    );

Would you be open to including this fix in your PR? This would help me depend on it directly.

mj-shifu avatar Aug 20 '24 12:08 mj-shifu

@mj-shifu thanks so much for noticing 👍 We have some dynamic left here and there from the first implementation 😓 I've pushed the fix

Lyokone avatar Aug 20 '24 13:08 Lyokone

latest version should be used

faheemstepsharp avatar Aug 21 '24 06:08 faheemstepsharp

How long does it take for this update to be released and available on pub.dev?

RicharC293 avatar Aug 21 '24 17:08 RicharC293

I would love this to be merged as well. This dependency is blocking quite some of my other dependencies

millerf avatar Aug 21 '24 22:08 millerf

@russellwheatley @Salakar this PR unblocks a train of dependency updates that grows longer by the day....

T-P-F avatar Aug 26 '24 08:08 T-P-F

@russellwheatley @Salakar please review this PR asap. A lot of depedencies are being blocked by this. Thank you.

mghali1 avatar Aug 28 '24 20:08 mghali1

@Lyokone This

dart pub global activate flutterfire_cli 1.0.1-dev.4 --overwrite
flutterfire install git:feat/update-web100

Did not work for me... The latter command failed.

millerf avatar Aug 29 '24 08:08 millerf

Also, side question: I am actually not using flutter on web, so I was wondering if there was a way to prevent this dependency to be used altogether from my project pubspec.yaml. It infuriating that a dependency I do not use prevents me to update other things. Or maybe I should just override the web dependency!? 🤔🎉

millerf avatar Aug 29 '24 08:08 millerf

@millerf Unfortunately, the web package was in beta, but it is now stable 1.0.0, it will have less frequent updates or breaking changes

amrgetment avatar Aug 29 '24 09:08 amrgetment

Hello, this PR has attracted a lot of attention. We are not ready to force users to upgrade to Dart 3.4 (which is required for us to add support for web: ^1.0.0. We are expecting to make Dart 3.4 required in the coming weeks. You still can depend on this PR or override the web version if needed.

Lyokone avatar Aug 30 '24 09:08 Lyokone

@Lyokone getting some typeerrors in web_utils convertPlatformActionCodeSettings method: https://github.com/firebase/flutterfire/blob/9c3181dde8e2e999e39eba0bc8cc49d535654966/packages/firebase_auth/firebase_auth_web/lib/src/utils/web_utils.dart#L240

The AndroidSettings and IOSSettings fields are not being converted to JS. This works:

if (actionCodeSettingsMap['android'] != null) {
    webActionCodeSettings.android = auth_interop.AndroidSettings(
      packageName: (actionCodeSettingsMap['android']['packageName'] as String?)?.toJS,
      minimumVersion: (actionCodeSettingsMap['android']['minimumVersion'] as String?)?.toJS,
      installApp: (actionCodeSettingsMap['android']['installApp'] as bool?)?.toJS,
    );
  }

  if (actionCodeSettingsMap['iOS'] != null) {
    webActionCodeSettings.iOS = auth_interop.IosSettings(
      bundleId: (actionCodeSettingsMap['iOS']['bundleId'] as String?)?.toJS,
    );
  }

PR here: https://github.com/firebase/flutterfire/pull/13260

josh-burton avatar Sep 03 '24 00:09 josh-burton

@Lyokone pls release an update with this PR asap. A lot of packages are stuck only because of this

sagar1garg avatar Sep 04 '24 15:09 sagar1garg

Hello, this PR has attracted a lot of attention. We are not ready to force users to upgrade to Dart 3.4 (which is required for us to add support for web: ^1.0.0. We are expecting to make Dart 3.4 required in the coming weeks. You still can depend on this PR or override the web version if needed.

The existing package is not compatible with web^1.0.0 so it won't overwrite as well

sagar1garg avatar Sep 04 '24 16:09 sagar1garg

Nice! Thanks for working on it everyone! Will it be deployed on pub.dev soon?

millerf avatar Sep 10 '24 14:09 millerf

It is now deployed.

Kuhlemann avatar Sep 10 '24 15:09 Kuhlemann