reflectable 1.0.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 92

Reflectable

A listing of known limitations is given at the end of this page.

Introduction

This package provides support for reflection which may be tailored to cover certain reflective features and omit others, thus reducing the resource requirements at runtime.

The core idea is that the desired level of support for reflection is specified explicitly and statically, and any usage of reflection at runtime must stay within the boundaries thus specified; otherwise a NoSuchCapabilityError is thrown. In return for statically confining the required reflection support, programs can be smaller. Other than that, using this package and using dart:mirrors is very similar.

The core concept in the reflection support specification is that of a reflectable capability. For a more detailed discussion about capabilities, please consult the reflectable capability design document. On this page we just use a couple of simple special cases.

The resource benefits obtained by using this package are established by transformation. That is, this package includes a pub transformer. The transformer receives a specification of which programs to transform (see the description of entry_points: below), and it uses certain elements in the program itself to decide how to transform it. As a result, the transformed program will contain generated code providing the requested level of support for reflection. If a quick turn-around is more important than space economy, it is also possible to run the code without transformation. In this case, the behavior of the program is identical, but it is implemented by delegation to dart:mirrors, which means that the execution may be costly in terms of space.

In other words, the package can be used in two modes: transformed mode and untransformed mode.

For both modes, your code will not depend directly on dart:mirrors. In the untransformed mode there is an indirect dependency because the support for reflective features is implemented by delegation to mirror objects from dart:mirrors. In the transformed mode there is no dependency on dart:mirrors at all, because the reflectable transformer generates specialized, static code that supports the required reflective features.

The use of dynamic reflection is supported if and only if the usage is covered by the set of capabilities specified.

In general, reflection is provided via a subclass of the class Reflectable (we use the term reflector to designate an instance of such a subclass).

class Reflector extends Reflectable {
  const Reflector() : super(capability1, capability2, ...);
}

Reflection is disabled by default, and it is enabled by specifying reflectable capabilities. With Reflector we have specified that capability1, capability2, and so on must be supported. The main case for using this is annotating a given class A with a reflector. This implies that the specified level of reflection support for that reflector should be provided for the class A and its instances.

@Reflector()
class A {
  ...
}

Only classes covered by a reflector R and their instances can be accessed reflectively using R, and that access is constrained by the capabilities passed as the superinitializer in the class of R. The basic case is when R is used as an annotation of a given class (as is the case with A above), but a class C can also be covered by a reflector R because a supertype A of C is annotated by a reflector which specifies that subtypes of A are covered. There are several other indirect mechanisms in addition to subtype based coverage, as described in the capability design document.

As a result, the available universe of reflection related operations is so well-known at compile time that it is possible to specialize the support for reflection to a purely static form that satisfies the requirements of the given annotations and capabilities.

Usage

Here is a simple usage example. Assume that we have the following code in the file web/main.dart:

import 'package:reflectable/reflectable.dart';

// Annotate with this class to enable reflection.
class Reflector extends Reflectable {
  const Reflector()
      : super(invokingCapability); // Request the capability to invoke methods.
}

const reflector = const Reflector();

@reflector // This annotation enables reflection on A.
class A {
  final int a;
  A(this.a);
  greater(int x) => x > a;
  lessEqual(int x) => x <= a;
}

main() {
  A x = new A(10);
  // Reflect upon [x] using the const instance of the reflector:
  InstanceMirror instanceMirror = reflector.reflect(x);
  int weekday = new DateTime.now().weekday;
  // On Fridays we test if 3 is greater than 10, on other days if it is less
  // than or equal.
  String methodName = weekday == DateTime.FRIDAY ? "greater" : "lessEqual";
  // Reflectable invocation:
  print(instanceMirror.invoke(methodName, [3]));
}

You can directly run this code in untransformed mode, for instance using the Dart VM. To avoid the dependency on dart:mirrors and save space, you can transform the code using the transformer in this package.

In order to do this, add the following to your 'pubspec.yaml':

dependencies:
  reflectable: any

transformers:
- reflectable:
    entry_points:
      - web/main.dart # The path to your main file
    formatted: true # Optional.

Note that it is necessary to include the reflectable transformer in the pubspec.yaml of your package if you use reflectable directly or indirectly (by depending on a package that uses reflectable), because the transformer may need to generate code based on files in your package. In particular, if you are writing a package which uses reflectable and is expected to be used by clients, please make it explicit that such clients must include the reflectable transformer in their pubspec.yaml.

It is possible to use globbing with entry points, based on the package glob. For instance, entry_points: ["test/*_test.dart"] can be used to specify that all Dart source files in test whose name ends in _test.dart are entry points.

