Skip to content

Releases: dart-lang/source_gen

source_gen version 1.3.1

09 May 16:34
3d1f86b

Choose a tag to compare

always use a Uri in `part of` directives (#665)

Closes google/json_serializable.dart#1313

v0.9.1

10 Sep 19:29
1e87e13

Choose a tag to compare

0.9.1

  • The result of ConstantReader.revive() now returns a Revivable that assumes
    access to a private class, constructor, or function instead of null where
    possible. This allows generators that use part files to still use this
    functionality and allows generators that use separate libraries to emit more
    actionable error messages (i.e. "cannot use private class _X").

  • Revivable.isPrivate now returns true when the underyling class was public
    but the constructor was private, or the Revivable was pointing to a
    top-level or static private field or method. Previously it was only true
    when referencing a private class.

0.8.2

14 Jun 19:09
76c6345

Choose a tag to compare

  • Simplification to the output of generator names in header sections.

  • Update handling of whitespace in generator outputs.

    • If the output from a generator has wrapping whitespace, it is trimmed.
    • If the output from a generator is empty or whitespace-only, it is ignored.
    • These changes will likely have no effect on output, unless you customize
      the code formatter.

v0.8.1

16 Apr 17:36
5b2a8a9

Choose a tag to compare

  • Cleanup logging output that duplicates headers provided by
    package:build_runner.

  • InvalidGenerationSourceError added an optional element
    parameter to support more helpful error messages.

v0.8.0

29 Mar 16:54
8bf5d08

Choose a tag to compare

  • BREAKING removed the deprecated requireLibraryDirective parameter in
    PartBuilder.

  • Revivable no longer throws a type error when attempting to revive a
    reference to a top-level function or static-class method. Now is returns a
    reference to that function or method, as expected.

v0.7.6

07 Mar 21:42
e856173

Choose a tag to compare

0.7.6

  • TypeChecker now throws an UnresolvedAnnotationException with a more
    detailed exception body (and properties useful for further debugging) instead
    of Could not resolve @null.

v0.7.5+1

15 Feb 17:56
4219ddd

Choose a tag to compare

  • LibraryBuilder and PartBuilder now have a more readable toString(),
    which is useful when emitting a warning or error in a build system. For
    example you may see Generating .g.dart: MyBuilder instead of
    Instance of LibraryBuilder in your build logs.

v0.7.4+2

31 Jan 18:05
fffde65

Choose a tag to compare

  • BUG FIX: ConstantReader.revive() now properly returns no URL fragment
    when the constant expression is resolved from a top-level or static-field.
    The documentation had said otherwise, and it was impossible to tell the
    difference between a constructor and a field. Now, fields are always in
    the form of accessor = {clazz}.{field} or {topLevelField}.

  • Fix file URIs on windows.

v0.7.4+1

22 Jan 22:42

Choose a tag to compare

  • Removed a log.finest with the output source of each generator. This allows
    a verbose option (-v) for tools like bazel or build_runner to be much more
    readable and debuggable. Files are emitted to disk for inspection in any
    case.

v0.7.4

18 Jan 22:50
5496758

Choose a tag to compare

  • Added typeNameOf, which is a safe way to get the name of a DartType,
    even when the type is a FunctionType, which has a null name in newer
    versions of the Dart analyzer.

  • Added LibraryReader.pathToUrl(Uri|String), which computes the import or
    export path necessary to reach the provided URL from the current library.
    Also added pathToAsset and pathToElement as convenience functions.

  • Expanded package:build support to allow version 0.12.0.