filiph / linkcheck

Fast link checker
https://pub.dartlang.org/packages/linkcheck
MIT License
403 stars 51 forks source link

Migrate to null safety and support Dart 3 #105

Closed parlough closed 1 year ago

parlough commented 1 year ago

Linkcheck needs to migrate to support sound null safety to allow developers with a Dart 3 dev SDK to run it.

This PR also moves away from a from-to-map based solution for passing messages between isolates. It was a bit messy once migrated to null safety, and the objects can be passed directly instead. To maintain the same system where workers stay alive due to their HTTP connections, messages are now specified within a WorkerTask with a WorkerVerb enum specifying its type. Messages are shared when immutable and automatically copied when not. I didn't run any benchmarks, but I imagine it may result in some speed ups too due to avoiding some unnecessary object constructions as well as simpler comparisons.

\cc @domesticmouse and @khanhnwin As this will be needed for dart-lang/site-www (sooner) and flutter/website (later)

parlough commented 1 year ago

Thanks for the review! I hope to test the changes further and likely make some other cleanup changes over the next few days, but it's nice to see the primary migration be complete.

filiph commented 1 year ago

@parlough No, thank you! Fantastic job.

Please let me know if/when you want to tag a commit with 3.0.0 so that it gets released.

Also, I'd love to add you to collaborators if you don't mind.

parlough commented 1 year ago

Sounds good. I'll open a PR updating the version to 3.0.0 once I finish my testing.

As for adding me as a collaborator, sure!