Now run pub build --mode=debug web to perform the transformation. This will rename the file web/main.dart and generate a new file build/web/main.dart. That file contains the data needed for reflection, and a main function that will initialize the reflection framework before running the original main. When you run this file, it is important that the package-root is set to build/web/packages, because the reflectable package itself is transformed to a version that uses the generated data, instead of using dart:mirrors.

Some elements in this scenario are optional: In the pub build.. command, you could omit the final argument when it is equal to web, because that is the default. You could also omit --mode=debug if you do not wish to inspect or use the generated Dart code (typically, that would be because you only need the final JavaScript output). In 'pubspec.yaml', the formatted option can be omitted, in which case the output from the transformer will skip the formatting step (saving time and space, but putting most of the generated code into one very long line). Finally, in 'pubspec.yaml' you can use one more option: 'suppress_warnings'; e.g., you could specify 'suppress_warnings: missing_entry_point' in order to suppress the warnings given in the situation where an entry point has been specified in 'pubspec.yaml', but no corresponding library (aka 'asset') has been provided by pub to the transformer.

If you want to use the transformer directly rather than having pub invoke it, you can invoke it as a stand-alone tool. This is particularly relevant if you have several entry points, but at some point you only want to work with one of them, e.g., because it is being extended or debugged.

The stand-alone version of the transformer will transform exactly the entry points you specify on the command line, no matter whether each of them is declared to be an entry point in 'pubspec.yaml'. It works in a similar way as pub serve because it is able to transform subsets of the entry points, but it differs in that it allows for inspection of the generated code, and it is completely under the programmer's control.

The stand-alone version of the reflectable transformer is bin/reflectable_transformer.dart. It can be invoked using pub global run (after activating it with pub global activate reflectable):

pub global run reflectable:reflectable_transformer \
  <my_package> <my_entry_point>..

In that command, my_package stands for the name of the package you are working in, and my_entry_point is the entry point to transform. For instance, the command could look like this in the testing package test_reflectable:

pub global run reflectable:reflectable_transformer \
  test_reflectable test/export_test.dart

The script reflectable_transformer in the test_reflectable package illustrates how you can call it directly if you wish to run it independently of pub.

It should be noted that the stand-alone transformer only works if pub build.. has been executed, because the stand-alone only produces transformed files; the symptoms that arise if pub build.. has not been executed successfully first is that some files are missing, including the packages directories inside build. When that is in place, stand-alone transformation can be used any number of times.

For a more advanced example, you could look at serialize_test.dart and its library, where the base of a serialization framework is implemented; or you could look at meta_reflectors_test.dart and the libraries it imports, which illustrates how reflectable can be used to dynamically make a choice among several kinds of reflection, and how to eliminate several kinds of static dependencies among libraries.

Comparison with dart:mirrors with MirrorsUsed annotations

A lot of the overhead of dart:mirrors can be mitigated by using a suitable MirrorsUsed annotation, which has a similar purpose as the capabilities of reflectable. So why do we have both?

First, on some Dart platforms there is no support for reflection at all, in which case it is necessary to use an approach that offers execution without any built-in reflection mechanism, and the reflectable transformer does just that.

Even when there is support for reflection, it makes sense to use reflectable. In particular, the concepts and mechanisms embedded in the reflectable capabilities represent a significant further development and generalization of the approach used with MirrorsUsed, which means that the level of reflection support can be tailored more precisely.

Another advantage of the reflectable approach is that the same restrictions are implemented both for running untransformed code (on top of dart:mirrors), and for running transformed code. The behaviour will thus be the same on Dartium and with code that is transformed and then compiled with Dart2js.

Another advantage is that whereas the interaction between two different MirrorsUsed annotations often is hard to predict, reflectable allows for several separate mirror-systems (reflectors) with different capabilities. This means that for some reflection targets used by one sub-system of the program (say, a serializer) detailed information can be generated. Another sub-system with simpler requirements could then be supported by a much smaller amount of information.

Known limitations

Several parts of the library have not yet been implemented. In particular, the following parts are still incomplete:

  • It is not supported to use reflectable in untransformed mode (that is the mode where reflectable uses 'dart:mirrors' internally) with dart2js. The reason for this is that some features in 'dart:mirrors' have not been implemented in dart2js.

  • Reflection on functions/closures. We do not have the required primitives to support this feature, so it is expected to remain unsupported for a while. There is support for one case: When a function type is given a name with typedef it is possible to use that name as a type annotation, say, on a method parameter or as a return type, and then reflectedTypeCapability will make it possible to get a corresponding reflectedType and dynamicReflectedType.

  • Private declarations. There is currently almost no support for reflection on private declarations, as this would require special support from the runtime for accessing private names from other libraries. As an example of a case where there is some support, library mirrors can deliver class mirrors for private classes, and instanceMembers includes public members inherited from private superclasses. But in the vast majority of situations, private declarations are not supported.

  • uri's of libraries. The transformer framework does not give us access to good uri's of libraries, so these are currently only partially supported: A unique uri containing the name given in the library directive (if any) is generated for each library; this means that equality tests will work, and the toString() of a uri will be somewhat human readable. But this kind of uri does not give any information about the location of a corresponding file on disk.

  • Type arguments of generic types are only supported in the simple cases. E.g., when it is known that a given list of actual type arguments is empty then the empty list is returned. However, when a parameterized type has a non-trivial list of actual type arguments then returning the actual type arguments would require runtime support that does not currently exist.

  • The mirror method libraryDependencies has not yet been implemented with transformed code.

Feature requests and bug reports

Please file feature requests and bugs using the github issue tracker for this repository.

Changelog

1.0.3

  • Updated version constraint on dart_style.

1.0.2

  • 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.

1.0.1

  • Updates analyzer and code_transformers dependencies.
  • As a consequence of these version updates, changes a method signature and deletes a method (overriding a previously deprecated, now deleted method). These changes should not affect clients of this package.

1.0.0

  • Updates documentation about capabilities required for each method.
  • Potentially breaking bug fix: Several mirror methods perform more strict checks on capabilities, to make them match the documented requirements. In particular, 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.
  • Updates tests to work with --no-packages-dir.
  • Deprecates NameCapability, nameCapability, ClassifyCapability, and classifyCapability; these capabilities are now always enabled.
  • Uses more strict typing in generated code: 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.
  • Uses more strict typing in the implementation, in order to pass strong mode checks.

0.5.4

  • Potentially breaking bug fix: Several additional mirror methods documented to require a 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.
  • Adds constant resolution requests for metadata such that some spurious 'This reflector does not match anything' events are avoided; fixes issue 82.
  • Corrects treatment of metadata with enum values, fixing issue 80.
  • Adds two missing package dependencies, fixing issue 81.

0.5.3

  • Eliminates the binding to analyzer 0.27.1, using ^0.27.2 instead; also uses code_transformers ^0.4.1.
  • Introduces support for entry point globbing; for more information please consult commit 8936f98.

0.5.2

  • Potentially breaking bug fix: In transformed code, 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.
  • Adds support for recognizing a const field as a reflector (e.g., class C can be covered by having @SomeClass.aConstField as metadata on C).
  • Fixes bug: misleading error messages from isSubtypeOf and isAssignableTo corrected.
  • Fixes bug: now named constructors can be used in metadata (e.g., @F.foo(42) var x; can be used to get reflective support for x).
  • Fixes bug: certain external function type mirrors seem to be unequal to themselves, which caused an infinite loop; now that case is handled.
  • Adds a stand-alone version of the transformer; for more information please consult the main comment on commit 8f90cb9.
  • Fixes bug: some private names could occur in generated code; this situation is now detected more consistently and transformation fails.
  • The documentation now clearly states that it is not supported to use reflectable in untransformed mode with dart2js generated code.
  • Adds a small corner of support for function types: A 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.
  • Fixes bug: in the case where a reflector does not match anything at all there used to be a null error; now that is handled, and a warning is emitted.
  • Switches from using an AggregateTransform to using a plain Transform for all transformations; this reduces the number of redundant transformations performed in the context of pub serve.
  • Adds extra tests such that line coverage in the transformer is again complete.
  • Fixes bug: hasReflectedType used to incorrectly return true in some cases where a type variable was used in a nested generic type instantiation.
  • Fixes bugs associated with anonymous mixin applications involving type arguments.
  • Fixes bug: several error messages claimed 'no such method' where they should claim 'no such constructor' etc.
  • Fixes bug: it is now possible to invoke a constructor in an abstract class reflectively, as long as it is a 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.
  • Fixes bug: some constructors of native classes were omitted, are now available like other members.

0.5.1

  • 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 this is a tight constraint (just one version allowed), but currently all other versions above 0.27.0 will fail so there is no point in trying them.
  • Bug fix: The transformer now treats the entry points as a set such that duplicates are eliminated; duplicates of entry points are not useful, and they can trigger an infinite loop if present.

