angel3_serialize_generator 10.0.0
angel3_serialize_generator: ^10.0.0 copied to clipboard
Angel3 model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
Change Log #
10.0.0 #
Breaking changes in 10.0.0 #
- Breaking: No longer uses
dart:mirrors:SerializableFieldMirror.serializeranddeserializerare function names asStrings, where they wereSymbols. The generated code is the same - Breaking: Generated
hashCodegetters useObject.hashAllinstead ofhashObjects; regenerate existing models - Breaking: A generated class is named by removing a
modelPrefix(_,Entity), then amodelSuffix(Entity), matched by case:UserIdentitykeeps its name, where it becameUserId. The prefixes and suffixes are capitalised - Breaking: A value in
includeAnnotationsthat is not a constant instance of a class or enum fails the build
Fixes in 10.0.0 #
- Hash codes:
ListandMapfields are hashed by their length, so equal models have equal hash codes - Serializers:
Serializable.serializersis read by enum value name, including from other constants; an unknown value is logged. The serializer class is generated only formaporjson, and is aCodeconly formap - Names: Generated classes and their serializers are named in pascal case everywhere (
UrlSerializerof_URL), models refer to each other by their generated names, and two models of the same generated name fail the build - Types: Types are written with their import prefixes, nullability and type arguments, and fields of function or record types are generated, where any of these could fail the build or not compile
- Annotations: Enum values and constants are generated as references, and keep their import prefixes
- ORM:
ShimFieldImplmakes its own member reference, so ORM models with@BelongsTobuild withanalyzer14.5;ShimFieldImplis deprecated - Dependencies: Removed
quiver - Docs: The README tells how to install and use the package, and how to migrate from 9.x
9.1.0 #
- Require Dart >= 3.13
- Updated
analyzerto 14.0.0
9.0.0 #
- Require Dart >= 3.12
- Updated
analyzerto 13.0.0
8.8.0 #
- Require Dart >= 3.9
- Updated
analyzerto 8.4.x - Updated
buildto 4.0.x - Updated
source_gento 4.0.0 - Updated
ShimFieldImpl - Removed
ShimFieldImpl2
8.6.1 #
-
Updated
TypeChecker.fromRuntime()toTypeChecker.typeNamed() -
Removed
ShimFieldImpl2
8.6.0 #
- Require Dart >= 3.8.0
- Updated
lintsto 6.0.0 - Updated dependencies to the latest release
- Updated
analyzerto 7.7.x - Added
ShimFieldImpl2due to breaking changes inanalyzer7.7.x
8.5.0 #
- Added support for
Entity<Class>and<Class>Entityas data model
8.4.1 #
- Fixed
ShimFieldImpldue to breaking changes inanalyzer7.3.0
8.4.0 #
- Require Dart >= 3.6
- Updated
lintsto 5.x - Updated
source_gento 2.x - Updated
analyzerto 7.x - Updated dependencies to the latest release
- Updated
ShimFieldImpl
8.3.1 #
- Updated dependencies
8.3.0 #
- Require Dart >= 3.3
- Updated
lintsto 4.0.0
8.2.1 #
- Updated repository link
8.2.0 #
- Updated
lintsto 3.0.0 - Fixed linter warnings
8.1.0 #
- Upgraded to
analyzer6.2.x
8.0.1 #
- Fixed
JsonModelGeneratorfrom generating duplicated fields - Fixed
JsonModelGeneratorto priortizeidfield as the first argument
8.0.0 #
- Require Dart >= 3.0
7.2.0-beta.1 #
- Require Dart >= 2.19
- Fixed
topMapincorrect return
7.1.0 #
- Require Dart >= 2.18
- Upgraded to
analyzer5.x.x - Replaced deprecated
element2withelement
7.0.0 #
- Require Dart >= 2.17
- Fixed enum test cases
- Resolved deprecated methods
6.1.1 #
- Fixed issue #68: Support for non-nullable type
6.1.0 #
- Updated to
analyzer4.x.x
6.0.0 #
- Require Dart >= 2.16
- Updated to
analyzer3.x.x - Fixed default value for
ListandEnum
5.0.0 #
- Skipped release
4.3.0 #
- Updated to use
package:belatuk_code_buffer
4.2.0 #
- Fixed
toMapmethod generation for non nullable Map - Fixed
fromMapmethod generation for non nullable Map - Updated linter to
package:lints
4.1.2 #
- Fixed
toMapmethod generation - Fixed
fromMapemethod generation - Fixed
TypescriptBuilder - Updated generator to add
const []toListtype args in the contructor - Updated generator to product non nullable aware code
- Refactored away nullable code
- Added logging to facilitate tracing the code generation via
-verboseflag - Removed redudant null checking in the generated code
4.1.1 #
- Fixed
SerializerGeneratorto recognize nullable class
4.1.0 #
- Upgraded to support
analyzer2.0.0 major release
4.0.3 #
- Added
useNullSafetySyntax: trueto DartEmitter - Fixed
JsonModelGeneratorclass to produce correct NNBD code- Replaced
@requiredwithrequired - Fixed all none nullable field to be
requiredin the constructor - Fixed generated methods to return the correct type
- Fixed generated methods to be annnotated with
overridewhere applicable - Removed redundant null checking in the generated code
- Replaced
4.0.2 #
- Fixed
build.yamlto useangel3packages - Updated README
4.0.1 #
- Resolved static analysis warnings
4.0.0 #
- Migrated to support Dart >= 2.12 NNBD
- Importing
Optionalpackage is required for the ORM model
3.0.0 #
- Migrated to work with Dart >= 2.12 Non NNBD
2.5.0 #
- Support mutable models (again).
- Use
whereType()instead of chainingwhere()andcast(). - Support pulling fields from parent classes and interfaces.
- Only generate
constconstructors if all fields lack a setter. - Don't type-annotate initializing formals.
2.4.4 #
- Remove unnecessary
newandconst.
2.4.3 #
- Generate
CodecandConverterclasses. - Generate
toStringmethods. - Include original documentation comments from the model.
2.4.2 #
- Fix bug where enums didn't support default values.
- Stop emitting
@requiredon items with default values. - Create default
@SerializableFieldfor fields without them.
2.4.1+1 #
- Change
as Iterable<Map>to.cast<Map>.
2.4.1 #
- Support
serializesTo. - Don't emit
@requiredif there is a default value. - Deprecate
autoIdAndDateFields.
2.4.0 #
- Introduce
@SerializableField, and say goodbye to annotation hell. - Support custom (de)serializers.
- Allow passing of annotations to the generated class.
- Fixted TypeScript
refgenerator.
2.3.0 #
- Add
@DefaultValuesupport.
2.2.2 #
- Split out TS def builder, to emit to source.
2.2.1 #
- Explicit changes for assisting
angel_orm_generator.
2.2.0 #
- Build to
cache. - Only generate one
.g.dartfile. - Support for
Uint8List. - Use
.cast()forLists andMaps of non-Modeltypes.
2.1.2 #
- Add
declare moduleto generated TypeScript files.
2.1.1 #
- Generate
hashCode.
2.1.0 #
- Removed dependency on
package:id. - Update dependencies for Dart2Stable.
jsonModelBuildernow usesSharedPartBuilder, rather thanPartBuilder.
2.0.10 #
- Generate
XFields.allFieldsconstant. - No longer breaks in cases where
dynamicis present. - Call
toJsonintoMapon nested models. - Never generate named parameters from private fields.
- Use the new
@generatedSerializableto always find generated models.
2.0.9+4 #
- Remove
defaultsinbuild.yaml.
2.0.9+3 #
- Fix a cast error when self-referencing nested list expressions.
2.0.9+2 #
- Fix previously unseen cast errors with enums.
2.0.9+1 #
- Fix a cast error when deserializing nested model classes.
2.0.9 #
- Upgrade to
source_gen@^0.8.0.
2.0.8+3 #
- Don't fail on
nullintoMap. - Support self-referencing via
toJson().
2.0.8+2 #
- Better discern when custom methods disqualify classes
from
constprotection.
2.0.8+1 #
- Fix generation of
constconstructors with iterables.
2.0.8 #
- Now supports de/serialization of
enumtypes. - Generate
constconstructors when possible. - Remove
whereType, perform manual coercion. - Generate a
fromMapwith typecasting, for Dart 2's sake.
2.0.7 #
- Create unmodifiable Lists and Maps.
- Support
@requiredon fields. - Affix an
@immutableannotation to classes, ifpackage:metais imported. - Add
/// <reference path="..." />to TypeScript models.
2.0.6 #
- Support for using
abstractto create immutable model classes. - Add support for custom constructor parameters.
- Closed ##21 - better naming
of
Maptypes. - Added overridden
==operators.
2.0.5 #
- Deserialization now supports un-serialized
DateTime. - Better support for regular typed Lists and Maps in TypeScript.
2.0.4 #
- Fields in TypeScript definitions are now nullable by default.
2.0.3 #
- Added a
TypeScriptDefinitionBuilder.
2.0.2 #
- Generates an
XFieldsclass with the serialized names of all fields in a model classX. - Removed unnecessary named parameters from
XSerializer.fromMap.
2.0.1 #
- Ensured that
Listis only transformed if it generically references aModel.