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

raise package upper bounds and/or migrate to Dart 3 #947

Open
dave-doty opened this issue Sep 14, 2024 · 5 comments
Open

raise package upper bounds and/or migrate to Dart 3 #947

dave-doty opened this issue Sep 14, 2024 · 5 comments

Comments

@dave-doty
Copy link

  • Issue Type: FEATURE REQUEST
  • over_react Version(s): 5.3.0

My project depends heavily on OverReact, and I finished migrating it to null safety with Dart 2.19.6. (If it matters, it's what's on the dev branch here: https://github.com/UC-Davis-molecular-computing/scadnano/tree/dev)

I thought I could then proceed to upgrade to Dart 3, but I ran into some issues that I believe are coming from package upper bounds in OverReact: UC-Davis-molecular-computing/scadnano#990 (comment) In particular, although OverReact is ostensibly compatible with Dart 3:

image

I think the package upper bounds of OverReact make this difficult. In particular (as I mention in the comment linked above) I suspect that you need frontend_server_client version 4 in order to run dart run build_runner build (or related build_runner tasks such as dart run build_runner build, or webdev serve, which I think runs dart run build_runner build behind the scenes) with Dart 3.

Maybe I'm just doing something wrong, but I wrestled with this for a while and, based on the discussion I linked in the comment (dart-lang/sdk#55911 (comment)) I suspect that I won't be able to upgrade to Dart 3 until OverReact raises the package upper bounds on frontend_server_client (and perhaps others? e.g., build_runner is currently at version 2.4.12 but I ran into resolving issues, I believe related to other version upper bounds in OverReact that limits it to 2.3 for build_runner).

Sorry if this isn't the right place to put this. There used to be a gitter page that the team used (https://app.gitter.im/#/room/#over_react_Lobby:gitter.im?source=orgpage), but I'm not sure how to contact them anymore.


FYI: @greglittlefield-wf @aaronlademann-wf @kealjones-wk @evanweible-wf @maxwellpeterson-wf

@greglittlefield-wf
Copy link
Contributor

Sorry if this isn't the right place to put this. There used to be a gitter page that the team used (https://app.gitter.im/#/room/#over_react_Lobby:gitter.im?source=orgpage), but I'm not sure how to contact them anymore.

This is the right place! Yeah, we haven't checked that in a while, sorry about that... we should remove that link from our README. Additionally, we're trying to get better about monitoring issues here.

We do have plans to officially add Dart 3 support, but I'm not sure when exactly we'll be able to get to it.

We don't rely on frontend_server_client directly, but I'm guessing it's our dependency on build or some other package that transitively depends on it (see here).

We'd accept PRs, but heads up that it might not be possible to support both Dart 2 and Dart 3 versions of packages in the same release (in both the root over_react package and the analyzer plugin subpackage) and get everything passing in the various matrix configs in our CI. So, we may have to support only Dart 3 moving forward, and support Dart 2 in a separate release line.

@dave-doty
Copy link
Author

We do have plans to officially add Dart 3 support, but I'm not sure when exactly we'll be able to get to it.

Is it that difficult? I thought the main barrier to Dart 3 migration was null safety. I know I ran into a few small syntax things when I started trying to upgrade my repo (e.g., in Dart 3 you can only use mixins with the with keyword, so I had to convert some abstract classes to mixins), but it was way simpler and faster than null safety. Or is it something like, you are waiting for some other package you depend on to upgrade, and until then you can't?

@greglittlefield-wf
Copy link
Contributor

Hey @dave-doty!

No, it was less about difficultly, and more a matter of bandwidth and unknown scope of work.

I did have some time this past week to give running on Dart 3 a try, though, and thankfully was able to get it working! I've got a PR in progress, and should hopefully be able to land that soon: #958

However, none of the changes in that branch are fixes in lib that would impact consumers, so I'd expect the latest published release to work in Dart 3.

I did hit a few snags along the way, including this bug in Dart >=3.3.0 <3.5.0 that breaks JS interop for some functions, notably callback refs, in react-dart/over_react: dart-lang/sdk#56897

So long as you're on older or newer versions of Dart outside that range, though, you should be good.


Now, back to the dependency issues, and frontend_server_client: I didn't see anything in over_react's depdendencies that was preventing newer versions of frontend_server_client from being pulled in.

Actually, even with all its dev_dependencies, frontend_server_client 4.0.0 is resolved to in over_react (see "Install dependencies" job in this run).

So I'm thinking there may be some other dependency in your package that's preventing it from pulling it in, possibly due to mismatches with other over_react packages. We are still on analyzer 5, so hopefully it's not that...

Could you try adding frontend_server_client: ^4.0.0 to your dev_dependencies in you pubspec.yaml, and posting what the version mismatch message is that it gives? That should narrow us in on which package is the culprit. Sorry, I should have thought to ask for that sooner!

@greglittlefield-wf
Copy link
Contributor

@dave-doty Sorry, forgot to follow up, but those changes are released now in over_react 5.4.1!

Oh, and, we also ended up raising the analyzer constraint to allow 6.x (in addition to 5.x), which may also help with dependency resolution.

@dave-doty
Copy link
Author

Great! It will be some time before I'll have the bandwidth to test this, but I hope it clears up the issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants