reflection_factory 2.9.0
reflection_factory: ^2.9.0 copied to clipboard
Allows Dart reflection with an easy approach, even for third-party classes, using code generation portable for all Dart platforms.
2.9.0 #
-
dart_style:>=3.1.9 <3.1.10→>=3.1.10 <3.1.11.- 2.8.1 capped
dart_stylebelow 3.1.10 because the Dart SDK still bundled an older formatter, and generated code has to match thedart formatof the consumer's SDK. Dart 3.13.0 bundlesdart_style3.1.10 (dart format --version), so the cap now selects the wrong formatter and reintroduces the very mismatch it was added to prevent — the two CI checks (dart format --set-exit-if-changedand abuild_verify"build is up to date" test) became mutually exclusive again, this time on Dart 3.13. Hit inbones_api. - The bound moves with the SDK rather than being lifted: pinning to the exact formatter version the SDK ships is what keeps the two checks satisfiable.
- 2.8.1 capped
-
environment.sdk:>=3.10.0 <4.0.0→>=3.13.0 <4.0.0.- The
dart_stylepin is only correct for the SDK that bundles that same version. Raising the floor makespubresolve 2.8.1 for Dart 3.10–3.12 users (whose SDKs bundledart_style3.1.6) instead of handing them generated code their owndart formatwould rewrite. - This narrows compatibility, hence the minor bump rather than a patch.
- The
2.8.1 #
-
dart_style:^3.1.9→>=3.1.9 <3.1.10.- The generated
*.reflection.g.dartis formatted byDartFormatter, using thedart_styleresolved bypubfor this package, while consumers check that code with thedart formatbundled in their Dart SDK. dart_style3.1.10 changed the splitting of an argument list containing a collection literal — which is exactly the shape of the generated proxy code (onCall(this, '<method>', <String, dynamic>{...}, const __TR<...>(...))). The Dart SDK 3.12.2 still bundlesdart_style3.1.6 (dart format --version), so a package generating with 3.1.10+ ends up with generated code its owndart formatwants to reformat.- That makes 2 common CI checks mutually exclusive for the consumer:
committing the generator output fails
dart format --set-exit-if-changed, and committing the formatted output fails abuild_verify"the build is up to date" check, becausebuild_runnerrewrites the file back. - The upper bound is the lowest version that still satisfies
analyzer: ^13.0.0(3.1.9 is the firstdart_styleaccepting analyzer 13), so this does not roll back any other dependency. - Not a language-version issue: the builder already resolves and passes
the correct language version to
DartFormatter. Verified that the divergence reproduces identically at language versions 3.7, 3.10, 3.11 and 3.12. Lift this bound once the Dart SDK bundlesdart_style>= 3.1.10.
- The generated
-
Tests:
- New
reflection_factory_format_test.dart, guarding the above:- the committed
*.g.dartare left untouched by the SDK'sdart format; DartFormatterand the SDK'sdart formatagree on an argument list containing a collection literal (the generated-proxy shape). This second test is the one that actually catches the regression — the repository's own generated code does not happen to contain a diverging shape.
- the committed
- New
2.8.0 #
-
JsonEncoder:- Fixed
removeFieldwhen combined withremoveNullFields: the filters were joined with||, so enabling both disabled both, and a field marked for removal was still emitted. - Fixed the encoding of a negative
Duration: it was written with a minus sign on every component (-1:-30:0:0:-5), and since-is also a field separator the value decoded back positive. Now written with a single leading-(-1:30:0:0:5).- Note: this changes the wire format of negative
Durationvalues. The previous format is still decoded correctly, so already persisted data is recovered. Positive values are unchanged.
- Note: this changes the wire format of negative
- Fixed
-
JsonDecoder:- Fixed
fromJsonAsync/decodeAsyncfor aListof entities: the collectionTypeInfowas applied to each element instead of its argument, so elements were returned as rawMaps instead of entities, without any error. - Fixed the async
Mappath droppingduplicatedEntitiesAsIDand resetting the entity cache in the middle of an in-progress object tree.
- Fixed
-
ClassReflection:- Fixed
getBestConstructorsForMapcache key: it ignoredallowOptionalOnlyConstructors, so both values of the flag shared one cache entry and the result depended on which was requested first. - Fixed
castIterablewithnullable: true: it cast toEinstead ofE?, making the parameter a no-op and throwing aTypeErroron a collection containingnull(castListandcastSetwere already correct). - Fixed
castMapKeyswithnullable: true: it made the values nullable instead of the keys, throwing aTypeErroron aMapwith anullkey.
- Fixed
-
Reflection:- Fixed
siblingReflectionForthrowing aTypeErrorinstead of returningnullwhen no sibling matched the requested type: it cast withas Reflection<T>while declaring a nullable return.
- Fixed
-
FunctionReflection:- Fixed
getParameterByIndexfor named parameters: the offset did not includeoptionalParameters, so for a function with optional positional parameters the named indexes were shifted, returning the wrong parameter and making the last one unreachable. Indexes now followallParameters.
- Fixed
-
ReflectionBuilder:- Fixed
ClassProxygeneration for a method with more than one type parameter: they were written with no separator, sopair<A, B>was generated aspair<AB>. - Fixed
operator >>>(Dart 2.14) not being in the operator blocklist: it was generated as a method name and broke the build. - Fixed
ClassProxywithignoreParametersTypeswhen the first parameter is dropped: a leading comma was emitted (compute(, int a)), breaking the build. - Fixed type names being generated unqualified: a type reachable only
through a prefixed import (
import 'other.dart' as o;) was written asOtherinstead ofo.Other, so the generated part did not compile. Type name resolution is now aware of the input library's import prefixes. - Fixed record type generation: no comma was emitted between positional
fields and the named group (
(double{bool y})), and a record with a single positional field was missing its mandatory trailing comma ((int)instead of(int,)). Both aborted the build. - Fixed an infinite loop in the generated alias naming when a library
declares names colliding with both an internal alias and its
0suffix. - Fixed
enumreflection: astatic constfield of theenum's own type (likestatic const Color def = Color.red;) was generated as anenumvalue in_valuesByName, shadowing the real name inEnumReflection.getName. Now only actualenumconstants are generated.
- Fixed
-
TypeParser:parseDuration: a leading-now negates the wholeDurationinstead of being consumed as a field separator.
-
ListSortedByUsage:- Exposed
clampCountas@visibleForTesting.
- Exposed
-
Tests:
- Added coverage for
lib/src/analyzer/(ConstantReader,TypeChecker,LibraryReader,UnresolvedAnnotationExceptionand the url helpers), for the annotations and for theClassProxyreturn helpers. - Total tests: 96 -> 250. Line coverage: 86.0% -> 89.1%.
- Added coverage for
-
pubspec.yaml:- Updated dependencies:
analyzerto^13.0.0buildto^4.0.6dart_styleto^3.1.9
- The previous
buildanddart_stylelower bounds were not satisfiable withanalyzer13.x, sopubsilently resolved above them. - SDK constraint unchanged (
>=3.10.0 <4.0.0):analyzer13.0.0 still supports^3.9.0, butdart_style3.1.9 (the only release compatible withanalyzer13) requires^3.10.0.
- Updated dependencies:
2.7.5 #
- Dependency updates:
analyzer: ^10.2.0dart_style: ^3.1.6
2.7.4 #
-
JsonEntityCacheSimple:- Updated
toStringmethod to use null-aware spread operator for combining maps.
- Updated
-
TypeParser:- Updated map entry parsing to use null-aware list element in
Map.fromEntries.
- Updated map entry parsing to use null-aware list element in
-
pubspec.yaml:- Updated SDK constraint to
>=3.10.0 <4.0.0. - Updated dependencies:
buildto^4.0.4analyzerto^9.0.0metato^1.18.1source_spanto^1.10.2
- Updated dev_dependencies:
build_runnerto^2.11.1build_testto^3.5.7lintsto^6.1.0testto^1.30.0
- Updated SDK constraint to
2.7.3 #
-
lib/src/reflection_factory_builder.dart:_EnumTree<T>: Filtered enum entries to include only those marked asconstwhen generating_valuesByNamemap.
-
pubspec.yaml:- Updated dependencies:
build: ^4.0.3analyzer: ^8.4.1dart_style: ^3.1.3
- Updated dev_dependencies:
build_runner: ^2.10.4build_test: ^3.5.4test: ^1.29.0
- Updated dependencies:
2.7.2 #
-
BasicDartType: addedfunction. -
TypeInfo: addedtFunction. -
build_runner: ^2.10.1
-
build_test: ^3.5.1
2.7.1 #
-
Allow
build_runner build --force-aotflag, removingdart:mirrorsdependency. -
TypeChecker:- Added
TypeChecker.fromPackage:- Implementation
_PackageTypeChecker.
- Implementation
- Removed
TypeChecker.fromRuntime:- Remove import of
dart:mirrors. - Remove implementation
_MirrorTypeChecker.
- Remove import of
- Added
-
build: ^4.0.2
-
build_runner: ^2.10.0
-
build_test: ^3.5.0
2.7.0 #
-
sdk: '>=3.9.0 <4.0.0'
- dart format
-
analyzer: ^8.4.0
2.6.1 #
- build: ^4.0.1
- build_runner: ^2.9.0
- build_test: ^3.4.1
2.6.0 #
-
Migrate to
analyzer: ^8.1.1andbuild: ^3.0.2. -
build: ^3.0.2
-
analyzer: ^8.1.1
-
dart_style: ^3.1.2
-
mime: ^2.0.0
-
collection: ^1.19.1
-
logging: ^1.3.0
-
build_runner: ^2.7.0
-
build_test: ^3.3.2
-
lints: ^6.0.0
-
Comment
#dependency_validator: ^5.0.2(incompatible withanalyzer: ^8.1.1). -
Dart CI:
DART_VERSION: "latest" -
sdk: '>=3.7.0 <4.0.0'
2.5.3 #
-
ReflectionBuilder: improve use ofconstfor generated code. -
dependency_validator: ^4.1.3
2.5.2 #
-
JsonCodecandJsonEncoder:- Added
encodeToSink.
- Added
-
Dart CI:
DART_VERSION: "3.6.2": avoid CI issues with Dart 3.8+ andbuild_test.
-
build: ^2.4.2
-
meta: ^1.17.0
-
pub_semver: ^2.2.0
-
build_runner: ^2.4.15
-
test: ^1.26.3
-
coverage: ^1.15.0
2.5.1 #
-
Reflection:- Added
getSymbol, to allow resolution ofconst Symbolinstances.
- Added
-
MethodInvocation:- Added field
reflection. namedArguments: usereflection.getSymbolto resolve theconst Symbolfor the named parameters keys.
- Added field
-
ReflectionBuilder:_writeGeneratedCode:DartFormatter(languageVersion).
-
dart_style: ^3.0.1
2.5.0 #
-
Constructor: addedfullName. -
ClassTree._buildConstructors: use as direct constructor name asconstructorAccessor, reducing generated code. -
sdk: '>=3.6.0 <4.0.0'
-
collection: ^1.19.0
-
build_runner: ^2.4.15
-
lints: ^5.1.1
-
test: ^1.25.15
2.4.10 #
-
New
InputAnalyzerandInputAnalyzerResolved:- Move library, compilation unit and parts resolver code.
-
ReflectionBuilder:- Use
InputAnalyzerResolved. _classProxy: Force class library dependency, and fix cache dependency issue.- Check for reflection annotations (AST) before skipping generation if no
partdirective is found.
- Use
-
ClassReflection,EnumReflection:compareTo: compare enumName and className in addition toreflectionLevel.
2.4.9 #
-
ReflectionBuilder:_buildSiblingsClassReflection:- Also activate
XYZ$reflection()for imported classes with@EnableReflection.
- Also activate
-
_DartTypeExtension:- Added caches for:
isDartCore,isTypeWithReflection,getTypesWithReflection.typeNameResolvable,typeName,hasSimpleTypeArguments,typeNameAsCode.
- Added caches for:
-
build: ^2.4.2
-
dart_style: ^2.3.8
-
yaml: ^3.1.3
-
build_runner: ^2.4.14
-
build_test: ^2.2.3
-
pubspec_parse: ^1.5.0
-
test: ^1.25.14
2.4.8 #
-
TypeParser:_parserForTypeInfo: handle casting of collections.
-
sdk: '>=3.4.0 <4.0.0'
-
analyzer: ^6.11.0
-
pub_semver: ^2.1.5
-
source_span: ^1.10.1
-
build_runner: ^2.4.13
-
test: ^1.25.12
-
coverage: ^1.11.1
2.4.7 #
JsonDecoder:_fromJsonImpl: try to parse primitives totypeInfodefinition (AllowMapStringkeys to be parsed asint)._fromJsonMapImpl: fix for whentypeInfois for aMap<K,V>.
2.4.6 #
TypeInfo:isValidGenericType: fix forMap,MapEntry,ListandSet.- Added
toMapType,toMapEntryValueType,toMapEntryKeyType,toMapEntryTypeandisCastedMapEntry.
2.4.5 #
-
_TypeWrapperList,_TypeWrapperMap,_TypeWrapperSet,_TypeWrapperIterable:- Improve
parse, handling generic types of constructed collections.
- Improve
-
analyzer: ^6.8.0
-
dart_style: ^2.3.7
-
meta: ^1.16.0
-
mime: ^1.0.6
-
path: ^1.9.1
-
data_serializer: ^1.2.1
-
coverage: ^1.10.0
2.4.4 #
-
🐛 fix(builder):
- Use raw strings on class names.
ignore_for_file: addeddeprecated_member_useanddeprecated_member_use_from_same_package.
-
Change package
pubspectopubspec_parse. -
pubspec_parse: ^1.3.0
2.4.3 #
ClassReflection: optimizecreateInstanceWithConstructors.
2.4.2 #
-
JsonDecoder:decode: optimize resolution forT/typedynamic/Object(any type).
-
JsonConverter(JsonEncoder&JsonDecoder):- Added
isStandard.
- Added
2.4.1 #
JsonEntityCache:- Added
isCachedEntityByIDandcacheEntityInstantiator. JsonEntityCacheSimple: implement new methods.- Added to interface (from
JsonEntityCacheSimple):cachedEntities,allCachedEntities,instantiateAllCachedEntities,cachedEntitiesLength,cachedEntitiesInstantiatorsLength,totalCachedEntities.
- Added
2.4.0 #
-
sdk: '>=3.3.0 <4.0.0'
-
analyzer: ^6.5.0
-
meta: ^1.15.0
-
lints: ^4.0.0
-
test: ^1.25.5
-
coverage: ^1.8.0
2.3.4 #
- Fix handling og record types with named parameters.
- Fix type argument resolution.
2.3.3 #
ClassReflection:- Fix generation of
getJsonFieldsVisibleValuesfor getters and setters withJsonField.hiddenannotations.
- Fix generation of
2.3.2 #
-
ClassReflection:- Added
getJsonFieldsVisibleValues
- Added
-
meta: ^1.14.0
-
build_runner: ^2.4.9
2.3.1 #
-
JsonEncoder:- Expose
entityCache.
- Expose
-
data_serializer: ^1.1.0
-
dart_style: ^2.3.6
2.3.0 #
-
New
StaticFunctionReflection.- New
StaticMethodReflection. ConstructorReflectionextendsStaticFunctionReflection.
- New
-
New
BasicFieldReflection:- New
StaticFieldReflection.
- New
-
ClassReflection:- Added
getFieldsValues.
- Added
-
meta: ^1.12.0
-
path: ^1.9.0
-
dependency_validator: ^3.2.3
2.2.8 #
-
Fix issue with parameter resolution when calling a constructor/method.
-
analyzer: ^6.4.1
-
mime: ^1.0.5
-
build_runner: ^2.4.8
-
test: ^1.25.2
2.2.7 #
- Small fix for
Durationsupport.
2.2.6 #
-
TypeParser: addedparseDuration. -
Json: add support to
Duration. -
coverage: ^1.7.2
-
build_test: ^2.2.2
2.2.5 #
-
TypeInfo:- Fix
castListfor nullable types.
- Fix
-
lints: ^3.0.0
- Adjust code generation for
type_literal_in_constant_patternlint.
- Adjust code generation for
-
dart_style: ^2.3.4
-
build_runner: ^2.4.7
2.2.4 #
-
Added basic support for Records types.
- Added logic to handle record types and generate typedefs for record declarations.
-
Added new tests for Records and generics in
test/reflection_factory_build_test.dart. -
test: ^1.24.9
-
coverage: ^1.6.4
-
data_serializer: ^1.0.12
2.2.3 #
- Added
ClassProxy.ignoreMethods2.
2.2.2 #
- Added
@IgnoreClassProxyMethod.
2.2.1 #
-
ReflectionBuilder:- Generated files:
ignore_for_file: camel_case_typesignore_for_file: camel_case_extensions
- Generated files:
-
build: ^2.4.1
-
dart_style: ^2.3.2
-
collection: ^1.18.0
-
build_runner: ^2.4.6
-
build_test: ^2.2.0
-
data_serializer: ^1.0.10
-
test: ^1.24.6
2.2.0 #
-
LibraryReader: addedallAnnotatedElements. -
ReflectionBuilder- Optimize detection of annotated elements.
- Fix typos.
-
sdk: '>=3.0.0 <4.0.0'
-
analyzer: ^6.2.0
-
lints: ^2.1.1
2.1.6 #
- New
ClassProxyDelegateListener.
2.1.5 #
- Optimize
createInstanceWithBestConstructorandcreateInstanceWithConstructors.
2.1.4 #
- Added
TypeParser.parserForTypeInfo. - Optimize
TypeParser.parserFor. - Optimize
_TypeWrapperwith specialized implementations for each handled type inBasicDartType. - Optimize
TypeInfo.parsedelegating to specializedTypeWrapper.parseimplementations.
2.1.3 #
TypeInfo:- Fix
castCollection: redirectingMaps tocastMap.
- Fix
- sdk: '>=2.19.0 <4.0.0'
- build: ^2.4.0
- analyzer: ^5.13.0
- dart_style: ^2.3.1
- meta: ^1.9.1
- pub_semver: ^2.1.4
- collection: ^1.17.1
- yaml: ^3.1.2
- source_span: ^1.10.0
- test: ^1.24.3
2.1.2 #
TypeParser:- Small fixes
parseList,parseMapandparseMapEntry.
- Small fixes
TypeInfo:- Added
callCastedArgumentAandcallCastedArgumentsAB.
- Added
2.1.1 #
TypeInfo:- Added getters
arguments0andarguments1. - Added
isCastedList,isCastedSet,isCastedIterableandisCastedMap.
- Added getters
2.1.0 #
EnumReflection(Breaking Change):- Now separates fields into
staticFieldsNamesandfieldsNames.
- Now separates fields into
- sdk: '>=2.18.0 <3.0.0'
- collection: ^1.17.0
2.0.7 #
TypeInfo:- Fix
isValidGenericTypeforList<T>. _fromJsonImpl: passtypeInfoinstead oftype.
- Fix
JsonDecoder:_fromJsonListImpl: fix forList<List<T>>.
2.0.6 #
TypeParser.parseBool: improve detected values.- analyzer: ^5.10.0
2.0.5 #
ClassProxy:- Added
returnValue,returnFutureandreturnFutureOr.
- Added
- Added
ClassProxyCallError. - analyzer: ^5.8.0
- dart_style: ^2.3.0
2.0.4 #
JsonEncoder:- Added
JsonEncoder.callToJson:- Optimized call of
toJsonand avoidNoSuchMethodError.
- Optimized call of
- Added
TypeInfo- Added static
isPrimitiveTypeFor
- Added static
TypeParser:- Optimize
isPrimitiveTypeandisPrimitiveValue.
- Optimize
ClassReflection:- Optimize
withObject.
- Optimize
FieldReflection:- Optimize
withObject.
- Optimize
ReflectionBuilder:- Optimize generation of getters that can use static fields:
- Enums:
fieldsNames,valuesByName
- Classes:
constructorsNames,fieldsNames,staticFieldsNames,methodsNames,staticMethodsNames.
- Enums:
- Fix: ensure that reflected annotations are
const.
- Optimize generation of getters that can use static fields:
analysis_options.yaml:- Added linter rules:
avoid_dynamic_callsavoid_type_to_stringno_runtimeType_toStringdiscarded_futuresno_adjacent_strings_in_list
- Added linter rules:
2.0.3 #
JsonEntityCacheSimple:- Rename
lengthtototalCachedEntitesto avoid implementation issues.
- Rename
2.0.2 #
ClassReflection:getBestConstructorsFor,createInstanceWithBestConstructor,getBestConstructorForMap,getBestConstructorsForMap:- Added parameter
allowOptionalOnlyConstructors.
- Added parameter
createInstanceFromMap:- Improved constructor resolution.
EnableReflection,ReflectionBridge:- Added parameter
optimizeReflectionInstances = true:- If
trueall generatedClassReflectionandEnumReflectionwill have afactoryconstructor and anExpandoto cache reflection instances.
- If
- Added parameter
FunctionReflection:methodInvocationFromMap: optimize and clean code.
- Added annotation
JsonConstructor.
2.0.1 #
ClassReflection.createInstanceWithBestConstructor:- Now throws
UnresolvedParameterErrorinstead ofStateErrorfor unresolved parameters.
- Now throws
- analyzer: ^5.5.0
- test: ^1.23.1
- coverage: ^1.6.3
2.0.0 #
ClassReflection:constructor:- removed
<R>type.
- removed
field:- Ggenerated implementation declares
TofFieldReflection<$class,T>statically.
- Ggenerated implementation declares
- Optimized:
allFields,allMethods: object instances derived from cachedno-objectinstances.construtor,staticField,field,method:- Caching instances.
- Object instances derived from cached
no-objectinstances.
FieldReflection:- Added
setNullable.
- Added
- benchmark: ^0.3.0
benchmark/reflection_factory_benchmark.dart
- meta: ^1.9.0
1.2.25 #
- Extra fix: issue when a source has a
part ofdirective.
1.2.24 #
- Fix issue when a source has a
part ofdirective.
1.2.23 #
ReflectionBuilder- New
sequentialandbuildStepTimeout. - Build now is sequential by default:
- Only one
BuildStepis processed at a time. - Avoid
InconsistentAnalysisException(buildissue #2689).
- Only one
- New
- Added
build.yamloptions (verbose,sequential,timeout). - Improved logging.
- Added
ClassProxytest usinglibraryPath. reflection_factory/build.yaml:generate_for:- Added
bin/*
- Added
1.2.22 #
- Attempt to avoid
buildissue:InconsistentAnalysisException: Requested result might be inconsistent with previously returned results#2689- https://github.com/dart-lang/build/issues/2689
- mime: ^1.0.4
- build_test: ^2.1.6
- test: ^1.22.2
- coverage: ^1.6.2
1.2.21 #
ClassReflection:- Fix generated
supperTypes.
- Fix generated
1.2.20 #
- Migrate to
analyzer: ^5.4.0. - analyzer: ^5.4.0
1.2.19 #
TypeInfo:- Added
isPrimitiveOrDynamicOrObjectTypeandisEntityType.
- Added
- Fix
castMapTypeforMap<String,dynamic>.
1.2.18 #
Reflection:- Fix
castMap: - Added
castMapKeysandcastMapValues. - Added getters:
asTypeReflection,typeInfo,listType,mapKeyTypeandmapValueType.
- Fix
JsonCodec:- Added field
mapCaster.
- Added field
_JsonDecoder:- Now supports
Mapcasting when decoding an entity field.
- Now supports
- Added
castMapType. ReflectionBuilder:- Optimize and reduce generated code.
- build: ^2.3.1
- analyzer: ^4.7.0
- dart_style: ^2.2.4
- mime: ^1.0.3
- pub_semver: ^2.1.3
- path: ^1.8.3
- build_runner: ^2.3.3
- lints: ^2.0.1
- test: ^1.22.1
- coverage: ^1.6.1
1.2.17 #
FunctionReflection.parametersNamesWhere:- Added parameter
nameResolver.
- Added parameter
ClassReflection.getBestConstructorsFor:- Improve parameter/field JSON name alias (
JsonFieldAlias) resolution.
- Improve parameter/field JSON name alias (
1.2.16 #
ClassReflection:- Added
fieldsWithJsonFieldHidden,fieldsWithJsonFieldVisible,hasJsonFieldHiddenandhasJsonFieldVisible. - Added
entityFieldsandentityFieldsNamesWhere. - Added
getBestConstructorsFor. getBestConstructorFor: using multiple contructor candidates.
- Added
1.2.15 #
JsonTypeDecoder: added parameterTypeInfo typeInfo.JsonDecoder:- Added
unregisterTypeDecoder - Allow decoding of
nullvalues with personalizedJsonTypeDecoder.
- Added
- Added
ClassReflection.createInstanceWithConstructorByName.
1.2.14 #
FunctionReflection.methodInvocation:- Function
parameterProvider:- Add
parameterIndexto indicate the order of the parameter in the method.
- Add
- Function
1.2.13 #
- Json:
- Add parameter
TypeInfoas an alternative to the parameterType. - Improve collections casting.
- Add parameter
TypeInfo:- Added constructors:
TypeInfo.fromListType,TypeInfo.fromSetType,TypeInfo.fromMapType. - Added
toListType,toSetType,toIterableType,toMapValueTypeandtoMapKeyType. - Added
castList,castSet,castIterableandcastMap.
- Added constructors:
1.2.12 #
ClassReflectionadded fieldclassName.EnumReflectionadded fieldenumName.
1.2.11 #
ClassProxy:- Optimize
@ClassProxyclasses resolution speed. - Added
ClassProxytest withlibraryPathparameter.
- Optimize
README.md:- Added
partdirective description. - Added
@ClassProxyexample.
- Added
- Added tests for
JsonEntityCacheSimple.
1.2.10 #
- Small fix in
TypeInfo.toString: was not passing the parameterwithTto recursive calls.
1.2.9 #
ReflectionFactory:- Added
getRegisterClassReflectionByNameandgetRegisterEnumReflectionByName.
- Added
JsonTypeDecoder: added parameterjsonDecoder.
1.2.8 #
FunctionReflection.methodInvocationFromMapandFunctionReflection.methodInvocation:- Better handling of unresolved parameters values. Attempts to resolve 2 times, to allow entities references through cache.
Reflection:castList,castSet,castIterable,castMap,castCollection:- Added parameter
nullable.
- Added parameter
1.2.7 #
TypeInfo:- Added
Tgeneric type. - Added
callCastedto pass theTto aFunction<T>(). - Improved internal representation og
arguments.
- Added
ReflectionBuilder:- Declare reflected types using
TypeInfo<T>generics.
- Declare reflected types using
- Improved tests coverage.
1.2.6 #
- Add
coverage:ignore-fileto generated files. - analyzer: ^4.6.0
1.2.5 #
Json:toJson: fix casting bug when the resulting JSON value isnull.
- Removed unused analyzer helper code.
- Adjusted for analyzer 4.4.0.
- sdk: '>=2.17.0 <3.0.0'
- analyzer: ^4.4.0
1.2.4 #
TypeParserandTypeInfo:- Add support for
Uint8List.
- Add support for
1.2.3 #
JsonEntityCache:- Added instance
id. - Added
allowEntityFetch.
- Added instance
TypeInfo:- Added
equalsTypeAndArguments.
- Added
TypeReflection:- Added
isBigInt. isNumericTyperenamed toisNumberType.- Added
isNumericType(isNumericType+isBigInt).
- Added
- Added extension
TypeExtension:- method
isPrimitiveType.
- method
- Added extension
GenericObjectExtension:isPrimitiveValue,isPrimitiveList,isPrimitiveMap.
1.2.2 #
ReflectionInspector:- Fix inspection for generated files in the subdirectory
reflection.
- Fix inspection for generated files in the subdirectory
1.2.1 #
- Fix use of deprecated methods of package
analyzer. - build: ^2.3.0
- analyzer: ^4.3.0
- pub_semver: ^2.1.1
- yaml: ^3.1.1
- source_span: ^1.9.1
- build_runner: ^2.2.0
- build_test: ^2.1.5
- pubspec: ^2.3.0
- data_serializer: ^1.0.7
- dependency_validator: ^3.2.2
- test: ^1.21.4
- coverage: ^1.5.0
1.2.0 #
- sdk: '>=2.15.0 <3.0.0'
- analyzer: ^4.1.0
- meta: ^1.8.0
- path: ^1.8.2
- build_runner: ^2.1.11
- lints: ^2.0.0
- pubspec: ^2.2.0
- test: ^1.21.2
- coverage: ^1.3.2
1.1.2 #
ClassProxy.- Allow type parameters in generated proxy methods.
1.1.1 #
TypeInfo:- Fix
fromJsonwhen decoding a list with a graph containing duplicated entities (referenced by ID). - Added support for
FutureOr.
- Fix
JsonCoder/JsonEncoder/JsonDecoder:- Allow override of
autoResetEntityCachewhile encoding or decoding.
- Allow override of
- Improved GitHub CI: added browser tests (chrome).
- mime: ^1.0.2
- analyzer: ^3.4.1
- dart_style: ^2.2.3
1.1.0 #
- Changed possible generated reflection file path. Now it can generate:
- Inside the directory:
reflection/{{file}}.g.dart - Or as a sibling file
{{file}}.reflection.g.dart
- Inside the directory:
- Added warning of absent
partdirective for the generated reflection file.
1.0.29 #
ClassReflection:- Add parameter
duplicatedEntitiesAsIDto JSON related methods.
- Add parameter
1.0.28 #
- Fix
createInstanceFromMapwhen there's no constructor without arguments. - New annotation
JsonFieldAlias.
1.0.27 #
- Fix JSON
DateTimeparsing when encoded as anint. - JSON encoder/decoder can reference already encoded entities by ID through
JsonEntityCache.
1.0.26 #
- Fix
ClassProxy.ignoreParametersTypes.
1.0.25 #
ClassProxy: addedignoreParametersTypes.
1.0.24 #
ClassProxy:- Fix proxy generation for methods that returns
FutureOr.
- Fix proxy generation for methods that returns
ClassReflection:- Optimize
createInstanceWithBestConstructorandgetBestConstructorForMap.
- Optimize
- source_span: ^1.8.2
- path: ^1.8.1
- collection: ^1.16.0
- build: ^2.2.1
- analyzer: ^3.3.1
- dart_style: ^2.2.1
1.0.23 #
ClassProxy:- Fix target class resolution issue. Added
libraryPath. - Added extra configuration:
alwaysReturnFuture,traverseReturnTypes,ignoreMethods.
- Fix target class resolution issue. Added
- Improve
JsonEncoderandJsonDecoder:- Added
registerTypeToEncodableandregisterTypeDecoder.
- Added
1.0.22 #
- Added
ClassProxy:- Allows generation of a class proxy without directly depending on the target class.
1.0.21 #
- Improve JSON codec customization.
- Improve
createInstanceWithBestConstructor.
1.0.20 #
- Added
TypeInfoto perform type checking and handle otherTypeoperations needed for reflection use. - Improved
TypeReflectionforFunctiontypes. - Fixed constructors with nullable named parameters.
- Fixed constructors with
requirednamed parameters. - Fixed fields/parameters with
Functiontypedefalias.
1.0.19 #
- Fix small bug at
createInstanceFromMapfor field resolution.
1.0.18 #
EnumReflection: addedenumNameto extension.- Fix
siblingEnumReflectionForandsiblingEnumReflectionFor.
1.0.17 #
- JSON
- Better JSON handling and reflection integration.
- Encoding/decoding to/from bytes (
Uint8List). @JsonField: to hide a field or to force it as a json field.
- Added support for enums:
EnumReflection ClassReflection:- Support for supper classes.
- Added
createInstanceWithNoRequiredArgsConstructoras another way to create an instance without arguments. - Added
getBestConstructorFor, that selects the constructor capable to create an instance with provided parameters. - Added
fromJsonandfromJsonEncoded. - Added
createInstanceWithBestConstructorandcreateInstanceFromMap. - Added
declaringType.
- Generating
ClassFoo$fromJsonandClassFoo$fromJsonEncoded. - Optimized some operations.
- Fixed
TypeReflectionforFunction. - mime: ^1.0.1
- base_codecs: ^1.0.1
1.0.16 #
ClassReflection:withoutObjectInstance: now always returns the same instance.- Added
reflectionFactoryVersion.
1.0.15 #
ClassReflection: addedcallCasted.ReflectionInspector: now checks if a generated file version is the same of thereflection_factorypackage.
1.0.14 #
ClassReflection:- Added
siblingsClassReflectionandwithoutObjectInstance. registernow triggers registration of all siblingClassReflection.
- Added
- Using standard Dart coverage.
- coverage: ^1.0.3
1.0.13 #
- Allow call to
fieldwithout an object. Useful to get the field type before instantiate an object.
1.0.12 #
FieldReflection: addedhasSetter.
1.0.11 #
- Added support to default values of optional and named parameters.
1.0.10 #
- Removed
BUILD TIMEcomment in generated files to avoid unnecessary generate file modification/change.
1.0.9 #
- Added
ReflectionInspector. - Generated files now have the package version in the header comments.
toJsonEncodable: fixed handling ofDateTime.- Improved tests.
1.0.8 #
- Improve tests.
- Fix issue with genetic types.
1.0.7 #
TypeReflection:- Added
isOfType.
- Added
FunctionReflection(MethodReflection,ConstructorReflection):methodInvocation(parametersProvider)now accepts aParameterReflection, not only aStringwith the parameter name.
1.0.6 #
ClassReflection:- Added:
fieldsWhere,staticFieldsWhere,methodsWhere,staticMethodsWhere.
- Added:
TypeReflection:- Added:
isPrimitiveType,isCollectionType,isMapType,isIterableType,isNumericType,isIntType,isDoubleType,isBoolType,isStringType.
1.0.5 #
- Added support for class constructors.
- Added
TypeReflection:- Allows handling of Type generics/arguments.
- Added extensions:
IterableTypeReflectionExtension,IterableParameterReflectionExtension,IterableFieldReflectionExtension.
1.0.4 #
- Added
ElementResolver: ClassReflection:- Added resolvers:
fieldResolver,staticFieldResolver,methodResolver,staticMethodResolver. - Optimized
toJsonto resolve fasterMethodReflectionofobj.toJson.
- Added resolvers:
- Changed
FieldReflectionto allowwithObject. - Changed
MethodReflectionto allowwithObject. - Added
ReflectionFactory.toJsonEncodable. - Improve API Documentation.
- Fix issue with operator overloading.
1.0.3 #
- Annotation reflection:
- Support for classes, fields, methods and method parameters.
1.0.2 #
ClassReflection:- Added:
allMethods,allStaticMethods
- Added:
MethodReflection:- Methods parameters now are defined with
ParameterReflection. returnType: fixed forvoid.method: exposed, not private anymore.- Added:
equalsNormalParametersTypes,equalsOptionalParametersTypes,equalsNamedParametersTypes.methodInvocation,methodInvocationFromMap.
- Methods parameters now are defined with
MethodInvocation: class to represent an invocation.- Builder:
- Now generates documentation of generated extension methods.
- Better handling of parameters and fields with
ParameterReflection.- Now knows if a parameter is
required.
- Now knows if a parameter is
- Improved API documentation.
- Improved tests.
- collection: ^1.15.0
1.0.1 #
- @EnableReflection:
- Added
reflectionClassName,reflectionExtensionName.
- Added
- @ReflectionBridge:
- Added
bridgeExtensionName,reflectionClassNames,reflectionExtensionNames.
- Added
- Builder:
MethodReflection:- Added method parameters names to normal and optional parameters.
- Optimize generated code.
- Improved console output and verbose mode.
- Improved tests.
1.0.0 #
- Support for Class reflection:
- FieldReflection
- MethodReflection
- Initial version.