dart-lang / web

Lightweight browser API bindings built around JS static interop.
https://pub.dev/packages/web
BSD 3-Clause "New" or "Revised" License
135 stars 23 forks source link

Use mono_repo for package:web #288

Closed srujzs closed 2 months ago

srujzs commented 2 months ago

Splits package:web into two packages:

The latter contains our tooling to generate the former, and used to be the tool directory.

Refactors code to point to new paths and moves directories like third_party to their appropriate locations. Moves the CI configurations to mono_repo.yaml and mono_pkg.yaml files, and is now generated as dart.yml.

kevmoo commented 2 months ago

But...why? What does this get us?

srujzs commented 2 months ago

This came up with analysis of an external PR. Analysis with the latest dev version has started failing due to the generator using JSArray.length and JSArray.[]. Since those members didn't exist until recently in dart:js_interop, we were using the declarations in util.dart. Once those members were added to dart:js_interop, it started using the definitions in the SDK instead implicitly because type members have higher precedence than extension members. However, when we added @Since annotations, analysis started to fail because the minimum SDK version of this package was not >=3.6. This will start turning CI red.

The solutions were:

As a bonus, if we wanted, we could publish the generator as a separate package so users can use it to generate definitions that we don't emit in this package. This was discussed in https://github.com/dart-lang/web/issues/145 before, but is not really the primary goal of this PR.