Skip to content

FED-4777 Remove dart_style dep, fix builder AOT compilation#1009

Open
greglittlefield-wf wants to merge 8 commits into
masterfrom
remove-dart_style-and-mirrors
Open

FED-4777 Remove dart_style dep, fix builder AOT compilation#1009
greglittlefield-wf wants to merge 8 commits into
masterfrom
remove-dart_style-and-mirrors

Conversation

@greglittlefield-wf

@greglittlefield-wf greglittlefield-wf commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Motivation

We have a pretty gross workaround using dart:mirrors to support dart_style API differences between versions supported in Dart 2 and 3: https://github.com/Workiva/over_react/blob/5.6.2/lib/src/builder/dart_style_compat.dart

This use of dart:mirrors prevents AOT snapshots from being used by newer versions of build_runner in Dart 3.

Initially I looked into dropping support for Dart 2 in the main release line, but that still left us with a dart_style range of >=2.3.7, which constrained analyzer to ^6.5.0, meaning we'd be effectively dropping support for analyzer 5, which isn't ideal.

The formatting step in the over_react builder specifically doesn't provide a bunch of value. As a build_to:cache builder, consumers of over_react don't see the generated code unless they jump to definition on the generated part or generated API members. And, the code outputted by the builder before it gets to dart_style is already pretty well-formatted.

So, to simplify things, and prevent unnecessary constraining of dependencies, we'll just remove the formatting step altogether.

Changes

Note to reviewers: these changes are best reviewed commit-by-commit

  • Remove formatting step entirely from builder
  • Remove no-longer-used dart_style and pub_semver dependencies
  • Tweak/fix manual formatting in builder to reduce diffs after removing dart_style
    • Formatting was already pretty good, so this was pretty minor
  • Regenerate checked-in generated code and gold files
  • Update tests to handle new formatting
  • Fix CI in Dart 3, unrelated to this PR, by constraining build_runner dev dep

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed
    • Steps from PR author:
      • Verify CI passes
      • Locally,
        • Check out this branch and switch to the latest Dart 3 version
        • Update deps in pubspec.yaml to enable aot compilation (build_runner: ^2.14.0)
        • Verify AOT build works by running the following command and validating that the AOT compilation takes place, and that the builder runs successfully:
          % dart run build_runner build --build-filter='**/**.dart'
          Building package executable... (2.9s)
          Built build_runner:build_runner.
          11s compiling builders/aot
          0s over_react:overReactBuilder on 166 inputs: 107 output, 59 no-op
          0s over_react:_over_react_local_builder on 361 inputs: 122 output, 239 no-op
          0s build_test:test_bootstrap on 131 inputs: 131 output
          
          Built with build_runner/aot in 15s; wrote 467 outputs
    • Anything falling under manual testing criteria outlined in CONTRIBUTING.md

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Frameworks Design member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@greglittlefield-wf greglittlefield-wf changed the title Remove dart_style and mirrors Remove dart_style dep, fix builder AOT compilation Jul 2, 2026

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.

Note to reviewers: these changes are best reviewed commit-by-commit

@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review July 2, 2026 19:17
@btr-rmconsole-3 btr-rmconsole-3 Bot changed the title Remove dart_style dep, fix builder AOT compilation FED-4777 Remove dart_style dep, fix builder AOT compilation Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants