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

[all] Upgrade to package:web version 1.0.0 #3093

Closed
Rexios80 opened this issue Jul 18, 2024 · 11 comments
Closed

[all] Upgrade to package:web version 1.0.0 #3093

Rexios80 opened this issue Jul 18, 2024 · 11 comments
Labels
all enhancement New feature or request

Comments

@Rexios80
Copy link
Contributor

Plugin

all

Use case

Dependency resolution

Proposal

Upgrade all packages to package:web version 1.0.0

@Rexios80 Rexios80 added enhancement New feature or request triage labels Jul 18, 2024
@Rexios80
Copy link
Contributor Author

I don't think there are any breaking changes, but there might be some cleanup to do if there are any extensions on JS types since version 1.0.0 added a bunch that didn't used to exist (and thus needed to be added manually)

@miquelbeltran
Copy link
Member

We will probably get the PRs from dependabot within a week nevertheless ;)

Have you tried to do a dependency_overrides? any issues?

@miquelbeltran miquelbeltran added all and removed triage labels Jul 18, 2024
@Rexios80
Copy link
Contributor Author

I have not tried anything since this is not urgent for me right now. I just wanted to bring attention to it.

@miquelbeltran miquelbeltran pinned this issue Jul 18, 2024
@miquelbeltran
Copy link
Member

I am pinning the issue, hopefully avoiding people creating the same ticket over and over.

@LucazzP
Copy link

LucazzP commented Jul 21, 2024

I tried to add the web: 1.0.0 as a dependency_override, but it threw a bunch of exceptions on the share_plus_web, I think it is because the new web version as a new ShareData object, that conflicts with the ShareData object from share_plus.
Here are the exceptions:

../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:43:38: Error: The argument type 'ShareData/*1*/' can't be assigned to the parameter type 'ShareData/*2*/'.
 - 'ShareData/*1*/' is from 'package:share_plus/src/share_plus_web.dart' ('../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart').
 - 'ShareData/*2*/' is from 'package:web/src/dom/web_share.dart' ('../../../../../.pub-cache/hosted/pub.dev/web-1.0.0/lib/src/dom/web_share.dart').
      canShare = _navigator.canShare(data);
                                     ^
../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:58:30: Error: The argument type 'ShareData/*1*/' can't be assigned to the parameter type 'ShareData/*2*/'.
 - 'ShareData/*1*/' is from 'package:share_plus/src/share_plus_web.dart' ('../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart').
 - 'ShareData/*2*/' is from 'package:web/src/dom/web_share.dart' ('../../../../../.pub-cache/hosted/pub.dev/web-1.0.0/lib/src/dom/web_share.dart').
      await _navigator.share(data).toDart;
                             ^
../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:91:38: Error: The argument type 'ShareData/*1*/' can't be assigned to the parameter type 'ShareData/*2*/'.
 - 'ShareData/*1*/' is from 'package:share_plus/src/share_plus_web.dart' ('../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart').
 - 'ShareData/*2*/' is from 'package:web/src/dom/web_share.dart' ('../../../../../.pub-cache/hosted/pub.dev/web-1.0.0/lib/src/dom/web_share.dart').
      canShare = _navigator.canShare(data);
                                     ^
../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:129:30: Error: The argument type 'ShareData/*1*/' can't be assigned to the parameter type 'ShareData/*2*/'.
 - 'ShareData/*1*/' is from 'package:share_plus/src/share_plus_web.dart' ('../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart').
 - 'ShareData/*2*/' is from 'package:web/src/dom/web_share.dart' ('../../../../../.pub-cache/hosted/pub.dev/web-1.0.0/lib/src/dom/web_share.dart').
      await _navigator.share(data).toDart;
                             ^
../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:192:38: Error: The argument type 'ShareData/*1*/' can't be assigned to the parameter type 'ShareData/*2*/'.
 - 'ShareData/*1*/' is from 'package:share_plus/src/share_plus_web.dart' ('../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart').
 - 'ShareData/*2*/' is from 'package:web/src/dom/web_share.dart' ('../../../../../.pub-cache/hosted/pub.dev/web-1.0.0/lib/src/dom/web_share.dart').
      canShare = _navigator.canShare(data);
                                     ^
../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:207:30: Error: The argument type 'ShareData/*1*/' can't be assigned to the parameter type 'ShareData/*2*/'.
 - 'ShareData/*1*/' is from 'package:share_plus/src/share_plus_web.dart' ('../../../../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart').
 - 'ShareData/*2*/' is from 'package:web/src/dom/web_share.dart' ('../../../../../.pub-cache/hosted/pub.dev/web-1.0.0/lib/src/dom/web_share.dart').
      await _navigator.share(data).toDart;
                             ^

@miquelbeltran
Copy link
Member

share_plus and battery_plus fail to build with web 1.0.0.
device_info_plus, connectivity_plus and package_info_plus seem fine.

@miquelbeltran
Copy link
Member

FYI for anyone who is getting web 1.0.0 issues: In device_info_plus, package_info_plus and connectivity_plus you can simply do a dependency overrides and set web to 1.0.0, e.g.

dependency_overrides:
  web: ^1.0.0

Learn more about managing dependencies here: https://dart.dev/tools/pub/dependencies

@miquelbeltran
Copy link
Member

Changes in share_plus and battery_plus should be ready to land soon. Our current plan is to release all packages sometime next week (week 33).

Meanwhile, you can use dependency overrides and/or git-ref in your pubspecs if this is blocking you. If you do, please provide feedback if you encounter any issues.

@vbuberen
Copy link
Collaborator

After yesterday's release all plugins now support projects with web: 1.0.0, so closing this as completed.

@provokateurin

This comment has been minimized.

@vbuberen

This comment has been minimized.

@miquelbeltran miquelbeltran unpinned this issue Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants