NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #2629 most downloaded on pub.dev
Reflection support based on code generation, using 'capabilities' to specify which operations to support, on which objects. This is the run-time part of reflectable.
Last release 4 months ago
26 May 2026
Release timing varies
gaps range from 8 days to 13 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
89 releases · first in 2015
Eliminates the use of package barback (which is now deprecated). This change requires many changes in the implementation, but it should not give rise…
A stable version of Dart 2 has been released at this point. This version of reflectable contains a rather substantial number of changes needed in order to make it possible to use this package with the current Dart 2 tools, and under the associated version constraints.
Eliminates the use of package barback (which is now deprecated). This change requires many changes in the implementation, but it should not give rise to incompatibilities for clients of reflectable.
Updates many version dependencies: analyzer, build_resolvers, build_config, build_runner, and test, in order to enable the use of Dart 2 tools.
Changes a handful of implementation details such that every downcast is
concretely justified. Removed new from the implementation (but not from
generated code), because code generation must anyway use Dart 2, but
generated code may still need to run as Dart 1.
Improves code generation ERROR, WARNING, and INFO messages such that it includes a precise source code location.
Now includes lib/main.dart among possible build targets, because Flutter
uses that as the standard entry point.
One column per quarter.
Update the SDK version constraint to 3.0.0 to satisfy Dart 2 requirements.
This version is a tiny update: It solves a version problem by changing some package dependencies.
This version is updated for Dart 2, to the extent that this is possible at this point (a stable version of Dart 2 has not yet been released). Minor up
This version is updated for Dart 2, to the extent that this is possible
at this point (a stable version of Dart 2 has not yet been released).
Minor updates will be used to track the language updates as needed,
so a dependency on reflectable version ^2.0.0 should work for Dart 2.
…to generate code as a separate step. This is a breaking change for *every* program using reflectable because it requires a different workflow, it requ…
This version is a pre-release of the version 2.0.0 which makes all the
changes described below. Henceforth, reflectable will be based on code
generation using build rather than a pub transformer, because
transformers will not be supported in the future.
build to generate code as a separate
step. This is a breaking change for every program using reflectable
because it requires a different workflow, it requires the generated code to
be imported explicitly by the root library (the one that contains the main
function), and it requires invocation of initializeReflectable() at the
beginning of main. To see the commands in this new workflow, please
consult README.md.Note that this forces a lower bound of 0.30.0 because of a breaking change in the analyzer.
analyzer to include versions ^0.30.0. Note
that this forces a lower bound of 0.30.0 because of a breaking change in the
analyzer.Updated version constraint on dart_style.
dart_style.Bug fix, handling the case where prefix is null on a library mirror, and the case where targetLibrary is null on a library dependency mirror.
prefix is null on a library mirror,
and the case where targetLibrary is null on a library dependency mirror.As a consequence of these version updates, changes a method signature and deletes a method (overriding a previously deprecated, now deleted method). T…
analyzer and code_transformers dependencies.Deprecates NameCapability, nameCapability, ClassifyCapability, and classifyCapability; these capabilities are now always enabled.
LibraryMirror.libraryDependencies requires a
libraryCapability; ClosureMirror.apply requires an
InstanceInvokeCapability; ParameterMirror.hasDefaultValue,
ParameterMirror.defaultValue, MethodMirror.parameters,
GetterMirror.parameters, and SetterMirror.parameters require a
DeclarationsCapability; TypeMirror.isOriginalDeclaration,
TypeMirror.typeArguments, ClassMirror.isAssignableTo,
TypeVariableMirror.isAssignableTo and TypeVariableMirror.isSubtypeOf
require a TypeRelationsCapability; and ClassMirror.dynamicReflectedType
and VariableMirror.reflectedType require a ReflectedTypeCapability.--no-packages-dir.NameCapability, nameCapability, ClassifyCapability, and
classifyCapability; these capabilities are now always enabled.List and Map literals will now
consistently include type arguments. This is rarely detectable in client code,
but could for instance be detected in some situations with complex metadata.Potentially breaking bug fix: Several additional mirror methods documented to require a typeRelationsCapability will now actually require it. Concrete
typeRelationsCapability will now actually require
it. Concretely, this affects the methods typeVariables, typeArguments,
superclass, superinterfaces, mixin, isSubclassOf, isAssignableTo,
isSubtypeOf, originalDeclaration. Programs relying on the previous
(incorrect) behavior may need to have the relevant reflectors extended with
a typeRelationsCapability. This change also enables throwing an error
which blames the missing capability rather than incorrectly blaming lack of
coverage for a specific class. This fixes issue 77.Eliminates the binding to analyzer 0.27.1, using ^0.27.2 instead; also uses code_transformers ^0.4.1.
analyzer 0.27.1, using ^0.27.2 instead; also uses
code_transformers ^0.4.1.Potentially breaking bug fix: In transformed code, superinterfaces used to be callable even without a typeRelationsCapability. That capability is now
superinterfaces
used to be callable even without a typeRelationsCapability. That
capability is now required (as it should be according to the documentation)
and this will break programs that rely on the old, incorrect behavior.const field as a reflector (e.g., class C
can be covered by having @SomeClass.aConstField as metadata on C).isSubtypeOf and isAssignableTo
corrected.@F.foo(42) var x; can be used to get reflective support for x).dart2js generated code.typedef can be used
to give a function type a name, and such a type can be used as a type
annotation (say, for a method parameter) for which it is possible to obtain
a mirror, and that type hasReflectedType.AggregateTransform to using a plain Transform for
all transformations; this reduces the number of redundant transformations
performed in the context of pub serve.hasReflectedType used to incorrectly return true in some cases
where a type variable was used in a nested generic type instantiation.factory.List receives some constructor arguments with default values which are
different on different platforms, and the analyzer reports that there are
no default values; this release introduces a special case for that.Changes the version constraint on analyzer to 0.27.1, to avoid an issue with version 0.27.1+1 which breaks all reflectable transformations. Note that
Breaking: The methods hasBestEffortReflectedType and bestEffortReflectedType are now deprecated. They will be removed in the next published version.
hasBestEffortReflectedType and
bestEffortReflectedType are now deprecated. They will be removed in the
next published version.invoke, invokeGetter, invokeSetter,
newInstance, delegate) fails due to an unknown selector or an argument
list with the wrong shape, a ReflectableNoSuchMethodError is thrown. (In
particular, noSuchMethod is not invoked, and no NoSuchMethodError is
thrown). For more details, please consult the capability design document
near occurrences of 'no-such-method'.SuperclassQuantifyCapability in order to include support for an
anonymous mixin application (like A with M in class B extends A with M..).
Such mixin applications used to be included even without the
SuperclassQuantifyCapability, but that was an anomaly.superclass to strictly follow the
documentation: It is now required to have a TypeRelationsCapability in
order to perform superclass, even in the cases where this yields a mixin
application.instanceMembers and staticMembers
to strictly follow the documentation: It is now required to have a
DeclarationsCapability in order to perform these methods.analyzer package (because the constant evaluation issue has been resolved).
The analyzer dependency is now '^0.27.0'. Switches to code_transformers
version '^0.3.0'.isSubtypeOf and isAssignableTo for type mirrors.delegate on instance mirrors, and adds a delegateCapability
to enable it. The reason why this requires a separate capability is that
the cost of storing maps between strings and symbols needed by delegate
is non-trivial.Changes the representation of reflected types such that duplication of Type expressions is avoided (by using indices into a shared list).
Type expressions is avoided (by using indices into a shared list).dynamicReflectedType and hasDynamicReflectedType to several
mirror classes, yielding the erased version of the reflected type (for
List<int> it would return List<dynamic>, i.e., List). This method is
capable of returning a result in some cases where reflectedType fails.reflectedType and hasReflectedType, such
that reflectedType returns an instantiated generic class when that is
appropriate, and hasReflectedType returns false in some cases where it
used to return true, because the correct instantiated generic class cannot
be obtained.bestEffortReflectedType which will use reflectedType and
dynamicReflectedType to obtain a reflected type if at all possible (though
with a less precise specification, because it may be one or the other). Adds
method hasBestEffortReflectedType to go with it. This pair of methods
resembles the 0.3.3 and earlier semantics of reflectedType.The version number is stepped up to 0.4.0 because reflectedType behaves
differently now than it did in 0.3.3 and earlier, which turned out to break
some programs. In some cases the best reaction may be to replace invocations
of reflectedType and hasReflectedType by the corresponding "best effort"
methods, but it may also be better to use both the reflectedType and the
dynamicReflectedType method pairs, taking the precise semantics into
account when using the returned result.
Note that version 0.3.4 also deals with reflectedType in a stricter way
than 0.3.3 and earlier versions, but at that point the changes were
considered to be bug fixes or implementations of missing features.
NB Adds a non-trivial upper version constraint on analyzer in order to require version 0.26.1+14 or older. This is necessary because newer versions of
@myLib.myMetadata).NewInstanceMetaCapability and TypingCapability).null but should
instead throw NoSuchCapabilityError.LibraryCapability is available when performing a top-level invocation).TypingCapability, adjusted it to include
LibraryCapability.UnreachableError and adjusted error handling to throw this in
all cases where a location should never be reached.pub build test, 'web/foo.dart' is not provided
to the transformer, but that is not a problem).typeRelationsCapability was sometimes not required
with certain operations (including superclass), even though the
documentation states that it is required. Similarly, a TypeCapability is
now required in a few extra cases where it should be required.UnimplementedError,
and static information like type variables (that is, formals) is supported.isEnum, isPrivate,
isOriginalDeclaration, originalDeclaration.LibraryMirror.owner.List required, but
only Iterable justified).Update many DartDoc comments in 'capability.dart'.
declarations of library mirrors.
However, it is not possible to reflect on an instance of a private class,
to create new instances with newInstance, nor to call its static methods.correspondingSetterQuantifyCapability, which will add the corresponding
setter for each already included explicitly declared getter.new UnmodifiableListView.., replace many plain list literals by const
list literals, for better startup time and more redundancy elimination.InvokingMetaCapability was treated as a
NewInstanceMetaCapability.Introduce reflectedTypeCapability which enables methods reflectedType on variable and parameter mirrors, and reflectedReturnType on method mirrors. Th
reflectedTypeCapability which enables methods reflectedType on
variable and parameter mirrors, and reflectedReturnType on method mirrors.
This enables limited access to type annotations while avoiding the generation
of many class mirrors.Reflectable.getInstance which delivers the canonical instance of
any given reflector class which is being used in the current program. An
example shows how this enables "meta-reflection".isAbstract, isSynthetic; fixed bug in selection of
supported members of library mirrors; and implemented methods libraries
and declarations for library mirrors; and fixed several other library
related bugs.Fix bug where metadata was searched the same way for invocation and for declarations with InstanceInvokeMetaCapability (invocation must traverse super
InstanceInvokeMetaCapability (invocation must traverse
superclasses).Breaking: Add support for type annotation quantification. This is a breaking change: we used to do that implicitly, but that is expensive, and now it…
Recognize private identifier constants as metadata in certain cases.
pubspec.yaml.Breaking: Enforces the use of a TypeCapability as specified in the design document, and makes it a supertype of several other capabilities such that i
TypeCapability as specified in the
design document, and makes it a supertype of several other capabilities such
that it is automatically included with, e.g., declarationsCapability.excludeUpperBound flag to SuperClassQuantifyCapability.Support for return types of getters and setters.
operator~ in the transformer.mainSupport for subtype quantification in transformed code.
Non-transformed code supports subTypeQuantifyCapability
subTypeQuantifyCapability.superinterfaces.mixinMade changes to avoid deprecated features in the new version of analyzer.
code_transformers. Changed pubspec.yaml to avoid the conflict.analyzer.staticMembers on ClassMirror.Transformer implements .type of fields and parameters.
.type of fields and parameters.main function that is not in the entry-point
file.main returning a Future.* First published release.
Your coding agent can read these notes before it upgrades. Set up the MCP server →