Skip to content

v1.23.0

Choose a tag to compare

@gmpassos gmpassos released this 15 Oct 05:07
f5be02e
  • reflection_factory: ^2.11.0 → ^2.12.0, with reflection regenerated:
    its generated constructor invokers call constructors directly instead
    of through Function.apply.

  • Optimization: ClassReflectionEntityHandler.instantiateFromMapImpl
    resolves the values up front, with the same
    Json.defaultFieldValueResolver (by each field's type), and calls
    createInstanceFromMap(valuesResolved: true): constructors are called
    straight from the map, without reflection_factory's MethodInvocation
    building. The resolver path is used as before when the map has a key that
    isn't a field (e.g. a constructor parameter with another name), when a
    constructor parameter named as a field has another type than the field,
    or when a value doesn't resolve synchronously (or resolves to null).

    • Users benchmark (SQLite), alternated with 1.22.0: user/list +17–20%,
      user/byState +12–18%, user/byId +12–15%.
  • Fix: Json.defaultFieldValueResolver resolves:

    • An EntityReferenceList<T> field or parameter from a list of IDs,
      entities or entities maps (as an EntityReferenceList<T>). It gave a
      List, so instantiating with such a value failed.
    • A Set<T> field or parameter from a list or a set (as a Set<T>, with
      its elements resolved as a List<T>). It gave a List.
    • TypeInfo.toEntityReferenceList: also from entities in an untyped
      List (e.g. List<dynamic>).