Skip to content

fix: add xml 7.x support (#761)#764

Merged
AlexV525 merged 2 commits into
FlutterGen:mainfrom
Akhrameev:fix/xml-7-support
Jun 9, 2026
Merged

fix: add xml 7.x support (#761)#764
AlexV525 merged 2 commits into
FlutterGen:mainfrom
Akhrameev:fix/xml-7-support

Conversation

@Akhrameev

Copy link
Copy Markdown
Contributor

What does this change?

Fixes #761. flutter_gen_core pinned xml: ^6.0.0, so any project depending
on both flutter_gen/flutter_gen_runner and xml: ^7.0.0 failed version
solving.

This widens the constraint to xml: '>=6.0.0 <8.0.0' instead of bumping to
^7.0.0, deliberately:

  • Non-breaking. Consumers on xml 7.x (and Dart ≥ 3.11) now resolve cleanly,
    while consumers on older toolchains keep working — pub falls back to xml 6.x
    automatically. A hard ^7.0.0 would instead force everyone onto xml 7,
    image ≥ 4.9.x, and effectively Dart ≥ 3.11 (xml 7 requires sdk: ^3.11.0),
    which would also require bumping this package's own sdk floor.
  • Robust. The range gives the resolver a fallback (xml 6.x + image 4.8.x),
    so it stays solvable through transitive image/meta/Flutter-SDK pin shifts
    that a single forced major can't survive.

Also replaces the deprecated XmlNode.text with XmlNode.innerText. This is
cleanup, not required to build: XmlNode.text is only deprecated in xml 7.x
(deprecated starting from 6.3.0), not removed, and the call was already
// ignore-suppressed. innerText has existed since xml 6.0.0, so it's
source-compatible with both majors and future-proofs against an eventual
removal in xml 8.x.

To guard both majors going forward, adds a cross-platform Dart matrix
(scripts/test_xml_versions.dart, exposed as melos test:xml-matrix) that runs
flutter_gen_core's tests against both xml 6.x and 7.x via a temporary
dependency_overrides, plus a CI step that runs it on every PR.

Fixes #761 🎯

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
    • Ensure the tests (melos run test)
    • Ensure the analyzer and formatter pass (melos run format to automatically apply formatting)
  • Appropriate docs were updated (if necessary)

Widen flutter_gen_core's `xml` constraint from `^6.0.0` to
`>=6.0.0 <8.0.0`, so projects depending on both flutter_gen and
`xml: ^7.0.0` can resolve. Replace the deprecated `XmlNode.text`
with `XmlNode.innerText` (present since xml 6.0.0, so compatible
with both majors).

Add a cross-platform Dart matrix (scripts/test_xml_versions.dart,
exposed as `melos test:xml-matrix`) plus a CI step that runs
flutter_gen_core's tests against both xml 6.x and 7.x via a temporary
dependency_overrides, so neither major regresses.

Closes FlutterGen#761

@AlexV525 AlexV525 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I want to know about API compatibility

element.getAttribute('name')!,
// ignore: deprecated_member_use
element.text,
element.innerText,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new API introduced in v7? If yes then it's not compatible with v6 then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it appeared earlier. I'll find a proof

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2026-06-06 at 22 37 25 it was introduced in 4.2.0 and deprecated in 6.3.0

@Akhrameev

Copy link
Copy Markdown
Contributor Author

@AlexV525 earlier my newly added tests failed (not because of code part - but anyway). Please restart workflow to see actual state

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.37%. Comparing base (89c1920) to head (ee80d45).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #764   +/-   ##
=======================================
  Coverage   97.37%   97.37%           
=======================================
  Files          24       24           
  Lines         989      989           
=======================================
  Hits          963      963           
  Misses         26       26           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexV525 AlexV525 merged commit 3d5da4c into FlutterGen:main Jun 9, 2026
5 checks passed
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.

[BUG]: Update xml to 7.0.1

2 participants