Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Sep 1, 2025

This PR contains the following updates:

Package Type Update Change
source_gen (source) dependencies major ^0.9.5 -> 4.0.2

Release Notes

dart-lang/source_gen (source_gen)

v4.0.2

Compare Source

  • Bug fix: fix possible null pointer exception in TypeChecker.typeNamed on
    invalid code.

v4.0.1

Compare Source

  • Require analyzer: '>=8.1.1 <9.0.0'.
  • Allow build: '>=3.0.0 <5.0.0'.

v4.0.0

Compare Source

  • Breaking Change: remove TypeChecker.fromRuntime, use
    TypeChecker.typeNamed instead. This removes all use of dart:mirror, so
    builders using source_gen can be AOT compiled for better performance.
  • Keep // GENERATED FILE comments on the first line.

v3.1.0

Compare Source

  • Prepare to stop using dart:mirrors: deprecate TypeChecker.fromRuntime.
    It will be removed in version 4.0.0. Add TypeChecker.typeNamed which is
    the recommended replacement.
  • Prepare to stop using dart:mirrors: add inPackage and inSdk parameters
    to GenerateForAnnotation. These will start being used in version 4.0.0
    when it switches to TypeChecker.typeNamed.
  • InvalidGenerationSource support for Fragment, ElementDirective and
    Annotatable.
  • Allow analyzer: '>=7.4.0 <9.0.0'.

v3.0.0

Compare Source

  • Breaking Change: use the new element2 APIs in analyzer. Builders that
    do resolution need to switch to the new API, see
    https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/doc/element_model_migration_guide.md.
    For questions please use https://github.com/dart-lang/build/discussions.
  • Breaking Change: annotations are now reported separately for elements
    and directives. If you use TypeChecker().annotatedWith(), see also
    the new TypeChecker().libraryDirectivesAnnotatedWith(). If you use
    GeneratorForAnnotation see the new generateForAnnotatedDirective.
  • Require build: ^3.0.0
  • Updated the minimum package versions for a number of dependencies.
  • Require Dart 3.7.0
  • Update the GeneratorForAnnotation optimization to skip files with well known
    annotation names such as override, Deprecated, and pragma.

v2.0.0

Compare Source

  • Breaking Change: Change formatOutput function to accept a language
    version parameter.
  • Formatting Change: Generated code will no longer apply any fixes by
    default (previously it would apply the single cascades statements fix). The
    new formatter does not support applying fixes.
  • Document deduplication behavior for the output of
    GeneratorForAnnotation.generateForAnnotatedElement.
  • Support all the glob quotes.
  • Require analyzer: '>=6.9.0 <8.0.0'
  • Support the latest package:dart_style
  • LibraryBuilder, PartBuilder, and SharedPartBuilder now take an optional
    writeDescriptions boolean. When set to false, headers and generator
    descriptions for the files will not be included in the builder output.
  • Include //dart format width=80 comments in files generated by a
    LibraryBuilder or PartBuilder and formatted with the default callback.
  • Require Dart 3.6.0

v1.5.0

Compare Source

  • Add throwOnUnresolved configuration to the GeneratorForAnnotation
    constructor.
  • Rename InvalidGenerationSourceError to InvalidGenerationSource. Change
    from a subtype of Error to a subtype of Exception. This may be breaking if
    a builder relies on a on Exception catch to ignore this error.

v1.4.0

Compare Source

  • Require Dart 3.0
  • Support the latest package:analyzer.
  • Add a node argument to InvalidGenerationSourceError to allow finding the
    source location from an AstNode over an Element.

v1.3.2

Compare Source

  • Make TypeChecker.isAssignableFromType() null safe.

v1.3.1

Compare Source

  • Always use a Uri in part of directives (previously a name would be used if
    the library had a non-empty one).

v1.3.0

Compare Source

  • Add support for build_extensions configuration of builders producing
    multiple files. For example:
    build_extensions: { '.dart': ['.stub.dart', '.web.dart', '.vm.dart'] }
  • Avoid throwing when a type without a backing class is checked with
    TypeChecker.
  • Include imports, exports, and part directives in LibraryReader.allElements.
    This allows GeneratorForAnnotation to target annotated directives.

v1.2.7

Compare Source

  • Update the value of the pubspec repository field.
  • Require Dart SDK version 2.18.
  • Fix type-checking mixin elements with TypeChecker.

v1.2.6

Compare Source

  • Add support for a preamble option to combining_builder.

v1.2.5

Compare Source

  • Fix another issue with overly specific types.

v1.2.4

Compare Source

  • Fix overly-specific cast.

v1.2.3

Compare Source

  • Require analyzer: '>=4.6.0 <6.0.0'
  • Require sdk: '>=2.17.0 <3.0.0'

v1.2.2

Compare Source

  • Enable the fix for single cascade statements when formatting Dart code.
    • Individual builders can opt out of this by providing a custom formatOutput
      function to the PartBuilder or LibraryBuilder constructors.
  • Allow analyzer version 4.x.

v1.2.1

Compare Source

  • Allow reviving constants which are static fields defined on the class which
    represents their type. Previously we checked this pattern only for enums,
    however there are enum-like usages in classes which are not enums.
  • Allow the latest version of package:analyzer.

v1.2.0

Compare Source

  • Include the LibraryElement in LibraryReader.allElements,
    LibraryReader.annotatedWith, and LibraryReader.annotatedWithExact. Run
    GeneratorForAnnotation generators on library elements when the library
    statement has the annotation.
  • Add support for build_extensions configuration to the PartBuilder and
    LibraryBuilder. You must forward the BuilderOptions object to the super
    constructor for this to work.
  • Fix a bug finding source locations for reporting unresolved annotations on
    parameters.
  • Fix a bug checking for part statements on Windows.

v1.1.1

Compare Source

  • Drop dependency on package:pedantic.

v1.1.0

  • Add the build_extensions option to combining_builder, allowing output
    files to be generated into a different directory.

v1.0.5

  • Fix a bug with reviving constant expressions which are fields defined on a
    different class than their type (but in the same library).

v1.0.4

Compare Source

  • Fix warnings with latest analyzer, require analyzer 2.x.

v1.0.3

Compare Source

  • Allow the latest version of package:analyzer.

v1.0.2

Compare Source

  • Fix TypeChecker.fromRuntimeType for types that come from non-package uris.

v1.0.1

Compare Source

  • Improve the error message for a missing part directive.
  • Upgrade to package:analyzer version 1.7.0.

v1.0.0

Compare Source

  • Migrate to null safety.
  • Drop deprecated APIs:
    • ConstantReader.isAny.
    • ConstantReader.anyValue.
    • LibraryReader.classElements.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/source_gen-4.x branch from c2a60f0 to aba598f Compare November 2, 2025 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant