Skip to content

fix: Adapt to Flutter 3.47 - #3995

Merged
spydon merged 3 commits into
mainfrom
fix/flutter-3.47-compat
Aug 13, 2026
Merged

spydon merged 3 commits into
mainfrom
fix/flutter-3.47-compat

Conversation

@spydon

@spydon spydon commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Description

Flutter 3.47.0 broke the CI pipeline (analyze-latest and test), this adapts the code to it without bumping the minimum supported Flutter or Dart SDK versions:

  • Rewrites the flame_3d flutter_gpu backend for the new flutter_gpu API: ShaderLibrary.fromAsset is now async, so shader bundles are preloaded from the AssetManifest during GpuBackend.initialize() (mirroring the WebGPU backend), and the vertex/index counts moved from bindVertexBuffer/bindIndexBuffer to draw/drawIndexed, so the render pass now records the counts at bind time and picks the right draw call. The committed shader bundles are also regenerated with the new SDK.
  • Since flame_3d now requires the latest stable again, the analyze job (lowest supported version) skips flame_3d* and it is instead only covered by analyze-latest, like we have done before when flutter_gpu has had breaking changes.
  • Converts pass-through constructor parameters to super parameters in the flame effects and ColorTexture, and avoids a parameter assignment in FlameAudio, fixing the new use_super_parameters and parameter_assignments diagnostics.
  • Commits the analyzer.exclude blocks that the Flutter 3.47 tool now generates into every package's analysis_options.yaml on each run (see AnalysisOptionsMigration ignores include:, repeatedly rewriting analysis_options.yaml files that already inherit the exclusions flutter/flutter#191056), placed after the include: so the shared config stays first. Without committing them, every flutter pub get/run/build dirties the working tree.

Verified locally on Flutter 3.47.0: repo-wide dart analyze --fatal-infos, melos exec dart format . --set-exit-if-changed, dcm analyze ., and melos run test:select --no-select (2854 passed, 0 failed) are all green, and flutter pub get no longer rewrites any analysis_options.yaml.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • [-] I have updated/added tests for ALL new/updated/fixed functionality.
  • [-] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • [-] I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Related to flutter/flutter#191056

spydon added 3 commits August 13, 2026 22:23
- Rewrite the flutter_gpu backend for the new async ShaderLibrary.fromAsset
  and the draw-time vertex/index counts
