Skip to content

FED-4507 Analyzer plugin: fix in Dart 3, support analyzer 6.x#1002

Merged
btr-rmconsole-1[bot] merged 19 commits intomasterfrom
remove-mirrors
Mar 24, 2026
Merged

FED-4507 Analyzer plugin: fix in Dart 3, support analyzer 6.x#1002
btr-rmconsole-1[bot] merged 19 commits intomasterfrom
remove-mirrors

Conversation

@greglittlefield-wf
Copy link
Copy Markdown
Contributor

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

Motivation

In newer versions of Dart, analyzer plugins get AOT-compiled, which currently results in the following errors when attempting to launch the plugin:

An error occurred while executing an analyzer plugin: Failed to compile "/home/runner/.dartServer/.plugin_manager/2de6244a0f824110faf7b6fcb3ecc49f/analyzer_plugin/bin/plugin.dart" to an AOT snapshot.
  pluginFolder = /home/runner/.dartServer/.plugin_manager/2de6244a0f824110faf7b6fcb3ecc49f/analyzer_plugin
  exitCode = 254
  stdout = 
  stderr = error: import of dart:mirrors is not supported in the current Dart runtime
Error: AOT compilation failed
Bad state: Generating AOT snapshot failed!


#0      PluginManager._compileAsAot (package:analysis_server/src/plugin/plugin_manager.dart:731)
...

The source of the problem is the use of dart:mirrors.

Changes

  • Update over_react annotation instantiation logic (also used by analyzer plugin) to not use dart:mirrors
    • Move dart:mirrors usages in analyzer plugins's documentation tooling out of lib/ and the import graph of the main analyzer plugin, and into tool/
    • Clean up unused code, outdated tests
    • Don't add additional test coverage; annotation parsing and handling is handled by existing tests
  • Reorganize analyzer plugin doc generation code using dart:mirrors to live under tool instead of lib
    • It was in lib when it didn't need to be, and was in files that were getting AOT -compiled
  • Allow analyzer 6.x, fix
    • The plugin is quite behind on analyzer versions, and I noticed that allowing 6.x is trivial. I rolled that into this PR since it wasn't much more changes, and the QA steps are the same: passing CI, working analyzer plugin in Dart 3

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

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

@greglittlefield-wf greglittlefield-wf changed the title Remove dart:mirrors to fix analyzer plugin not AOT- compiling in Dart 3 Remove dart:mirrors to fix analyzer plugin not AOT-compiling in Dart 3 Mar 2, 2026
@greglittlefield-wf greglittlefield-wf changed the title Remove dart:mirrors to fix analyzer plugin not AOT-compiling in Dart 3 FED-4507 Remove dart:mirrors to fix analyzer plugin not AOT-compiling in Dart 3 Mar 2, 2026
@greglittlefield-wf greglittlefield-wf changed the title FED-4507 Remove dart:mirrors to fix analyzer plugin not AOT-compiling in Dart 3 FED-4507 Analyzer plugin: fix in Dart 3, support analyzer 6.x Mar 24, 2026
@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review March 24, 2026 20:13
Copy link
Copy Markdown
Contributor

@sydneyjodon-wk sydneyjodon-wk left a comment

Choose a reason for hiding this comment

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

QA +1 🎉

  • CI passes
  • Smoke tested playground and verified analyzer plugin lints still work
  • Build passed in wdesk link

@sydneyjodon-wk
Copy link
Copy Markdown
Contributor

@Workiva/release-management-p

Copy link
Copy Markdown

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@btr-rmconsole-1 btr-rmconsole-1 bot merged commit 598cf5f into master Mar 24, 2026
20 checks passed
@btr-rmconsole-1 btr-rmconsole-1 bot deleted the remove-mirrors branch March 24, 2026 22:06
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.

4 participants