Workiva / react-dart

Dart Bindings for React JS
BSD 2-Clause "Simplified" License
413 stars 67 forks source link

FED-3253 Officially support Dart 3 #409

Closed greglittlefield-wf closed 3 weeks ago

greglittlefield-wf commented 1 month ago

Related over_react PR: https://github.com/Workiva/over_react/pull/958

Motivation

We should support Dart 3.

react-dart can currently be consumed in Dart 3, despite not supporting it in its SDK constraints, due to the way Dart 3 treats null-safe packages as compatible.

However, we don't officially support Dart 3, and our automated CI checks don't validate that it works properly in Dart 3.

Also, we still need to support Dart 2 for the time being, so ideally we'd be able to support both Dart 2 and 3 in the same react-dart version, and run CI against each Dart version.

Changes

[!CAUTION] There's a bug in Dart >=3.3.0 <3.5.0 that breaks the behavior in DDC of certain functions passed to components, such as refs and potentially JS callback props: https://github.com/dart-lang/sdk/issues/56897

We can't prevent users on those versions from pulling in react-dart, since they can already resolve to null-safe versions that have already been published.

So, consumers will just have to avoid those versions of Dart, or use dart2js during development or tests.

If needed, we could potentially follow up with a warning that detects this bug and provides a helpful error.

QA Checklist

aviary-wf commented 1 month ago

Security Insights

No security relevant content was detected by automated scans.

Action Items

robbecker-wf commented 3 weeks ago

QA+1 CI passes. Verified that Dart 3 CI runs actually run on Dart 3 and analyzer 6.

robbecker-wf commented 3 weeks ago

can ignore semgrep ❌

greglittlefield-wf commented 3 weeks ago

@Workiva/release-management-p