- Convert pass-through constructor parameters to super parameters
- Avoid assigning to a parameter in FlameAudio
- Remove a redundant trailing zero flagged by DCM
@spydon
spydon force-pushed the fix/flutter-3.47-compat branch from c8ce52c to d539f53 Compare August 13, 2026 20:24
@spydon spydon changed the title fix: Bump Flutter min version to 3.47.0 fix: Adapt to Flutter 3.47 Aug 13, 2026
@spydon
spydon merged commit 0453bad into main Aug 13, 2026
9 checks passed
@spydon
spydon deleted the fix/flutter-3.47-compat branch August 13, 2026 20:44
IstiN pushed a commit to IstiN/flutter_js_widget_runtime that referenced this pull request Aug 14, 2026
flame_3d now resolves to IstiN/flame branch flame_3d-0.3.0-flutter-3.47
(backport of flame-engine/flame#3995 onto 0.3.0). Upstream has the fix
in main but has not published it to pub.dev yet.
IstiN pushed a commit to IstiN/flutter_js_widget_runtime that referenced this pull request Aug 14, 2026
…hing

pub.dev rejects git dependencies in published packages. The Flutter
3.47 compatible build (IstiN/flame fork) lives on the flame-3.47
branch until flame-engine/flame#3995 is published upstream.
@spydon spydon mentioned this pull request Aug 16, 2026
2 of 3 tasks
spydon added a commit that referenced this pull request Aug 16, 2026
Releases `flame_forge2d` 0.20.0, scoped to only this package so that the
pending unreleased changes in `flame` and the other packages stay
unreleased.

New version: `flame_forge2d` 0.19.3+7 -> 0.20.0

Included changes:

- **FIX**: Adapt to Flutter 3.47 (#3995)
- **BREAKING** **FEAT**: Migrate flame_forge2d to the Box2D v3 based
forge2d (#3952)

The flame-side breaking changes that also touched this package's
directory (#3968, #3961) only affected its tests and example, so they
are intentionally left out of the changelog: they do not apply to
flame_forge2d consumers until flame v2 is released.

The package keeps its `flame: ^1.38.0` dependency, verified by resolving
against the published flame 1.38.0 and forge2d 0.15.1 (`dart analyze`
clean, all 91 tests pass, `flutter pub publish --dry-run` passes). Since
melos refuses to version a package whose workspace dependency (`flame`)
has pending changes outside the scope filter, the version bump,
changelogs, and dependent constraint updates were applied manually in
the same format melos generates.

On merge, the `release-tag` workflow tags `flame_forge2d-v0.20.0` and
triggers the publish workflow for it.
spydon added a commit that referenced this pull request Aug 26, 2026
Flutter 3.47.0 broke the CI pipeline (`analyze-latest` and `test`), this
adapts the code to it without bumping the minimum supported Flutter or
Dart SDK versions:

- Rewrites the `flame_3d` flutter_gpu backend for the new flutter_gpu
API: `ShaderLibrary.fromAsset` is now async, so shader bundles are
preloaded from the `AssetManifest` during `GpuBackend.initialize()`
(mirroring the WebGPU backend), and the vertex/index counts moved from
`bindVertexBuffer`/`bindIndexBuffer` to `draw`/`drawIndexed`, so the
render pass now records the counts at bind time and picks the right draw
call. The committed shader bundles are also regenerated with the new
SDK.
- Since flame_3d now requires the latest stable again, the `analyze` job
(lowest supported version) skips `flame_3d*` and it is instead only
covered by `analyze-latest`, like we have done before when flutter_gpu
has had breaking changes.
- Converts pass-through constructor parameters to super parameters in
the `flame` effects and `ColorTexture`, and avoids a parameter
assignment in `FlameAudio`, fixing the new `use_super_parameters` and
`parameter_assignments` diagnostics.
- Commits the `analyzer.exclude` blocks that the Flutter 3.47 tool now
generates into every package's `analysis_options.yaml` on each run (see
flutter/flutter#191056), placed after the `include:` so the shared
config stays first. Without committing them, every `flutter pub
get`/`run`/`build` dirties the working tree.

Verified locally on Flutter 3.47.0: repo-wide `dart analyze
--fatal-infos`, `melos exec dart format . --set-exit-if-changed`, `dcm
analyze .`, and `melos run test:select --no-select` (2854 passed, 0
failed) are all green, and `flutter pub get` no longer rewrites any
`analysis_options.yaml`.

(cherry picked from commit 0453bad)
IstiN pushed a commit to IstiN/flutter_js_widget_runtime that referenced this pull request Sep 2, 2026
Hosted flame_3d 0.3.0 no longer compiles against the flutter_gpu API
shipped with Flutter 3.47 stable (ShaderLibrary is async-loaded, bind
calls no longer take counts), which broke every downstream host building
on current stable — published packages cannot use git deps, so the
flame-engine/flame#3995 backport (IstiN/flame fad05ce) is vendored:

- lib/src/flame_3d_vendor/ — flame_3d 0.3.0 + fix, imports rewritten to
  the vendor path (see VENDOR.md for provenance and maintenance rules)
- assets/flame_3d/shaders/ — shader bundles, pubspec-declared; keys
  rewritten accordingly
- pubspec: drop flame_3d, declare its transitive deps (collection, meta,
  ordered_set, flutter_gpu), environment flutter >=3.47.0, version
  0.4.110
- quality gates exclude the vendor dir (jscpd, lcov coverage, crap4dart);
  lcov 2.x needs --ignore-errors empty
- CI moves 3.44.4 -> 3.47.1 everywhere; automerge-main.yml and the
  flame-3.47 branch are retired (endgame of the old two-track plan)

No public API changes; all 540 tests and local gates pass on 3.47.1.
spydon added a commit that referenced this pull request Oct 3, 2026
…4089)

# Description

Users on the stable flame 1.38 line who upgrade to Flutter 3.47 could
not build with `flame_3d` 0.3.0, because its flutter_gpu backend
predates the API changes that #3995 adapted to, and the only published
version with that fix, 0.4.0-dev.0, requires flame 2.0.0-dev.0.

The fix for them is the `flame_3d` 0.3.1 and 0.3.2 hotfix releases cut
from the `flame-v1.38.2` tag, which already contains the #3995
adaptation, on the branch `hotfix/flame_3d-v0.3.1`. 0.3.1 raised the
`flutter` constraint to `>=3.47.0`, but the melos bootstrap step on CI
synced the shared bootstrap environment back into the package before
publishing, so it went out with `>=3.41.0`. 0.3.2 removes that sync on
the hotfix branch and is published with the intended constraint. 0.3.1
should be retracted on pub.dev so that Flutter 3.41 to 3.46 users do not
resolve it.

This PR is the forward port of those releases to `main`, following the
same approach as #4029 for flame_svg: it adds the 0.3.1 and 0.3.2
changelog entries so the history on `main` stays complete. The
`flame_3d` version on `main` is already 0.4.0-dev.0, so no version bump
is needed here.

## Checklist

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [-] I have updated/added tests for ALL new/updated/fixed
functionality.
- [-] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [-] I have updated/added relevant examples in `examples` or `docs`.

## Breaking Change?

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

[Contributor Guide]:
https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md
IstiN pushed a commit to IstiN/flutter_js_widget_runtime that referenced this pull request Nov 6, 2026
Hosted flame_3d 0.3.0 no longer compiles against the flutter_gpu API
shipped with Flutter 3.47 stable (ShaderLibrary is async-loaded, bind
calls no longer take counts), which broke every downstream host building
on current stable — published packages cannot use git deps, so the
flame-engine/flame#3995 backport (IstiN/flame fad05ce) is vendored:

- lib/src/flame_3d_vendor/ — flame_3d 0.3.0 + fix, imports rewritten to
  the vendor path (see VENDOR.md for provenance and maintenance rules)
- assets/flame_3d/shaders/ — shader bundles, pubspec-declared; keys
  rewritten accordingly
- pubspec: drop flame_3d, declare its transitive deps (collection, meta,
  ordered_set, flutter_gpu), environment flutter >=3.47.0, version
  0.4.110
- quality gates exclude the vendor dir (jscpd, lcov coverage, crap4dart);
  lcov 2.x needs --ignore-errors empty
- CI moves 3.44.4 -> 3.47.1 everywhere; automerge-main.yml and the
  flame-3.47 branch are retired (endgame of the old two-track plan)

No public API changes; all 540 tests and local gates pass on 3.47.1.
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