reflection_factory 2.4.5 reflection_factory: ^2.4.5 copied to clipboard
Allows Dart reflection with an easy approach, even for third-party classes, using code generation portable for all Dart platforms.
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_use
anddeprecated_member_use_from_same_package
.
-
Change package
pubspec
topubspec_parse
. -
pubspec_parse: ^1.3.0
2.4.3 #
ClassReflection
: optimizecreateInstanceWithConstructors
.
2.4.2 #
-
JsonDecoder
:decode
: optimize resolution forT
/type
dynamic
/Object
(any type).
-
JsonConverter
(JsonEncoder
&JsonDecoder
):- Added
isStandard
.
- Added
2.4.1 #
JsonEntityCache
:- Added
isCachedEntityByID
andcacheEntityInstantiator
. 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
getJsonFieldsVisibleValues
for getters and setters withJsonField.hidden
annotations.
- 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
. ConstructorReflection
extendsStaticFunctionReflection
.
- 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
Duration
support.
2.2.6 #
-
TypeParser
: addedparseDuration
. -
Json: add support to
Duration
. -
coverage: ^1.7.2
-
build_test: ^2.2.2
2.2.5 #
-
TypeInfo
:- Fix
castList
for nullable types.
- Fix
-
lints: ^3.0.0
- Adjust code generation for
type_literal_in_constant_pattern
lint.
- 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_types
ignore_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
createInstanceWithBestConstructor
andcreateInstanceWithConstructors
.
2.1.4 #
- Added
TypeParser.parserForTypeInfo
. - Optimize
TypeParser.parserFor
. - Optimize
_TypeWrapper
with specialized implementations for each handled type inBasicDartType
. - Optimize
TypeInfo.parse
delegating to specializedTypeWrapper.parse
implementations.
2.1.3 #
TypeInfo
:- Fix
castCollection
: redirectingMap
s 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
,parseMap
andparseMapEntry
.
- Small fixes
TypeInfo
:- Added
callCastedArgumentA
andcallCastedArgumentsAB
.
- Added
2.1.1 #
TypeInfo
:- Added getters
arguments0
andarguments1
. - Added
isCastedList
,isCastedSet
,isCastedIterable
andisCastedMap
.
- Added getters
2.1.0 #
EnumReflection
(Breaking Change):- Now separates fields into
staticFieldsNames
andfieldsNames
.
- Now separates fields into
- sdk: '>=2.18.0 <3.0.0'
- collection: ^1.17.0
2.0.7 #
TypeInfo
:- Fix
isValidGenericType
forList<T>
. _fromJsonImpl
: passtypeInfo
instead 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
,returnFuture
andreturnFutureOr
.
- Added
- Added
ClassProxyCallError
. - analyzer: ^5.8.0
- dart_style: ^2.3.0
2.0.4 #
JsonEncoder
:- Added
JsonEncoder.callToJson
:- Optimized call of
toJson
and avoidNoSuchMethodError
.
- Optimized call of
- Added
TypeInfo
- Added static
isPrimitiveTypeFor
- Added static
TypeParser
:- Optimize
isPrimitiveType
andisPrimitiveValue
.
- 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_calls
avoid_type_to_string
no_runtimeType_toString
discarded_futures
no_adjacent_strings_in_list
- Added linter rules:
2.0.3 #
JsonEntityCacheSimple
:- Rename
length
tototalCachedEntites
to 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
true
all generatedClassReflection
andEnumReflection
will have afactory
constructor and anExpando
to cache reflection instances.
- If
- Added parameter
FunctionReflection
:methodInvocationFromMap
: optimize and clean code.
- Added annotation
JsonConstructor
.
2.0.1 #
ClassReflection.createInstanceWithBestConstructor
:- Now throws
UnresolvedParameterError
instead ofStateError
for 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
T
ofFieldReflection<$class,T>
statically.
- Ggenerated implementation declares
- Optimized:
allFields
,allMethods
: object instances derived from cachedno-object
instances.construtor
,staticField
,field
,method
:- Caching instances.
- Object instances derived from cached
no-object
instances.
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 of
directive.
1.2.24 #
- Fix issue when a source has a
part of
directive.
1.2.23 #
ReflectionBuilder
- New
sequential
andbuildStepTimeout
. - Build now is sequential by default:
- Only one
BuildStep
is processed at a time. - Avoid
InconsistentAnalysisException
(build
issue #2689).
- Only one
- New
- Added
build.yaml
options (verbose
,sequential
,timeout
). - Improved logging.
- Added
ClassProxy
test usinglibraryPath
. reflection_factory/build.yaml
:generate_for
:- Added
bin/*
- Added
1.2.22 #
- Attempt to avoid
build
issue: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
isPrimitiveOrDynamicOrObjectType
andisEntityType
.
- Added
- Fix
castMapType
forMap<String,dynamic>
.
1.2.18 #
Reflection
:- Fix
castMap
: - Added
castMapKeys
andcastMapValues
. - Added getters:
asTypeReflection
,typeInfo
,listType
,mapKeyType
andmapValueType
.
- Fix
JsonCodec
:- Added field
mapCaster
.
- Added field
_JsonDecoder
:- Now supports
Map
casting 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
,hasJsonFieldHidden
andhasJsonFieldVisible
. - Added
entityFields
andentityFieldsNamesWhere
. - Added
getBestConstructorsFor
. getBestConstructorFor
: using multiple contructor candidates.
- Added
1.2.15 #
JsonTypeDecoder
: added parameterTypeInfo typeInfo
.JsonDecoder
:- Added
unregisterTypeDecoder
- Allow decoding of
null
values with personalizedJsonTypeDecoder
.
- Added
- Added
ClassReflection.createInstanceWithConstructorByName
.
1.2.14 #
FunctionReflection.methodInvocation
:- Function
parameterProvider
:- Add
parameterIndex
to indicate the order of the parameter in the method.
- Add
- Function
1.2.13 #
- Json:
- Add parameter
TypeInfo
as an alternative to the parameterType
. - Improve collections casting.
- Add parameter
TypeInfo
:- Added constructors:
TypeInfo.fromListType
,TypeInfo.fromSetType
,TypeInfo.fromMapType
. - Added
toListType
,toSetType
,toIterableType
,toMapValueType
andtoMapKeyType
. - Added
castList
,castSet
,castIterable
andcastMap
.
- Added constructors:
1.2.12 #
ClassReflection
added fieldclassName
.EnumReflection
added fieldenumName
.
1.2.11 #
ClassProxy
:- Optimize
@ClassProxy
classes resolution speed. - Added
ClassProxy
test withlibraryPath
parameter.
- Optimize
README.md
:- Added
part
directive description. - Added
@ClassProxy
example.
- Added
- Added tests for
JsonEntityCacheSimple
.
1.2.10 #
- Small fix in
TypeInfo.toString
: was not passing the parameterwithT
to recursive calls.
1.2.9 #
ReflectionFactory
:- Added
getRegisterClassReflectionByName
andgetRegisterEnumReflectionByName
.
- Added
JsonTypeDecoder
: added parameterjsonDecoder
.
1.2.8 #
FunctionReflection.methodInvocationFromMap
andFunctionReflection.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
T
generic type. - Added
callCasted
to pass theT
to 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-file
to 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 #
TypeParser
andTypeInfo
:- 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
. isNumericType
renamed 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
fromJson
when decoding a list with a graph containing duplicated entities (referenced by ID). - Added support for
FutureOr
.
- Fix
JsonCoder
/JsonEncoder
/JsonDecoder
:- Allow override of
autoResetEntityCache
while 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
part
directive for the generated reflection file.
1.0.29 #
ClassReflection
:- Add parameter
duplicatedEntitiesAsID
to JSON related methods.
- Add parameter
1.0.28 #
- Fix
createInstanceFromMap
when there's no constructor without arguments. - New annotation
JsonFieldAlias
.
1.0.27 #
- Fix JSON
DateTime
parsing 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
createInstanceWithBestConstructor
andgetBestConstructorForMap
.
- 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
JsonEncoder
andJsonDecoder
:- Added
registerTypeToEncodable
andregisterTypeDecoder
.
- 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
TypeInfo
to perform type checking and handle otherType
operations needed for reflection use. - Improved
TypeReflection
forFunction
types. - Fixed constructors with nullable named parameters.
- Fixed constructors with
required
named parameters. - Fixed fields/parameters with
Function
typedef
alias.
1.0.19 #
- Fix small bug at
createInstanceFromMap
for field resolution.
1.0.18 #
EnumReflection
: addedenumName
to extension.- Fix
siblingEnumReflectionFor
andsiblingEnumReflectionFor
.
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
createInstanceWithNoRequiredArgsConstructor
as another way to create an instance without arguments. - Added
getBestConstructorFor
, that selects the constructor capable to create an instance with provided parameters. - Added
fromJson
andfromJsonEncoded
. - Added
createInstanceWithBestConstructor
andcreateInstanceFromMap
. - Added
declaringType
.
- Generating
ClassFoo$fromJson
andClassFoo$fromJsonEncoded
. - Optimized some operations.
- Fixed
TypeReflection
forFunction
. - 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_factory
package.
1.0.14 #
ClassReflection
:- Added
siblingsClassReflection
andwithoutObjectInstance
. register
now triggers registration of all siblingClassReflection
.
- Added
- Using standard Dart coverage.
- coverage: ^1.0.3
1.0.13 #
- Allow call to
field
without 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 TIME
comment 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 aString
with 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
toJson
to resolve fasterMethodReflection
ofobj.toJson
.
- Added resolvers:
- Changed
FieldReflection
to allowwithObject
. - Changed
MethodReflection
to 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.