0.5.0

  • Breaking: The methods hasBestEffortReflectedType and bestEffortReflectedType are now deprecated. They will be removed in the next published version.
  • Breaking: Implements a new semantics for no-such-method situations: When a reflectable invocation (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'.
  • Fixes issue 51, which is concerned with coverage of getters/setters for variables inherited from non-covered classes.
  • Breaking: Changes coverage such that it requires a 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.
  • Breaking: Changes the semantics of 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.
  • Breaking: Changes the semantics of instanceMembers and staticMembers to strictly follow the documentation: It is now required to have a DeclarationsCapability in order to perform these methods.
  • Breaking: Eliminates the non-trivial upper bound on the version of the 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'.
  • Updates the capability design document to document the new treatment of no-such-method situations.
  • Implements isSubtypeOf and isAssignableTo for type mirrors.
  • Fixes issue 48, which is about wrong code generation involving mixin applications.
  • Implements 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 code generation to avoid generating code for some unused mirrors.
  • Fixes bug which prevented recognition of some forms of metadata during metadata based capability checking.

0.4.0

  • Changes the representation of reflected types such that duplication of Type expressions is avoided (by using indices into a shared list).
  • Adds methods 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.
  • Corrects the behavior of methods 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.
  • Adds method 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.

0.3.4

  • 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 analyzer have changed in ways that are incompatible with reflectable in several ways. We expect to be able to allow using the newest version of analyzer again soon.
  • Implements support for moving additional kinds of expressions (for argument default values and metadata), esp. when they use a library prefix (such as @myLib.myMetadata).
  • Adds test cases for previously untested capabilities (NewInstanceMetaCapability and TypingCapability).
  • Fixes bug where pre-transform check would attempt to use null but should instead throw NoSuchCapabilityError.
  • Adds missing checks in pre-transform code (e.g., checking that a LibraryCapability is available when performing a top-level invocation).
  • Corrects inconsistency among the type hierarchies for pre/post-transform capabilities (which caused the post-transform code to act incorrectly).
  • Corrects treatment of TypingCapability, adjusted it to include LibraryCapability.
  • Introduces UnreachableError and adjusted error handling to throw this in all cases where a location should never be reached.
  • Several 'README.md' files updated to match the current status.
  • A couple of smaller unimplemented methods implemented.
  • Eliminates many of the 'Missing entry point' messages: If it is specified that an entry point 'web/foo.dart' must be transformed, but no such asset is provided to the transformer, then the warning is only emitted if the file does not exist (with pub build test, 'web/foo.dart' is not provided to the transformer, but that is not a problem).
  • Corrects the bug that 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.
  • Correct the cyclic-dependency bug which previously made 'expanding_generics_test.dart' fail.
  • Adds support for enum classes.
  • Implement support for all the trivial parts of genericity: empty lists of type arguments are now delivered rather than throwing UnimplementedError, and static information like type variables (that is, formals) is supported.
  • Implement several missing class members, including isEnum, isPrivate, isOriginalDeclaration, originalDeclaration.
  • Correct several bugs in the implementation of LibraryMirror.
  • Correct several bugs with owner.
  • Implement several features for top-level entities, especially variables.
  • Correct several incorrect type annotations (e.g., List required, but only Iterable justified).
  • Implement simple code coverage support.

0.3.3

  • Update many DartDoc comments in 'capability.dart'.
  • Update the document The Design of Reflectable Capabilities to match the current selection of quantifiers and their semantics.
  • Add very limited support for private classes: They are preserved such that iteration over all superclasses will work even if some of them are private, and private class mirrors are included in 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.
  • Fix bug where some private names were used in generated code (which makes subsequent compilation fail).
  • Add option to format the generated code (off by default).
  • Add correspondingSetterQuantifyCapability, which will add the corresponding setter for each already included explicitly declared getter.
  • Change generated code: Eliminate many invocations of new UnmodifiableListView.., replace many plain list literals by const list literals, for better startup time and more redundancy elimination.
  • Fix bug where an InvokingMetaCapability was treated as a NewInstanceMetaCapability.
  • Fix bugs in the publication support script.

0.3.2

  • Introduce 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.
  • Introduce 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".
  • Fixed bugs in methods 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.

0.3.1

  • Fix bug where metadata was searched the same way for invocation and for declarations with InstanceInvokeMetaCapability (invocation must traverse superclasses).
  • Fix bug where some libraries were imported into generated code, even though they cannot be imported (private to core).
  • Fix bugs in publication support script.

0.3.0

  • 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 is only available on request.
  • Change the way the set of supported classes are computed.
  • Fix crash when transforming certain dart:html classes.
  • Fix memory leak from the transformer.

0.2.1

  • Recognize private identifier constants as metadata in certain cases.
  • Bump required SDK version in pubspec.yaml.
  • Correct generation of imports of the original entry point.
  • Fix issues with the computation of static members.
  • Allows the metadata capabilities to recognize any subtype of the given type.

0.2.0

  • Breaking: Enforces the use of a 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.
  • Fixed homepage link in pubspec
  • Fix several bug with mixins in the transformer.
  • Add excludeUpperBound flag to SuperClassQuantifyCapability.
  • Use a static initializer in the generated code which helps avoiding a stack overflow.

0.1.5

  • Support for return types of getters and setters.
  • Support for superTypeQuantifyCapability.
  • Fix bug in the mirror-based implementation's collection of classes that could lead to infinite loops.
  • Fix bug related to generating code for operator~ in the transformer.
  • Avoid crashing the transformer when an entry-point has no member named main

0.1.4

  • Support for subtype quantification in transformed code.
  • Code generation bugs fixed; metadata/library related bugs fixed.
  • Faster version of test procedure.

0.1.3

  • Non-transformed code supports subTypeQuantifyCapability
  • Transformer implements .superinterfaces
  • Transformer implements .mixin
  • Transformer implements reflection on libraries.
  • Better support for default values in transformed code.

0.1.2

  • Our tests started failing because of a version conflict introduced by an update to code_transformers. Changed pubspec.yaml to avoid the conflict.
  • Made changes to avoid deprecated features in the new version of analyzer.
  • Implemented support for implicit accessors (setters, getters).
  • Implemented support for staticMembers on ClassMirror.

0.1.1

  • Transformer implements .type of fields and parameters.
  • Transformer has support for main function that is not in the entry-point file.
  • Transformer supports async main returning a Future.
  • Other bug fixes...

0.1.0

  • First published release.

0.0.1

  • Initial project creation

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  reflectable: "^1.0.3"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:reflectable/reflectable.dart';
        
Version Uploaded Documentation Archive
1.0.4 Aug 24, 2017 Go to the documentation of reflectable 1.0.4 Download reflectable 1.0.4 archive
1.0.3 Jul 13, 2017 Go to the documentation of reflectable 1.0.3 Download reflectable 1.0.3 archive
1.0.2 Feb 24, 2017 Go to the documentation of reflectable 1.0.2 Download reflectable 1.0.2 archive
1.0.1 Nov 15, 2016 Go to the documentation of reflectable 1.0.1 Download reflectable 1.0.1 archive
1.0.0 Aug 18, 2016 Go to the documentation of reflectable 1.0.0 Download reflectable 1.0.0 archive
0.5.4 Apr 1, 2016 Go to the documentation of reflectable 0.5.4 Download reflectable 0.5.4 archive
0.5.3 Mar 8, 2016 Go to the documentation of reflectable 0.5.3 Download reflectable 0.5.3 archive
0.5.2 Feb 17, 2016 Go to the documentation of reflectable 0.5.2 Download reflectable 0.5.2 archive
0.5.1 Dec 22, 2015 Go to the documentation of reflectable 0.5.1 Download reflectable 0.5.1 archive
0.5.0 Dec 17, 2015 Go to the documentation of reflectable 0.5.0 Download reflectable 0.5.0 archive

All 25 versions...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
85 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
92

Platforms

Detected platforms: web, other

Primary library: package:reflectable/reflectable.dart with components: mirrors.

Suggestions

  • The description is too long.

    Search engines will display only the first part of the description. Try to keep it under 180 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use reflectable.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.12.0 <2.0.0
analyzer >=0.27.2 <0.30.0 0.29.5 0.31.0+1
barback ^0.15.0 0.15.2+14
code_transformers >=0.4.1 <0.6.0 0.5.1+4
dart_style >=0.2.0 <2.0.0 1.0.1 1.0.9+1
glob ^1.1.0 1.1.5
logging ^0.11.0 0.11.3+1
path ^1.2.0 1.5.1
source_span ^1.0.0 1.4.0
Transitive dependencies
args 0.13.7 1.3.0
async 2.0.3
charcode 1.1.1
cli_util 0.1.2+1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
html 0.13.2+2
isolate 0.2.3 1.1.0
meta 1.1.2
package_config 1.0.3
plugin 0.2.0+2
pool 1.3.4
source_maps 0.10.4
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
yaml 2.1.13
Dev dependencies
unittest ^0.11.0