Skip to content

chore: bump minimum Dart SDK to 3.9.0#1527

Merged
spydon merged 1 commit into
mainfrom
chore/bump-min-dart-3.9
Jul 3, 2026
Merged

chore: bump minimum Dart SDK to 3.9.0#1527
spydon merged 1 commit into
mainfrom
chore/bump-min-dart-3.9

Conversation

@spydon

@spydon spydon commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

Raises the minimum Dart SDK of the pure-Dart packages (functions_client, gotrue, postgrest, realtime_client, storage_client, supabase, supabase_lints, yet_another_json_isolate) and the supabase web example from 3.4.0/3.3.0 to 3.9.0, matching supabase_flutter.

This is the base PR for the pub workspaces + Melos 8 migration (#1525), which is stacked on top of it. Pub workspaces resolve the whole workspace as a unit under a single Dart SDK, so aligning every package on 3.9.0 keeps the toolchain and formatting consistent across the repo.

Why the large diff

Raising the language version to 3.9 switches dart format to its mandatory "tall" style. All affected packages are reformatted accordingly (109 files) — this is a pure formatting change. supabase_flutter was already on 3.9, so it is untouched.

Analyzer fixes surfaced by the new language version

  • postgrest: 3.9 no longer implicitly promotes the bare body as dynamic; statement in _parseResponse, which surfaced three argument_type_not_assignable errors. The casts are now explicit and behavior-preserving (body as Iterable / body as Map), guarded by the existing R == PostgrestList / R == PostgrestMap checks.
  • realtime_client: the tall formatter wraps a long single-line if onto two lines, which then needs braces (curly_braces_in_flow_control_structures).

Validation

  • dart format -l 80 --set-exit-if-changed is clean across all packages.
  • dart analyze --fatal-infos passes (verified on postgrest and realtime_client, which had the only issues).
  • postgrest's mock-based tests (response-conversion paths) pass.

Note

This raises the minimum supported Dart SDK for the affected published packages, which reviewers may want to reflect in the next version bump.

@spydon spydon requested a review from a team as a code owner July 3, 2026 12:07
Raise the minimum Dart SDK of the pure-Dart packages (and the supabase
web example) from 3.4.0/3.3.0 to 3.9.0, matching supabase_flutter.

Bumping the language version switches `dart format` to its mandatory
"tall" style, so all affected packages are reformatted accordingly.

The higher language version also surfaces two things the old style hid:
- postgrest no longer implicitly promotes the bare `body as dynamic;`
  statement, so the casts in `_parseResponse` are made explicit
  (`body as Iterable` / `body as Map`).
- the formatter wraps a long single-line `if` in realtime_client onto
  two lines, so it now needs braces (curly_braces_in_flow_control_structures).
@spydon spydon force-pushed the chore/bump-min-dart-3.9 branch from dd3ef5e to 639519d Compare July 3, 2026 12:17
@spydon spydon merged commit e595e02 into main Jul 3, 2026
34 checks passed
@spydon spydon deleted the chore/bump-min-dart-3.9 branch July 3, 2026 12:26
spydon added a commit that referenced this pull request Jul 3, 2026
> **Stacked on #1527.** Review/merge that one first. This PR targets
`chore/bump-min-dart-3.9` and its diff shows only the workspace/Melos
changes; the Dart 3.9 SDK bump, reformat, and analyzer fixes live in the
base PR.

## What

Migrates the monorepo from Melos 3 (`melos.yaml` +
`pubspec_overrides.yaml` linking) to [Dart pub
workspaces](https://dart.dev/tools/pub/workspaces) with the latest Melos
(8.1.0), following the [Melos migration
guide](https://melos.invertase.dev/guides/migrations) and mirroring how
[flame](https://github.com/flame-engine/flame/blob/main/pubspec.yaml) is
set up.

## Changes

- **Root `pubspec.yaml`** now holds the workspace: a literal
`workspace:` member list (globs would require Dart 3.11, we target 3.9),
`dev_dependencies: melos: ^8.1.0`, and the Melos config moved under the
`melos:` key. `melos.yaml` is deleted.
- **Every member** declares `resolution: workspace`, so pub links the
local packages automatically. `pubspec_overrides.yaml` and
`runPubGetInParallel`/`usePubspecOverrides` are gone.
- **All examples are workspace members**, including `examples/launcher`.
Launcher was previously excluded because the old minimum Flutter shipped
a Dart older than launcher required; now that the whole workspace is on
Dart 3.9 it joins like the rest (bumped to `>=3.9.0`, `resolution:
workspace`).
- **Built-in commands**: drops the hand-written
`analyze`/`format`/`lint:all`/`test:coverage`/`upgrade`/`outdated`
scripts in favor of the built-in `melos analyze`, `melos format` (line
length configured in the `melos:` block) and `melos test`. Only the
`update-version` script (used by the version hook) remains.
- **CI**: the Dart test matrix can no longer use `melos bootstrap
--no-flutter` (removed in Melos, and `resolution: workspace` resolves
the whole workspace at once, which includes `supabase_flutter` and
therefore requires Flutter). It now uses the Flutter
`stable`/`beta`/`master` channels, which bundle Dart
`stable`/`beta`/`dev`, preserving multi-channel coverage (beta/master
only on push to main, as #1524 set up). Affected-package detection now
watches the root `pubspec.yaml`. Melos stays unpinned (the action/CLI
install the latest, which supports workspaces).
- **passkeys example**: updated to pass a `PasskeyAuthenticator`,
matching the current `supabase_flutter` API (a pre-existing break from
#1444 that CI never covered, surfaced now that `melos analyze` runs the
whole workspace).

## Validation

Locally with Melos 8.1.0 and Flutter 3.44 (Dart 3.12):

- `melos bootstrap` resolves the whole workspace with a single `flutter
pub get` (13 packages).
- `melos analyze --fatal-infos` is green across all packages.
- `melos format --set-exit-if-changed` is clean.
- `melos test` runs (verified on a backend-free package).
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

Successfully merging this pull request may close these issues.

2 participants