Skip to content

Conversation

@greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Dec 3, 2025

Motivation

CI is currently failing on stable Dart (example build), with errors that look like this:

E build_web_compilers:ddc (lazy) on example/boilerplate_versions/backwards_compatible/basic.ddc.module:
  Error compiling dartdevc module:over_react|example/boilerplate_versions/backwards_compatible/basic.ddc.js
  
  example/boilerplate_versions/dart2_only/basic_component2.over_react.g.dart:120:44: Error: The class '_$BasicPropsAccessorsMixin' can't be used as a mixin because it isn't a mixin class nor a mixin.
  class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin {
                                             ^

This appears to be caused by dart-lang/build#4302, where newer versions of build_web_compilers incorrectly compile files with the a never language version than what's specified in over_react's pubspec.yaml.

In this case, the error seems to stem from generated code mixing in class declarations, which is no longer allowed as of Dart language version 3.0.

For example, from the above error:

  // Generated code in .over_react.g.dart
  class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { ... }
  abstract class _$BasicPropsAccessorsMixin implements _$BasicProps { ... }

...

It's failing because _$BasicPropsAccessorsMixin is declared as a class and not a mixin. Note that this is only an issue for generated code for legacy boilerplate.

Changes

While we could work around this issue by restricting newer build_web_compilers, this uncovered that this case of generated code doesn't work in Dart language versions 3.0 and higher. That was easy to fix, so I just updated the generation to work.

  • Fix compilation errors for legacy boilerplate defined in libraries with a Dart language version of >=3.0
    • This was as easy as changing abstract class to mixin: 26e6c63
  • Update tests and gold files
  • Clean up and fix generated files check in CI, which wasn't running properly

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 that Verify that generated files are up-to-date check runs on all Dart SDKs in the matrix and passes
      • As an extra precaution, verify passing internal consumer test run (hit me up for a link)
    • 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

Example of error:

    example/boilerplate_versions/dart2_only/basic_component2.over_react.g.dart:120:44: Error: The class '_$BasicPropsAccessorsMixin' can't be used as a mixin because it isn't a mixin class nor a mixin.
      class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin {
                                                 ^

For some reason, this is coming up in master CI in Dart 3, even though
we have a pubspec.yaml language version of 2.19.
This Seems like a build package bug, which I plan on reporting.

Since we'll need to fix this issue anyway, fix it now as a workaround.
@greglittlefield-wf greglittlefield-wf changed the title Fix stable ci Fix stable ci, make accessor mixins true mixins Dec 4, 2025
@greglittlefield-wf greglittlefield-wf changed the title Fix stable ci, make accessor mixins true mixins Fix stable ci, make generated accessor mixins true mixins Dec 4, 2025
@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review December 8, 2025 21:23
@btr-rmconsole-3 btr-rmconsole-3 bot changed the title Fix stable ci, make generated accessor mixins true mixins FED-4304 Fix stable ci, make generated accessor mixins true mixins Dec 8, 2025
Copy link
Contributor

@kealjones-wk kealjones-wk left a comment

Choose a reason for hiding this comment

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

@greglittlefield-wf
Copy link
Contributor Author

greglittlefield-wf commented Dec 8, 2025

@Release

Edit: ooops, typo on that tag; please ignore, sorry! 😅

@greglittlefield-wf
Copy link
Contributor Author

@Workiva/release-management-p

Copy link

@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-6 btr-rmconsole-6 bot merged commit acdc10a into master Dec 8, 2025
17 checks passed
@btr-rmconsole-6 btr-rmconsole-6 bot deleted the fix-stable-ci branch December 8, 2025 21:46
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