diff --git a/CHANGELOG.md b/CHANGELOG.md index 84e37872a..c81bc3654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # OverReact Changelog ## Unreleased +- [#989] Optimize generated code to decrease dart2js compile size, saving ~577 bytes per component (when using `-03 --csp --minify`) - [#992] Fix compilation errors for legacy boilerplate defined in libraries with a Dart language version of >=3.0 ## 5.4.6 diff --git a/example/boilerplate_versions/dart2_only/basic_component1.over_react.g.dart b/example/boilerplate_versions/dart2_only/basic_component1.over_react.g.dart index 8603ac7e2..c662262a6 100644 --- a/example/boilerplate_versions/dart2_only/basic_component1.over_react.g.dart +++ b/example/boilerplate_versions/dart2_only/basic_component1.over_react.g.dart @@ -131,16 +131,11 @@ _$$BasicProps _$Basic([Map? backingProps]) => _$$BasicProps(backingProps); class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/example/boilerplate_versions/dart2_only/basic_component2.over_react.g.dart b/example/boilerplate_versions/dart2_only/basic_component2.over_react.g.dart index 669393f1f..818382854 100644 --- a/example/boilerplate_versions/dart2_only/basic_component2.over_react.g.dart +++ b/example/boilerplate_versions/dart2_only/basic_component2.over_react.g.dart @@ -121,25 +121,19 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map? backingProps]) => backingProps == null - ? _$$BasicProps$JsMap(JsBackedMap()) - : _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map? backingProps]) => _$$BasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$BasicProps extends _$BasicProps +class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - _$$BasicProps._(); - - factory _$$BasicProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicProps$PlainMap(backingMap); - } - } + _$$BasicProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -167,48 +161,15 @@ abstract class _$$BasicProps extends _$BasicProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$BasicProps$PlainMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$BasicProps$JsMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$Basic2Component extends Basic2Component { - late _$$BasicProps$JsMap _cachedTypedProps; + late _$$BasicProps _cachedTypedProps; @override - _$$BasicProps$JsMap get props => _cachedTypedProps; + _$$BasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -225,8 +186,8 @@ class _$Basic2Component extends Basic2Component { } @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$BasicProps$JsMap(backingMap); + _$$BasicProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$BasicProps(backingMap); @override _$$BasicProps typedPropsFactory(Map? backingMap) => _$$BasicProps(backingMap); diff --git a/lib/src/builder/codegen/component_generator.dart b/lib/src/builder/codegen/component_generator.dart index 729947189..d47b5905d 100644 --- a/lib/src/builder/codegen/component_generator.dart +++ b/lib/src/builder/codegen/component_generator.dart @@ -60,10 +60,10 @@ abstract class ComponentGenerator extends BoilerplateDeclarationGenerator { // implemented for Component2. // This implementation here is necessary so that mixin accesses aren't compiled as index$ax outputContentsBuffer - ..writeln(' ${nullSafety ? 'late ' : ''}${propsNames.jsMapImplName} _cachedTypedProps;') + ..writeln(' ${nullSafety ? 'late ' : ''}${propsNames.implName} _cachedTypedProps;') ..writeln() ..writeln(' @override') - ..writeln(' ${propsNames.jsMapImplName} get props => _cachedTypedProps;') + ..writeln(' ${propsNames.implName} get props => _cachedTypedProps;') ..writeln() ..writeln(' @override') ..writeln(' set props(Map value) {') @@ -81,8 +81,8 @@ abstract class ComponentGenerator extends BoilerplateDeclarationGenerator { ..writeln() ..writeln(' @override ') ..writeln( - ' ${propsNames.jsMapImplName} typedPropsFactoryJs(JsBackedMap${nullSafety ? '?' : ''} backingMap)' - ' => ${propsNames.jsMapImplName}(backingMap);') + ' ${propsNames.implName} typedPropsFactoryJs(JsBackedMap${nullSafety ? '?' : ''} backingMap)' + ' => ${propsNames.implName}(backingMap);') ..writeln(); } @@ -96,9 +96,9 @@ abstract class ComponentGenerator extends BoilerplateDeclarationGenerator { final stateNames = this.stateNames!; if (isComponent2) { outputContentsBuffer - ..writeln(' ${nullSafety ? 'late ' : ''}${stateNames.jsMapImplName} _cachedTypedState;') + ..writeln(' ${nullSafety ? 'late ' : ''}${stateNames.implName} _cachedTypedState;') ..writeln(' @override') - ..writeln(' ${stateNames.jsMapImplName} get state => _cachedTypedState;') + ..writeln(' ${stateNames.implName} get state => _cachedTypedState;') ..writeln() ..writeln(' @override') ..writeln(' set state(Map value) {') @@ -111,8 +111,8 @@ abstract class ComponentGenerator extends BoilerplateDeclarationGenerator { ..writeln() ..writeln(' @override ') ..writeln( - ' ${stateNames.jsMapImplName} typedStateFactoryJs(JsBackedMap${nullSafety ? '?' : ''} backingMap)' - ' => ${stateNames.jsMapImplName}(backingMap);') + ' ${stateNames.implName} typedStateFactoryJs(JsBackedMap${nullSafety ? '?' : ''} backingMap)' + ' => ${stateNames.implName}(backingMap);') ..writeln(); } outputContentsBuffer diff --git a/lib/src/builder/codegen/names.dart b/lib/src/builder/codegen/names.dart index 419b3fb94..c370d812a 100644 --- a/lib/src/builder/codegen/names.dart +++ b/lib/src/builder/codegen/names.dart @@ -143,30 +143,6 @@ class TypedMapNames { /// | Mixin-based | FooProps | $FooProps | String get implName => '$_prefix$privateSourcePrefix\$$_normalizedName'; - /// The name of the generated concrete props/state implementation subclass - /// that can be backed by any Map. - /// - /// Example: - /// - /// | Version | [consumerName] | Value | - /// |-------------|----------------|-----------------------| - /// | Legacy | _$FooProps | _$$FooProps$PlainMap | - /// | Legacy | _$_FooProps | _$$_FooProps$PlainMap | - /// | Mixin-based | FooProps | $FooProps$PlainMap | - String get plainMapImplName => '$implName\$PlainMap'; - - /// The name of the generated concrete props/state implementation subclass - /// that can be backed only by JsBackedMaps. - /// - /// Example: - /// - /// | Version | [consumerName] | Value | - /// |-------------|----------------|--------------------| - /// | Legacy | _$FooProps | _$$FooProps$JsMap | - /// | Legacy | _$_FooProps | _$$_FooProps$JsMap | - /// | Mixin-based | FooProps | $FooProps$JsMap | - String get jsMapImplName => '$implName\$JsMap'; - /// The name of the consumable props/state class. /// /// - For legacy backwards compatible boilerplate, this is the companion class. diff --git a/lib/src/builder/codegen/typed_map_impl_generator.dart b/lib/src/builder/codegen/typed_map_impl_generator.dart index e27968925..887c75e67 100644 --- a/lib/src/builder/codegen/typed_map_impl_generator.dart +++ b/lib/src/builder/codegen/typed_map_impl_generator.dart @@ -95,18 +95,10 @@ abstract class TypedMapImplGenerator extends BoilerplateDeclarationGenerator { void _generateFactory() { assert(factoryNames.length == 1, 'factoryNames must have a length of 1'); - outputContentsBuffer.write( - '${names.implName} ${factoryNames.first.implName}([Map${nullSafety ? '?' : ''} backingProps]) => '); - - if (!isComponent2) { - /// _$$FooProps _$Foo([Map backingProps]) => _$$FooProps(backingProps); - outputContentsBuffer.writeln('${names.implName}(backingProps);'); - } else { - /// _$$FooProps _$Foo([Map backingProps]) => backingProps == null ? $jsMapImplName(JsBackedMap()) : _$$FooProps(backingProps); - // Optimize this case for when backingProps is null to promote inlining of `jsMapImplName` typing - outputContentsBuffer.writeln( - 'backingProps == null ? ${names.jsMapImplName}(JsBackedMap()) : ${names.implName}(backingProps);'); - } + // _$$FooProps _$Foo([Map? backingProps]) => _$$FooProps(backingProps); + outputContentsBuffer.writeln( + '${names.implName} ${factoryNames.first.implName}([Map${nullSafety ? '?' : ''} backingProps])' + ' => ${names.implName}(backingProps);'); } String _generateImplClassHeader(); @@ -168,54 +160,20 @@ abstract class TypedMapImplGenerator extends BoilerplateDeclarationGenerator { 'componentFactoryName/propKeyNamespace must not be specified for state'); } } - - final classDeclaration = StringBuffer(); - if (isComponent2) { - // This class will only have a factory constructor that instantiates one - // of two subclasses. - classDeclaration.write('abstract '); - } - - classDeclaration - ..write(_generateImplClassHeader()) - ..write(' {'); - final propsOrState = isProps ? 'props' : 'state'; - // Class declaration final buffer = StringBuffer() + // Class declaration ..writeln('// Concrete $propsOrState implementation.') ..writeln('//') ..writeln( '// Implements constructor and backing map${isProps ? ', and links up to generated component factory' : ''}.') ..write(internalGeneratedMemberDeprecationLine()) - ..writeln(classDeclaration); - - // Constructors - if (isComponent2) { - buffer - ..writeln(' ${names.implName}._();') - ..writeln() - ..writeln(' factory ${names.implName}(Map${nullSafety ? '?' : ''} backingMap) {') - ..writeln(' if (backingMap == null || backingMap is JsBackedMap) {') - ..writeln( - ' return ${names.jsMapImplName}(backingMap as JsBackedMap${nullSafety ? '?' : ''});') - ..writeln(' } else {') - ..writeln(' return ${names.plainMapImplName}(backingMap);') - ..writeln(' }') - ..writeln(' }'); - } else { - buffer - ..writeln( - ' // This initializer of `_$propsOrState` to an empty map, as well as the reassignment') - ..writeln( - ' // of `_$propsOrState` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217') - // TODO need to remove this workaround once https://github.com/dart-lang/sdk/issues/36217 is fixed get nice dart2js output - ..writeln( - ' ${names.implName}(Map${nullSafety ? '?' : ''} backingMap) : this._$propsOrState = {} {') - ..writeln(' this._$propsOrState = backingMap ?? {};') - ..writeln(' }'); - } + ..write(_generateImplClassHeader()) + ..writeln(' {') + // Constructor + ..writeln(' ${names.implName}([Map${nullSafety ? '?' : ''} backingMap])' + ' : this.$propsOrState = backingMap ?? JsBackedMap();'); // This needs to be a top-level member and not a static member, and it needs to be unique // to avoid collisions across typed map impls within the library, potentially in multiple parts. @@ -223,15 +181,11 @@ abstract class TypedMapImplGenerator extends BoilerplateDeclarationGenerator { final topLevelGetPropKeyAliasName = '_\$getPropKey\$${names.implName}'; // Members - if (!isComponent2) { - buffer - ..writeln() - ..writeln(' /// The backing $propsOrState map proxied by this class.') - ..writeln(' @override') - ..writeln(' Map get $propsOrState => _$propsOrState;') - ..writeln(' Map _$propsOrState;'); - } buffer + ..writeln() + ..writeln(' /// The backing $propsOrState map proxied by this class.') + ..writeln(' @override') + ..writeln(' final Map $propsOrState;') ..writeln() ..writeln( ' /// Let `${isProps ? 'UiProps' : 'UiState'}` internals know that this class has been generated.') @@ -296,38 +250,6 @@ abstract class TypedMapImplGenerator extends BoilerplateDeclarationGenerator { ..writeln('const $topLevelGetPropKeyAliasName = getPropKey;'); } - // Component2-specific classes - if (isComponent2) { - // TODO need to remove this workaround once https://github.com/dart-lang/sdk/issues/36217 is fixed get nice dart2js output - buffer - ..writeln() - ..writeln(''' -// Concrete $propsOrState implementation that can be backed by any [Map]. -${internalGeneratedMemberDeprecationLine()}class ${names.plainMapImplName}$typeParamsOnClass extends ${names.implName}$typeParamsOnSuper { - // This initializer of `_$propsOrState` to an empty map, as well as the reassignment - // of `_$propsOrState` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - ${names.plainMapImplName}(Map${nullSafety ? '?' : ''} backingMap) : this._$propsOrState = {}, super._() { - this._$propsOrState = backingMap ?? {}; - } - /// The backing $propsOrState map proxied by this class. - @override - Map get $propsOrState => _$propsOrState; - Map _$propsOrState; -} -// Concrete $propsOrState implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -${internalGeneratedMemberDeprecationLine()}class ${names.jsMapImplName}$typeParamsOnClass extends ${names.implName}$typeParamsOnSuper { - // This initializer of `_$propsOrState` to an empty map, as well as the reassignment - // of `_$propsOrState` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - ${names.jsMapImplName}(JsBackedMap${nullSafety ? '?' : ''} backingMap) : this._$propsOrState = JsBackedMap(), super._() { - this._$propsOrState = backingMap ?? JsBackedMap(); - } - /// The backing $propsOrState map proxied by this class. - @override - JsBackedMap get $propsOrState => _$propsOrState; - JsBackedMap _$propsOrState; -}'''); - } return buffer.toString(); } } @@ -488,7 +410,7 @@ class _TypedMapImplGenerator extends TypedMapImplGenerator { '${factoryName.privateConfigName} = UiFactoryConfig(\n' 'propsFactory: PropsFactory(\n' 'map: (map) => ${names.implName}(map),\n' - 'jsMap: (map) => ${names.jsMapImplName}(map),),\n' + 'jsMap: (map) => ${names.implName}(map),),\n' 'displayName: \'${factoryName.consumerName}\');\n\n' '@Deprecated(r\'Use the private variable, ${factoryName.privateConfigName}, instead \'\n' '\'and update the `over_react` lower bound to version 4.1.0. \'\n' diff --git a/lib/src/component/_deprecated/error_boundary.over_react.g.dart b/lib/src/component/_deprecated/error_boundary.over_react.g.dart index 3150fb95e..5cdc369aa 100644 --- a/lib/src/component/_deprecated/error_boundary.over_react.g.dart +++ b/lib/src/component/_deprecated/error_boundary.over_react.g.dart @@ -44,25 +44,20 @@ class ErrorBoundaryProps extends _$ErrorBoundaryProps } _$$ErrorBoundaryProps _$ErrorBoundary([Map? backingProps]) => - backingProps == null - ? _$$ErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$ErrorBoundaryProps(backingProps); + _$$ErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ErrorBoundaryProps extends _$ErrorBoundaryProps +class _$$ErrorBoundaryProps extends _$ErrorBoundaryProps with _$ErrorBoundaryPropsAccessorsMixin implements ErrorBoundaryProps { - _$$ErrorBoundaryProps._(); - - factory _$$ErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$ErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -93,40 +88,6 @@ abstract class _$$ErrorBoundaryProps extends _$ErrorBoundaryProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ErrorBoundaryProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$ErrorBoundaryProps$PlainMap extends _$$ErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ErrorBoundaryProps$JsMap extends _$$ErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - @Deprecated( 'Use the `ErrorBoundaryState` mixin exported from `package:over_react/components.dart` instead. Will be removed in the 4.0.0 release of over_react.') mixin _$ErrorBoundaryStateAccessorsMixin implements _$ErrorBoundaryState { @@ -154,55 +115,19 @@ class ErrorBoundaryState extends _$ErrorBoundaryState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ErrorBoundaryState extends _$ErrorBoundaryState +class _$$ErrorBoundaryState extends _$ErrorBoundaryState with _$ErrorBoundaryStateAccessorsMixin implements ErrorBoundaryState { - _$$ErrorBoundaryState._(); - - factory _$$ErrorBoundaryState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ErrorBoundaryState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ErrorBoundaryState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$ErrorBoundaryState$PlainMap extends _$$ErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$ErrorBoundaryState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ErrorBoundaryState$JsMap extends _$$ErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -210,10 +135,10 @@ class _$$ErrorBoundaryState$JsMap extends _$$ErrorBoundaryState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ErrorBoundaryComponent extends ErrorBoundaryComponent { - late _$$ErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$ErrorBoundaryProps _cachedTypedProps; @override - _$$ErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$ErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -230,16 +155,16 @@ class _$ErrorBoundaryComponent extends ErrorBoundaryComponent { } @override - _$$ErrorBoundaryProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ErrorBoundaryProps$JsMap(backingMap); + _$$ErrorBoundaryProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ErrorBoundaryProps(backingMap); @override _$$ErrorBoundaryProps typedPropsFactory(Map? backingMap) => _$$ErrorBoundaryProps(backingMap); - late _$$ErrorBoundaryState$JsMap _cachedTypedState; + late _$$ErrorBoundaryState _cachedTypedState; @override - _$$ErrorBoundaryState$JsMap get state => _cachedTypedState; + _$$ErrorBoundaryState get state => _cachedTypedState; @override set state(Map value) { @@ -252,8 +177,8 @@ class _$ErrorBoundaryComponent extends ErrorBoundaryComponent { } @override - _$$ErrorBoundaryState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$ErrorBoundaryState$JsMap(backingMap); + _$$ErrorBoundaryState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$ErrorBoundaryState(backingMap); @override _$$ErrorBoundaryState typedStateFactory(Map? backingMap) => diff --git a/lib/src/component/_deprecated/error_boundary_recoverable.over_react.g.dart b/lib/src/component/_deprecated/error_boundary_recoverable.over_react.g.dart index 2e46527c9..3e0222efa 100644 --- a/lib/src/component/_deprecated/error_boundary_recoverable.over_react.g.dart +++ b/lib/src/component/_deprecated/error_boundary_recoverable.over_react.g.dart @@ -46,26 +46,20 @@ class RecoverableErrorBoundaryProps extends _$RecoverableErrorBoundaryProps _$$RecoverableErrorBoundaryProps _$RecoverableErrorBoundary( [Map? backingProps]) => - backingProps == null - ? _$$RecoverableErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$RecoverableErrorBoundaryProps(backingProps); + _$$RecoverableErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$RecoverableErrorBoundaryProps - extends _$RecoverableErrorBoundaryProps +class _$$RecoverableErrorBoundaryProps extends _$RecoverableErrorBoundaryProps with _$RecoverableErrorBoundaryPropsAccessorsMixin implements RecoverableErrorBoundaryProps { - _$$RecoverableErrorBoundaryProps._(); - - factory _$$RecoverableErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$RecoverableErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$RecoverableErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$RecoverableErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -89,42 +83,6 @@ abstract class _$$RecoverableErrorBoundaryProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$RecoverableErrorBoundaryProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$RecoverableErrorBoundaryProps$PlainMap - extends _$$RecoverableErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$RecoverableErrorBoundaryProps$JsMap - extends _$$RecoverableErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - @Deprecated( 'For internal use with deprecated ErrorBoundary components only. Remove in the 4.0.0 release.') mixin _$RecoverableErrorBoundaryStateAccessorsMixin @@ -153,58 +111,19 @@ class RecoverableErrorBoundaryState extends _$RecoverableErrorBoundaryState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$RecoverableErrorBoundaryState - extends _$RecoverableErrorBoundaryState +class _$$RecoverableErrorBoundaryState extends _$RecoverableErrorBoundaryState with _$RecoverableErrorBoundaryStateAccessorsMixin implements RecoverableErrorBoundaryState { - _$$RecoverableErrorBoundaryState._(); - - factory _$$RecoverableErrorBoundaryState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$RecoverableErrorBoundaryState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$RecoverableErrorBoundaryState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$RecoverableErrorBoundaryState$PlainMap - extends _$$RecoverableErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$RecoverableErrorBoundaryState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$RecoverableErrorBoundaryState$JsMap - extends _$$RecoverableErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -213,10 +132,10 @@ class _$$RecoverableErrorBoundaryState$JsMap // generated for the associated props class. class _$RecoverableErrorBoundaryComponent extends RecoverableErrorBoundaryComponent { - late _$$RecoverableErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$RecoverableErrorBoundaryProps _cachedTypedProps; @override - _$$RecoverableErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$RecoverableErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -233,17 +152,17 @@ class _$RecoverableErrorBoundaryComponent } @override - _$$RecoverableErrorBoundaryProps$JsMap typedPropsFactoryJs( + _$$RecoverableErrorBoundaryProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$RecoverableErrorBoundaryProps$JsMap(backingMap); + _$$RecoverableErrorBoundaryProps(backingMap); @override _$$RecoverableErrorBoundaryProps typedPropsFactory(Map? backingMap) => _$$RecoverableErrorBoundaryProps(backingMap); - late _$$RecoverableErrorBoundaryState$JsMap _cachedTypedState; + late _$$RecoverableErrorBoundaryState _cachedTypedState; @override - _$$RecoverableErrorBoundaryState$JsMap get state => _cachedTypedState; + _$$RecoverableErrorBoundaryState get state => _cachedTypedState; @override set state(Map value) { @@ -256,9 +175,9 @@ class _$RecoverableErrorBoundaryComponent } @override - _$$RecoverableErrorBoundaryState$JsMap typedStateFactoryJs( + _$$RecoverableErrorBoundaryState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$RecoverableErrorBoundaryState$JsMap(backingMap); + _$$RecoverableErrorBoundaryState(backingMap); @override _$$RecoverableErrorBoundaryState typedStateFactory(Map? backingMap) => diff --git a/lib/src/component/_deprecated/resize_sensor.over_react.g.dart b/lib/src/component/_deprecated/resize_sensor.over_react.g.dart index 14781c3fe..bb4226c72 100644 --- a/lib/src/component/_deprecated/resize_sensor.over_react.g.dart +++ b/lib/src/component/_deprecated/resize_sensor.over_react.g.dart @@ -42,25 +42,21 @@ class ResizeSensorProps extends _$ResizeSensorProps static const PropsMeta meta = _$metaForResizeSensorProps; } -_$$ResizeSensorProps _$ResizeSensor([Map? backingProps]) => backingProps == null - ? _$$ResizeSensorProps$JsMap(JsBackedMap()) - : _$$ResizeSensorProps(backingProps); +_$$ResizeSensorProps _$ResizeSensor([Map? backingProps]) => + _$$ResizeSensorProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ResizeSensorProps extends _$ResizeSensorProps +class _$$ResizeSensorProps extends _$ResizeSensorProps with _$ResizeSensorPropsAccessorsMixin implements ResizeSensorProps { - _$$ResizeSensorProps._(); - - factory _$$ResizeSensorProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ResizeSensorProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ResizeSensorProps$PlainMap(backingMap); - } - } + _$$ResizeSensorProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -85,48 +81,15 @@ abstract class _$$ResizeSensorProps extends _$ResizeSensorProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ResizeSensorProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ResizeSensorProps$PlainMap extends _$$ResizeSensorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ResizeSensorProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ResizeSensorProps$JsMap extends _$$ResizeSensorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ResizeSensorProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ResizeSensorComponent extends ResizeSensorComponent { - late _$$ResizeSensorProps$JsMap _cachedTypedProps; + late _$$ResizeSensorProps _cachedTypedProps; @override - _$$ResizeSensorProps$JsMap get props => _cachedTypedProps; + _$$ResizeSensorProps get props => _cachedTypedProps; @override set props(Map value) { @@ -143,8 +106,8 @@ class _$ResizeSensorComponent extends ResizeSensorComponent { } @override - _$$ResizeSensorProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ResizeSensorProps$JsMap(backingMap); + _$$ResizeSensorProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ResizeSensorProps(backingMap); @override _$$ResizeSensorProps typedPropsFactory(Map? backingMap) => diff --git a/lib/src/component/abstract_transition_props.over_react.g.dart b/lib/src/component/abstract_transition_props.over_react.g.dart index a0fa441d0..3eb7a8ba4 100644 --- a/lib/src/component/abstract_transition_props.over_react.g.dart +++ b/lib/src/component/abstract_transition_props.over_react.g.dart @@ -119,29 +119,24 @@ const PropsMeta _$metaForTransitionPropsMixin = PropsMeta( ); _$$TransitionPropsMixin _$TransitionPropsMapView([Map? backingProps]) => - backingProps == null - ? _$$TransitionPropsMixin$JsMap(JsBackedMap()) - : _$$TransitionPropsMixin(backingProps); + _$$TransitionPropsMixin(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TransitionPropsMixin extends UiProps +class _$$TransitionPropsMixin extends UiProps with TransitionPropsMixin, // If this generated mixin is undefined, it's likely because TransitionPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TransitionPropsMixin, and check that $TransitionPropsMixin is exported/imported properly. $TransitionPropsMixin { - _$$TransitionPropsMixin._(); + _$$TransitionPropsMixin([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$TransitionPropsMixin(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TransitionPropsMixin$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TransitionPropsMixin$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -166,40 +161,3 @@ abstract class _$$TransitionPropsMixin extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TransitionPropsMixin = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TransitionPropsMixin$PlainMap extends _$$TransitionPropsMixin { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionPropsMixin$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TransitionPropsMixin$JsMap extends _$$TransitionPropsMixin { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionPropsMixin$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/lib/src/component/dummy_component2.over_react.g.dart b/lib/src/component/dummy_component2.over_react.g.dart index 5cbc2ae6f..0cd66ac67 100644 --- a/lib/src/component/dummy_component2.over_react.g.dart +++ b/lib/src/component/dummy_component2.over_react.g.dart @@ -37,25 +37,19 @@ class _Dummy2Props extends _$_Dummy2Props with _$_Dummy2PropsAccessorsMixin { static const PropsMeta meta = _$metaFor_Dummy2Props; } -_$$_Dummy2Props _$_Dummy2([Map? backingProps]) => backingProps == null - ? _$$_Dummy2Props$JsMap(JsBackedMap()) - : _$$_Dummy2Props(backingProps); +_$$_Dummy2Props _$_Dummy2([Map? backingProps]) => _$$_Dummy2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$_Dummy2Props extends _$_Dummy2Props +class _$$_Dummy2Props extends _$_Dummy2Props with _$_Dummy2PropsAccessorsMixin implements _Dummy2Props { - _$$_Dummy2Props._(); - - factory _$$_Dummy2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$_Dummy2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$_Dummy2Props$PlainMap(backingMap); - } - } + _$$_Dummy2Props([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -79,48 +73,15 @@ abstract class _$$_Dummy2Props extends _$_Dummy2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$_Dummy2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$_Dummy2Props$PlainMap extends _$$_Dummy2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$_Dummy2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$_Dummy2Props$JsMap extends _$$_Dummy2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$_Dummy2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$_Dummy2Component extends _Dummy2Component { - late _$$_Dummy2Props$JsMap _cachedTypedProps; + late _$$_Dummy2Props _cachedTypedProps; @override - _$$_Dummy2Props$JsMap get props => _cachedTypedProps; + _$$_Dummy2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -137,8 +98,8 @@ class _$_Dummy2Component extends _Dummy2Component { } @override - _$$_Dummy2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$_Dummy2Props$JsMap(backingMap); + _$$_Dummy2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$_Dummy2Props(backingMap); @override _$$_Dummy2Props typedPropsFactory(Map? backingMap) => diff --git a/lib/src/component/error_boundary.over_react.g.dart b/lib/src/component/error_boundary.over_react.g.dart index 239f9820e..a617e82c2 100644 --- a/lib/src/component/error_boundary.over_react.g.dart +++ b/lib/src/component/error_boundary.over_react.g.dart @@ -22,29 +22,24 @@ final $ErrorBoundaryComponentFactory = registerComponent2( ); _$$ErrorBoundaryProps _$ErrorBoundary([Map? backingProps]) => - backingProps == null - ? _$$ErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$ErrorBoundaryProps(backingProps); + _$$ErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ErrorBoundaryProps extends UiProps +class _$$ErrorBoundaryProps extends UiProps with ErrorBoundaryProps, // If this generated mixin is undefined, it's likely because ErrorBoundaryProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ErrorBoundaryProps, and check that $ErrorBoundaryProps is exported/imported properly. $ErrorBoundaryProps { - _$$ErrorBoundaryProps._(); - - factory _$$ErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$ErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -82,103 +77,26 @@ abstract class _$$ErrorBoundaryProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ErrorBoundaryProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ErrorBoundaryProps$PlainMap extends _$$ErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ErrorBoundaryProps$JsMap extends _$$ErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ErrorBoundaryState extends UiState +class _$$ErrorBoundaryState extends UiState with ErrorBoundaryState, // If this generated mixin is undefined, it's likely because ErrorBoundaryState is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of ErrorBoundaryState, and check that $ErrorBoundaryState is exported/imported properly. $ErrorBoundaryState { - _$$ErrorBoundaryState._(); - - factory _$$ErrorBoundaryState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ErrorBoundaryState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ErrorBoundaryState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ErrorBoundaryState$PlainMap extends _$$ErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$ErrorBoundaryState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ErrorBoundaryState$JsMap extends _$$ErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ErrorBoundaryState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -188,10 +106,10 @@ class _$$ErrorBoundaryState$JsMap extends _$$ErrorBoundaryState { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$ErrorBoundaryComponent extends ErrorBoundaryComponent { - late _$$ErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$ErrorBoundaryProps _cachedTypedProps; @override - _$$ErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$ErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -208,16 +126,16 @@ class _$ErrorBoundaryComponent extends ErrorBoundaryComponent { } @override - _$$ErrorBoundaryProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ErrorBoundaryProps$JsMap(backingMap); + _$$ErrorBoundaryProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ErrorBoundaryProps(backingMap); @override _$$ErrorBoundaryProps typedPropsFactory(Map? backingMap) => _$$ErrorBoundaryProps(backingMap); - late _$$ErrorBoundaryState$JsMap _cachedTypedState; + late _$$ErrorBoundaryState _cachedTypedState; @override - _$$ErrorBoundaryState$JsMap get state => _cachedTypedState; + _$$ErrorBoundaryState get state => _cachedTypedState; @override set state(Map value) { @@ -230,8 +148,8 @@ class _$ErrorBoundaryComponent extends ErrorBoundaryComponent { } @override - _$$ErrorBoundaryState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$ErrorBoundaryState$JsMap(backingMap); + _$$ErrorBoundaryState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$ErrorBoundaryState(backingMap); @override _$$ErrorBoundaryState typedStateFactory(Map? backingMap) => diff --git a/lib/src/component/error_boundary_recoverable.over_react.g.dart b/lib/src/component/error_boundary_recoverable.over_react.g.dart index bdbfef917..32bfca9cd 100644 --- a/lib/src/component/error_boundary_recoverable.over_react.g.dart +++ b/lib/src/component/error_boundary_recoverable.over_react.g.dart @@ -23,31 +23,26 @@ final $RecoverableErrorBoundaryComponentFactory = registerComponent2( _$$RecoverableErrorBoundaryProps _$RecoverableErrorBoundary( [Map? backingProps]) => - backingProps == null - ? _$$RecoverableErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$RecoverableErrorBoundaryProps(backingProps); + _$$RecoverableErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$RecoverableErrorBoundaryProps extends UiProps +class _$$RecoverableErrorBoundaryProps extends UiProps with v2.ErrorBoundaryProps, // If this generated mixin is undefined, it's likely because v2.ErrorBoundaryProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of v2.ErrorBoundaryProps, and check that v2.$ErrorBoundaryProps is exported/imported properly. v2.$ErrorBoundaryProps implements RecoverableErrorBoundaryProps { - _$$RecoverableErrorBoundaryProps._(); + _$$RecoverableErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$RecoverableErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$RecoverableErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$RecoverableErrorBoundaryProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -85,109 +80,28 @@ abstract class _$$RecoverableErrorBoundaryProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$RecoverableErrorBoundaryProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$RecoverableErrorBoundaryProps$PlainMap - extends _$$RecoverableErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$RecoverableErrorBoundaryProps$JsMap - extends _$$RecoverableErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$RecoverableErrorBoundaryState extends UiState +class _$$RecoverableErrorBoundaryState extends UiState with v2.ErrorBoundaryState, // If this generated mixin is undefined, it's likely because v2.ErrorBoundaryState is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of v2.ErrorBoundaryState, and check that v2.$ErrorBoundaryState is exported/imported properly. v2.$ErrorBoundaryState implements RecoverableErrorBoundaryState { - _$$RecoverableErrorBoundaryState._(); - - factory _$$RecoverableErrorBoundaryState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$RecoverableErrorBoundaryState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$RecoverableErrorBoundaryState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$RecoverableErrorBoundaryState$PlainMap - extends _$$RecoverableErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$RecoverableErrorBoundaryState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$RecoverableErrorBoundaryState$JsMap - extends _$$RecoverableErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$RecoverableErrorBoundaryState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -198,10 +112,10 @@ class _$$RecoverableErrorBoundaryState$JsMap ' Do not reference it in your code, as it may change at any time.') class _$RecoverableErrorBoundaryComponent extends RecoverableErrorBoundaryComponent { - late _$$RecoverableErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$RecoverableErrorBoundaryProps _cachedTypedProps; @override - _$$RecoverableErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$RecoverableErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -218,17 +132,17 @@ class _$RecoverableErrorBoundaryComponent } @override - _$$RecoverableErrorBoundaryProps$JsMap typedPropsFactoryJs( + _$$RecoverableErrorBoundaryProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$RecoverableErrorBoundaryProps$JsMap(backingMap); + _$$RecoverableErrorBoundaryProps(backingMap); @override _$$RecoverableErrorBoundaryProps typedPropsFactory(Map? backingMap) => _$$RecoverableErrorBoundaryProps(backingMap); - late _$$RecoverableErrorBoundaryState$JsMap _cachedTypedState; + late _$$RecoverableErrorBoundaryState _cachedTypedState; @override - _$$RecoverableErrorBoundaryState$JsMap get state => _cachedTypedState; + _$$RecoverableErrorBoundaryState get state => _cachedTypedState; @override set state(Map value) { @@ -241,9 +155,9 @@ class _$RecoverableErrorBoundaryComponent } @override - _$$RecoverableErrorBoundaryState$JsMap typedStateFactoryJs( + _$$RecoverableErrorBoundaryState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$RecoverableErrorBoundaryState$JsMap(backingMap); + _$$RecoverableErrorBoundaryState(backingMap); @override _$$RecoverableErrorBoundaryState typedStateFactory(Map? backingMap) => diff --git a/lib/src/component/fragment_component.over_react.g.dart b/lib/src/component/fragment_component.over_react.g.dart index 68dee239e..98ac4b89c 100644 --- a/lib/src/component/fragment_component.over_react.g.dart +++ b/lib/src/component/fragment_component.over_react.g.dart @@ -10,7 +10,7 @@ part of 'fragment_component.dart'; final UiFactoryConfig<_$$FragmentProps> _$FragmentConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$FragmentProps(map), - jsMap: (map) => _$$FragmentProps$JsMap(map), + jsMap: (map) => _$$FragmentProps(map), ), displayName: 'Fragment'); @@ -24,16 +24,13 @@ final UiFactoryConfig<_$$FragmentProps> $FragmentConfig = _$FragmentConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$FragmentProps extends UiProps implements FragmentProps { - _$$FragmentProps._(); +class _$$FragmentProps extends UiProps implements FragmentProps { + _$$FragmentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$FragmentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FragmentProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FragmentProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -54,40 +51,3 @@ abstract class _$$FragmentProps extends UiProps implements FragmentProps { /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FragmentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$FragmentProps$PlainMap extends _$$FragmentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FragmentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$FragmentProps$JsMap extends _$$FragmentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FragmentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/lib/src/component/prop_mixins.dart b/lib/src/component/prop_mixins.dart index 2eb2d45ab..5d7abf79e 100644 --- a/lib/src/component/prop_mixins.dart +++ b/lib/src/component/prop_mixins.dart @@ -275,8 +275,7 @@ abstract class _$UbiquitousDomPropsMixin { /// (Button() /// ..aria.controls = 'my_popover' /// )('Open popover') - @Accessor(doNotGenerate: true) - late final AriaPropsMixin aria = AriaPropsMapView(props); + AriaPropsMixin get aria => AriaPropsMapView(props); /// A view into this map that can be used to access DOM props, for convenience. /// @@ -285,8 +284,7 @@ abstract class _$UbiquitousDomPropsMixin { /// (Tab() /// ..dom.draggable = true /// )('Untitled Document') - @Accessor(doNotGenerate: true) - late final DomPropsMixin dom = DomProps(null, props); + DomPropsMixin get dom => DomProps(null, props); /// Whether the element if focusable. /// Must be a valid integer or String of valid integer. diff --git a/lib/src/component/prop_mixins.over_react.g.dart b/lib/src/component/prop_mixins.over_react.g.dart index 9f549fecc..1de5e3906 100644 --- a/lib/src/component/prop_mixins.over_react.g.dart +++ b/lib/src/component/prop_mixins.over_react.g.dart @@ -6792,11 +6792,9 @@ mixin UbiquitousDomPropsMixin implements _$UbiquitousDomPropsMixin { static const PropsMeta meta = _$metaForUbiquitousDomPropsMixin; @override - @Accessor(doNotGenerate: true) - late final AriaPropsMixin aria = AriaPropsMapView(props); + AriaPropsMixin get aria => AriaPropsMapView(props); @override - @Accessor(doNotGenerate: true) - late final DomPropsMixin dom = DomProps(null, props); + DomPropsMixin get dom => DomProps(null, props); @override Map? get style => _conditionallyUnconvertStyle(_raw$UbiquitousDomProps$style); diff --git a/lib/src/component/resize_sensor.over_react.g.dart b/lib/src/component/resize_sensor.over_react.g.dart index b29872253..1ad9ee29f 100644 --- a/lib/src/component/resize_sensor.over_react.g.dart +++ b/lib/src/component/resize_sensor.over_react.g.dart @@ -20,29 +20,25 @@ final $ResizeSensorComponentFactory = registerComponent2( parentType: null, ); -_$$ResizeSensorProps _$ResizeSensor([Map? backingProps]) => backingProps == null - ? _$$ResizeSensorProps$JsMap(JsBackedMap()) - : _$$ResizeSensorProps(backingProps); +_$$ResizeSensorProps _$ResizeSensor([Map? backingProps]) => + _$$ResizeSensorProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ResizeSensorProps extends UiProps +class _$$ResizeSensorProps extends UiProps with ResizeSensorProps, // If this generated mixin is undefined, it's likely because ResizeSensorProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ResizeSensorProps, and check that $ResizeSensorProps is exported/imported properly. $ResizeSensorProps { - _$$ResizeSensorProps._(); + _$$ResizeSensorProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$ResizeSensorProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ResizeSensorProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ResizeSensorProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -77,43 +73,6 @@ abstract class _$$ResizeSensorProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ResizeSensorProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ResizeSensorProps$PlainMap extends _$$ResizeSensorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ResizeSensorProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ResizeSensorProps$JsMap extends _$$ResizeSensorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ResizeSensorProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -121,10 +80,10 @@ class _$$ResizeSensorProps$JsMap extends _$$ResizeSensorProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$ResizeSensorComponent extends ResizeSensorComponent { - late _$$ResizeSensorProps$JsMap _cachedTypedProps; + late _$$ResizeSensorProps _cachedTypedProps; @override - _$$ResizeSensorProps$JsMap get props => _cachedTypedProps; + _$$ResizeSensorProps get props => _cachedTypedProps; @override set props(Map value) { @@ -141,8 +100,8 @@ class _$ResizeSensorComponent extends ResizeSensorComponent { } @override - _$$ResizeSensorProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ResizeSensorProps$JsMap(backingMap); + _$$ResizeSensorProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ResizeSensorProps(backingMap); @override _$$ResizeSensorProps typedPropsFactory(Map? backingMap) => diff --git a/lib/src/component/strictmode_component.over_react.g.dart b/lib/src/component/strictmode_component.over_react.g.dart index a26e27159..70b548cea 100644 --- a/lib/src/component/strictmode_component.over_react.g.dart +++ b/lib/src/component/strictmode_component.over_react.g.dart @@ -10,7 +10,7 @@ part of 'strictmode_component.dart'; final UiFactoryConfig<_$$StrictModeProps> _$StrictModeConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$StrictModeProps(map), - jsMap: (map) => _$$StrictModeProps$JsMap(map), + jsMap: (map) => _$$StrictModeProps(map), ), displayName: 'StrictMode'); @@ -25,16 +25,13 @@ final UiFactoryConfig<_$$StrictModeProps> $StrictModeConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$StrictModeProps extends UiProps implements StrictModeProps { - _$$StrictModeProps._(); +class _$$StrictModeProps extends UiProps implements StrictModeProps { + _$$StrictModeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$StrictModeProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$StrictModeProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$StrictModeProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -56,40 +53,3 @@ abstract class _$$StrictModeProps extends UiProps implements StrictModeProps { /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$StrictModeProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$StrictModeProps$PlainMap extends _$$StrictModeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StrictModeProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$StrictModeProps$JsMap extends _$$StrictModeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StrictModeProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/lib/src/component/suspense_component.over_react.g.dart b/lib/src/component/suspense_component.over_react.g.dart index a870e3998..eea0a3414 100644 --- a/lib/src/component/suspense_component.over_react.g.dart +++ b/lib/src/component/suspense_component.over_react.g.dart @@ -46,7 +46,7 @@ const PropsMeta _$metaForSuspensePropsMixin = PropsMeta( final UiFactoryConfig<_$$SuspenseProps> _$SuspenseConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$SuspenseProps(map), - jsMap: (map) => _$$SuspenseProps$JsMap(map), + jsMap: (map) => _$$SuspenseProps(map), ), displayName: 'Suspense'); @@ -60,22 +60,19 @@ final UiFactoryConfig<_$$SuspenseProps> $SuspenseConfig = _$SuspenseConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SuspenseProps extends UiProps +class _$$SuspenseProps extends UiProps with SuspensePropsMixin, // If this generated mixin is undefined, it's likely because SuspensePropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SuspensePropsMixin, and check that $SuspensePropsMixin is exported/imported properly. $SuspensePropsMixin implements SuspenseProps { - _$$SuspenseProps._(); + _$$SuspenseProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$SuspenseProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SuspenseProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$SuspenseProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -99,40 +96,3 @@ abstract class _$$SuspenseProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SuspenseProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SuspenseProps$PlainMap extends _$$SuspenseProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SuspenseProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SuspenseProps$JsMap extends _$$SuspenseProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SuspenseProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/lib/src/component/with_transition.over_react.g.dart b/lib/src/component/with_transition.over_react.g.dart index 969102c90..e7191cf68 100644 --- a/lib/src/component/with_transition.over_react.g.dart +++ b/lib/src/component/with_transition.over_react.g.dart @@ -21,16 +21,14 @@ final $WithTransitionComponentFactory = registerComponent2( ); _$$WithTransitionProps _$WithTransition([Map? backingProps]) => - backingProps == null - ? _$$WithTransitionProps$JsMap(JsBackedMap()) - : _$$WithTransitionProps(backingProps); + _$$WithTransitionProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$WithTransitionProps extends UiProps +class _$$WithTransitionProps extends UiProps with v2.TransitionPropsMixin, // If this generated mixin is undefined, it's likely because v2.TransitionPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of v2.TransitionPropsMixin, and check that v2.$TransitionPropsMixin is exported/imported properly. @@ -40,15 +38,12 @@ abstract class _$$WithTransitionProps extends UiProps $WithTransitionPropsMixin implements WithTransitionProps { - _$$WithTransitionProps._(); - - factory _$$WithTransitionProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$WithTransitionProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$WithTransitionProps$PlainMap(backingMap); - } - } + _$$WithTransitionProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -85,103 +80,26 @@ abstract class _$$WithTransitionProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$WithTransitionProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$WithTransitionProps$PlainMap extends _$$WithTransitionProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$WithTransitionProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$WithTransitionProps$JsMap extends _$$WithTransitionProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$WithTransitionProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$WithTransitionState extends UiState +class _$$WithTransitionState extends UiState with WithTransitionState, // If this generated mixin is undefined, it's likely because WithTransitionState is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of WithTransitionState, and check that $WithTransitionState is exported/imported properly. $WithTransitionState { - _$$WithTransitionState._(); - - factory _$$WithTransitionState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$WithTransitionState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$WithTransitionState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$WithTransitionState$PlainMap extends _$$WithTransitionState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$WithTransitionState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$WithTransitionState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$WithTransitionState$JsMap extends _$$WithTransitionState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$WithTransitionState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -191,10 +109,10 @@ class _$$WithTransitionState$JsMap extends _$$WithTransitionState { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$WithTransitionComponent extends WithTransitionComponent { - late _$$WithTransitionProps$JsMap _cachedTypedProps; + late _$$WithTransitionProps _cachedTypedProps; @override - _$$WithTransitionProps$JsMap get props => _cachedTypedProps; + _$$WithTransitionProps get props => _cachedTypedProps; @override set props(Map value) { @@ -211,16 +129,16 @@ class _$WithTransitionComponent extends WithTransitionComponent { } @override - _$$WithTransitionProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$WithTransitionProps$JsMap(backingMap); + _$$WithTransitionProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$WithTransitionProps(backingMap); @override _$$WithTransitionProps typedPropsFactory(Map? backingMap) => _$$WithTransitionProps(backingMap); - late _$$WithTransitionState$JsMap _cachedTypedState; + late _$$WithTransitionState _cachedTypedState; @override - _$$WithTransitionState$JsMap get state => _cachedTypedState; + _$$WithTransitionState get state => _cachedTypedState; @override set state(Map value) { @@ -233,8 +151,8 @@ class _$WithTransitionComponent extends WithTransitionComponent { } @override - _$$WithTransitionState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$WithTransitionState$JsMap(backingMap); + _$$WithTransitionState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$WithTransitionState(backingMap); @override _$$WithTransitionState typedStateFactory(Map? backingMap) => diff --git a/lib/src/component_declaration/builder_helpers.dart b/lib/src/component_declaration/builder_helpers.dart index 0192450d1..21b66d7d8 100644 --- a/lib/src/component_declaration/builder_helpers.dart +++ b/lib/src/component_declaration/builder_helpers.dart @@ -40,10 +40,14 @@ class GeneratedClass { /// This should ONLY be overridden by code generation; behavior is undefined otherwise. bool get $isClassGenerated => false; - void _throwIfNotGenerated() { - if (!this.$isClassGenerated) { - throw IllegalInstantiationError(runtimeType: this.runtimeType); - } + void _assertIsGenerated() { + assert( + this.$isClassGenerated, + 'This type cannot be instantiated directly, but only indirectly via the UiFactoryBe sure to follow usage instructions for over_react component classes.\n\n' + 'If you need to do something extra custom and want to implement everything without code generation, ' + 'base classes are available by importing the ' + '`package:over_react/src/component_declaration/component_base.dart` ' + 'library directly. '); } } @@ -80,7 +84,7 @@ abstract class UiComponent _GeneratedUiComponentStubs { /// This class should not be instantiated directly, and throws an error to indicate this. UiComponent() { - _throwIfNotGenerated(); + _assertIsGenerated(); } } @@ -97,7 +101,7 @@ abstract class UiStatefulComponent { /// This class should not be instantiated directly, and throws an error to indicate this. UiStatefulComponent() { - _throwIfNotGenerated(); + _assertIsGenerated(); } @override @@ -117,7 +121,7 @@ abstract class UiStatefulComponent on T { abstract class UiState extends component_base.UiState with GeneratedClass { /// This class should not be instantiated directly, and throws an error to indicate this. UiState() { - _throwIfNotGenerated(); + _assertIsGenerated(); } @override @toBeGenerated Map get state => throw UngeneratedError(member: #state); @@ -325,23 +329,6 @@ class UngeneratedError extends Error implements UnimplementedError { 'Ensure that you\'re running a build via build_runner.'; } -/// Thrown when a class is directly instantiated when it should not be. -class IllegalInstantiationError extends Error { - final String message; - IllegalInstantiationError({String? message, Type? runtimeType}) : - this.message = message ?? '`$runtimeType` cannot be instantated directly, but only indirectly via the UiFactory'; - - - @override - String toString() => - 'IllegalInstantiationError: $message.\n\n' - 'Be sure to follow usage instructions for over_react component classes.\n\n' - 'If you need to do something extra custom and want to implement everything without code generation, ' - 'base classes are available by importing the ' - '`package:over_react/src/component_declaration/component_base.dart` ' - 'library directly. '; -} - abstract class GeneratedErrorMessages { static const String typedStateFactory = '\n\n' diff --git a/lib/src/over_react_redux/over_react_redux.over_react.g.dart b/lib/src/over_react_redux/over_react_redux.over_react.g.dart index 2d26b1731..76ed218b0 100644 --- a/lib/src/over_react_redux/over_react_redux.over_react.g.dart +++ b/lib/src/over_react_redux/over_react_redux.over_react.g.dart @@ -100,7 +100,7 @@ final UiFactoryConfig<_$$ReduxProviderProps> _$ReduxProviderConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ReduxProviderProps(map), - jsMap: (map) => _$$ReduxProviderProps$JsMap(map), + jsMap: (map) => _$$ReduxProviderProps(map), ), displayName: 'ReduxProvider'); @@ -115,22 +115,19 @@ final UiFactoryConfig<_$$ReduxProviderProps> $ReduxProviderConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ReduxProviderProps extends UiProps +class _$$ReduxProviderProps extends UiProps with ReduxProviderPropsMixin, // If this generated mixin is undefined, it's likely because ReduxProviderPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ReduxProviderPropsMixin, and check that $ReduxProviderPropsMixin is exported/imported properly. $ReduxProviderPropsMixin implements ReduxProviderProps { - _$$ReduxProviderProps._(); + _$$ReduxProviderProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$ReduxProviderProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ReduxProviderProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ReduxProviderProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -155,40 +152,3 @@ abstract class _$$ReduxProviderProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ReduxProviderProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ReduxProviderProps$PlainMap extends _$$ReduxProviderProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ReduxProviderProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ReduxProviderProps$JsMap extends _$$ReduxProviderProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ReduxProviderProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/lib/src/over_react_redux/redux_multi_provider.over_react.g.dart b/lib/src/over_react_redux/redux_multi_provider.over_react.g.dart index bfb404450..c51d15849 100644 --- a/lib/src/over_react_redux/redux_multi_provider.over_react.g.dart +++ b/lib/src/over_react_redux/redux_multi_provider.over_react.g.dart @@ -76,25 +76,20 @@ class ReduxMultiProviderProps extends _$ReduxMultiProviderProps } _$$ReduxMultiProviderProps _$ReduxMultiProvider([Map? backingProps]) => - backingProps == null - ? _$$ReduxMultiProviderProps$JsMap(JsBackedMap()) - : _$$ReduxMultiProviderProps(backingProps); + _$$ReduxMultiProviderProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ReduxMultiProviderProps extends _$ReduxMultiProviderProps +class _$$ReduxMultiProviderProps extends _$ReduxMultiProviderProps with _$ReduxMultiProviderPropsAccessorsMixin implements ReduxMultiProviderProps { - _$$ReduxMultiProviderProps._(); - - factory _$$ReduxMultiProviderProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ReduxMultiProviderProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ReduxMultiProviderProps$PlainMap(backingMap); - } - } + _$$ReduxMultiProviderProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -119,48 +114,15 @@ abstract class _$$ReduxMultiProviderProps extends _$ReduxMultiProviderProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ReduxMultiProviderProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ReduxMultiProviderProps$PlainMap extends _$$ReduxMultiProviderProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ReduxMultiProviderProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ReduxMultiProviderProps$JsMap extends _$$ReduxMultiProviderProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ReduxMultiProviderProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ReduxMultiProviderComponent extends ReduxMultiProviderComponent { - late _$$ReduxMultiProviderProps$JsMap _cachedTypedProps; + late _$$ReduxMultiProviderProps _cachedTypedProps; @override - _$$ReduxMultiProviderProps$JsMap get props => _cachedTypedProps; + _$$ReduxMultiProviderProps get props => _cachedTypedProps; @override set props(Map value) { @@ -177,9 +139,8 @@ class _$ReduxMultiProviderComponent extends ReduxMultiProviderComponent { } @override - _$$ReduxMultiProviderProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$ReduxMultiProviderProps$JsMap(backingMap); + _$$ReduxMultiProviderProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ReduxMultiProviderProps(backingMap); @override _$$ReduxMultiProviderProps typedPropsFactory(Map? backingMap) => diff --git a/lib/src/util/context.over_react.g.dart b/lib/src/util/context.over_react.g.dart index 240a89180..e879b8cb3 100644 --- a/lib/src/util/context.over_react.g.dart +++ b/lib/src/util/context.over_react.g.dart @@ -90,31 +90,27 @@ const PropsMeta _$metaFor_ConsumerPropsMixin = PropsMeta( keys: $_ConsumerPropsMixin.$propKeys, ); -_$$ProviderProps _$_Provider([Map? backingProps]) => backingProps == null - ? _$$ProviderProps$JsMap(JsBackedMap()) - : _$$ProviderProps(backingProps); +_$$ProviderProps _$_Provider([Map? backingProps]) => + _$$ProviderProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ProviderProps extends UiProps +class _$$ProviderProps extends UiProps with _ProviderPropsMixin, // If this generated mixin is undefined, it's likely because _ProviderPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of _ProviderPropsMixin, and check that $_ProviderPropsMixin is exported/imported properly. $_ProviderPropsMixin implements ProviderProps { - _$$ProviderProps._(); + _$$ProviderProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$ProviderProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ProviderProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ProviderProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -138,69 +134,27 @@ abstract class _$$ProviderProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ProviderProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ProviderProps$PlainMap extends _$$ProviderProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ProviderProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ProviderProps$JsMap extends _$$ProviderProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ProviderProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - -_$$ConsumerProps _$_Consumer([Map? backingProps]) => backingProps == null - ? _$$ConsumerProps$JsMap(JsBackedMap()) - : _$$ConsumerProps(backingProps); +_$$ConsumerProps _$_Consumer([Map? backingProps]) => + _$$ConsumerProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ConsumerProps extends UiProps +class _$$ConsumerProps extends UiProps with _ConsumerPropsMixin, // If this generated mixin is undefined, it's likely because _ConsumerPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of _ConsumerPropsMixin, and check that $_ConsumerPropsMixin is exported/imported properly. $_ConsumerPropsMixin implements ConsumerProps { - _$$ConsumerProps._(); + _$$ConsumerProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$ConsumerProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ConsumerProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ConsumerProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -224,40 +178,3 @@ abstract class _$$ConsumerProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ConsumerProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ConsumerProps$PlainMap extends _$$ConsumerProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConsumerProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ConsumerProps$JsMap extends _$$ConsumerProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConsumerProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/lib/src/util/safe_render_manager/safe_render_manager_helper.over_react.g.dart b/lib/src/util/safe_render_manager/safe_render_manager_helper.over_react.g.dart index 25a2824d1..b76faf1e5 100644 --- a/lib/src/util/safe_render_manager/safe_render_manager_helper.over_react.g.dart +++ b/lib/src/util/safe_render_manager/safe_render_manager_helper.over_react.g.dart @@ -22,29 +22,24 @@ final $SafeRenderManagerHelperComponentFactory = registerComponent2( _$$SafeRenderManagerHelperProps _$SafeRenderManagerHelper( [Map? backingProps]) => - backingProps == null - ? _$$SafeRenderManagerHelperProps$JsMap(JsBackedMap()) - : _$$SafeRenderManagerHelperProps(backingProps); + _$$SafeRenderManagerHelperProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SafeRenderManagerHelperProps extends UiProps +class _$$SafeRenderManagerHelperProps extends UiProps with SafeRenderManagerHelperProps, // If this generated mixin is undefined, it's likely because SafeRenderManagerHelperProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SafeRenderManagerHelperProps, and check that $SafeRenderManagerHelperProps is exported/imported properly. $SafeRenderManagerHelperProps { - _$$SafeRenderManagerHelperProps._(); - - factory _$$SafeRenderManagerHelperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SafeRenderManagerHelperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$SafeRenderManagerHelperProps$PlainMap(backingMap); - } - } + _$$SafeRenderManagerHelperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -75,107 +70,26 @@ abstract class _$$SafeRenderManagerHelperProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SafeRenderManagerHelperProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SafeRenderManagerHelperProps$PlainMap - extends _$$SafeRenderManagerHelperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SafeRenderManagerHelperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SafeRenderManagerHelperProps$JsMap - extends _$$SafeRenderManagerHelperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SafeRenderManagerHelperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SafeRenderManagerHelperState extends UiState +class _$$SafeRenderManagerHelperState extends UiState with SafeRenderManagerHelperState, // If this generated mixin is undefined, it's likely because SafeRenderManagerHelperState is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of SafeRenderManagerHelperState, and check that $SafeRenderManagerHelperState is exported/imported properly. $SafeRenderManagerHelperState { - _$$SafeRenderManagerHelperState._(); - - factory _$$SafeRenderManagerHelperState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SafeRenderManagerHelperState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$SafeRenderManagerHelperState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SafeRenderManagerHelperState$PlainMap - extends _$$SafeRenderManagerHelperState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SafeRenderManagerHelperState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$SafeRenderManagerHelperState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SafeRenderManagerHelperState$JsMap - extends _$$SafeRenderManagerHelperState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SafeRenderManagerHelperState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -186,10 +100,10 @@ class _$$SafeRenderManagerHelperState$JsMap ' Do not reference it in your code, as it may change at any time.') class _$SafeRenderManagerHelperComponent extends SafeRenderManagerHelperComponent { - late _$$SafeRenderManagerHelperProps$JsMap _cachedTypedProps; + late _$$SafeRenderManagerHelperProps _cachedTypedProps; @override - _$$SafeRenderManagerHelperProps$JsMap get props => _cachedTypedProps; + _$$SafeRenderManagerHelperProps get props => _cachedTypedProps; @override set props(Map value) { @@ -206,17 +120,17 @@ class _$SafeRenderManagerHelperComponent } @override - _$$SafeRenderManagerHelperProps$JsMap typedPropsFactoryJs( + _$$SafeRenderManagerHelperProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$SafeRenderManagerHelperProps$JsMap(backingMap); + _$$SafeRenderManagerHelperProps(backingMap); @override _$$SafeRenderManagerHelperProps typedPropsFactory(Map? backingMap) => _$$SafeRenderManagerHelperProps(backingMap); - late _$$SafeRenderManagerHelperState$JsMap _cachedTypedState; + late _$$SafeRenderManagerHelperState _cachedTypedState; @override - _$$SafeRenderManagerHelperState$JsMap get state => _cachedTypedState; + _$$SafeRenderManagerHelperState get state => _cachedTypedState; @override set state(Map value) { @@ -229,9 +143,9 @@ class _$SafeRenderManagerHelperComponent } @override - _$$SafeRenderManagerHelperState$JsMap typedStateFactoryJs( + _$$SafeRenderManagerHelperState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$SafeRenderManagerHelperState$JsMap(backingMap); + _$$SafeRenderManagerHelperState(backingMap); @override _$$SafeRenderManagerHelperState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/_deprecated/abstract_transition_test.over_react.g.dart b/test/over_react/component/_deprecated/abstract_transition_test.over_react.g.dart index c2225e8d6..c218ccf75 100644 --- a/test/over_react/component/_deprecated/abstract_transition_test.over_react.g.dart +++ b/test/over_react/component/_deprecated/abstract_transition_test.over_react.g.dart @@ -210,16 +210,12 @@ _$$TransitionerProps _$Transitioner([Map? backingProps]) => class _$$TransitionerProps extends _$TransitionerProps with _$TransitionerPropsAccessorsMixin implements TransitionerProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionerProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TransitionerProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -273,16 +269,12 @@ class TransitionerState extends _$TransitionerState class _$$TransitionerState extends _$TransitionerState with _$TransitionerStateAccessorsMixin implements TransitionerState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionerState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TransitionerState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component/_deprecated/fixtures/custom_error_boundary_component.over_react.g.dart b/test/over_react/component/_deprecated/fixtures/custom_error_boundary_component.over_react.g.dart index f5b1281e7..c3ebf2162 100644 --- a/test/over_react/component/_deprecated/fixtures/custom_error_boundary_component.over_react.g.dart +++ b/test/over_react/component/_deprecated/fixtures/custom_error_boundary_component.over_react.g.dart @@ -41,25 +41,20 @@ class CustomErrorBoundaryProps extends _$CustomErrorBoundaryProps } _$$CustomErrorBoundaryProps _$CustomErrorBoundary([Map? backingProps]) => - backingProps == null - ? _$$CustomErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$CustomErrorBoundaryProps(backingProps); + _$$CustomErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$CustomErrorBoundaryProps extends _$CustomErrorBoundaryProps +class _$$CustomErrorBoundaryProps extends _$CustomErrorBoundaryProps with _$CustomErrorBoundaryPropsAccessorsMixin implements CustomErrorBoundaryProps { - _$$CustomErrorBoundaryProps._(); - - factory _$$CustomErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CustomErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$CustomErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -83,40 +78,6 @@ abstract class _$$CustomErrorBoundaryProps extends _$CustomErrorBoundaryProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CustomErrorBoundaryProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$CustomErrorBoundaryProps$PlainMap extends _$$CustomErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$CustomErrorBoundaryProps$JsMap extends _$$CustomErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$CustomErrorBoundaryStateAccessorsMixin implements _$CustomErrorBoundaryState { @override @@ -141,55 +102,19 @@ class CustomErrorBoundaryState extends _$CustomErrorBoundaryState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$CustomErrorBoundaryState extends _$CustomErrorBoundaryState +class _$$CustomErrorBoundaryState extends _$CustomErrorBoundaryState with _$CustomErrorBoundaryStateAccessorsMixin implements CustomErrorBoundaryState { - _$$CustomErrorBoundaryState._(); - - factory _$$CustomErrorBoundaryState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomErrorBoundaryState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CustomErrorBoundaryState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$CustomErrorBoundaryState$PlainMap extends _$$CustomErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomErrorBoundaryState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$CustomErrorBoundaryState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$CustomErrorBoundaryState$JsMap extends _$$CustomErrorBoundaryState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomErrorBoundaryState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -197,10 +122,10 @@ class _$$CustomErrorBoundaryState$JsMap extends _$$CustomErrorBoundaryState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$CustomErrorBoundaryComponent extends CustomErrorBoundaryComponent { - late _$$CustomErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$CustomErrorBoundaryProps _cachedTypedProps; @override - _$$CustomErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$CustomErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -217,17 +142,16 @@ class _$CustomErrorBoundaryComponent extends CustomErrorBoundaryComponent { } @override - _$$CustomErrorBoundaryProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$CustomErrorBoundaryProps$JsMap(backingMap); + _$$CustomErrorBoundaryProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$CustomErrorBoundaryProps(backingMap); @override _$$CustomErrorBoundaryProps typedPropsFactory(Map? backingMap) => _$$CustomErrorBoundaryProps(backingMap); - late _$$CustomErrorBoundaryState$JsMap _cachedTypedState; + late _$$CustomErrorBoundaryState _cachedTypedState; @override - _$$CustomErrorBoundaryState$JsMap get state => _cachedTypedState; + _$$CustomErrorBoundaryState get state => _cachedTypedState; @override set state(Map value) { @@ -240,9 +164,8 @@ class _$CustomErrorBoundaryComponent extends CustomErrorBoundaryComponent { } @override - _$$CustomErrorBoundaryState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$CustomErrorBoundaryState$JsMap(backingMap); + _$$CustomErrorBoundaryState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$CustomErrorBoundaryState(backingMap); @override _$$CustomErrorBoundaryState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/abstract_transition_test.over_react.g.dart b/test/over_react/component/abstract_transition_test.over_react.g.dart index 8bd47f073..a1bb493ce 100644 --- a/test/over_react/component/abstract_transition_test.over_react.g.dart +++ b/test/over_react/component/abstract_transition_test.over_react.g.dart @@ -20,16 +20,15 @@ final $TransitionerComponentFactory = registerComponent2( parentType: null, ); -_$$TransitionerProps _$Transitioner([Map? backingProps]) => backingProps == null - ? _$$TransitionerProps$JsMap(JsBackedMap()) - : _$$TransitionerProps(backingProps); +_$$TransitionerProps _$Transitioner([Map? backingProps]) => + _$$TransitionerProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TransitionerProps extends UiProps +class _$$TransitionerProps extends UiProps with TransitionerPropsMixin, // If this generated mixin is undefined, it's likely because TransitionerPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TransitionerPropsMixin, and check that $TransitionerPropsMixin is exported/imported properly. @@ -39,15 +38,12 @@ abstract class _$$TransitionerProps extends UiProps $TransitionPropsMixin implements TransitionerProps { - _$$TransitionerProps._(); - - factory _$$TransitionerProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TransitionerProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TransitionerProps$PlainMap(backingMap); - } - } + _$$TransitionerProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -84,105 +80,28 @@ abstract class _$$TransitionerProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TransitionerProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TransitionerProps$PlainMap extends _$$TransitionerProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionerProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TransitionerProps$JsMap extends _$$TransitionerProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionerProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TransitionerState extends UiState +class _$$TransitionerState extends UiState with AbstractTransitionState, // If this generated mixin is undefined, it's likely because AbstractTransitionState is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of AbstractTransitionState, and check that $AbstractTransitionState is exported/imported properly. $AbstractTransitionState implements TransitionerState { - _$$TransitionerState._(); - - factory _$$TransitionerState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TransitionerState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TransitionerState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TransitionerState$PlainMap extends _$$TransitionerState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionerState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TransitionerState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TransitionerState$JsMap extends _$$TransitionerState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TransitionerState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -192,10 +111,10 @@ class _$$TransitionerState$JsMap extends _$$TransitionerState { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$TransitionerComponent extends TransitionerComponent { - late _$$TransitionerProps$JsMap _cachedTypedProps; + late _$$TransitionerProps _cachedTypedProps; @override - _$$TransitionerProps$JsMap get props => _cachedTypedProps; + _$$TransitionerProps get props => _cachedTypedProps; @override set props(Map value) { @@ -212,16 +131,16 @@ class _$TransitionerComponent extends TransitionerComponent { } @override - _$$TransitionerProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TransitionerProps$JsMap(backingMap); + _$$TransitionerProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TransitionerProps(backingMap); @override _$$TransitionerProps typedPropsFactory(Map? backingMap) => _$$TransitionerProps(backingMap); - late _$$TransitionerState$JsMap _cachedTypedState; + late _$$TransitionerState _cachedTypedState; @override - _$$TransitionerState$JsMap get state => _cachedTypedState; + _$$TransitionerState get state => _cachedTypedState; @override set state(Map value) { @@ -234,8 +153,8 @@ class _$TransitionerComponent extends TransitionerComponent { } @override - _$$TransitionerState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$TransitionerState$JsMap(backingMap); + _$$TransitionerState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$TransitionerState(backingMap); @override _$$TransitionerState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/context_test.over_react.g.dart b/test/over_react/component/context_test.over_react.g.dart index 1b903f955..3bf3ca27c 100644 --- a/test/over_react/component/context_test.over_react.g.dart +++ b/test/over_react/component/context_test.over_react.g.dart @@ -21,29 +21,24 @@ final $ContextTypeDynamicComponentFactory = registerComponent2( ); _$$ContextTypeDynamicProps _$ContextTypeDynamic([Map? backingProps]) => - backingProps == null - ? _$$ContextTypeDynamicProps$JsMap(JsBackedMap()) - : _$$ContextTypeDynamicProps(backingProps); + _$$ContextTypeDynamicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ContextTypeDynamicProps extends UiProps +class _$$ContextTypeDynamicProps extends UiProps with ContextTypeDynamicProps, // If this generated mixin is undefined, it's likely because ContextTypeDynamicProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ContextTypeDynamicProps, and check that $ContextTypeDynamicProps is exported/imported properly. $ContextTypeDynamicProps { - _$$ContextTypeDynamicProps._(); - - factory _$$ContextTypeDynamicProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ContextTypeDynamicProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ContextTypeDynamicProps$PlainMap(backingMap); - } - } + _$$ContextTypeDynamicProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -74,43 +69,6 @@ abstract class _$$ContextTypeDynamicProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ContextTypeDynamicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ContextTypeDynamicProps$PlainMap extends _$$ContextTypeDynamicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextTypeDynamicProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ContextTypeDynamicProps$JsMap extends _$$ContextTypeDynamicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextTypeDynamicProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -118,10 +76,10 @@ class _$$ContextTypeDynamicProps$JsMap extends _$$ContextTypeDynamicProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$ContextTypeDynamicComponent extends ContextTypeDynamicComponent { - late _$$ContextTypeDynamicProps$JsMap _cachedTypedProps; + late _$$ContextTypeDynamicProps _cachedTypedProps; @override - _$$ContextTypeDynamicProps$JsMap get props => _cachedTypedProps; + _$$ContextTypeDynamicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -138,9 +96,8 @@ class _$ContextTypeDynamicComponent extends ContextTypeDynamicComponent { } @override - _$$ContextTypeDynamicProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$ContextTypeDynamicProps$JsMap(backingMap); + _$$ContextTypeDynamicProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ContextTypeDynamicProps(backingMap); @override _$$ContextTypeDynamicProps typedPropsFactory(Map? backingMap) => @@ -180,30 +137,24 @@ final $ContextTypeWithoutDefaultComponentFactory = registerComponent2( _$$ContextTypeWithoutDefaultProps _$ContextTypeWithoutDefault( [Map? backingProps]) => - backingProps == null - ? _$$ContextTypeWithoutDefaultProps$JsMap(JsBackedMap()) - : _$$ContextTypeWithoutDefaultProps(backingProps); + _$$ContextTypeWithoutDefaultProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ContextTypeWithoutDefaultProps extends UiProps +class _$$ContextTypeWithoutDefaultProps extends UiProps with ContextTypeWithoutDefaultProps, // If this generated mixin is undefined, it's likely because ContextTypeWithoutDefaultProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ContextTypeWithoutDefaultProps, and check that $ContextTypeWithoutDefaultProps is exported/imported properly. $ContextTypeWithoutDefaultProps { - _$$ContextTypeWithoutDefaultProps._(); - - factory _$$ContextTypeWithoutDefaultProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ContextTypeWithoutDefaultProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$ContextTypeWithoutDefaultProps$PlainMap(backingMap); - } - } + _$$ContextTypeWithoutDefaultProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -234,45 +185,6 @@ abstract class _$$ContextTypeWithoutDefaultProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ContextTypeWithoutDefaultProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ContextTypeWithoutDefaultProps$PlainMap - extends _$$ContextTypeWithoutDefaultProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextTypeWithoutDefaultProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ContextTypeWithoutDefaultProps$JsMap - extends _$$ContextTypeWithoutDefaultProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextTypeWithoutDefaultProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -281,10 +193,10 @@ class _$$ContextTypeWithoutDefaultProps$JsMap ' Do not reference it in your code, as it may change at any time.') class _$ContextTypeWithoutDefaultComponent extends ContextTypeWithoutDefaultComponent { - late _$$ContextTypeWithoutDefaultProps$JsMap _cachedTypedProps; + late _$$ContextTypeWithoutDefaultProps _cachedTypedProps; @override - _$$ContextTypeWithoutDefaultProps$JsMap get props => _cachedTypedProps; + _$$ContextTypeWithoutDefaultProps get props => _cachedTypedProps; @override set props(Map value) { @@ -301,9 +213,9 @@ class _$ContextTypeWithoutDefaultComponent } @override - _$$ContextTypeWithoutDefaultProps$JsMap typedPropsFactoryJs( + _$$ContextTypeWithoutDefaultProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$ContextTypeWithoutDefaultProps$JsMap(backingMap); + _$$ContextTypeWithoutDefaultProps(backingMap); @override _$$ContextTypeWithoutDefaultProps typedPropsFactory(Map? backingMap) => @@ -342,29 +254,24 @@ final $ContextTypeWithDefaultComponentFactory = registerComponent2( ); _$$ContextTypeWithDefaultProps _$ContextTypeWithDefault([Map? backingProps]) => - backingProps == null - ? _$$ContextTypeWithDefaultProps$JsMap(JsBackedMap()) - : _$$ContextTypeWithDefaultProps(backingProps); + _$$ContextTypeWithDefaultProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ContextTypeWithDefaultProps extends UiProps +class _$$ContextTypeWithDefaultProps extends UiProps with ContextTypeWithDefaultProps, // If this generated mixin is undefined, it's likely because ContextTypeWithDefaultProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ContextTypeWithDefaultProps, and check that $ContextTypeWithDefaultProps is exported/imported properly. $ContextTypeWithDefaultProps { - _$$ContextTypeWithDefaultProps._(); - - factory _$$ContextTypeWithDefaultProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ContextTypeWithDefaultProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ContextTypeWithDefaultProps$PlainMap(backingMap); - } - } + _$$ContextTypeWithDefaultProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -395,45 +302,6 @@ abstract class _$$ContextTypeWithDefaultProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ContextTypeWithDefaultProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ContextTypeWithDefaultProps$PlainMap - extends _$$ContextTypeWithDefaultProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextTypeWithDefaultProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ContextTypeWithDefaultProps$JsMap - extends _$$ContextTypeWithDefaultProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextTypeWithDefaultProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -442,10 +310,10 @@ class _$$ContextTypeWithDefaultProps$JsMap ' Do not reference it in your code, as it may change at any time.') class _$ContextTypeWithDefaultComponent extends ContextTypeWithDefaultComponent { - late _$$ContextTypeWithDefaultProps$JsMap _cachedTypedProps; + late _$$ContextTypeWithDefaultProps _cachedTypedProps; @override - _$$ContextTypeWithDefaultProps$JsMap get props => _cachedTypedProps; + _$$ContextTypeWithDefaultProps get props => _cachedTypedProps; @override set props(Map value) { @@ -462,9 +330,8 @@ class _$ContextTypeWithDefaultComponent } @override - _$$ContextTypeWithDefaultProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$ContextTypeWithDefaultProps$JsMap(backingMap); + _$$ContextTypeWithDefaultProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ContextTypeWithDefaultProps(backingMap); @override _$$ContextTypeWithDefaultProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component/element_type_test.over_react.g.dart b/test/over_react/component/element_type_test.over_react.g.dart index 38eb41f9e..b12cacc44 100644 --- a/test/over_react/component/element_type_test.over_react.g.dart +++ b/test/over_react/component/element_type_test.over_react.g.dart @@ -20,29 +20,25 @@ final $CustomTestComponentFactory = registerComponent2( parentType: null, ); -_$$CustomTestProps _$CustomTest([Map? backingProps]) => backingProps == null - ? _$$CustomTestProps$JsMap(JsBackedMap()) - : _$$CustomTestProps(backingProps); +_$$CustomTestProps _$CustomTest([Map? backingProps]) => + _$$CustomTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CustomTestProps extends UiProps +class _$$CustomTestProps extends UiProps with CustomTestProps, // If this generated mixin is undefined, it's likely because CustomTestProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CustomTestProps, and check that $CustomTestProps is exported/imported properly. $CustomTestProps { - _$$CustomTestProps._(); - - factory _$$CustomTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CustomTestProps$PlainMap(backingMap); - } - } + _$$CustomTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -73,43 +69,6 @@ abstract class _$$CustomTestProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CustomTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomTestProps$PlainMap extends _$$CustomTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomTestProps$JsMap extends _$$CustomTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -117,10 +76,10 @@ class _$$CustomTestProps$JsMap extends _$$CustomTestProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$CustomTestComponent extends CustomTestComponent { - late _$$CustomTestProps$JsMap _cachedTypedProps; + late _$$CustomTestProps _cachedTypedProps; @override - _$$CustomTestProps$JsMap get props => _cachedTypedProps; + _$$CustomTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -137,8 +96,8 @@ class _$CustomTestComponent extends CustomTestComponent { } @override - _$$CustomTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$CustomTestProps$JsMap(backingMap); + _$$CustomTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$CustomTestProps(backingMap); @override _$$CustomTestProps typedPropsFactory(Map? backingMap) => @@ -217,7 +176,7 @@ final UiFactoryConfig<_$$CustomFnTestProps> _$CustomFnTestConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$CustomFnTestProps(map), - jsMap: (map) => _$$CustomFnTestProps$JsMap(map), + jsMap: (map) => _$$CustomFnTestProps(map), ), displayName: 'CustomFnTest'); @@ -232,20 +191,17 @@ final UiFactoryConfig<_$$CustomFnTestProps> $CustomFnTestConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CustomFnTestProps extends UiProps +class _$$CustomFnTestProps extends UiProps with CustomFnTestProps, // If this generated mixin is undefined, it's likely because CustomFnTestProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CustomFnTestProps, and check that $CustomFnTestProps is exported/imported properly. $CustomFnTestProps { - _$$CustomFnTestProps._(); - - factory _$$CustomFnTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomFnTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CustomFnTestProps$PlainMap(backingMap); - } - } + _$$CustomFnTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -270,40 +226,3 @@ abstract class _$$CustomFnTestProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CustomFnTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomFnTestProps$PlainMap extends _$$CustomFnTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomFnTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomFnTestProps$JsMap extends _$$CustomFnTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomFnTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/error_boundary/shared_stack_tests.over_react.g.dart b/test/over_react/component/error_boundary/shared_stack_tests.over_react.g.dart index 01ba2c184..fd6d1c79d 100644 --- a/test/over_react/component/error_boundary/shared_stack_tests.over_react.g.dart +++ b/test/over_react/component/error_boundary/shared_stack_tests.over_react.g.dart @@ -21,29 +21,24 @@ final $ThrowingComponent2ComponentFactory = registerComponent2( ); _$$ThrowingComponent2Props _$ThrowingComponent2([Map? backingProps]) => - backingProps == null - ? _$$ThrowingComponent2Props$JsMap(JsBackedMap()) - : _$$ThrowingComponent2Props(backingProps); + _$$ThrowingComponent2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ThrowingComponent2Props extends UiProps +class _$$ThrowingComponent2Props extends UiProps with ThrowingComponent2Props, // If this generated mixin is undefined, it's likely because ThrowingComponent2Props is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ThrowingComponent2Props, and check that $ThrowingComponent2Props is exported/imported properly. $ThrowingComponent2Props { - _$$ThrowingComponent2Props._(); - - factory _$$ThrowingComponent2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ThrowingComponent2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ThrowingComponent2Props$PlainMap(backingMap); - } - } + _$$ThrowingComponent2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -74,43 +69,6 @@ abstract class _$$ThrowingComponent2Props extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ThrowingComponent2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ThrowingComponent2Props$PlainMap extends _$$ThrowingComponent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingComponent2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ThrowingComponent2Props$JsMap extends _$$ThrowingComponent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingComponent2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -118,10 +76,10 @@ class _$$ThrowingComponent2Props$JsMap extends _$$ThrowingComponent2Props { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$ThrowingComponent2Component extends ThrowingComponent2Component { - late _$$ThrowingComponent2Props$JsMap _cachedTypedProps; + late _$$ThrowingComponent2Props _cachedTypedProps; @override - _$$ThrowingComponent2Props$JsMap get props => _cachedTypedProps; + _$$ThrowingComponent2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -138,9 +96,8 @@ class _$ThrowingComponent2Component extends ThrowingComponent2Component { } @override - _$$ThrowingComponent2Props$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$ThrowingComponent2Props$JsMap(backingMap); + _$$ThrowingComponent2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ThrowingComponent2Props(backingMap); @override _$$ThrowingComponent2Props typedPropsFactory(Map? backingMap) => @@ -206,16 +163,12 @@ _$$ThrowingComponentProps _$ThrowingComponent([Map? backingProps]) => class _$$ThrowingComponentProps extends _$ThrowingComponentProps with _$ThrowingComponentPropsAccessorsMixin implements ThrowingComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingComponentProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ThrowingComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -343,7 +296,7 @@ final UiFactoryConfig<_$$ThrowingFunctionComponentProps> _$ThrowingFunctionComponentConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ThrowingFunctionComponentProps(map), - jsMap: (map) => _$$ThrowingFunctionComponentProps$JsMap(map), + jsMap: (map) => _$$ThrowingFunctionComponentProps(map), ), displayName: 'ThrowingFunctionComponent'); @@ -359,21 +312,17 @@ final UiFactoryConfig<_$$ThrowingFunctionComponentProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ThrowingFunctionComponentProps extends UiProps +class _$$ThrowingFunctionComponentProps extends UiProps with ThrowingFunctionComponentProps, // If this generated mixin is undefined, it's likely because ThrowingFunctionComponentProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ThrowingFunctionComponentProps, and check that $ThrowingFunctionComponentProps is exported/imported properly. $ThrowingFunctionComponentProps { - _$$ThrowingFunctionComponentProps._(); - - factory _$$ThrowingFunctionComponentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ThrowingFunctionComponentProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$ThrowingFunctionComponentProps$PlainMap(backingMap); - } - } + _$$ThrowingFunctionComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -398,51 +347,11 @@ abstract class _$$ThrowingFunctionComponentProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ThrowingFunctionComponentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ThrowingFunctionComponentProps$PlainMap - extends _$$ThrowingFunctionComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingFunctionComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ThrowingFunctionComponentProps$JsMap - extends _$$ThrowingFunctionComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingFunctionComponentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$ThrowingForwardRefComponentProps> _$ThrowingForwardRefComponentConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ThrowingForwardRefComponentProps(map), - jsMap: (map) => _$$ThrowingForwardRefComponentProps$JsMap(map), + jsMap: (map) => _$$ThrowingForwardRefComponentProps(map), ), displayName: 'ThrowingForwardRefComponent'); @@ -458,21 +367,17 @@ final UiFactoryConfig<_$$ThrowingForwardRefComponentProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ThrowingForwardRefComponentProps extends UiProps +class _$$ThrowingForwardRefComponentProps extends UiProps with ThrowingForwardRefComponentProps, // If this generated mixin is undefined, it's likely because ThrowingForwardRefComponentProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ThrowingForwardRefComponentProps, and check that $ThrowingForwardRefComponentProps is exported/imported properly. $ThrowingForwardRefComponentProps { - _$$ThrowingForwardRefComponentProps._(); - - factory _$$ThrowingForwardRefComponentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ThrowingForwardRefComponentProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$ThrowingForwardRefComponentProps$PlainMap(backingMap); - } - } + _$$ThrowingForwardRefComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -498,42 +403,3 @@ abstract class _$$ThrowingForwardRefComponentProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ThrowingForwardRefComponentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ThrowingForwardRefComponentProps$PlainMap - extends _$$ThrowingForwardRefComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingForwardRefComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ThrowingForwardRefComponentProps$JsMap - extends _$$ThrowingForwardRefComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ThrowingForwardRefComponentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/fixtures/basic_child_component.over_react.g.dart b/test/over_react/component/fixtures/basic_child_component.over_react.g.dart index 8f2edc9e0..14356fd68 100644 --- a/test/over_react/component/fixtures/basic_child_component.over_react.g.dart +++ b/test/over_react/component/fixtures/basic_child_component.over_react.g.dart @@ -38,25 +38,21 @@ class BasicChildProps extends _$BasicChildProps static const PropsMeta meta = _$metaForBasicChildProps; } -_$$BasicChildProps _$BasicChild([Map? backingProps]) => backingProps == null - ? _$$BasicChildProps$JsMap(JsBackedMap()) - : _$$BasicChildProps(backingProps); +_$$BasicChildProps _$BasicChild([Map? backingProps]) => + _$$BasicChildProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$BasicChildProps extends _$BasicChildProps +class _$$BasicChildProps extends _$BasicChildProps with _$BasicChildPropsAccessorsMixin implements BasicChildProps { - _$$BasicChildProps._(); - - factory _$$BasicChildProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicChildProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicChildProps$PlainMap(backingMap); - } - } + _$$BasicChildProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -81,48 +77,15 @@ abstract class _$$BasicChildProps extends _$BasicChildProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicChildProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$BasicChildProps$PlainMap extends _$$BasicChildProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicChildProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$BasicChildProps$JsMap extends _$$BasicChildProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicChildProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$BasicChildComponent extends BasicChildComponent { - late _$$BasicChildProps$JsMap _cachedTypedProps; + late _$$BasicChildProps _cachedTypedProps; @override - _$$BasicChildProps$JsMap get props => _cachedTypedProps; + _$$BasicChildProps get props => _cachedTypedProps; @override set props(Map value) { @@ -139,8 +102,8 @@ class _$BasicChildComponent extends BasicChildComponent { } @override - _$$BasicChildProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$BasicChildProps$JsMap(backingMap); + _$$BasicChildProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$BasicChildProps(backingMap); @override _$$BasicChildProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/basic_ui_component.over_react.g.dart b/test/over_react/component/fixtures/basic_ui_component.over_react.g.dart index 003f4a586..11d3502b4 100644 --- a/test/over_react/component/fixtures/basic_ui_component.over_react.g.dart +++ b/test/over_react/component/fixtures/basic_ui_component.over_react.g.dart @@ -47,16 +47,12 @@ _$$BasicUiComponentProps _$BasicUiComponent([Map? backingProps]) => class _$$BasicUiComponentProps extends _$BasicUiComponentProps with _$BasicUiComponentPropsAccessorsMixin implements BasicUiComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicUiComponentProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicUiComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component/fixtures/context_provider_component.over_react.g.dart b/test/over_react/component/fixtures/context_provider_component.over_react.g.dart index 68a12c0c6..716107de7 100644 --- a/test/over_react/component/fixtures/context_provider_component.over_react.g.dart +++ b/test/over_react/component/fixtures/context_provider_component.over_react.g.dart @@ -40,26 +40,20 @@ class ContextProviderWrapperProps extends _$ContextProviderWrapperProps } _$$ContextProviderWrapperProps _$ContextProviderWrapper([Map? backingProps]) => - backingProps == null - ? _$$ContextProviderWrapperProps$JsMap(JsBackedMap()) - : _$$ContextProviderWrapperProps(backingProps); + _$$ContextProviderWrapperProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ContextProviderWrapperProps - extends _$ContextProviderWrapperProps +class _$$ContextProviderWrapperProps extends _$ContextProviderWrapperProps with _$ContextProviderWrapperPropsAccessorsMixin implements ContextProviderWrapperProps { - _$$ContextProviderWrapperProps._(); - - factory _$$ContextProviderWrapperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ContextProviderWrapperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ContextProviderWrapperProps$PlainMap(backingMap); - } - } + _$$ContextProviderWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -83,42 +77,6 @@ abstract class _$$ContextProviderWrapperProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ContextProviderWrapperProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$ContextProviderWrapperProps$PlainMap - extends _$$ContextProviderWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextProviderWrapperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ContextProviderWrapperProps$JsMap - extends _$$ContextProviderWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextProviderWrapperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$ContextProviderWrapperStateAccessorsMixin implements _$ContextProviderWrapperState { @override @@ -164,58 +122,19 @@ class ContextProviderWrapperState extends _$ContextProviderWrapperState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ContextProviderWrapperState - extends _$ContextProviderWrapperState +class _$$ContextProviderWrapperState extends _$ContextProviderWrapperState with _$ContextProviderWrapperStateAccessorsMixin implements ContextProviderWrapperState { - _$$ContextProviderWrapperState._(); - - factory _$$ContextProviderWrapperState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ContextProviderWrapperState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ContextProviderWrapperState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$ContextProviderWrapperState$PlainMap - extends _$$ContextProviderWrapperState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextProviderWrapperState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$ContextProviderWrapperState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ContextProviderWrapperState$JsMap - extends _$$ContextProviderWrapperState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ContextProviderWrapperState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -224,10 +143,10 @@ class _$$ContextProviderWrapperState$JsMap // generated for the associated props class. class _$ContextProviderWrapperComponent extends ContextProviderWrapperComponent { - late _$$ContextProviderWrapperProps$JsMap _cachedTypedProps; + late _$$ContextProviderWrapperProps _cachedTypedProps; @override - _$$ContextProviderWrapperProps$JsMap get props => _cachedTypedProps; + _$$ContextProviderWrapperProps get props => _cachedTypedProps; @override set props(Map value) { @@ -244,17 +163,16 @@ class _$ContextProviderWrapperComponent } @override - _$$ContextProviderWrapperProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$ContextProviderWrapperProps$JsMap(backingMap); + _$$ContextProviderWrapperProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ContextProviderWrapperProps(backingMap); @override _$$ContextProviderWrapperProps typedPropsFactory(Map? backingMap) => _$$ContextProviderWrapperProps(backingMap); - late _$$ContextProviderWrapperState$JsMap _cachedTypedState; + late _$$ContextProviderWrapperState _cachedTypedState; @override - _$$ContextProviderWrapperState$JsMap get state => _cachedTypedState; + _$$ContextProviderWrapperState get state => _cachedTypedState; @override set state(Map value) { @@ -267,9 +185,8 @@ class _$ContextProviderWrapperComponent } @override - _$$ContextProviderWrapperState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$ContextProviderWrapperState$JsMap(backingMap); + _$$ContextProviderWrapperState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$ContextProviderWrapperState(backingMap); @override _$$ContextProviderWrapperState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/dummy_component.over_react.g.dart b/test/over_react/component/fixtures/dummy_component.over_react.g.dart index 89f602c83..e33d57331 100644 --- a/test/over_react/component/fixtures/dummy_component.over_react.g.dart +++ b/test/over_react/component/fixtures/dummy_component.over_react.g.dart @@ -51,25 +51,19 @@ const PropsMeta _$metaForDummyProps = PropsMeta( keys: _$DummyPropsAccessorsMixin.$propKeys, ); -_$$DummyProps _$Dummy([Map? backingProps]) => backingProps == null - ? _$$DummyProps$JsMap(JsBackedMap()) - : _$$DummyProps(backingProps); +_$$DummyProps _$Dummy([Map? backingProps]) => _$$DummyProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$DummyProps extends _$DummyProps +class _$$DummyProps extends _$DummyProps with _$DummyPropsAccessorsMixin implements DummyProps { - _$$DummyProps._(); - - factory _$$DummyProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DummyProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$DummyProps$PlainMap(backingMap); - } - } + _$$DummyProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -93,48 +87,15 @@ abstract class _$$DummyProps extends _$DummyProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DummyProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$DummyProps$PlainMap extends _$$DummyProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DummyProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$DummyProps$JsMap extends _$$DummyProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DummyProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$DummyComponent extends DummyComponent { - late _$$DummyProps$JsMap _cachedTypedProps; + late _$$DummyProps _cachedTypedProps; @override - _$$DummyProps$JsMap get props => _cachedTypedProps; + _$$DummyProps get props => _cachedTypedProps; @override set props(Map value) { @@ -151,8 +112,8 @@ class _$DummyComponent extends DummyComponent { } @override - _$$DummyProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$DummyProps$JsMap(backingMap); + _$$DummyProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$DummyProps(backingMap); @override _$$DummyProps typedPropsFactory(Map? backingMap) => _$$DummyProps(backingMap); diff --git a/test/over_react/component/fixtures/flawed_component.over_react.g.dart b/test/over_react/component/fixtures/flawed_component.over_react.g.dart index 9e01ed662..e38d3c560 100644 --- a/test/over_react/component/fixtures/flawed_component.over_react.g.dart +++ b/test/over_react/component/fixtures/flawed_component.over_react.g.dart @@ -50,25 +50,19 @@ const PropsMeta _$metaForFlawedProps = PropsMeta( keys: _$FlawedPropsAccessorsMixin.$propKeys, ); -_$$FlawedProps _$Flawed([Map? backingProps]) => backingProps == null - ? _$$FlawedProps$JsMap(JsBackedMap()) - : _$$FlawedProps(backingProps); +_$$FlawedProps _$Flawed([Map? backingProps]) => _$$FlawedProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FlawedProps extends _$FlawedProps +class _$$FlawedProps extends _$FlawedProps with _$FlawedPropsAccessorsMixin implements FlawedProps { - _$$FlawedProps._(); - - factory _$$FlawedProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FlawedProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FlawedProps$PlainMap(backingMap); - } - } + _$$FlawedProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -95,40 +89,6 @@ abstract class _$$FlawedProps extends _$FlawedProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FlawedProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$FlawedProps$PlainMap extends _$$FlawedProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FlawedProps$JsMap extends _$$FlawedProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$FlawedStateAccessorsMixin implements _$FlawedState { @override Map get state; @@ -180,55 +140,18 @@ const StateMeta _$metaForFlawedState = StateMeta( // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$FlawedState extends _$FlawedState +class _$$FlawedState extends _$FlawedState with _$FlawedStateAccessorsMixin implements FlawedState { - _$$FlawedState._(); - - factory _$$FlawedState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FlawedState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FlawedState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$FlawedState$PlainMap extends _$$FlawedState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$FlawedState([Map? backingMap]) : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FlawedState$JsMap extends _$$FlawedState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -236,10 +159,10 @@ class _$$FlawedState$JsMap extends _$$FlawedState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FlawedComponent extends FlawedComponent { - late _$$FlawedProps$JsMap _cachedTypedProps; + late _$$FlawedProps _cachedTypedProps; @override - _$$FlawedProps$JsMap get props => _cachedTypedProps; + _$$FlawedProps get props => _cachedTypedProps; @override set props(Map value) { @@ -256,16 +179,16 @@ class _$FlawedComponent extends FlawedComponent { } @override - _$$FlawedProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$FlawedProps$JsMap(backingMap); + _$$FlawedProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FlawedProps(backingMap); @override _$$FlawedProps typedPropsFactory(Map? backingMap) => _$$FlawedProps(backingMap); - late _$$FlawedState$JsMap _cachedTypedState; + late _$$FlawedState _cachedTypedState; @override - _$$FlawedState$JsMap get state => _cachedTypedState; + _$$FlawedState get state => _cachedTypedState; @override set state(Map value) { @@ -278,8 +201,8 @@ class _$FlawedComponent extends FlawedComponent { } @override - _$$FlawedState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$FlawedState$JsMap(backingMap); + _$$FlawedState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$FlawedState(backingMap); @override _$$FlawedState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/flawed_component_on_mount.over_react.g.dart b/test/over_react/component/fixtures/flawed_component_on_mount.over_react.g.dart index 9691ecdf3..7068c138c 100644 --- a/test/over_react/component/fixtures/flawed_component_on_mount.over_react.g.dart +++ b/test/over_react/component/fixtures/flawed_component_on_mount.over_react.g.dart @@ -34,25 +34,20 @@ const PropsMeta _$metaForFlawedOnMountProps = PropsMeta( ); _$$FlawedOnMountProps _$FlawedOnMount([Map? backingProps]) => - backingProps == null - ? _$$FlawedOnMountProps$JsMap(JsBackedMap()) - : _$$FlawedOnMountProps(backingProps); + _$$FlawedOnMountProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FlawedOnMountProps extends _$FlawedOnMountProps +class _$$FlawedOnMountProps extends _$FlawedOnMountProps with _$FlawedOnMountPropsAccessorsMixin implements FlawedOnMountProps { - _$$FlawedOnMountProps._(); - - factory _$$FlawedOnMountProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FlawedOnMountProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FlawedOnMountProps$PlainMap(backingMap); - } - } + _$$FlawedOnMountProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -77,48 +72,15 @@ abstract class _$$FlawedOnMountProps extends _$FlawedOnMountProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FlawedOnMountProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FlawedOnMountProps$PlainMap extends _$$FlawedOnMountProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedOnMountProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FlawedOnMountProps$JsMap extends _$$FlawedOnMountProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedOnMountProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FlawedOnMountComponent extends FlawedOnMountComponent { - late _$$FlawedOnMountProps$JsMap _cachedTypedProps; + late _$$FlawedOnMountProps _cachedTypedProps; @override - _$$FlawedOnMountProps$JsMap get props => _cachedTypedProps; + _$$FlawedOnMountProps get props => _cachedTypedProps; @override set props(Map value) { @@ -135,8 +97,8 @@ class _$FlawedOnMountComponent extends FlawedOnMountComponent { } @override - _$$FlawedOnMountProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$FlawedOnMountProps$JsMap(backingMap); + _$$FlawedOnMountProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FlawedOnMountProps(backingMap); @override _$$FlawedOnMountProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/flawed_component_that_renders_a_string.over_react.g.dart b/test/over_react/component/fixtures/flawed_component_that_renders_a_string.over_react.g.dart index 22c47b310..df0fa3bd9 100644 --- a/test/over_react/component/fixtures/flawed_component_that_renders_a_string.over_react.g.dart +++ b/test/over_react/component/fixtures/flawed_component_that_renders_a_string.over_react.g.dart @@ -35,26 +35,20 @@ const PropsMeta _$metaForFlawedWithStringChildProps = PropsMeta( ); _$$FlawedWithStringChildProps _$FlawedWithStringChild([Map? backingProps]) => - backingProps == null - ? _$$FlawedWithStringChildProps$JsMap(JsBackedMap()) - : _$$FlawedWithStringChildProps(backingProps); + _$$FlawedWithStringChildProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FlawedWithStringChildProps - extends _$FlawedWithStringChildProps +class _$$FlawedWithStringChildProps extends _$FlawedWithStringChildProps with _$FlawedWithStringChildPropsAccessorsMixin implements FlawedWithStringChildProps { - _$$FlawedWithStringChildProps._(); - - factory _$$FlawedWithStringChildProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FlawedWithStringChildProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FlawedWithStringChildProps$PlainMap(backingMap); - } - } + _$$FlawedWithStringChildProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -79,50 +73,15 @@ abstract class _$$FlawedWithStringChildProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FlawedWithStringChildProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FlawedWithStringChildProps$PlainMap - extends _$$FlawedWithStringChildProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedWithStringChildProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FlawedWithStringChildProps$JsMap - extends _$$FlawedWithStringChildProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedWithStringChildProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FlawedWithStringChildComponent extends FlawedWithStringChildComponent { - late _$$FlawedWithStringChildProps$JsMap _cachedTypedProps; + late _$$FlawedWithStringChildProps _cachedTypedProps; @override - _$$FlawedWithStringChildProps$JsMap get props => _cachedTypedProps; + _$$FlawedWithStringChildProps get props => _cachedTypedProps; @override set props(Map value) { @@ -139,9 +98,8 @@ class _$FlawedWithStringChildComponent extends FlawedWithStringChildComponent { } @override - _$$FlawedWithStringChildProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$FlawedWithStringChildProps$JsMap(backingMap); + _$$FlawedWithStringChildProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FlawedWithStringChildProps(backingMap); @override _$$FlawedWithStringChildProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/flawed_component_that_renders_nothing.over_react.g.dart b/test/over_react/component/fixtures/flawed_component_that_renders_nothing.over_react.g.dart index e4f6bfa14..8e38ad97c 100644 --- a/test/over_react/component/fixtures/flawed_component_that_renders_nothing.over_react.g.dart +++ b/test/over_react/component/fixtures/flawed_component_that_renders_nothing.over_react.g.dart @@ -35,25 +35,20 @@ const PropsMeta _$metaForFlawedWithNoChildProps = PropsMeta( ); _$$FlawedWithNoChildProps _$FlawedWithNoChild([Map? backingProps]) => - backingProps == null - ? _$$FlawedWithNoChildProps$JsMap(JsBackedMap()) - : _$$FlawedWithNoChildProps(backingProps); + _$$FlawedWithNoChildProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FlawedWithNoChildProps extends _$FlawedWithNoChildProps +class _$$FlawedWithNoChildProps extends _$FlawedWithNoChildProps with _$FlawedWithNoChildPropsAccessorsMixin implements FlawedWithNoChildProps { - _$$FlawedWithNoChildProps._(); - - factory _$$FlawedWithNoChildProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FlawedWithNoChildProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FlawedWithNoChildProps$PlainMap(backingMap); - } - } + _$$FlawedWithNoChildProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -78,48 +73,15 @@ abstract class _$$FlawedWithNoChildProps extends _$FlawedWithNoChildProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FlawedWithNoChildProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FlawedWithNoChildProps$PlainMap extends _$$FlawedWithNoChildProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedWithNoChildProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FlawedWithNoChildProps$JsMap extends _$$FlawedWithNoChildProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FlawedWithNoChildProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FlawedWithNoChildComponent extends FlawedWithNoChildComponent { - late _$$FlawedWithNoChildProps$JsMap _cachedTypedProps; + late _$$FlawedWithNoChildProps _cachedTypedProps; @override - _$$FlawedWithNoChildProps$JsMap get props => _cachedTypedProps; + _$$FlawedWithNoChildProps get props => _cachedTypedProps; @override set props(Map value) { @@ -136,9 +98,8 @@ class _$FlawedWithNoChildComponent extends FlawedWithNoChildComponent { } @override - _$$FlawedWithNoChildProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$FlawedWithNoChildProps$JsMap(backingMap); + _$$FlawedWithNoChildProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FlawedWithNoChildProps(backingMap); @override _$$FlawedWithNoChildProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/lazy_load_me_component.over_react.g.dart b/test/over_react/component/fixtures/lazy_load_me_component.over_react.g.dart index 8290367da..d6f651b60 100644 --- a/test/over_react/component/fixtures/lazy_load_me_component.over_react.g.dart +++ b/test/over_react/component/fixtures/lazy_load_me_component.over_react.g.dart @@ -10,7 +10,7 @@ part of 'lazy_load_me_component.dart'; final UiFactoryConfig<_$$LazyLoadMeProps> _$LazyLoadMeConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$LazyLoadMeProps(map), - jsMap: (map) => _$$LazyLoadMeProps$JsMap(map), + jsMap: (map) => _$$LazyLoadMeProps(map), ), displayName: 'LazyLoadMe'); @@ -25,22 +25,19 @@ final UiFactoryConfig<_$$LazyLoadMeProps> $LazyLoadMeConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$LazyLoadMeProps extends UiProps +class _$$LazyLoadMeProps extends UiProps with LazyLoadMePropsMixin, // If this generated mixin is undefined, it's likely because LazyLoadMePropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of LazyLoadMePropsMixin, and check that $LazyLoadMePropsMixin is exported/imported properly. $LazyLoadMePropsMixin implements LazyLoadMeProps { - _$$LazyLoadMeProps._(); + _$$LazyLoadMeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$LazyLoadMeProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$LazyLoadMeProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$LazyLoadMeProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -65,40 +62,3 @@ abstract class _$$LazyLoadMeProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$LazyLoadMeProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$LazyLoadMeProps$PlainMap extends _$$LazyLoadMeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$LazyLoadMeProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$LazyLoadMeProps$JsMap extends _$$LazyLoadMeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$LazyLoadMeProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/fixtures/lazy_load_me_props.over_react.g.dart b/test/over_react/component/fixtures/lazy_load_me_props.over_react.g.dart index 75246af1f..99602bdb5 100644 --- a/test/over_react/component/fixtures/lazy_load_me_props.over_react.g.dart +++ b/test/over_react/component/fixtures/lazy_load_me_props.over_react.g.dart @@ -47,29 +47,24 @@ const PropsMeta _$metaForLazyLoadMePropsMixin = PropsMeta( ); _$$LazyLoadMePropsMixin _$LazyLoadMePropsMapView([Map? backingProps]) => - backingProps == null - ? _$$LazyLoadMePropsMixin$JsMap(JsBackedMap()) - : _$$LazyLoadMePropsMixin(backingProps); + _$$LazyLoadMePropsMixin(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$LazyLoadMePropsMixin extends UiProps +class _$$LazyLoadMePropsMixin extends UiProps with LazyLoadMePropsMixin, // If this generated mixin is undefined, it's likely because LazyLoadMePropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of LazyLoadMePropsMixin, and check that $LazyLoadMePropsMixin is exported/imported properly. $LazyLoadMePropsMixin { - _$$LazyLoadMePropsMixin._(); + _$$LazyLoadMePropsMixin([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$LazyLoadMePropsMixin(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$LazyLoadMePropsMixin$JsMap(backingMap as JsBackedMap?); - } else { - return _$$LazyLoadMePropsMixin$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -94,40 +89,3 @@ abstract class _$$LazyLoadMePropsMixin extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$LazyLoadMePropsMixin = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$LazyLoadMePropsMixin$PlainMap extends _$$LazyLoadMePropsMixin { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$LazyLoadMePropsMixin$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$LazyLoadMePropsMixin$JsMap extends _$$LazyLoadMePropsMixin { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$LazyLoadMePropsMixin$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/fixtures/prop_typedef_fixtures.over_react.g.dart b/test/over_react/component/fixtures/prop_typedef_fixtures.over_react.g.dart index 3dac63145..75888d497 100644 --- a/test/over_react/component/fixtures/prop_typedef_fixtures.over_react.g.dart +++ b/test/over_react/component/fixtures/prop_typedef_fixtures.over_react.g.dart @@ -241,31 +241,21 @@ class TestConsumingAbstractCustomRendererComponentProps _$$TestConsumingAbstractCustomRendererComponentProps _$TestConsumingAbstractCustomRendererComponent([Map? backingProps]) => - backingProps == null - ? _$$TestConsumingAbstractCustomRendererComponentProps$JsMap( - JsBackedMap()) - : _$$TestConsumingAbstractCustomRendererComponentProps( - backingProps); + _$$TestConsumingAbstractCustomRendererComponentProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestConsumingAbstractCustomRendererComponentProps +class _$$TestConsumingAbstractCustomRendererComponentProps extends _$TestConsumingAbstractCustomRendererComponentProps with _$TestConsumingAbstractCustomRendererComponentPropsAccessorsMixin implements TestConsumingAbstractCustomRendererComponentProps { - _$$TestConsumingAbstractCustomRendererComponentProps._(); - - factory _$$TestConsumingAbstractCustomRendererComponentProps( - Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestConsumingAbstractCustomRendererComponentProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestConsumingAbstractCustomRendererComponentProps$PlainMap( - backingMap); - } - } + _$$TestConsumingAbstractCustomRendererComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -294,53 +284,16 @@ abstract class _$$TestConsumingAbstractCustomRendererComponentProps const _$getPropKey$_$$TestConsumingAbstractCustomRendererComponentProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestConsumingAbstractCustomRendererComponentProps$PlainMap - extends _$$TestConsumingAbstractCustomRendererComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestConsumingAbstractCustomRendererComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestConsumingAbstractCustomRendererComponentProps$JsMap - extends _$$TestConsumingAbstractCustomRendererComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestConsumingAbstractCustomRendererComponentProps$JsMap( - JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestConsumingAbstractCustomRendererComponentComponent extends TestConsumingAbstractCustomRendererComponentComponent { - late _$$TestConsumingAbstractCustomRendererComponentProps$JsMap - _cachedTypedProps; + late _$$TestConsumingAbstractCustomRendererComponentProps _cachedTypedProps; @override - _$$TestConsumingAbstractCustomRendererComponentProps$JsMap get props => + _$$TestConsumingAbstractCustomRendererComponentProps get props => _cachedTypedProps; @override @@ -358,10 +311,9 @@ class _$TestConsumingAbstractCustomRendererComponentComponent } @override - _$$TestConsumingAbstractCustomRendererComponentProps$JsMap - typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestConsumingAbstractCustomRendererComponentProps$JsMap( - backingMap); + _$$TestConsumingAbstractCustomRendererComponentProps typedPropsFactoryJs( + JsBackedMap? backingMap) => + _$$TestConsumingAbstractCustomRendererComponentProps(backingMap); @override _$$TestConsumingAbstractCustomRendererComponentProps typedPropsFactory( @@ -463,27 +415,21 @@ class TestConsumingCustomRendererComponentProps _$$TestConsumingCustomRendererComponentProps _$TestConsumingCustomRendererComponent([Map? backingProps]) => - backingProps == null - ? _$$TestConsumingCustomRendererComponentProps$JsMap(JsBackedMap()) - : _$$TestConsumingCustomRendererComponentProps(backingProps); + _$$TestConsumingCustomRendererComponentProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestConsumingCustomRendererComponentProps +class _$$TestConsumingCustomRendererComponentProps extends _$TestConsumingCustomRendererComponentProps with _$TestConsumingCustomRendererComponentPropsAccessorsMixin implements TestConsumingCustomRendererComponentProps { - _$$TestConsumingCustomRendererComponentProps._(); - - factory _$$TestConsumingCustomRendererComponentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestConsumingCustomRendererComponentProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestConsumingCustomRendererComponentProps$PlainMap(backingMap); - } - } + _$$TestConsumingCustomRendererComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -509,52 +455,16 @@ abstract class _$$TestConsumingCustomRendererComponentProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestConsumingCustomRendererComponentProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestConsumingCustomRendererComponentProps$PlainMap - extends _$$TestConsumingCustomRendererComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestConsumingCustomRendererComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestConsumingCustomRendererComponentProps$JsMap - extends _$$TestConsumingCustomRendererComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestConsumingCustomRendererComponentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestConsumingCustomRendererComponentComponent extends TestConsumingCustomRendererComponentComponent { - late _$$TestConsumingCustomRendererComponentProps$JsMap _cachedTypedProps; + late _$$TestConsumingCustomRendererComponentProps _cachedTypedProps; @override - _$$TestConsumingCustomRendererComponentProps$JsMap get props => - _cachedTypedProps; + _$$TestConsumingCustomRendererComponentProps get props => _cachedTypedProps; @override set props(Map value) { @@ -571,9 +481,9 @@ class _$TestConsumingCustomRendererComponentComponent } @override - _$$TestConsumingCustomRendererComponentProps$JsMap typedPropsFactoryJs( + _$$TestConsumingCustomRendererComponentProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestConsumingCustomRendererComponentProps$JsMap(backingMap); + _$$TestConsumingCustomRendererComponentProps(backingMap); @override _$$TestConsumingCustomRendererComponentProps typedPropsFactory( @@ -655,29 +565,21 @@ class TestCustomRendererFromAbstractComponentProps _$$TestCustomRendererFromAbstractComponentProps _$TestCustomRendererFromAbstractComponent([Map? backingProps]) => - backingProps == null - ? _$$TestCustomRendererFromAbstractComponentProps$JsMap( - JsBackedMap()) - : _$$TestCustomRendererFromAbstractComponentProps(backingProps); + _$$TestCustomRendererFromAbstractComponentProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestCustomRendererFromAbstractComponentProps +class _$$TestCustomRendererFromAbstractComponentProps extends _$TestCustomRendererFromAbstractComponentProps with _$TestCustomRendererFromAbstractComponentPropsAccessorsMixin implements TestCustomRendererFromAbstractComponentProps { - _$$TestCustomRendererFromAbstractComponentProps._(); - - factory _$$TestCustomRendererFromAbstractComponentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestCustomRendererFromAbstractComponentProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestCustomRendererFromAbstractComponentProps$PlainMap( - backingMap); - } - } + _$$TestCustomRendererFromAbstractComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -703,42 +605,6 @@ abstract class _$$TestCustomRendererFromAbstractComponentProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestCustomRendererFromAbstractComponentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestCustomRendererFromAbstractComponentProps$PlainMap - extends _$$TestCustomRendererFromAbstractComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererFromAbstractComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestCustomRendererFromAbstractComponentProps$JsMap - extends _$$TestCustomRendererFromAbstractComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererFromAbstractComponentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestCustomRendererFromAbstractComponentStateAccessorsMixin implements _$TestCustomRendererFromAbstractComponentState { @override @@ -766,60 +632,20 @@ class TestCustomRendererFromAbstractComponentState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestCustomRendererFromAbstractComponentState +class _$$TestCustomRendererFromAbstractComponentState extends _$TestCustomRendererFromAbstractComponentState with _$TestCustomRendererFromAbstractComponentStateAccessorsMixin implements TestCustomRendererFromAbstractComponentState { - _$$TestCustomRendererFromAbstractComponentState._(); - - factory _$$TestCustomRendererFromAbstractComponentState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestCustomRendererFromAbstractComponentState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestCustomRendererFromAbstractComponentState$PlainMap( - backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestCustomRendererFromAbstractComponentState$PlainMap - extends _$$TestCustomRendererFromAbstractComponentState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererFromAbstractComponentState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestCustomRendererFromAbstractComponentState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestCustomRendererFromAbstractComponentState$JsMap - extends _$$TestCustomRendererFromAbstractComponentState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererFromAbstractComponentState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -828,10 +654,10 @@ class _$$TestCustomRendererFromAbstractComponentState$JsMap // generated for the associated props class. class _$TestCustomRendererFromAbstractComponentComponent extends TestCustomRendererFromAbstractComponentComponent { - late _$$TestCustomRendererFromAbstractComponentProps$JsMap _cachedTypedProps; + late _$$TestCustomRendererFromAbstractComponentProps _cachedTypedProps; @override - _$$TestCustomRendererFromAbstractComponentProps$JsMap get props => + _$$TestCustomRendererFromAbstractComponentProps get props => _cachedTypedProps; @override @@ -849,18 +675,18 @@ class _$TestCustomRendererFromAbstractComponentComponent } @override - _$$TestCustomRendererFromAbstractComponentProps$JsMap typedPropsFactoryJs( + _$$TestCustomRendererFromAbstractComponentProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestCustomRendererFromAbstractComponentProps$JsMap(backingMap); + _$$TestCustomRendererFromAbstractComponentProps(backingMap); @override _$$TestCustomRendererFromAbstractComponentProps typedPropsFactory( Map? backingMap) => _$$TestCustomRendererFromAbstractComponentProps(backingMap); - late _$$TestCustomRendererFromAbstractComponentState$JsMap _cachedTypedState; + late _$$TestCustomRendererFromAbstractComponentState _cachedTypedState; @override - _$$TestCustomRendererFromAbstractComponentState$JsMap get state => + _$$TestCustomRendererFromAbstractComponentState get state => _cachedTypedState; @override @@ -874,9 +700,9 @@ class _$TestCustomRendererFromAbstractComponentComponent } @override - _$$TestCustomRendererFromAbstractComponentState$JsMap typedStateFactoryJs( + _$$TestCustomRendererFromAbstractComponentState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$TestCustomRendererFromAbstractComponentState$JsMap(backingMap); + _$$TestCustomRendererFromAbstractComponentState(backingMap); @override _$$TestCustomRendererFromAbstractComponentState typedStateFactory( @@ -1030,27 +856,21 @@ class TestCustomRendererComponentProps _$$TestCustomRendererComponentProps _$TestCustomRendererComponent( [Map? backingProps]) => - backingProps == null - ? _$$TestCustomRendererComponentProps$JsMap(JsBackedMap()) - : _$$TestCustomRendererComponentProps(backingProps); + _$$TestCustomRendererComponentProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestCustomRendererComponentProps +class _$$TestCustomRendererComponentProps extends _$TestCustomRendererComponentProps with _$TestCustomRendererComponentPropsAccessorsMixin implements TestCustomRendererComponentProps { - _$$TestCustomRendererComponentProps._(); - - factory _$$TestCustomRendererComponentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestCustomRendererComponentProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestCustomRendererComponentProps$PlainMap(backingMap); - } - } + _$$TestCustomRendererComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1074,42 +894,6 @@ abstract class _$$TestCustomRendererComponentProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestCustomRendererComponentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestCustomRendererComponentProps$PlainMap - extends _$$TestCustomRendererComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestCustomRendererComponentProps$JsMap - extends _$$TestCustomRendererComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererComponentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestCustomRendererComponentStateAccessorsMixin implements _$TestCustomRendererComponentState { @override @@ -1154,59 +938,20 @@ class TestCustomRendererComponentState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestCustomRendererComponentState +class _$$TestCustomRendererComponentState extends _$TestCustomRendererComponentState with _$TestCustomRendererComponentStateAccessorsMixin implements TestCustomRendererComponentState { - _$$TestCustomRendererComponentState._(); - - factory _$$TestCustomRendererComponentState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestCustomRendererComponentState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestCustomRendererComponentState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestCustomRendererComponentState$PlainMap - extends _$$TestCustomRendererComponentState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererComponentState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestCustomRendererComponentState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestCustomRendererComponentState$JsMap - extends _$$TestCustomRendererComponentState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCustomRendererComponentState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1215,10 +960,10 @@ class _$$TestCustomRendererComponentState$JsMap // generated for the associated props class. class _$TestCustomRendererComponentComponent extends TestCustomRendererComponentComponent { - late _$$TestCustomRendererComponentProps$JsMap _cachedTypedProps; + late _$$TestCustomRendererComponentProps _cachedTypedProps; @override - _$$TestCustomRendererComponentProps$JsMap get props => _cachedTypedProps; + _$$TestCustomRendererComponentProps get props => _cachedTypedProps; @override set props(Map value) { @@ -1235,17 +980,17 @@ class _$TestCustomRendererComponentComponent } @override - _$$TestCustomRendererComponentProps$JsMap typedPropsFactoryJs( + _$$TestCustomRendererComponentProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestCustomRendererComponentProps$JsMap(backingMap); + _$$TestCustomRendererComponentProps(backingMap); @override _$$TestCustomRendererComponentProps typedPropsFactory(Map? backingMap) => _$$TestCustomRendererComponentProps(backingMap); - late _$$TestCustomRendererComponentState$JsMap _cachedTypedState; + late _$$TestCustomRendererComponentState _cachedTypedState; @override - _$$TestCustomRendererComponentState$JsMap get state => _cachedTypedState; + _$$TestCustomRendererComponentState get state => _cachedTypedState; @override set state(Map value) { @@ -1258,9 +1003,9 @@ class _$TestCustomRendererComponentComponent } @override - _$$TestCustomRendererComponentState$JsMap typedStateFactoryJs( + _$$TestCustomRendererComponentState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$TestCustomRendererComponentState$JsMap(backingMap); + _$$TestCustomRendererComponentState(backingMap); @override _$$TestCustomRendererComponentState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/fixtures/pure_test_components.over_react.g.dart b/test/over_react/component/fixtures/pure_test_components.over_react.g.dart index 765f4d4c2..05a9e7164 100644 --- a/test/over_react/component/fixtures/pure_test_components.over_react.g.dart +++ b/test/over_react/component/fixtures/pure_test_components.over_react.g.dart @@ -21,31 +21,26 @@ final $PureTestWrapperComponentFactory = registerComponent2( ); _$$PureTestWrapperProps _$PureTestWrapper([Map? backingProps]) => - backingProps == null - ? _$$PureTestWrapperProps$JsMap(JsBackedMap()) - : _$$PureTestWrapperProps(backingProps); + _$$PureTestWrapperProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$PureTestWrapperProps extends UiProps +class _$$PureTestWrapperProps extends UiProps with SharedPureTestPropsMixin, // If this generated mixin is undefined, it's likely because SharedPureTestPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SharedPureTestPropsMixin, and check that $SharedPureTestPropsMixin is exported/imported properly. $SharedPureTestPropsMixin implements PureTestWrapperProps { - _$$PureTestWrapperProps._(); - - factory _$$PureTestWrapperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$PureTestWrapperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$PureTestWrapperProps$PlainMap(backingMap); - } - } + _$$PureTestWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -76,43 +71,6 @@ abstract class _$$PureTestWrapperProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$PureTestWrapperProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$PureTestWrapperProps$PlainMap extends _$$PureTestWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$PureTestWrapperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$PureTestWrapperProps$JsMap extends _$$PureTestWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$PureTestWrapperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -120,10 +78,10 @@ class _$$PureTestWrapperProps$JsMap extends _$$PureTestWrapperProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$PureTestWrapperComponent extends PureTestWrapperComponent { - late _$$PureTestWrapperProps$JsMap _cachedTypedProps; + late _$$PureTestWrapperProps _cachedTypedProps; @override - _$$PureTestWrapperProps$JsMap get props => _cachedTypedProps; + _$$PureTestWrapperProps get props => _cachedTypedProps; @override set props(Map value) { @@ -140,8 +98,8 @@ class _$PureTestWrapperComponent extends PureTestWrapperComponent { } @override - _$$PureTestWrapperProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$PureTestWrapperProps$JsMap(backingMap); + _$$PureTestWrapperProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$PureTestWrapperProps(backingMap); @override _$$PureTestWrapperProps typedPropsFactory(Map? backingMap) => @@ -179,16 +137,15 @@ final $PureTestComponentFactory = registerComponent2( parentType: null, ); -_$$PureTestProps _$PureTest([Map? backingProps]) => backingProps == null - ? _$$PureTestProps$JsMap(JsBackedMap()) - : _$$PureTestProps(backingProps); +_$$PureTestProps _$PureTest([Map? backingProps]) => + _$$PureTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$PureTestProps extends UiProps +class _$$PureTestProps extends UiProps with SharedPureTestPropsMixin, // If this generated mixin is undefined, it's likely because SharedPureTestPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SharedPureTestPropsMixin, and check that $SharedPureTestPropsMixin is exported/imported properly. @@ -198,15 +155,12 @@ abstract class _$$PureTestProps extends UiProps $PureTestPropsMixin implements PureTestProps { - _$$PureTestProps._(); - - factory _$$PureTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$PureTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$PureTestProps$PlainMap(backingMap); - } - } + _$$PureTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -241,103 +195,26 @@ abstract class _$$PureTestProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$PureTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$PureTestProps$PlainMap extends _$$PureTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$PureTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$PureTestProps$JsMap extends _$$PureTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$PureTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$PureTestState extends UiState +class _$$PureTestState extends UiState with PureTestState, // If this generated mixin is undefined, it's likely because PureTestState is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of PureTestState, and check that $PureTestState is exported/imported properly. $PureTestState { - _$$PureTestState._(); - - factory _$$PureTestState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$PureTestState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$PureTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$PureTestState$PlainMap extends _$$PureTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$PureTestState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$PureTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} + final Map state; -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$PureTestState$JsMap extends _$$PureTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$PureTestState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } - - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -347,10 +224,10 @@ class _$$PureTestState$JsMap extends _$$PureTestState { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$PureTestComponent extends PureTestComponent { - late _$$PureTestProps$JsMap _cachedTypedProps; + late _$$PureTestProps _cachedTypedProps; @override - _$$PureTestProps$JsMap get props => _cachedTypedProps; + _$$PureTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -367,16 +244,16 @@ class _$PureTestComponent extends PureTestComponent { } @override - _$$PureTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$PureTestProps$JsMap(backingMap); + _$$PureTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$PureTestProps(backingMap); @override _$$PureTestProps typedPropsFactory(Map? backingMap) => _$$PureTestProps(backingMap); - late _$$PureTestState$JsMap _cachedTypedState; + late _$$PureTestState _cachedTypedState; @override - _$$PureTestState$JsMap get state => _cachedTypedState; + _$$PureTestState get state => _cachedTypedState; @override set state(Map value) { @@ -389,8 +266,8 @@ class _$PureTestComponent extends PureTestComponent { } @override - _$$PureTestState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$PureTestState$JsMap(backingMap); + _$$PureTestState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$PureTestState(backingMap); @override _$$PureTestState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/lazy_test.over_react.g.dart b/test/over_react/component/lazy_test.over_react.g.dart index 906fca895..7f4dbfe9f 100644 --- a/test/over_react/component/lazy_test.over_react.g.dart +++ b/test/over_react/component/lazy_test.over_react.g.dart @@ -21,16 +21,14 @@ final $TestDartClassComponentFactory = registerComponent2( ); _$$TestDartClassProps _$TestDartClass([Map? backingProps]) => - backingProps == null - ? _$$TestDartClassProps$JsMap(JsBackedMap()) - : _$$TestDartClassProps(backingProps); + _$$TestDartClassProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestDartClassProps extends UiProps +class _$$TestDartClassProps extends UiProps with TestJsProps, // If this generated mixin is undefined, it's likely because TestJsProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestJsProps, and check that $TestJsProps is exported/imported properly. @@ -40,15 +38,12 @@ abstract class _$$TestDartClassProps extends UiProps $TestDartPropsMixin implements TestDartClassProps { - _$$TestDartClassProps._(); + _$$TestDartClassProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$TestDartClassProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestDartClassProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestDartClassProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -81,43 +76,6 @@ abstract class _$$TestDartClassProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestDartClassProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestDartClassProps$PlainMap extends _$$TestDartClassProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestDartClassProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestDartClassProps$JsMap extends _$$TestDartClassProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestDartClassProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -125,10 +83,10 @@ class _$$TestDartClassProps$JsMap extends _$$TestDartClassProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$TestDartClassComponent extends TestDartClassComponent { - late _$$TestDartClassProps$JsMap _cachedTypedProps; + late _$$TestDartClassProps _cachedTypedProps; @override - _$$TestDartClassProps$JsMap get props => _cachedTypedProps; + _$$TestDartClassProps get props => _cachedTypedProps; @override set props(Map value) { @@ -145,8 +103,8 @@ class _$TestDartClassComponent extends TestDartClassComponent { } @override - _$$TestDartClassProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestDartClassProps$JsMap(backingMap); + _$$TestDartClassProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestDartClassProps(backingMap); @override _$$TestDartClassProps typedPropsFactory(Map? backingMap) => @@ -188,29 +146,24 @@ final $ClassComponentTypeTesterComponentFactory = registerComponent2( _$$ClassComponentTypeTesterProps _$ClassComponentTypeTester( [Map? backingProps]) => - backingProps == null - ? _$$ClassComponentTypeTesterProps$JsMap(JsBackedMap()) - : _$$ClassComponentTypeTesterProps(backingProps); + _$$ClassComponentTypeTesterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ClassComponentTypeTesterProps extends UiProps +class _$$ClassComponentTypeTesterProps extends UiProps with ClassComponentTypeTesterProps, // If this generated mixin is undefined, it's likely because ClassComponentTypeTesterProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ClassComponentTypeTesterProps, and check that $ClassComponentTypeTesterProps is exported/imported properly. $ClassComponentTypeTesterProps { - _$$ClassComponentTypeTesterProps._(); + _$$ClassComponentTypeTesterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$ClassComponentTypeTesterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ClassComponentTypeTesterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ClassComponentTypeTesterProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -241,45 +194,6 @@ abstract class _$$ClassComponentTypeTesterProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ClassComponentTypeTesterProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ClassComponentTypeTesterProps$PlainMap - extends _$$ClassComponentTypeTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ClassComponentTypeTesterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ClassComponentTypeTesterProps$JsMap - extends _$$ClassComponentTypeTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ClassComponentTypeTesterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -288,10 +202,10 @@ class _$$ClassComponentTypeTesterProps$JsMap ' Do not reference it in your code, as it may change at any time.') class _$ClassComponentTypeTesterComponent extends ClassComponentTypeTesterComponent { - late _$$ClassComponentTypeTesterProps$JsMap _cachedTypedProps; + late _$$ClassComponentTypeTesterProps _cachedTypedProps; @override - _$$ClassComponentTypeTesterProps$JsMap get props => _cachedTypedProps; + _$$ClassComponentTypeTesterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -308,9 +222,9 @@ class _$ClassComponentTypeTesterComponent } @override - _$$ClassComponentTypeTesterProps$JsMap typedPropsFactoryJs( + _$$ClassComponentTypeTesterProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$ClassComponentTypeTesterProps$JsMap(backingMap); + _$$ClassComponentTypeTesterProps(backingMap); @override _$$ClassComponentTypeTesterProps typedPropsFactory(Map? backingMap) => @@ -613,7 +527,7 @@ final UiFactoryConfig<_$$DartTestJsWrapperProps> _$DartTestJsWrapperConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$DartTestJsWrapperProps(map), - jsMap: (map) => _$$DartTestJsWrapperProps$JsMap(map), + jsMap: (map) => _$$DartTestJsWrapperProps(map), ), displayName: 'DartTestJsWrapper'); @@ -628,7 +542,7 @@ final UiFactoryConfig<_$$DartTestJsWrapperProps> $DartTestJsWrapperConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$DartTestJsWrapperProps extends UiProps +class _$$DartTestJsWrapperProps extends UiProps with TestJsProps, // If this generated mixin is undefined, it's likely because TestJsProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestJsProps, and check that $TestJsProps is exported/imported properly. @@ -638,15 +552,12 @@ abstract class _$$DartTestJsWrapperProps extends UiProps $DartTestJsWrapperPropsMixin implements DartTestJsWrapperProps { - _$$DartTestJsWrapperProps._(); + _$$DartTestJsWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$DartTestJsWrapperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DartTestJsWrapperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$DartTestJsWrapperProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -673,49 +584,11 @@ abstract class _$$DartTestJsWrapperProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DartTestJsWrapperProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DartTestJsWrapperProps$PlainMap extends _$$DartTestJsWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DartTestJsWrapperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DartTestJsWrapperProps$JsMap extends _$$DartTestJsWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DartTestJsWrapperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$JsTypeTesterProps> _$JsTypeTesterConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$JsTypeTesterProps(map), - jsMap: (map) => _$$JsTypeTesterProps$JsMap(map), + jsMap: (map) => _$$JsTypeTesterProps(map), ), displayName: 'JsTypeTester'); @@ -730,20 +603,17 @@ final UiFactoryConfig<_$$JsTypeTesterProps> $JsTypeTesterConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$JsTypeTesterProps extends UiProps +class _$$JsTypeTesterProps extends UiProps with JsTypeTesterProps, // If this generated mixin is undefined, it's likely because JsTypeTesterProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of JsTypeTesterProps, and check that $JsTypeTesterProps is exported/imported properly. $JsTypeTesterProps { - _$$JsTypeTesterProps._(); + _$$JsTypeTesterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$JsTypeTesterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$JsTypeTesterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$JsTypeTesterProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -768,48 +638,10 @@ abstract class _$$JsTypeTesterProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$JsTypeTesterProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$JsTypeTesterProps$PlainMap extends _$$JsTypeTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$JsTypeTesterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$JsTypeTesterProps$JsMap extends _$$JsTypeTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$JsTypeTesterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestDartProps> _$TestDartConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestDartProps(map), - jsMap: (map) => _$$TestDartProps$JsMap(map), + jsMap: (map) => _$$TestDartProps(map), ), displayName: 'TestDart'); @@ -823,7 +655,7 @@ final UiFactoryConfig<_$$TestDartProps> $TestDartConfig = _$TestDartConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestDartProps extends UiProps +class _$$TestDartProps extends UiProps with TestJsProps, // If this generated mixin is undefined, it's likely because TestJsProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestJsProps, and check that $TestJsProps is exported/imported properly. @@ -833,15 +665,12 @@ abstract class _$$TestDartProps extends UiProps $TestDartPropsMixin implements TestDartProps { - _$$TestDartProps._(); + _$$TestDartProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$TestDartProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestDartProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestDartProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -867,49 +696,11 @@ abstract class _$$TestDartProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestDartProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestDartProps$PlainMap extends _$$TestDartProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestDartProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestDartProps$JsMap extends _$$TestDartProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestDartProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TypeTesterProps> _$UiForwardRefTypeTesterConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TypeTesterProps(map), - jsMap: (map) => _$$TypeTesterProps$JsMap(map), + jsMap: (map) => _$$TypeTesterProps(map), ), displayName: 'UiForwardRefTypeTester'); @@ -925,20 +716,17 @@ final UiFactoryConfig<_$$TypeTesterProps> $UiForwardRefTypeTesterConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TypeTesterProps extends UiProps +class _$$TypeTesterProps extends UiProps with TypeTesterProps, // If this generated mixin is undefined, it's likely because TypeTesterProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TypeTesterProps, and check that $TypeTesterProps is exported/imported properly. $TypeTesterProps { - _$$TypeTesterProps._(); + _$$TypeTesterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$TypeTesterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TypeTesterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TypeTesterProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -963,40 +751,3 @@ abstract class _$$TypeTesterProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TypeTesterProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TypeTesterProps$PlainMap extends _$$TypeTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TypeTesterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TypeTesterProps$JsMap extends _$$TypeTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TypeTesterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/memo_test.over_react.g.dart b/test/over_react/component/memo_test.over_react.g.dart index db1d6fa74..3e6853b78 100644 --- a/test/over_react/component/memo_test.over_react.g.dart +++ b/test/over_react/component/memo_test.over_react.g.dart @@ -57,25 +57,20 @@ class BasicUiComponent2Props extends _$BasicUiComponent2Props } _$$BasicUiComponent2Props _$BasicUiComponent2([Map? backingProps]) => - backingProps == null - ? _$$BasicUiComponent2Props$JsMap(JsBackedMap()) - : _$$BasicUiComponent2Props(backingProps); + _$$BasicUiComponent2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$BasicUiComponent2Props extends _$BasicUiComponent2Props +class _$$BasicUiComponent2Props extends _$BasicUiComponent2Props with _$BasicUiComponent2PropsAccessorsMixin implements BasicUiComponent2Props { - _$$BasicUiComponent2Props._(); - - factory _$$BasicUiComponent2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicUiComponent2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicUiComponent2Props$PlainMap(backingMap); - } - } + _$$BasicUiComponent2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -100,48 +95,15 @@ abstract class _$$BasicUiComponent2Props extends _$BasicUiComponent2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicUiComponent2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$BasicUiComponent2Props$PlainMap extends _$$BasicUiComponent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicUiComponent2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$BasicUiComponent2Props$JsMap extends _$$BasicUiComponent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicUiComponent2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$BasicUiComponent2Component extends BasicUiComponent2Component { - late _$$BasicUiComponent2Props$JsMap _cachedTypedProps; + late _$$BasicUiComponent2Props _cachedTypedProps; @override - _$$BasicUiComponent2Props$JsMap get props => _cachedTypedProps; + _$$BasicUiComponent2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -158,9 +120,8 @@ class _$BasicUiComponent2Component extends BasicUiComponent2Component { } @override - _$$BasicUiComponent2Props$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$BasicUiComponent2Props$JsMap(backingMap); + _$$BasicUiComponent2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$BasicUiComponent2Props(backingMap); @override _$$BasicUiComponent2Props typedPropsFactory(Map? backingMap) => @@ -237,7 +198,7 @@ final UiFactoryConfig<_$$FunctionCustomPropsProps> _$FunctionCustomPropsConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$FunctionCustomPropsProps(map), - jsMap: (map) => _$$FunctionCustomPropsProps$JsMap(map), + jsMap: (map) => _$$FunctionCustomPropsProps(map), ), displayName: 'FunctionCustomProps'); @@ -252,20 +213,17 @@ final UiFactoryConfig<_$$FunctionCustomPropsProps> $FunctionCustomPropsConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$FunctionCustomPropsProps extends UiProps +class _$$FunctionCustomPropsProps extends UiProps with FunctionCustomPropsProps, // If this generated mixin is undefined, it's likely because FunctionCustomPropsProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of FunctionCustomPropsProps, and check that $FunctionCustomPropsProps is exported/imported properly. $FunctionCustomPropsProps { - _$$FunctionCustomPropsProps._(); - - factory _$$FunctionCustomPropsProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FunctionCustomPropsProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FunctionCustomPropsProps$PlainMap(backingMap); - } - } + _$$FunctionCustomPropsProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -290,40 +248,3 @@ abstract class _$$FunctionCustomPropsProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FunctionCustomPropsProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$FunctionCustomPropsProps$PlainMap extends _$$FunctionCustomPropsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FunctionCustomPropsProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$FunctionCustomPropsProps$JsMap extends _$$FunctionCustomPropsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FunctionCustomPropsProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/prop_mixins_test.dart b/test/over_react/component/prop_mixins_test.dart index e7659abfa..5bb01a05c 100644 --- a/test/over_react/component/prop_mixins_test.dart +++ b/test/over_react/component/prop_mixins_test.dart @@ -108,7 +108,6 @@ main() { expect(instance, equals(ariaProps()..labelledby = 'foo'), reason: 'should set the prop properly'); expect(instance.aria.labelledby, 'foo', reason: 'should be able to read the prop in addition to setting it'); - expect(instance.aria, same(instance.aria), reason: 'should cache the backing typed MapView'); }); test('DOM props', () { @@ -117,7 +116,6 @@ main() { expect(instance, equals(domProps()..target = 'foo'), reason: 'should set the prop properly'); expect(instance.dom.target, 'foo', reason: 'should be able to read the prop in addition to setting it'); - expect(instance.dom, same(instance.dom), reason: 'should cache the backing typed MapView'); }); }); }); diff --git a/test/over_react/component/ref_util_test.over_react.g.dart b/test/over_react/component/ref_util_test.over_react.g.dart index 55ae3552c..eae135c0a 100644 --- a/test/over_react/component/ref_util_test.over_react.g.dart +++ b/test/over_react/component/ref_util_test.over_react.g.dart @@ -20,29 +20,23 @@ final $BasicComponentFactory = registerComponent2( parentType: null, ); -_$$BasicProps _$Basic([Map? backingProps]) => backingProps == null - ? _$$BasicProps$JsMap(JsBackedMap()) - : _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map? backingProps]) => _$$BasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicProps extends UiProps +class _$$BasicProps extends UiProps with BasicProps, // If this generated mixin is undefined, it's likely because BasicProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicProps, and check that $BasicProps is exported/imported properly. $BasicProps { - _$$BasicProps._(); - - factory _$$BasicProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicProps$PlainMap(backingMap); - } - } + _$$BasicProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -72,43 +66,6 @@ abstract class _$$BasicProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$PlainMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$JsMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -116,10 +73,10 @@ class _$$BasicProps$JsMap extends _$$BasicProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$BasicComponent extends BasicComponent { - late _$$BasicProps$JsMap _cachedTypedProps; + late _$$BasicProps _cachedTypedProps; @override - _$$BasicProps$JsMap get props => _cachedTypedProps; + _$$BasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -136,8 +93,8 @@ class _$BasicComponent extends BasicComponent { } @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$BasicProps$JsMap(backingMap); + _$$BasicProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$BasicProps(backingMap); @override _$$BasicProps typedPropsFactory(Map? backingMap) => _$$BasicProps(backingMap); @@ -222,7 +179,7 @@ final UiFactoryConfig<_$$BasicUiFunctionProps> _$BasicUiFunctionConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$BasicUiFunctionProps(map), - jsMap: (map) => _$$BasicUiFunctionProps$JsMap(map), + jsMap: (map) => _$$BasicUiFunctionProps(map), ), displayName: 'BasicUiFunction'); @@ -237,20 +194,17 @@ final UiFactoryConfig<_$$BasicUiFunctionProps> $BasicUiFunctionConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicUiFunctionProps extends UiProps +class _$$BasicUiFunctionProps extends UiProps with BasicUiFunctionProps, // If this generated mixin is undefined, it's likely because BasicUiFunctionProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicUiFunctionProps, and check that $BasicUiFunctionProps is exported/imported properly. $BasicUiFunctionProps { - _$$BasicUiFunctionProps._(); - - factory _$$BasicUiFunctionProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicUiFunctionProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicUiFunctionProps$PlainMap(backingMap); - } - } + _$$BasicUiFunctionProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -275,49 +229,11 @@ abstract class _$$BasicUiFunctionProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicUiFunctionProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicUiFunctionProps$PlainMap extends _$$BasicUiFunctionProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicUiFunctionProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicUiFunctionProps$JsMap extends _$$BasicUiFunctionProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicUiFunctionProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$SecondaryBasicUiFunctionProps> _$TopLevelForwardUiRefFunctionConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$SecondaryBasicUiFunctionProps(map), - jsMap: (map) => _$$SecondaryBasicUiFunctionProps$JsMap(map), + jsMap: (map) => _$$SecondaryBasicUiFunctionProps(map), ), displayName: 'TopLevelForwardUiRefFunction'); @@ -333,22 +249,19 @@ final UiFactoryConfig<_$$SecondaryBasicUiFunctionProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SecondaryBasicUiFunctionProps extends UiProps +class _$$SecondaryBasicUiFunctionProps extends UiProps with BasicUiFunctionProps, // If this generated mixin is undefined, it's likely because BasicUiFunctionProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicUiFunctionProps, and check that $BasicUiFunctionProps is exported/imported properly. $BasicUiFunctionProps implements SecondaryBasicUiFunctionProps { - _$$SecondaryBasicUiFunctionProps._(); - - factory _$$SecondaryBasicUiFunctionProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SecondaryBasicUiFunctionProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$SecondaryBasicUiFunctionProps$PlainMap(backingMap); - } - } + _$$SecondaryBasicUiFunctionProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -373,42 +286,3 @@ abstract class _$$SecondaryBasicUiFunctionProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SecondaryBasicUiFunctionProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SecondaryBasicUiFunctionProps$PlainMap - extends _$$SecondaryBasicUiFunctionProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SecondaryBasicUiFunctionProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SecondaryBasicUiFunctionProps$JsMap - extends _$$SecondaryBasicUiFunctionProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SecondaryBasicUiFunctionProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component/typed_factory_test.over_react.g.dart b/test/over_react/component/typed_factory_test.over_react.g.dart index d62ffa41b..4d4b72c82 100644 --- a/test/over_react/component/typed_factory_test.over_react.g.dart +++ b/test/over_react/component/typed_factory_test.over_react.g.dart @@ -57,25 +57,20 @@ class TypedFactoryTesterProps extends _$TypedFactoryTesterProps } _$$TypedFactoryTesterProps _$TypedFactoryTester([Map? backingProps]) => - backingProps == null - ? _$$TypedFactoryTesterProps$JsMap(JsBackedMap()) - : _$$TypedFactoryTesterProps(backingProps); + _$$TypedFactoryTesterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TypedFactoryTesterProps extends _$TypedFactoryTesterProps +class _$$TypedFactoryTesterProps extends _$TypedFactoryTesterProps with _$TypedFactoryTesterPropsAccessorsMixin implements TypedFactoryTesterProps { - _$$TypedFactoryTesterProps._(); - - factory _$$TypedFactoryTesterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TypedFactoryTesterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TypedFactoryTesterProps$PlainMap(backingMap); - } - } + _$$TypedFactoryTesterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -99,40 +94,6 @@ abstract class _$$TypedFactoryTesterProps extends _$TypedFactoryTesterProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TypedFactoryTesterProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TypedFactoryTesterProps$PlainMap extends _$$TypedFactoryTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TypedFactoryTesterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TypedFactoryTesterProps$JsMap extends _$$TypedFactoryTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TypedFactoryTesterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TypedFactoryTesterStateAccessorsMixin implements _$TypedFactoryTesterState { @override @@ -174,55 +135,19 @@ class TypedFactoryTesterState extends _$TypedFactoryTesterState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TypedFactoryTesterState extends _$TypedFactoryTesterState +class _$$TypedFactoryTesterState extends _$TypedFactoryTesterState with _$TypedFactoryTesterStateAccessorsMixin implements TypedFactoryTesterState { - _$$TypedFactoryTesterState._(); - - factory _$$TypedFactoryTesterState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TypedFactoryTesterState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TypedFactoryTesterState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TypedFactoryTesterState$PlainMap extends _$$TypedFactoryTesterState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TypedFactoryTesterState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TypedFactoryTesterState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TypedFactoryTesterState$JsMap extends _$$TypedFactoryTesterState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TypedFactoryTesterState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -230,10 +155,10 @@ class _$$TypedFactoryTesterState$JsMap extends _$$TypedFactoryTesterState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TypedFactoryTesterComponent extends TypedFactoryTesterComponent { - late _$$TypedFactoryTesterProps$JsMap _cachedTypedProps; + late _$$TypedFactoryTesterProps _cachedTypedProps; @override - _$$TypedFactoryTesterProps$JsMap get props => _cachedTypedProps; + _$$TypedFactoryTesterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -250,17 +175,16 @@ class _$TypedFactoryTesterComponent extends TypedFactoryTesterComponent { } @override - _$$TypedFactoryTesterProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TypedFactoryTesterProps$JsMap(backingMap); + _$$TypedFactoryTesterProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TypedFactoryTesterProps(backingMap); @override _$$TypedFactoryTesterProps typedPropsFactory(Map? backingMap) => _$$TypedFactoryTesterProps(backingMap); - late _$$TypedFactoryTesterState$JsMap _cachedTypedState; + late _$$TypedFactoryTesterState _cachedTypedState; @override - _$$TypedFactoryTesterState$JsMap get state => _cachedTypedState; + _$$TypedFactoryTesterState get state => _cachedTypedState; @override set state(Map value) { @@ -273,9 +197,8 @@ class _$TypedFactoryTesterComponent extends TypedFactoryTesterComponent { } @override - _$$TypedFactoryTesterState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$TypedFactoryTesterState$JsMap(backingMap); + _$$TypedFactoryTesterState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$TypedFactoryTesterState(backingMap); @override _$$TypedFactoryTesterState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component/with_transition_test.over_react.g.dart b/test/over_react/component/with_transition_test.over_react.g.dart index e8a11476a..413958a50 100644 --- a/test/over_react/component/with_transition_test.over_react.g.dart +++ b/test/over_react/component/with_transition_test.over_react.g.dart @@ -21,16 +21,14 @@ final $WithTransitionTesterComponentFactory = registerComponent2( ); _$$WithTransitionTesterProps _$WithTransitionTester([Map? backingProps]) => - backingProps == null - ? _$$WithTransitionTesterProps$JsMap(JsBackedMap()) - : _$$WithTransitionTesterProps(backingProps); + _$$WithTransitionTesterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$WithTransitionTesterProps extends UiProps +class _$$WithTransitionTesterProps extends UiProps with WithTransitionPropsMixin, // If this generated mixin is undefined, it's likely because WithTransitionPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of WithTransitionPropsMixin, and check that $WithTransitionPropsMixin is exported/imported properly. @@ -40,15 +38,12 @@ abstract class _$$WithTransitionTesterProps extends UiProps $TransitionPropsMixin implements WithTransitionTesterProps { - _$$WithTransitionTesterProps._(); - - factory _$$WithTransitionTesterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$WithTransitionTesterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$WithTransitionTesterProps$PlainMap(backingMap); - } - } + _$$WithTransitionTesterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -85,44 +80,6 @@ abstract class _$$WithTransitionTesterProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$WithTransitionTesterProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$WithTransitionTesterProps$PlainMap - extends _$$WithTransitionTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$WithTransitionTesterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$WithTransitionTesterProps$JsMap extends _$$WithTransitionTesterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$WithTransitionTesterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -130,10 +87,10 @@ class _$$WithTransitionTesterProps$JsMap extends _$$WithTransitionTesterProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$WithTransitionTesterComponent extends WithTransitionTesterComponent { - late _$$WithTransitionTesterProps$JsMap _cachedTypedProps; + late _$$WithTransitionTesterProps _cachedTypedProps; @override - _$$WithTransitionTesterProps$JsMap get props => _cachedTypedProps; + _$$WithTransitionTesterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -150,9 +107,8 @@ class _$WithTransitionTesterComponent extends WithTransitionTesterComponent { } @override - _$$WithTransitionTesterProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$WithTransitionTesterProps$JsMap(backingMap); + _$$WithTransitionTesterProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$WithTransitionTesterProps(backingMap); @override _$$WithTransitionTesterProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_helpers_test.dart b/test/over_react/component_declaration/builder_helpers_test.dart index 686150680..4c53fec3e 100644 --- a/test/over_react/component_declaration/builder_helpers_test.dart +++ b/test/over_react/component_declaration/builder_helpers_test.dart @@ -18,8 +18,8 @@ library over_react.builder_generation.helpers_test; import 'package:over_react/src/component_declaration/builder_helpers.dart'; import 'package:test/test.dart'; -final Matcher throwsUngeneratedError = throwsA(isA()); -final Matcher throwsIllegalInstantiationError = throwsA(isA()); +final Matcher throwsUngeneratedError = throwsA(isA()); +final Matcher throwsAssertionError = throwsA(isA()); main() { group('transformation generation helpers:', () { @@ -52,8 +52,8 @@ main() { group('UiProps', () { test('cannot be instantiated directly if not generated', () { - expect(() => UngeneratedUiProps(), throwsIllegalInstantiationError); - }); + expect(() => UngeneratedUiProps(), throwsAssertionError); + }, tags: 'ddc'); group('throws errors when stubbed members are called that have not been generated:', () { late UiProps unimplemented; @@ -73,8 +73,8 @@ main() { group('UiComponent', () { test('cannot be instantiated directly if not generated', () { - expect(() => UngeneratedUiComponent(), throwsIllegalInstantiationError); - }); + expect(() => UngeneratedUiComponent(), throwsAssertionError); + }, tags: 'ddc'); group('throws errors when stubbed members are called that have not been generated:', () { late UiComponent unimplemented; @@ -90,8 +90,8 @@ main() { group('UiState', () { test('cannot be instantiated directly if not generated', () { - expect(() => UngeneratedUiState(), throwsIllegalInstantiationError); - }); + expect(() => UngeneratedUiState(), throwsAssertionError); + }, tags: 'ddc'); group('throws errors when stubbed members are called that have not been generated:', () { late UiState unimplemented; @@ -110,8 +110,8 @@ main() { group('UiStatefulComponent', () { test('cannot be instantiated directly if not generated', () { - expect(() => UngeneratedUiStatefulComponent(), throwsIllegalInstantiationError); - }); + expect(() => UngeneratedUiStatefulComponent(), throwsAssertionError); + }, tags: 'ddc'); group('throws errors when stubbed members are called that have not been generated:', () { late UiStatefulComponent unimplemented; diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart index 5995cf34e..64a8a8c16 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart @@ -25,8 +25,8 @@ main() { test('state class cannot be instantiated directly', () { expect(() { StatefulComponentTestState(); - }, throwsA(isA())); - }); + }, throwsA(isA())); + }, tags: 'ddc'); test('renders a component from end to end, successfully reading state via typed getters', () { var renderedInstance = render(StatefulComponentTest()()); diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart index a23b2d07a..be9c71b01 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart @@ -51,16 +51,12 @@ class _$$AnnotationErrorDefaultPropsProps extends _$AnnotationErrorDefaultPropsProps with _$AnnotationErrorDefaultPropsPropsAccessorsMixin implements AnnotationErrorDefaultPropsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorDefaultPropsProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorDefaultPropsProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -153,16 +149,12 @@ _$$AnnotationErrorProps _$AnnotationError([Map? backingProps]) => class _$$AnnotationErrorProps extends _$AnnotationErrorProps with _$AnnotationErrorPropsAccessorsMixin implements AnnotationErrorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -253,16 +245,12 @@ _$$AnnotationErrorStatefulProps _$AnnotationErrorStateful( class _$$AnnotationErrorStatefulProps extends _$AnnotationErrorStatefulProps with _$AnnotationErrorStatefulPropsAccessorsMixin implements AnnotationErrorStatefulProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorStatefulProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -313,16 +301,12 @@ class AnnotationErrorStatefulState extends _$AnnotationErrorStatefulState class _$$AnnotationErrorStatefulState extends _$AnnotationErrorStatefulState with _$AnnotationErrorStatefulStateAccessorsMixin implements AnnotationErrorStatefulState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$AnnotationErrorStatefulState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -403,17 +387,12 @@ class _$$AnnotationErrorStatefulDefaultPropsProps extends _$AnnotationErrorStatefulDefaultPropsProps with _$AnnotationErrorStatefulDefaultPropsPropsAccessorsMixin implements AnnotationErrorStatefulDefaultPropsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulDefaultPropsProps(Map? backingMap) - : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorStatefulDefaultPropsProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -471,17 +450,12 @@ class _$$AnnotationErrorStatefulDefaultPropsState extends _$AnnotationErrorStatefulDefaultPropsState with _$AnnotationErrorStatefulDefaultPropsStateAccessorsMixin implements AnnotationErrorStatefulDefaultPropsState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulDefaultPropsState(Map? backingMap) - : this._state = {} { - this._state = backingMap ?? {}; - } + _$$AnnotationErrorStatefulDefaultPropsState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.over_react.g.dart index 2245f75f1..fa24568f2 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.over_react.g.dart @@ -179,25 +179,20 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map? backingProps]) => - backingProps == null - ? _$$ComponentTestProps$JsMap(JsBackedMap()) - : _$$ComponentTestProps(backingProps); + _$$ComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ComponentTestProps extends _$ComponentTestProps +class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - - factory _$$ComponentTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ComponentTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ComponentTestProps$PlainMap(backingMap); - } - } + _$$ComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -226,48 +221,15 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ComponentTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ComponentTestProps$JsMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ComponentTestComponent extends ComponentTestComponent { - late _$$ComponentTestProps$JsMap _cachedTypedProps; + late _$$ComponentTestProps _cachedTypedProps; @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + _$$ComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -284,8 +246,8 @@ class _$ComponentTestComponent extends ComponentTestComponent { } @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ComponentTestProps$JsMap(backingMap); + _$$ComponentTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ComponentTestProps(backingMap); @override _$$ComponentTestProps typedPropsFactory(Map? backingMap) => @@ -339,25 +301,20 @@ class IsErrorBoundaryProps extends _$IsErrorBoundaryProps } _$$IsErrorBoundaryProps _$IsErrorBoundary([Map? backingProps]) => - backingProps == null - ? _$$IsErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$IsErrorBoundaryProps(backingProps); + _$$IsErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$IsErrorBoundaryProps extends _$IsErrorBoundaryProps +class _$$IsErrorBoundaryProps extends _$IsErrorBoundaryProps with _$IsErrorBoundaryPropsAccessorsMixin implements IsErrorBoundaryProps { - _$$IsErrorBoundaryProps._(); - - factory _$$IsErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$IsErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$IsErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$IsErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -382,48 +339,15 @@ abstract class _$$IsErrorBoundaryProps extends _$IsErrorBoundaryProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$IsErrorBoundaryProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$IsErrorBoundaryProps$PlainMap extends _$$IsErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$IsErrorBoundaryProps$JsMap extends _$$IsErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$IsErrorBoundaryComponent extends IsErrorBoundaryComponent { - late _$$IsErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$IsErrorBoundaryProps _cachedTypedProps; @override - _$$IsErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$IsErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -440,8 +364,8 @@ class _$IsErrorBoundaryComponent extends IsErrorBoundaryComponent { } @override - _$$IsErrorBoundaryProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$IsErrorBoundaryProps$JsMap(backingMap); + _$$IsErrorBoundaryProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$IsErrorBoundaryProps(backingMap); @override _$$IsErrorBoundaryProps typedPropsFactory(Map? backingMap) => @@ -495,25 +419,20 @@ class IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps } _$$IsNotErrorBoundaryProps _$IsNotErrorBoundary([Map? backingProps]) => - backingProps == null - ? _$$IsNotErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$IsNotErrorBoundaryProps(backingProps); + _$$IsNotErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps +class _$$IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps with _$IsNotErrorBoundaryPropsAccessorsMixin implements IsNotErrorBoundaryProps { - _$$IsNotErrorBoundaryProps._(); - - factory _$$IsNotErrorBoundaryProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$IsNotErrorBoundaryProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$IsNotErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$IsNotErrorBoundaryProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -538,48 +457,15 @@ abstract class _$$IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$IsNotErrorBoundaryProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$IsNotErrorBoundaryProps$PlainMap extends _$$IsNotErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsNotErrorBoundaryProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$IsNotErrorBoundaryProps$JsMap extends _$$IsNotErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsNotErrorBoundaryProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$IsNotErrorBoundaryComponent extends IsNotErrorBoundaryComponent { - late _$$IsNotErrorBoundaryProps$JsMap _cachedTypedProps; + late _$$IsNotErrorBoundaryProps _cachedTypedProps; @override - _$$IsNotErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$IsNotErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -596,9 +482,8 @@ class _$IsNotErrorBoundaryComponent extends IsNotErrorBoundaryComponent { } @override - _$$IsNotErrorBoundaryProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$IsNotErrorBoundaryProps$JsMap(backingMap); + _$$IsNotErrorBoundaryProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$IsNotErrorBoundaryProps(backingMap); @override _$$IsNotErrorBoundaryProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart index d446aae78..b08342225 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart @@ -98,25 +98,20 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map? backingProps]) => - backingProps == null - ? _$$ComponentTestProps$JsMap(JsBackedMap()) - : _$$ComponentTestProps(backingProps); + _$$ComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ComponentTestProps extends _$ComponentTestProps +class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - - factory _$$ComponentTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ComponentTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ComponentTestProps$PlainMap(backingMap); - } - } + _$$ComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -141,48 +136,15 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ComponentTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ComponentTestProps$JsMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ComponentTestComponent extends ComponentTestComponent { - late _$$ComponentTestProps$JsMap _cachedTypedProps; + late _$$ComponentTestProps _cachedTypedProps; @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + _$$ComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -199,8 +161,8 @@ class _$ComponentTestComponent extends ComponentTestComponent { } @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ComponentTestProps$JsMap(backingMap); + _$$ComponentTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ComponentTestProps(backingMap); @override _$$ComponentTestProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart index 6d30c7753..602a146d3 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart @@ -101,27 +101,20 @@ class DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( [Map? backingProps]) => - backingProps == null - ? _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap()) - : _$$DoNotGenerateAccessorTestProps(backingProps); + _$$DoNotGenerateAccessorTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$DoNotGenerateAccessorTestProps - extends _$DoNotGenerateAccessorTestProps +class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps with _$DoNotGenerateAccessorTestPropsAccessorsMixin implements DoNotGenerateAccessorTestProps { - _$$DoNotGenerateAccessorTestProps._(); - - factory _$$DoNotGenerateAccessorTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DoNotGenerateAccessorTestProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); - } - } + _$$DoNotGenerateAccessorTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -145,42 +138,6 @@ abstract class _$$DoNotGenerateAccessorTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DoNotGenerateAccessorTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$DoNotGenerateAccessorTestProps$PlainMap - extends _$$DoNotGenerateAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$DoNotGenerateAccessorTestProps$JsMap - extends _$$DoNotGenerateAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$DoNotGenerateAccessorTestStateAccessorsMixin implements _$DoNotGenerateAccessorTestState { @override @@ -265,59 +222,19 @@ class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$DoNotGenerateAccessorTestState - extends _$DoNotGenerateAccessorTestState +class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { - _$$DoNotGenerateAccessorTestState._(); - - factory _$$DoNotGenerateAccessorTestState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DoNotGenerateAccessorTestState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$DoNotGenerateAccessorTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$DoNotGenerateAccessorTestState$PlainMap - extends _$$DoNotGenerateAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$DoNotGenerateAccessorTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$DoNotGenerateAccessorTestState$JsMap - extends _$$DoNotGenerateAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -326,10 +243,10 @@ class _$$DoNotGenerateAccessorTestState$JsMap // generated for the associated props class. class _$DoNotGenerateAccessorTestComponent extends DoNotGenerateAccessorTestComponent { - late _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; + late _$$DoNotGenerateAccessorTestProps _cachedTypedProps; @override - _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; + _$$DoNotGenerateAccessorTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -346,17 +263,17 @@ class _$DoNotGenerateAccessorTestComponent } @override - _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( + _$$DoNotGenerateAccessorTestProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); + _$$DoNotGenerateAccessorTestProps(backingMap); @override _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map? backingMap) => _$$DoNotGenerateAccessorTestProps(backingMap); - late _$$DoNotGenerateAccessorTestState$JsMap _cachedTypedState; + late _$$DoNotGenerateAccessorTestState _cachedTypedState; @override - _$$DoNotGenerateAccessorTestState$JsMap get state => _cachedTypedState; + _$$DoNotGenerateAccessorTestState get state => _cachedTypedState; @override set state(Map value) { @@ -369,9 +286,9 @@ class _$DoNotGenerateAccessorTestComponent } @override - _$$DoNotGenerateAccessorTestState$JsMap typedStateFactoryJs( + _$$DoNotGenerateAccessorTestState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$DoNotGenerateAccessorTestState$JsMap(backingMap); + _$$DoNotGenerateAccessorTestState(backingMap); @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart index a3725e65e..4284ffe8c 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart @@ -158,26 +158,20 @@ class NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps } _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map? backingProps]) => - backingProps == null - ? _$$NamespacedAccessorTestProps$JsMap(JsBackedMap()) - : _$$NamespacedAccessorTestProps(backingProps); + _$$NamespacedAccessorTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$NamespacedAccessorTestProps - extends _$NamespacedAccessorTestProps +class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps with _$NamespacedAccessorTestPropsAccessorsMixin implements NamespacedAccessorTestProps { - _$$NamespacedAccessorTestProps._(); - - factory _$$NamespacedAccessorTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$NamespacedAccessorTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$NamespacedAccessorTestProps$PlainMap(backingMap); - } - } + _$$NamespacedAccessorTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -201,42 +195,6 @@ abstract class _$$NamespacedAccessorTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$NamespacedAccessorTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$NamespacedAccessorTestProps$PlainMap - extends _$$NamespacedAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$NamespacedAccessorTestProps$JsMap - extends _$$NamespacedAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$NamespacedAccessorTestStateAccessorsMixin implements _$NamespacedAccessorTestState { @override @@ -380,58 +338,19 @@ class NamespacedAccessorTestState extends _$NamespacedAccessorTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$NamespacedAccessorTestState - extends _$NamespacedAccessorTestState +class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { - _$$NamespacedAccessorTestState._(); - - factory _$$NamespacedAccessorTestState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$NamespacedAccessorTestState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$NamespacedAccessorTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$NamespacedAccessorTestState$PlainMap - extends _$$NamespacedAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$NamespacedAccessorTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$NamespacedAccessorTestState$JsMap - extends _$$NamespacedAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -440,10 +359,10 @@ class _$$NamespacedAccessorTestState$JsMap // generated for the associated props class. class _$NamespacedAccessorTestComponent extends NamespacedAccessorTestComponent { - late _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; + late _$$NamespacedAccessorTestProps _cachedTypedProps; @override - _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; + _$$NamespacedAccessorTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -460,17 +379,16 @@ class _$NamespacedAccessorTestComponent } @override - _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$NamespacedAccessorTestProps$JsMap(backingMap); + _$$NamespacedAccessorTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$NamespacedAccessorTestProps(backingMap); @override _$$NamespacedAccessorTestProps typedPropsFactory(Map? backingMap) => _$$NamespacedAccessorTestProps(backingMap); - late _$$NamespacedAccessorTestState$JsMap _cachedTypedState; + late _$$NamespacedAccessorTestState _cachedTypedState; @override - _$$NamespacedAccessorTestState$JsMap get state => _cachedTypedState; + _$$NamespacedAccessorTestState get state => _cachedTypedState; @override set state(Map value) { @@ -483,9 +401,8 @@ class _$NamespacedAccessorTestComponent } @override - _$$NamespacedAccessorTestState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$NamespacedAccessorTestState$JsMap(backingMap); + _$$NamespacedAccessorTestState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$NamespacedAccessorTestState(backingMap); @override _$$NamespacedAccessorTestState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/null_safe_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/null_safe_accessor_integration_test.over_react.g.dart index 1c9b895fe..27c792a30 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/null_safe_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/null_safe_accessor_integration_test.over_react.g.dart @@ -214,25 +214,21 @@ class NullSafeTestProps extends _$NullSafeTestProps static const PropsMeta meta = _$metaForNullSafeTestProps; } -_$$NullSafeTestProps _$NullSafeTest([Map? backingProps]) => backingProps == null - ? _$$NullSafeTestProps$JsMap(JsBackedMap()) - : _$$NullSafeTestProps(backingProps); +_$$NullSafeTestProps _$NullSafeTest([Map? backingProps]) => + _$$NullSafeTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$NullSafeTestProps extends _$NullSafeTestProps +class _$$NullSafeTestProps extends _$NullSafeTestProps with _$NullSafeTestPropsAccessorsMixin implements NullSafeTestProps { - _$$NullSafeTestProps._(); - - factory _$$NullSafeTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$NullSafeTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$NullSafeTestProps$PlainMap(backingMap); - } - } + _$$NullSafeTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -256,40 +252,6 @@ abstract class _$$NullSafeTestProps extends _$NullSafeTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$NullSafeTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$NullSafeTestProps$PlainMap extends _$$NullSafeTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NullSafeTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$NullSafeTestProps$JsMap extends _$$NullSafeTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NullSafeTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$NullSafeTestStateAccessorsMixin implements _$NullSafeTestState { @override Map get state; @@ -466,55 +428,19 @@ class NullSafeTestState extends _$NullSafeTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$NullSafeTestState extends _$NullSafeTestState +class _$$NullSafeTestState extends _$NullSafeTestState with _$NullSafeTestStateAccessorsMixin implements NullSafeTestState { - _$$NullSafeTestState._(); - - factory _$$NullSafeTestState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$NullSafeTestState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$NullSafeTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$NullSafeTestState$PlainMap extends _$$NullSafeTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NullSafeTestState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$NullSafeTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$NullSafeTestState$JsMap extends _$$NullSafeTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NullSafeTestState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -522,10 +448,10 @@ class _$$NullSafeTestState$JsMap extends _$$NullSafeTestState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$NullSafeTestComponent extends NullSafeTestComponent { - late _$$NullSafeTestProps$JsMap _cachedTypedProps; + late _$$NullSafeTestProps _cachedTypedProps; @override - _$$NullSafeTestProps$JsMap get props => _cachedTypedProps; + _$$NullSafeTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -542,16 +468,16 @@ class _$NullSafeTestComponent extends NullSafeTestComponent { } @override - _$$NullSafeTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$NullSafeTestProps$JsMap(backingMap); + _$$NullSafeTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$NullSafeTestProps(backingMap); @override _$$NullSafeTestProps typedPropsFactory(Map? backingMap) => _$$NullSafeTestProps(backingMap); - late _$$NullSafeTestState$JsMap _cachedTypedState; + late _$$NullSafeTestState _cachedTypedState; @override - _$$NullSafeTestState$JsMap get state => _cachedTypedState; + _$$NullSafeTestState get state => _cachedTypedState; @override set state(Map value) { @@ -564,8 +490,8 @@ class _$NullSafeTestComponent extends NullSafeTestComponent { } @override - _$$NullSafeTestState$JsMap typedStateFactoryJs(JsBackedMap? backingMap) => - _$$NullSafeTestState$JsMap(backingMap); + _$$NullSafeTestState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$NullSafeTestState(backingMap); @override _$$NullSafeTestState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart index 311655c78..99f58099a 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart @@ -49,25 +49,19 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map? backingProps]) => backingProps == null - ? _$$FooProps$JsMap(JsBackedMap()) - : _$$FooProps(backingProps); +_$$FooProps _$Foo([Map? backingProps]) => _$$FooProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FooProps extends _$FooProps +class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - - factory _$$FooProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FooProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FooProps$PlainMap(backingMap); - } - } + _$$FooProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -94,48 +88,15 @@ abstract class _$$FooProps extends _$FooProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FooProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FooProps$PlainMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FooProps$JsMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FooComponent extends FooComponent { - late _$$FooProps$JsMap _cachedTypedProps; + late _$$FooProps _cachedTypedProps; @override - _$$FooProps$JsMap get props => _cachedTypedProps; + _$$FooProps get props => _cachedTypedProps; @override set props(Map value) { @@ -152,8 +113,8 @@ class _$FooComponent extends FooComponent { } @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$FooProps$JsMap(backingMap); + _$$FooProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FooProps(backingMap); @override _$$FooProps typedPropsFactory(Map? backingMap) => _$$FooProps(backingMap); diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart index 28a213fa0..f037783b3 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart @@ -136,25 +136,20 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map? backingProps]) => - backingProps == null - ? _$$ComponentTestProps$JsMap(JsBackedMap()) - : _$$ComponentTestProps(backingProps); + _$$ComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ComponentTestProps extends _$ComponentTestProps +class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); + _$$ComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$ComponentTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ComponentTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ComponentTestProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -179,48 +174,15 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ComponentTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ComponentTestProps$JsMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ComponentTestComponent extends ComponentTestComponent { - late _$$ComponentTestProps$JsMap _cachedTypedProps; + late _$$ComponentTestProps _cachedTypedProps; @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + _$$ComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -237,8 +199,8 @@ class _$ComponentTestComponent extends ComponentTestComponent { } @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ComponentTestProps$JsMap(backingMap); + _$$ComponentTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ComponentTestProps(backingMap); @override _$$ComponentTestProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart index aef3491f6..33d018a44 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart @@ -24,8 +24,8 @@ main() { test('state class cannot be instantiated directly', () { expect(() { StatefulComponentTestState(); - }, throwsA(isA())); - }); + }, throwsA(isA())); + }, tags: 'ddc'); test('renders a component from end to end, successfully reading state via typed getters', () { var renderedInstance = render(StatefulComponentTest()()); diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart index 47c97dc92..171a984ef 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart @@ -63,26 +63,20 @@ class StatefulComponentTestProps extends _$StatefulComponentTestProps } _$$StatefulComponentTestProps _$StatefulComponentTest([Map? backingProps]) => - backingProps == null - ? _$$StatefulComponentTestProps$JsMap(JsBackedMap()) - : _$$StatefulComponentTestProps(backingProps); + _$$StatefulComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$StatefulComponentTestProps - extends _$StatefulComponentTestProps +class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps with _$StatefulComponentTestPropsAccessorsMixin implements StatefulComponentTestProps { - _$$StatefulComponentTestProps._(); - - factory _$$StatefulComponentTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$StatefulComponentTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$StatefulComponentTestProps$PlainMap(backingMap); - } - } + _$$StatefulComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -110,42 +104,6 @@ abstract class _$$StatefulComponentTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$StatefulComponentTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$StatefulComponentTestProps$PlainMap - extends _$$StatefulComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$StatefulComponentTestProps$JsMap - extends _$$StatefulComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$StatefulComponentTestStateAccessorsMixin implements _$StatefulComponentTestState { @override @@ -289,58 +247,19 @@ class StatefulComponentTestState extends _$StatefulComponentTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$StatefulComponentTestState - extends _$StatefulComponentTestState +class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { - _$$StatefulComponentTestState._(); - - factory _$$StatefulComponentTestState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$StatefulComponentTestState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$StatefulComponentTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$StatefulComponentTestState$PlainMap - extends _$$StatefulComponentTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$StatefulComponentTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$StatefulComponentTestState$JsMap - extends _$$StatefulComponentTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -348,10 +267,10 @@ class _$$StatefulComponentTestState$JsMap // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { - late _$$StatefulComponentTestProps$JsMap _cachedTypedProps; + late _$$StatefulComponentTestProps _cachedTypedProps; @override - _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; + _$$StatefulComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -368,17 +287,16 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { } @override - _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$StatefulComponentTestProps$JsMap(backingMap); + _$$StatefulComponentTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$StatefulComponentTestProps(backingMap); @override _$$StatefulComponentTestProps typedPropsFactory(Map? backingMap) => _$$StatefulComponentTestProps(backingMap); - late _$$StatefulComponentTestState$JsMap _cachedTypedState; + late _$$StatefulComponentTestState _cachedTypedState; @override - _$$StatefulComponentTestState$JsMap get state => _cachedTypedState; + _$$StatefulComponentTestState get state => _cachedTypedState; @override set state(Map value) { @@ -391,9 +309,8 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { } @override - _$$StatefulComponentTestState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$StatefulComponentTestState$JsMap(backingMap); + _$$StatefulComponentTestState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$StatefulComponentTestState(backingMap); @override _$$StatefulComponentTestState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart index 9d13d46ff..93ecb3fa8 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart @@ -68,25 +68,19 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map? backingProps]) => backingProps == null - ? _$$FooProps$JsMap(JsBackedMap()) - : _$$FooProps(backingProps); +_$$FooProps _$Foo([Map? backingProps]) => _$$FooProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FooProps extends _$FooProps +class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - - factory _$$FooProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FooProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FooProps$PlainMap(backingMap); - } - } + _$$FooProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -113,48 +107,15 @@ abstract class _$$FooProps extends _$FooProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FooProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FooProps$PlainMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FooProps$JsMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FooComponent extends FooComponent { - late _$$FooProps$JsMap _cachedTypedProps; + late _$$FooProps _cachedTypedProps; @override - _$$FooProps$JsMap get props => _cachedTypedProps; + _$$FooProps get props => _cachedTypedProps; @override set props(Map value) { @@ -171,8 +132,8 @@ class _$FooComponent extends FooComponent { } @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$FooProps$JsMap(backingMap); + _$$FooProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FooProps(backingMap); @override _$$FooProps typedPropsFactory(Map? backingMap) => _$$FooProps(backingMap); diff --git a/test/over_react/component_declaration/builder_integration_tests/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component_integration_test.over_react.g.dart index 6fc54c6c7..f86436d51 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component_integration_test.over_react.g.dart @@ -153,16 +153,12 @@ _$$ComponentTestProps _$ComponentTest([Map? backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart index 0bb8d34f8..c890c2cf2 100644 --- a/test/over_react/component_declaration/builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart @@ -85,16 +85,12 @@ _$$ComponentTestProps _$ComponentTest([Map? backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart index 891ddf5a5..7cb31ccdb 100644 --- a/test/over_react/component_declaration/builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart @@ -109,16 +109,12 @@ _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps with _$DoNotGenerateAccessorTestPropsAccessorsMixin implements DoNotGenerateAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$DoNotGenerateAccessorTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -229,16 +225,12 @@ class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$DoNotGenerateAccessorTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart index 964c76954..cd1c0914f 100644 --- a/test/over_react/component_declaration/builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart @@ -166,16 +166,12 @@ _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map? backingProps]) => class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps with _$NamespacedAccessorTestPropsAccessorsMixin implements NamespacedAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$NamespacedAccessorTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -345,16 +341,12 @@ class NamespacedAccessorTestState extends _$NamespacedAccessorTestState class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$NamespacedAccessorTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/null_safe_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/null_safe_accessor_integration_test.over_react.g.dart index d0c192d46..4c3a33c4e 100644 --- a/test/over_react/component_declaration/builder_integration_tests/null_safe_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/null_safe_accessor_integration_test.over_react.g.dart @@ -223,16 +223,12 @@ _$$NullSafeTestProps _$NullSafeTest([Map? backingProps]) => class _$$NullSafeTestProps extends _$NullSafeTestProps with _$NullSafeTestPropsAccessorsMixin implements NullSafeTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NullSafeTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$NullSafeTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -435,16 +431,12 @@ class NullSafeTestState extends _$NullSafeTestState class _$$NullSafeTestState extends _$NullSafeTestState with _$NullSafeTestStateAccessorsMixin implements NullSafeTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NullSafeTestState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$NullSafeTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/private_props_ddc_bug.over_react.g.dart index 7833eb742..5ccbe54c0 100644 --- a/test/over_react/component_declaration/builder_integration_tests/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/private_props_ddc_bug.over_react.g.dart @@ -57,16 +57,11 @@ _$$FooProps _$Foo([Map? backingProps]) => _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$FooProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/required_accessor_integration_test.over_react.g.dart index 599303760..97d89dbb1 100644 --- a/test/over_react/component_declaration/builder_integration_tests/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/required_accessor_integration_test.over_react.g.dart @@ -116,16 +116,12 @@ _$$ComponentTestProps _$ComponentTest([Map? backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.dart index 3a0464b2a..9cc6d9eb7 100644 --- a/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.dart +++ b/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.dart @@ -25,8 +25,8 @@ main() { test('state class cannot be instantiated directly', () { expect(() { StatefulComponentTestState(); - }, throwsA(isA())); - }); + }, throwsA(isA())); + }, tags: 'ddc'); test('renders a component from end to end, successfully reading state via typed getters', () { var renderedInstance = render(StatefulComponentTest()()); diff --git a/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.over_react.g.dart index ae55c0b9b..f3a4cb421 100644 --- a/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/stateful_component_integration_test.over_react.g.dart @@ -48,16 +48,12 @@ _$$StatefulComponentTestProps _$StatefulComponentTest([Map? backingProps]) => class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps with _$StatefulComponentTestPropsAccessorsMixin implements StatefulComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$StatefulComponentTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -227,16 +223,12 @@ class StatefulComponentTestState extends _$StatefulComponentTestState class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$StatefulComponentTestState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart index 37da4bf08..9717fdb48 100644 --- a/test/over_react/component_declaration/builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart @@ -76,16 +76,11 @@ _$$FooProps _$Foo([Map? backingProps]) => _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$FooProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/component2_type_checking_test/test_a2.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/test_a2.over_react.g.dart index aca0a3055..0d460f93f 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/test_a2.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/test_a2.over_react.g.dart @@ -37,25 +37,19 @@ class TestA2Props extends _$TestA2Props with _$TestA2PropsAccessorsMixin { static const PropsMeta meta = _$metaForTestA2Props; } -_$$TestA2Props _$TestA2([Map? backingProps]) => backingProps == null - ? _$$TestA2Props$JsMap(JsBackedMap()) - : _$$TestA2Props(backingProps); +_$$TestA2Props _$TestA2([Map? backingProps]) => _$$TestA2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestA2Props extends _$TestA2Props +class _$$TestA2Props extends _$TestA2Props with _$TestA2PropsAccessorsMixin implements TestA2Props { - _$$TestA2Props._(); - - factory _$$TestA2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestA2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestA2Props$PlainMap(backingMap); - } - } + _$$TestA2Props([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -79,48 +73,15 @@ abstract class _$$TestA2Props extends _$TestA2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestA2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestA2Props$PlainMap extends _$$TestA2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestA2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestA2Props$JsMap extends _$$TestA2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestA2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestA2Component extends TestA2Component { - late _$$TestA2Props$JsMap _cachedTypedProps; + late _$$TestA2Props _cachedTypedProps; @override - _$$TestA2Props$JsMap get props => _cachedTypedProps; + _$$TestA2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -137,8 +98,8 @@ class _$TestA2Component extends TestA2Component { } @override - _$$TestA2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestA2Props$JsMap(backingMap); + _$$TestA2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestA2Props(backingMap); @override _$$TestA2Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/test_b2.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/test_b2.over_react.g.dart index 033693f54..27ba45640 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/test_b2.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/test_b2.over_react.g.dart @@ -37,25 +37,19 @@ class TestB2Props extends _$TestB2Props with _$TestB2PropsAccessorsMixin { static const PropsMeta meta = _$metaForTestB2Props; } -_$$TestB2Props _$TestB2([Map? backingProps]) => backingProps == null - ? _$$TestB2Props$JsMap(JsBackedMap()) - : _$$TestB2Props(backingProps); +_$$TestB2Props _$TestB2([Map? backingProps]) => _$$TestB2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestB2Props extends _$TestB2Props +class _$$TestB2Props extends _$TestB2Props with _$TestB2PropsAccessorsMixin implements TestB2Props { - _$$TestB2Props._(); - - factory _$$TestB2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestB2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestB2Props$PlainMap(backingMap); - } - } + _$$TestB2Props([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -79,48 +73,15 @@ abstract class _$$TestB2Props extends _$TestB2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestB2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestB2Props$PlainMap extends _$$TestB2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestB2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestB2Props$JsMap extends _$$TestB2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestB2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestB2Component extends TestB2Component { - late _$$TestB2Props$JsMap _cachedTypedProps; + late _$$TestB2Props _cachedTypedProps; @override - _$$TestB2Props$JsMap get props => _cachedTypedProps; + _$$TestB2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -137,8 +98,8 @@ class _$TestB2Component extends TestB2Component { } @override - _$$TestB2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestB2Props$JsMap(backingMap); + _$$TestB2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestB2Props(backingMap); @override _$$TestB2Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/abstract_inheritance/extendedtype2.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/abstract_inheritance/extendedtype2.over_react.g.dart index b2a13e6b7..bc0685ba8 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/abstract_inheritance/extendedtype2.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/abstract_inheritance/extendedtype2.over_react.g.dart @@ -40,25 +40,20 @@ class TestExtendtype2Props extends _$TestExtendtype2Props } _$$TestExtendtype2Props _$TestExtendtype2([Map? backingProps]) => - backingProps == null - ? _$$TestExtendtype2Props$JsMap(JsBackedMap()) - : _$$TestExtendtype2Props(backingProps); + _$$TestExtendtype2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestExtendtype2Props extends _$TestExtendtype2Props +class _$$TestExtendtype2Props extends _$TestExtendtype2Props with _$TestExtendtype2PropsAccessorsMixin implements TestExtendtype2Props { - _$$TestExtendtype2Props._(); - - factory _$$TestExtendtype2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestExtendtype2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestExtendtype2Props$PlainMap(backingMap); - } - } + _$$TestExtendtype2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -83,48 +78,15 @@ abstract class _$$TestExtendtype2Props extends _$TestExtendtype2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestExtendtype2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestExtendtype2Props$PlainMap extends _$$TestExtendtype2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestExtendtype2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestExtendtype2Props$JsMap extends _$$TestExtendtype2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestExtendtype2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestExtendtype2Component extends TestExtendtype2Component { - late _$$TestExtendtype2Props$JsMap _cachedTypedProps; + late _$$TestExtendtype2Props _cachedTypedProps; @override - _$$TestExtendtype2Props$JsMap get props => _cachedTypedProps; + _$$TestExtendtype2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -141,8 +103,8 @@ class _$TestExtendtype2Component extends TestExtendtype2Component { } @override - _$$TestExtendtype2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestExtendtype2Props$JsMap(backingMap); + _$$TestExtendtype2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestExtendtype2Props(backingMap); @override _$$TestExtendtype2Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/parent2.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/parent2.over_react.g.dart index bd28b5bba..57a71eda1 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/parent2.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/parent2.over_react.g.dart @@ -38,25 +38,21 @@ class TestParent2Props extends _$TestParent2Props static const PropsMeta meta = _$metaForTestParent2Props; } -_$$TestParent2Props _$TestParent2([Map? backingProps]) => backingProps == null - ? _$$TestParent2Props$JsMap(JsBackedMap()) - : _$$TestParent2Props(backingProps); +_$$TestParent2Props _$TestParent2([Map? backingProps]) => + _$$TestParent2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestParent2Props extends _$TestParent2Props +class _$$TestParent2Props extends _$TestParent2Props with _$TestParent2PropsAccessorsMixin implements TestParent2Props { - _$$TestParent2Props._(); - - factory _$$TestParent2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestParent2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestParent2Props$PlainMap(backingMap); - } - } + _$$TestParent2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -81,48 +77,15 @@ abstract class _$$TestParent2Props extends _$TestParent2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestParent2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestParent2Props$PlainMap extends _$$TestParent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestParent2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestParent2Props$JsMap extends _$$TestParent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestParent2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestParent2Component extends TestParent2Component { - late _$$TestParent2Props$JsMap _cachedTypedProps; + late _$$TestParent2Props _cachedTypedProps; @override - _$$TestParent2Props$JsMap get props => _cachedTypedProps; + _$$TestParent2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -139,8 +102,8 @@ class _$TestParent2Component extends TestParent2Component { } @override - _$$TestParent2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestParent2Props$JsMap(backingMap); + _$$TestParent2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestParent2Props(backingMap); @override _$$TestParent2Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype2.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype2.over_react.g.dart index a5e93d438..8e567fe9a 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype2.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype2.over_react.g.dart @@ -40,25 +40,20 @@ class TestSubsubtype2Props extends _$TestSubsubtype2Props } _$$TestSubsubtype2Props _$TestSubsubtype2([Map? backingProps]) => - backingProps == null - ? _$$TestSubsubtype2Props$JsMap(JsBackedMap()) - : _$$TestSubsubtype2Props(backingProps); + _$$TestSubsubtype2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestSubsubtype2Props extends _$TestSubsubtype2Props +class _$$TestSubsubtype2Props extends _$TestSubsubtype2Props with _$TestSubsubtype2PropsAccessorsMixin implements TestSubsubtype2Props { - _$$TestSubsubtype2Props._(); - - factory _$$TestSubsubtype2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSubsubtype2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestSubsubtype2Props$PlainMap(backingMap); - } - } + _$$TestSubsubtype2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -83,48 +78,15 @@ abstract class _$$TestSubsubtype2Props extends _$TestSubsubtype2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSubsubtype2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestSubsubtype2Props$PlainMap extends _$$TestSubsubtype2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtype2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestSubsubtype2Props$JsMap extends _$$TestSubsubtype2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtype2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestSubsubtype2Component extends TestSubsubtype2Component { - late _$$TestSubsubtype2Props$JsMap _cachedTypedProps; + late _$$TestSubsubtype2Props _cachedTypedProps; @override - _$$TestSubsubtype2Props$JsMap get props => _cachedTypedProps; + _$$TestSubsubtype2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -141,8 +103,8 @@ class _$TestSubsubtype2Component extends TestSubsubtype2Component { } @override - _$$TestSubsubtype2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestSubsubtype2Props$JsMap(backingMap); + _$$TestSubsubtype2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestSubsubtype2Props(backingMap); @override _$$TestSubsubtype2Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype_of_component1.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype_of_component1.over_react.g.dart index 268e4fa50..56f2e60d0 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype_of_component1.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subsubtype_of_component1.over_react.g.dart @@ -42,27 +42,21 @@ class TestSubsubtypeOfComponent1Props extends _$TestSubsubtypeOfComponent1Props _$$TestSubsubtypeOfComponent1Props _$TestSubsubtypeOfComponent1( [Map? backingProps]) => - backingProps == null - ? _$$TestSubsubtypeOfComponent1Props$JsMap(JsBackedMap()) - : _$$TestSubsubtypeOfComponent1Props(backingProps); + _$$TestSubsubtypeOfComponent1Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestSubsubtypeOfComponent1Props +class _$$TestSubsubtypeOfComponent1Props extends _$TestSubsubtypeOfComponent1Props with _$TestSubsubtypeOfComponent1PropsAccessorsMixin implements TestSubsubtypeOfComponent1Props { - _$$TestSubsubtypeOfComponent1Props._(); - - factory _$$TestSubsubtypeOfComponent1Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSubsubtypeOfComponent1Props$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestSubsubtypeOfComponent1Props$PlainMap(backingMap); - } - } + _$$TestSubsubtypeOfComponent1Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -87,51 +81,16 @@ abstract class _$$TestSubsubtypeOfComponent1Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSubsubtypeOfComponent1Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestSubsubtypeOfComponent1Props$PlainMap - extends _$$TestSubsubtypeOfComponent1Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtypeOfComponent1Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestSubsubtypeOfComponent1Props$JsMap - extends _$$TestSubsubtypeOfComponent1Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtypeOfComponent1Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestSubsubtypeOfComponent1Component extends TestSubsubtypeOfComponent1Component { - late _$$TestSubsubtypeOfComponent1Props$JsMap _cachedTypedProps; + late _$$TestSubsubtypeOfComponent1Props _cachedTypedProps; @override - _$$TestSubsubtypeOfComponent1Props$JsMap get props => _cachedTypedProps; + _$$TestSubsubtypeOfComponent1Props get props => _cachedTypedProps; @override set props(Map value) { @@ -148,9 +107,9 @@ class _$TestSubsubtypeOfComponent1Component } @override - _$$TestSubsubtypeOfComponent1Props$JsMap typedPropsFactoryJs( + _$$TestSubsubtypeOfComponent1Props typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestSubsubtypeOfComponent1Props$JsMap(backingMap); + _$$TestSubsubtypeOfComponent1Props(backingMap); @override _$$TestSubsubtypeOfComponent1Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype2.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype2.over_react.g.dart index 633d30eee..345b2c0d5 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype2.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype2.over_react.g.dart @@ -39,25 +39,21 @@ class TestSubtype2Props extends _$TestSubtype2Props static const PropsMeta meta = _$metaForTestSubtype2Props; } -_$$TestSubtype2Props _$TestSubtype2([Map? backingProps]) => backingProps == null - ? _$$TestSubtype2Props$JsMap(JsBackedMap()) - : _$$TestSubtype2Props(backingProps); +_$$TestSubtype2Props _$TestSubtype2([Map? backingProps]) => + _$$TestSubtype2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestSubtype2Props extends _$TestSubtype2Props +class _$$TestSubtype2Props extends _$TestSubtype2Props with _$TestSubtype2PropsAccessorsMixin implements TestSubtype2Props { - _$$TestSubtype2Props._(); - - factory _$$TestSubtype2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSubtype2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestSubtype2Props$PlainMap(backingMap); - } - } + _$$TestSubtype2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -82,48 +78,15 @@ abstract class _$$TestSubtype2Props extends _$TestSubtype2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSubtype2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestSubtype2Props$PlainMap extends _$$TestSubtype2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtype2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestSubtype2Props$JsMap extends _$$TestSubtype2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtype2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestSubtype2Component extends TestSubtype2Component { - late _$$TestSubtype2Props$JsMap _cachedTypedProps; + late _$$TestSubtype2Props _cachedTypedProps; @override - _$$TestSubtype2Props$JsMap get props => _cachedTypedProps; + _$$TestSubtype2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -140,8 +103,8 @@ class _$TestSubtype2Component extends TestSubtype2Component { } @override - _$$TestSubtype2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestSubtype2Props$JsMap(backingMap); + _$$TestSubtype2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestSubtype2Props(backingMap); @override _$$TestSubtype2Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype_of_component1.over_react.g.dart b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype_of_component1.over_react.g.dart index 8123ab74b..5d632cb6d 100644 --- a/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype_of_component1.over_react.g.dart +++ b/test/over_react/component_declaration/component2_type_checking_test/type_inheritance/subtype_of_component1.over_react.g.dart @@ -42,26 +42,20 @@ class TestSubtypeOfComponent1Props extends _$TestSubtypeOfComponent1Props _$$TestSubtypeOfComponent1Props _$TestSubtypeOfComponent1( [Map? backingProps]) => - backingProps == null - ? _$$TestSubtypeOfComponent1Props$JsMap(JsBackedMap()) - : _$$TestSubtypeOfComponent1Props(backingProps); + _$$TestSubtypeOfComponent1Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestSubtypeOfComponent1Props - extends _$TestSubtypeOfComponent1Props +class _$$TestSubtypeOfComponent1Props extends _$TestSubtypeOfComponent1Props with _$TestSubtypeOfComponent1PropsAccessorsMixin implements TestSubtypeOfComponent1Props { - _$$TestSubtypeOfComponent1Props._(); - - factory _$$TestSubtypeOfComponent1Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSubtypeOfComponent1Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestSubtypeOfComponent1Props$PlainMap(backingMap); - } - } + _$$TestSubtypeOfComponent1Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -86,51 +80,16 @@ abstract class _$$TestSubtypeOfComponent1Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSubtypeOfComponent1Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestSubtypeOfComponent1Props$PlainMap - extends _$$TestSubtypeOfComponent1Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtypeOfComponent1Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestSubtypeOfComponent1Props$JsMap - extends _$$TestSubtypeOfComponent1Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtypeOfComponent1Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestSubtypeOfComponent1Component extends TestSubtypeOfComponent1Component { - late _$$TestSubtypeOfComponent1Props$JsMap _cachedTypedProps; + late _$$TestSubtypeOfComponent1Props _cachedTypedProps; @override - _$$TestSubtypeOfComponent1Props$JsMap get props => _cachedTypedProps; + _$$TestSubtypeOfComponent1Props get props => _cachedTypedProps; @override set props(Map value) { @@ -147,9 +106,9 @@ class _$TestSubtypeOfComponent1Component } @override - _$$TestSubtypeOfComponent1Props$JsMap typedPropsFactoryJs( + _$$TestSubtypeOfComponent1Props typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestSubtypeOfComponent1Props$JsMap(backingMap); + _$$TestSubtypeOfComponent1Props(backingMap); @override _$$TestSubtypeOfComponent1Props typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/component_type_checking_test/test_a.over_react.g.dart b/test/over_react/component_declaration/component_type_checking_test/test_a.over_react.g.dart index e5292564b..7a140d242 100644 --- a/test/over_react/component_declaration/component_type_checking_test/test_a.over_react.g.dart +++ b/test/over_react/component_declaration/component_type_checking_test/test_a.over_react.g.dart @@ -45,16 +45,11 @@ _$$TestAProps _$TestA([Map? backingProps]) => _$$TestAProps(backingProps); class _$$TestAProps extends _$TestAProps with _$TestAPropsAccessorsMixin implements TestAProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestAProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestAProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/component_type_checking_test/test_b.over_react.g.dart b/test/over_react/component_declaration/component_type_checking_test/test_b.over_react.g.dart index a7591e25a..fcfea5c0f 100644 --- a/test/over_react/component_declaration/component_type_checking_test/test_b.over_react.g.dart +++ b/test/over_react/component_declaration/component_type_checking_test/test_b.over_react.g.dart @@ -45,16 +45,11 @@ _$$TestBProps _$TestB([Map? backingProps]) => _$$TestBProps(backingProps); class _$$TestBProps extends _$TestBProps with _$TestBPropsAccessorsMixin implements TestBProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestBProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestBProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/abstract_inheritance/extendedtype.over_react.g.dart b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/abstract_inheritance/extendedtype.over_react.g.dart index 5f836825e..7337731a3 100644 --- a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/abstract_inheritance/extendedtype.over_react.g.dart +++ b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/abstract_inheritance/extendedtype.over_react.g.dart @@ -48,16 +48,12 @@ _$$TestExtendtypeProps _$TestExtendtype([Map? backingProps]) => class _$$TestExtendtypeProps extends _$TestExtendtypeProps with _$TestExtendtypePropsAccessorsMixin implements TestExtendtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestExtendtypeProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestExtendtypeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/parent.over_react.g.dart b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/parent.over_react.g.dart index 7e14c8721..054c4fc0a 100644 --- a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/parent.over_react.g.dart +++ b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/parent.over_react.g.dart @@ -47,16 +47,12 @@ _$$TestParentProps _$TestParent([Map? backingProps]) => class _$$TestParentProps extends _$TestParentProps with _$TestParentPropsAccessorsMixin implements TestParentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestParentProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestParentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subsubtype.over_react.g.dart b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subsubtype.over_react.g.dart index e91915848..7976f4542 100644 --- a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subsubtype.over_react.g.dart +++ b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subsubtype.over_react.g.dart @@ -48,16 +48,12 @@ _$$TestSubsubtypeProps _$TestSubsubtype([Map? backingProps]) => class _$$TestSubsubtypeProps extends _$TestSubsubtypeProps with _$TestSubsubtypePropsAccessorsMixin implements TestSubsubtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtypeProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestSubsubtypeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subtype.over_react.g.dart b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subtype.over_react.g.dart index 39e094458..baf31fa79 100644 --- a/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subtype.over_react.g.dart +++ b/test/over_react/component_declaration/component_type_checking_test/type_inheritance/subtype.over_react.g.dart @@ -48,16 +48,12 @@ _$$TestSubtypeProps _$TestSubtype([Map? backingProps]) => class _$$TestSubtypeProps extends _$TestSubtypeProps with _$TestSubtypePropsAccessorsMixin implements TestSubtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtypeProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestSubtypeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/flux_component_test/component2/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test/component2/flux_component_test.over_react.g.dart index 0f0de1835..1f999313a 100644 --- a/test/over_react/component_declaration/flux_component_test/component2/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test/component2/flux_component_test.over_react.g.dart @@ -38,25 +38,21 @@ class TestBasicProps extends _$TestBasicProps static const PropsMeta meta = _$metaForTestBasicProps; } -_$$TestBasicProps _$TestBasic([Map? backingProps]) => backingProps == null - ? _$$TestBasicProps$JsMap(JsBackedMap()) - : _$$TestBasicProps(backingProps); +_$$TestBasicProps _$TestBasic([Map? backingProps]) => + _$$TestBasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestBasicProps extends _$TestBasicProps +class _$$TestBasicProps extends _$TestBasicProps with _$TestBasicPropsAccessorsMixin implements TestBasicProps { - _$$TestBasicProps._(); - - factory _$$TestBasicProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestBasicProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestBasicProps$PlainMap(backingMap); - } - } + _$$TestBasicProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -81,48 +77,15 @@ abstract class _$$TestBasicProps extends _$TestBasicProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestBasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestBasicProps$PlainMap extends _$$TestBasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestBasicProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestBasicProps$JsMap extends _$$TestBasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestBasicProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestBasicComponent extends TestBasicComponent { - late _$$TestBasicProps$JsMap _cachedTypedProps; + late _$$TestBasicProps _cachedTypedProps; @override - _$$TestBasicProps$JsMap get props => _cachedTypedProps; + _$$TestBasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -139,8 +102,8 @@ class _$TestBasicComponent extends TestBasicComponent { } @override - _$$TestBasicProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestBasicProps$JsMap(backingMap); + _$$TestBasicProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestBasicProps(backingMap); @override _$$TestBasicProps typedPropsFactory(Map? backingMap) => @@ -194,25 +157,20 @@ class TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps } _$$TestHandlerLifecycleProps _$TestHandlerLifecycle([Map? backingProps]) => - backingProps == null - ? _$$TestHandlerLifecycleProps$JsMap(JsBackedMap()) - : _$$TestHandlerLifecycleProps(backingProps); + _$$TestHandlerLifecycleProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps +class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps with _$TestHandlerLifecyclePropsAccessorsMixin implements TestHandlerLifecycleProps { - _$$TestHandlerLifecycleProps._(); - - factory _$$TestHandlerLifecycleProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestHandlerLifecycleProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestHandlerLifecycleProps$PlainMap(backingMap); - } - } + _$$TestHandlerLifecycleProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -237,49 +195,15 @@ abstract class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestHandlerLifecycleProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestHandlerLifecycleProps$PlainMap - extends _$$TestHandlerLifecycleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestHandlerLifecycleProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestHandlerLifecycleProps$JsMap extends _$$TestHandlerLifecycleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestHandlerLifecycleProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestHandlerLifecycleComponent extends TestHandlerLifecycleComponent { - late _$$TestHandlerLifecycleProps$JsMap _cachedTypedProps; + late _$$TestHandlerLifecycleProps _cachedTypedProps; @override - _$$TestHandlerLifecycleProps$JsMap get props => _cachedTypedProps; + _$$TestHandlerLifecycleProps get props => _cachedTypedProps; @override set props(Map value) { @@ -296,9 +220,8 @@ class _$TestHandlerLifecycleComponent extends TestHandlerLifecycleComponent { } @override - _$$TestHandlerLifecycleProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TestHandlerLifecycleProps$JsMap(backingMap); + _$$TestHandlerLifecycleProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestHandlerLifecycleProps(backingMap); @override _$$TestHandlerLifecycleProps typedPropsFactory(Map? backingMap) => @@ -352,26 +275,20 @@ class TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps } _$$TestHandlerPrecedenceProps _$TestHandlerPrecedence([Map? backingProps]) => - backingProps == null - ? _$$TestHandlerPrecedenceProps$JsMap(JsBackedMap()) - : _$$TestHandlerPrecedenceProps(backingProps); + _$$TestHandlerPrecedenceProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestHandlerPrecedenceProps - extends _$TestHandlerPrecedenceProps +class _$$TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps with _$TestHandlerPrecedencePropsAccessorsMixin implements TestHandlerPrecedenceProps { - _$$TestHandlerPrecedenceProps._(); - - factory _$$TestHandlerPrecedenceProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestHandlerPrecedenceProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestHandlerPrecedenceProps$PlainMap(backingMap); - } - } + _$$TestHandlerPrecedenceProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -396,50 +313,15 @@ abstract class _$$TestHandlerPrecedenceProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestHandlerPrecedenceProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestHandlerPrecedenceProps$PlainMap - extends _$$TestHandlerPrecedenceProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestHandlerPrecedenceProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestHandlerPrecedenceProps$JsMap - extends _$$TestHandlerPrecedenceProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestHandlerPrecedenceProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestHandlerPrecedenceComponent extends TestHandlerPrecedenceComponent { - late _$$TestHandlerPrecedenceProps$JsMap _cachedTypedProps; + late _$$TestHandlerPrecedenceProps _cachedTypedProps; @override - _$$TestHandlerPrecedenceProps$JsMap get props => _cachedTypedProps; + _$$TestHandlerPrecedenceProps get props => _cachedTypedProps; @override set props(Map value) { @@ -456,9 +338,8 @@ class _$TestHandlerPrecedenceComponent extends TestHandlerPrecedenceComponent { } @override - _$$TestHandlerPrecedenceProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TestHandlerPrecedenceProps$JsMap(backingMap); + _$$TestHandlerPrecedenceProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestHandlerPrecedenceProps(backingMap); @override _$$TestHandlerPrecedenceProps typedPropsFactory(Map? backingMap) => @@ -532,25 +413,20 @@ class TestPropValidationProps extends _$TestPropValidationProps } _$$TestPropValidationProps _$TestPropValidation([Map? backingProps]) => - backingProps == null - ? _$$TestPropValidationProps$JsMap(JsBackedMap()) - : _$$TestPropValidationProps(backingProps); + _$$TestPropValidationProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestPropValidationProps extends _$TestPropValidationProps +class _$$TestPropValidationProps extends _$TestPropValidationProps with _$TestPropValidationPropsAccessorsMixin implements TestPropValidationProps { - _$$TestPropValidationProps._(); - - factory _$$TestPropValidationProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestPropValidationProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestPropValidationProps$PlainMap(backingMap); - } - } + _$$TestPropValidationProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -575,48 +451,15 @@ abstract class _$$TestPropValidationProps extends _$TestPropValidationProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestPropValidationProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestPropValidationProps$PlainMap extends _$$TestPropValidationProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestPropValidationProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestPropValidationProps$JsMap extends _$$TestPropValidationProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestPropValidationProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestPropValidationComponent extends TestPropValidationComponent { - late _$$TestPropValidationProps$JsMap _cachedTypedProps; + late _$$TestPropValidationProps _cachedTypedProps; @override - _$$TestPropValidationProps$JsMap get props => _cachedTypedProps; + _$$TestPropValidationProps get props => _cachedTypedProps; @override set props(Map value) { @@ -633,9 +476,8 @@ class _$TestPropValidationComponent extends TestPropValidationComponent { } @override - _$$TestPropValidationProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TestPropValidationProps$JsMap(backingMap); + _$$TestPropValidationProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestPropValidationProps(backingMap); @override _$$TestPropValidationProps typedPropsFactory(Map? backingMap) => @@ -687,25 +529,21 @@ class TestRedrawOnProps extends _$TestRedrawOnProps static const PropsMeta meta = _$metaForTestRedrawOnProps; } -_$$TestRedrawOnProps _$TestRedrawOn([Map? backingProps]) => backingProps == null - ? _$$TestRedrawOnProps$JsMap(JsBackedMap()) - : _$$TestRedrawOnProps(backingProps); +_$$TestRedrawOnProps _$TestRedrawOn([Map? backingProps]) => + _$$TestRedrawOnProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestRedrawOnProps extends _$TestRedrawOnProps +class _$$TestRedrawOnProps extends _$TestRedrawOnProps with _$TestRedrawOnPropsAccessorsMixin implements TestRedrawOnProps { - _$$TestRedrawOnProps._(); - - factory _$$TestRedrawOnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestRedrawOnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestRedrawOnProps$PlainMap(backingMap); - } - } + _$$TestRedrawOnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -730,48 +568,15 @@ abstract class _$$TestRedrawOnProps extends _$TestRedrawOnProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestRedrawOnProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestRedrawOnProps$PlainMap extends _$$TestRedrawOnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestRedrawOnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestRedrawOnProps$JsMap extends _$$TestRedrawOnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestRedrawOnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestRedrawOnComponent extends TestRedrawOnComponent { - late _$$TestRedrawOnProps$JsMap _cachedTypedProps; + late _$$TestRedrawOnProps _cachedTypedProps; @override - _$$TestRedrawOnProps$JsMap get props => _cachedTypedProps; + _$$TestRedrawOnProps get props => _cachedTypedProps; @override set props(Map value) { @@ -788,8 +593,8 @@ class _$TestRedrawOnComponent extends TestRedrawOnComponent { } @override - _$$TestRedrawOnProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestRedrawOnProps$JsMap(backingMap); + _$$TestRedrawOnProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestRedrawOnProps(backingMap); @override _$$TestRedrawOnProps typedPropsFactory(Map? backingMap) => @@ -843,25 +648,20 @@ class TestStoreHandlersProps extends _$TestStoreHandlersProps } _$$TestStoreHandlersProps _$TestStoreHandlers([Map? backingProps]) => - backingProps == null - ? _$$TestStoreHandlersProps$JsMap(JsBackedMap()) - : _$$TestStoreHandlersProps(backingProps); + _$$TestStoreHandlersProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps +class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps with _$TestStoreHandlersPropsAccessorsMixin implements TestStoreHandlersProps { - _$$TestStoreHandlersProps._(); - - factory _$$TestStoreHandlersProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStoreHandlersProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestStoreHandlersProps$PlainMap(backingMap); - } - } + _$$TestStoreHandlersProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -886,48 +686,15 @@ abstract class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStoreHandlersProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStoreHandlersProps$PlainMap extends _$$TestStoreHandlersProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStoreHandlersProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStoreHandlersProps$JsMap extends _$$TestStoreHandlersProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStoreHandlersProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestStoreHandlersComponent extends TestStoreHandlersComponent { - late _$$TestStoreHandlersProps$JsMap _cachedTypedProps; + late _$$TestStoreHandlersProps _cachedTypedProps; @override - _$$TestStoreHandlersProps$JsMap get props => _cachedTypedProps; + _$$TestStoreHandlersProps get props => _cachedTypedProps; @override set props(Map value) { @@ -944,9 +711,8 @@ class _$TestStoreHandlersComponent extends TestStoreHandlersComponent { } @override - _$$TestStoreHandlersProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TestStoreHandlersProps$JsMap(backingMap); + _$$TestStoreHandlersProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestStoreHandlersProps(backingMap); @override _$$TestStoreHandlersProps typedPropsFactory(Map? backingMap) => @@ -1000,25 +766,20 @@ class TestStatefulBasicProps extends _$TestStatefulBasicProps } _$$TestStatefulBasicProps _$TestStatefulBasic([Map? backingProps]) => - backingProps == null - ? _$$TestStatefulBasicProps$JsMap(JsBackedMap()) - : _$$TestStatefulBasicProps(backingProps); + _$$TestStatefulBasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps +class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps with _$TestStatefulBasicPropsAccessorsMixin implements TestStatefulBasicProps { - _$$TestStatefulBasicProps._(); - - factory _$$TestStatefulBasicProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulBasicProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestStatefulBasicProps$PlainMap(backingMap); - } - } + _$$TestStatefulBasicProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1042,40 +803,6 @@ abstract class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStatefulBasicProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStatefulBasicProps$PlainMap extends _$$TestStatefulBasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulBasicProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulBasicProps$JsMap extends _$$TestStatefulBasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulBasicProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestStatefulBasicStateAccessorsMixin implements _$TestStatefulBasicState { @override @@ -1100,55 +827,19 @@ class TestStatefulBasicState extends _$TestStatefulBasicState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestStatefulBasicState extends _$TestStatefulBasicState +class _$$TestStatefulBasicState extends _$TestStatefulBasicState with _$TestStatefulBasicStateAccessorsMixin implements TestStatefulBasicState { - _$$TestStatefulBasicState._(); - - factory _$$TestStatefulBasicState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulBasicState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestStatefulBasicState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestStatefulBasicState$PlainMap extends _$$TestStatefulBasicState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulBasicState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestStatefulBasicState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulBasicState$JsMap extends _$$TestStatefulBasicState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulBasicState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1156,10 +847,10 @@ class _$$TestStatefulBasicState$JsMap extends _$$TestStatefulBasicState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { - late _$$TestStatefulBasicProps$JsMap _cachedTypedProps; + late _$$TestStatefulBasicProps _cachedTypedProps; @override - _$$TestStatefulBasicProps$JsMap get props => _cachedTypedProps; + _$$TestStatefulBasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -1176,17 +867,16 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { } @override - _$$TestStatefulBasicProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TestStatefulBasicProps$JsMap(backingMap); + _$$TestStatefulBasicProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestStatefulBasicProps(backingMap); @override _$$TestStatefulBasicProps typedPropsFactory(Map? backingMap) => _$$TestStatefulBasicProps(backingMap); - late _$$TestStatefulBasicState$JsMap _cachedTypedState; + late _$$TestStatefulBasicState _cachedTypedState; @override - _$$TestStatefulBasicState$JsMap get state => _cachedTypedState; + _$$TestStatefulBasicState get state => _cachedTypedState; @override set state(Map value) { @@ -1199,9 +889,8 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { } @override - _$$TestStatefulBasicState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$TestStatefulBasicState$JsMap(backingMap); + _$$TestStatefulBasicState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$TestStatefulBasicState(backingMap); @override _$$TestStatefulBasicState typedStateFactory(Map? backingMap) => @@ -1257,27 +946,21 @@ class TestStatefulHandlerLifecycleProps _$$TestStatefulHandlerLifecycleProps _$TestStatefulHandlerLifecycle( [Map? backingProps]) => - backingProps == null - ? _$$TestStatefulHandlerLifecycleProps$JsMap(JsBackedMap()) - : _$$TestStatefulHandlerLifecycleProps(backingProps); + _$$TestStatefulHandlerLifecycleProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStatefulHandlerLifecycleProps +class _$$TestStatefulHandlerLifecycleProps extends _$TestStatefulHandlerLifecycleProps with _$TestStatefulHandlerLifecyclePropsAccessorsMixin implements TestStatefulHandlerLifecycleProps { - _$$TestStatefulHandlerLifecycleProps._(); - - factory _$$TestStatefulHandlerLifecycleProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulHandlerLifecycleProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulHandlerLifecycleProps$PlainMap(backingMap); - } - } + _$$TestStatefulHandlerLifecycleProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1301,42 +984,6 @@ abstract class _$$TestStatefulHandlerLifecycleProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStatefulHandlerLifecycleProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStatefulHandlerLifecycleProps$PlainMap - extends _$$TestStatefulHandlerLifecycleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerLifecycleProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulHandlerLifecycleProps$JsMap - extends _$$TestStatefulHandlerLifecycleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerLifecycleProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestStatefulHandlerLifecycleStateAccessorsMixin implements _$TestStatefulHandlerLifecycleState { @override @@ -1362,59 +1009,20 @@ class TestStatefulHandlerLifecycleState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestStatefulHandlerLifecycleState +class _$$TestStatefulHandlerLifecycleState extends _$TestStatefulHandlerLifecycleState with _$TestStatefulHandlerLifecycleStateAccessorsMixin implements TestStatefulHandlerLifecycleState { - _$$TestStatefulHandlerLifecycleState._(); - - factory _$$TestStatefulHandlerLifecycleState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulHandlerLifecycleState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulHandlerLifecycleState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestStatefulHandlerLifecycleState$PlainMap - extends _$$TestStatefulHandlerLifecycleState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerLifecycleState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestStatefulHandlerLifecycleState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulHandlerLifecycleState$JsMap - extends _$$TestStatefulHandlerLifecycleState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerLifecycleState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1423,10 +1031,10 @@ class _$$TestStatefulHandlerLifecycleState$JsMap // generated for the associated props class. class _$TestStatefulHandlerLifecycleComponent extends TestStatefulHandlerLifecycleComponent { - late _$$TestStatefulHandlerLifecycleProps$JsMap _cachedTypedProps; + late _$$TestStatefulHandlerLifecycleProps _cachedTypedProps; @override - _$$TestStatefulHandlerLifecycleProps$JsMap get props => _cachedTypedProps; + _$$TestStatefulHandlerLifecycleProps get props => _cachedTypedProps; @override set props(Map value) { @@ -1443,17 +1051,17 @@ class _$TestStatefulHandlerLifecycleComponent } @override - _$$TestStatefulHandlerLifecycleProps$JsMap typedPropsFactoryJs( + _$$TestStatefulHandlerLifecycleProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulHandlerLifecycleProps$JsMap(backingMap); + _$$TestStatefulHandlerLifecycleProps(backingMap); @override _$$TestStatefulHandlerLifecycleProps typedPropsFactory(Map? backingMap) => _$$TestStatefulHandlerLifecycleProps(backingMap); - late _$$TestStatefulHandlerLifecycleState$JsMap _cachedTypedState; + late _$$TestStatefulHandlerLifecycleState _cachedTypedState; @override - _$$TestStatefulHandlerLifecycleState$JsMap get state => _cachedTypedState; + _$$TestStatefulHandlerLifecycleState get state => _cachedTypedState; @override set state(Map value) { @@ -1466,9 +1074,9 @@ class _$TestStatefulHandlerLifecycleComponent } @override - _$$TestStatefulHandlerLifecycleState$JsMap typedStateFactoryJs( + _$$TestStatefulHandlerLifecycleState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulHandlerLifecycleState$JsMap(backingMap); + _$$TestStatefulHandlerLifecycleState(backingMap); @override _$$TestStatefulHandlerLifecycleState typedStateFactory(Map? backingMap) => @@ -1524,27 +1132,21 @@ class TestStatefulHandlerPrecedenceProps _$$TestStatefulHandlerPrecedenceProps _$TestStatefulHandlerPrecedence( [Map? backingProps]) => - backingProps == null - ? _$$TestStatefulHandlerPrecedenceProps$JsMap(JsBackedMap()) - : _$$TestStatefulHandlerPrecedenceProps(backingProps); + _$$TestStatefulHandlerPrecedenceProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStatefulHandlerPrecedenceProps +class _$$TestStatefulHandlerPrecedenceProps extends _$TestStatefulHandlerPrecedenceProps with _$TestStatefulHandlerPrecedencePropsAccessorsMixin implements TestStatefulHandlerPrecedenceProps { - _$$TestStatefulHandlerPrecedenceProps._(); - - factory _$$TestStatefulHandlerPrecedenceProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulHandlerPrecedenceProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulHandlerPrecedenceProps$PlainMap(backingMap); - } - } + _$$TestStatefulHandlerPrecedenceProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1568,42 +1170,6 @@ abstract class _$$TestStatefulHandlerPrecedenceProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStatefulHandlerPrecedenceProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStatefulHandlerPrecedenceProps$PlainMap - extends _$$TestStatefulHandlerPrecedenceProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerPrecedenceProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulHandlerPrecedenceProps$JsMap - extends _$$TestStatefulHandlerPrecedenceProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerPrecedenceProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements _$TestStatefulHandlerPrecedenceState { @override @@ -1629,59 +1195,20 @@ class TestStatefulHandlerPrecedenceState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestStatefulHandlerPrecedenceState +class _$$TestStatefulHandlerPrecedenceState extends _$TestStatefulHandlerPrecedenceState with _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements TestStatefulHandlerPrecedenceState { - _$$TestStatefulHandlerPrecedenceState._(); - - factory _$$TestStatefulHandlerPrecedenceState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulHandlerPrecedenceState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulHandlerPrecedenceState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestStatefulHandlerPrecedenceState$PlainMap - extends _$$TestStatefulHandlerPrecedenceState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerPrecedenceState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestStatefulHandlerPrecedenceState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} + final Map state; -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulHandlerPrecedenceState$JsMap - extends _$$TestStatefulHandlerPrecedenceState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerPrecedenceState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } - - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1690,10 +1217,10 @@ class _$$TestStatefulHandlerPrecedenceState$JsMap // generated for the associated props class. class _$TestStatefulHandlerPrecedenceComponent extends TestStatefulHandlerPrecedenceComponent { - late _$$TestStatefulHandlerPrecedenceProps$JsMap _cachedTypedProps; + late _$$TestStatefulHandlerPrecedenceProps _cachedTypedProps; @override - _$$TestStatefulHandlerPrecedenceProps$JsMap get props => _cachedTypedProps; + _$$TestStatefulHandlerPrecedenceProps get props => _cachedTypedProps; @override set props(Map value) { @@ -1710,17 +1237,17 @@ class _$TestStatefulHandlerPrecedenceComponent } @override - _$$TestStatefulHandlerPrecedenceProps$JsMap typedPropsFactoryJs( + _$$TestStatefulHandlerPrecedenceProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulHandlerPrecedenceProps$JsMap(backingMap); + _$$TestStatefulHandlerPrecedenceProps(backingMap); @override _$$TestStatefulHandlerPrecedenceProps typedPropsFactory(Map? backingMap) => _$$TestStatefulHandlerPrecedenceProps(backingMap); - late _$$TestStatefulHandlerPrecedenceState$JsMap _cachedTypedState; + late _$$TestStatefulHandlerPrecedenceState _cachedTypedState; @override - _$$TestStatefulHandlerPrecedenceState$JsMap get state => _cachedTypedState; + _$$TestStatefulHandlerPrecedenceState get state => _cachedTypedState; @override set state(Map value) { @@ -1733,9 +1260,9 @@ class _$TestStatefulHandlerPrecedenceComponent } @override - _$$TestStatefulHandlerPrecedenceState$JsMap typedStateFactoryJs( + _$$TestStatefulHandlerPrecedenceState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulHandlerPrecedenceState$JsMap(backingMap); + _$$TestStatefulHandlerPrecedenceState(backingMap); @override _$$TestStatefulHandlerPrecedenceState typedStateFactory(Map? backingMap) => @@ -1814,27 +1341,21 @@ class TestStatefulPropValidationProps extends _$TestStatefulPropValidationProps _$$TestStatefulPropValidationProps _$TestStatefulPropValidation( [Map? backingProps]) => - backingProps == null - ? _$$TestStatefulPropValidationProps$JsMap(JsBackedMap()) - : _$$TestStatefulPropValidationProps(backingProps); + _$$TestStatefulPropValidationProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStatefulPropValidationProps +class _$$TestStatefulPropValidationProps extends _$TestStatefulPropValidationProps with _$TestStatefulPropValidationPropsAccessorsMixin implements TestStatefulPropValidationProps { - _$$TestStatefulPropValidationProps._(); - - factory _$$TestStatefulPropValidationProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulPropValidationProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulPropValidationProps$PlainMap(backingMap); - } - } + _$$TestStatefulPropValidationProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1858,42 +1379,6 @@ abstract class _$$TestStatefulPropValidationProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStatefulPropValidationProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStatefulPropValidationProps$PlainMap - extends _$$TestStatefulPropValidationProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulPropValidationProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulPropValidationProps$JsMap - extends _$$TestStatefulPropValidationProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulPropValidationProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestStatefulPropValidationStateAccessorsMixin implements _$TestStatefulPropValidationState { @override @@ -1918,59 +1403,20 @@ class TestStatefulPropValidationState extends _$TestStatefulPropValidationState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestStatefulPropValidationState +class _$$TestStatefulPropValidationState extends _$TestStatefulPropValidationState with _$TestStatefulPropValidationStateAccessorsMixin implements TestStatefulPropValidationState { - _$$TestStatefulPropValidationState._(); - - factory _$$TestStatefulPropValidationState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulPropValidationState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulPropValidationState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestStatefulPropValidationState$PlainMap - extends _$$TestStatefulPropValidationState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulPropValidationState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestStatefulPropValidationState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} + final Map state; -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulPropValidationState$JsMap - extends _$$TestStatefulPropValidationState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulPropValidationState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } - - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1979,10 +1425,10 @@ class _$$TestStatefulPropValidationState$JsMap // generated for the associated props class. class _$TestStatefulPropValidationComponent extends TestStatefulPropValidationComponent { - late _$$TestStatefulPropValidationProps$JsMap _cachedTypedProps; + late _$$TestStatefulPropValidationProps _cachedTypedProps; @override - _$$TestStatefulPropValidationProps$JsMap get props => _cachedTypedProps; + _$$TestStatefulPropValidationProps get props => _cachedTypedProps; @override set props(Map value) { @@ -1999,17 +1445,17 @@ class _$TestStatefulPropValidationComponent } @override - _$$TestStatefulPropValidationProps$JsMap typedPropsFactoryJs( + _$$TestStatefulPropValidationProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulPropValidationProps$JsMap(backingMap); + _$$TestStatefulPropValidationProps(backingMap); @override _$$TestStatefulPropValidationProps typedPropsFactory(Map? backingMap) => _$$TestStatefulPropValidationProps(backingMap); - late _$$TestStatefulPropValidationState$JsMap _cachedTypedState; + late _$$TestStatefulPropValidationState _cachedTypedState; @override - _$$TestStatefulPropValidationState$JsMap get state => _cachedTypedState; + _$$TestStatefulPropValidationState get state => _cachedTypedState; @override set state(Map value) { @@ -2022,9 +1468,9 @@ class _$TestStatefulPropValidationComponent } @override - _$$TestStatefulPropValidationState$JsMap typedStateFactoryJs( + _$$TestStatefulPropValidationState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulPropValidationState$JsMap(backingMap); + _$$TestStatefulPropValidationState(backingMap); @override _$$TestStatefulPropValidationState typedStateFactory(Map? backingMap) => @@ -2078,25 +1524,20 @@ class TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps } _$$TestStatefulRedrawOnProps _$TestStatefulRedrawOn([Map? backingProps]) => - backingProps == null - ? _$$TestStatefulRedrawOnProps$JsMap(JsBackedMap()) - : _$$TestStatefulRedrawOnProps(backingProps); + _$$TestStatefulRedrawOnProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps +class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps with _$TestStatefulRedrawOnPropsAccessorsMixin implements TestStatefulRedrawOnProps { - _$$TestStatefulRedrawOnProps._(); - - factory _$$TestStatefulRedrawOnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulRedrawOnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestStatefulRedrawOnProps$PlainMap(backingMap); - } - } + _$$TestStatefulRedrawOnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -2120,41 +1561,6 @@ abstract class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStatefulRedrawOnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStatefulRedrawOnProps$PlainMap - extends _$$TestStatefulRedrawOnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulRedrawOnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulRedrawOnProps$JsMap extends _$$TestStatefulRedrawOnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulRedrawOnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestStatefulRedrawOnStateAccessorsMixin implements _$TestStatefulRedrawOnState { @override @@ -2179,56 +1585,19 @@ class TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState +class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState with _$TestStatefulRedrawOnStateAccessorsMixin implements TestStatefulRedrawOnState { - _$$TestStatefulRedrawOnState._(); - - factory _$$TestStatefulRedrawOnState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulRedrawOnState$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestStatefulRedrawOnState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestStatefulRedrawOnState$PlainMap - extends _$$TestStatefulRedrawOnState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulRedrawOnState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestStatefulRedrawOnState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} + final Map state; -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulRedrawOnState$JsMap extends _$$TestStatefulRedrawOnState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulRedrawOnState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } - - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -2236,10 +1605,10 @@ class _$$TestStatefulRedrawOnState$JsMap extends _$$TestStatefulRedrawOnState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { - late _$$TestStatefulRedrawOnProps$JsMap _cachedTypedProps; + late _$$TestStatefulRedrawOnProps _cachedTypedProps; @override - _$$TestStatefulRedrawOnProps$JsMap get props => _cachedTypedProps; + _$$TestStatefulRedrawOnProps get props => _cachedTypedProps; @override set props(Map value) { @@ -2256,17 +1625,16 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { } @override - _$$TestStatefulRedrawOnProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$TestStatefulRedrawOnProps$JsMap(backingMap); + _$$TestStatefulRedrawOnProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestStatefulRedrawOnProps(backingMap); @override _$$TestStatefulRedrawOnProps typedPropsFactory(Map? backingMap) => _$$TestStatefulRedrawOnProps(backingMap); - late _$$TestStatefulRedrawOnState$JsMap _cachedTypedState; + late _$$TestStatefulRedrawOnState _cachedTypedState; @override - _$$TestStatefulRedrawOnState$JsMap get state => _cachedTypedState; + _$$TestStatefulRedrawOnState get state => _cachedTypedState; @override set state(Map value) { @@ -2279,9 +1647,8 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { } @override - _$$TestStatefulRedrawOnState$JsMap typedStateFactoryJs( - JsBackedMap? backingMap) => - _$$TestStatefulRedrawOnState$JsMap(backingMap); + _$$TestStatefulRedrawOnState typedStateFactoryJs(JsBackedMap? backingMap) => + _$$TestStatefulRedrawOnState(backingMap); @override _$$TestStatefulRedrawOnState typedStateFactory(Map? backingMap) => @@ -2336,27 +1703,20 @@ class TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps _$$TestStatefulStoreHandlersProps _$TestStatefulStoreHandlers( [Map? backingProps]) => - backingProps == null - ? _$$TestStatefulStoreHandlersProps$JsMap(JsBackedMap()) - : _$$TestStatefulStoreHandlersProps(backingProps); + _$$TestStatefulStoreHandlersProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestStatefulStoreHandlersProps - extends _$TestStatefulStoreHandlersProps +class _$$TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps with _$TestStatefulStoreHandlersPropsAccessorsMixin implements TestStatefulStoreHandlersProps { - _$$TestStatefulStoreHandlersProps._(); - - factory _$$TestStatefulStoreHandlersProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulStoreHandlersProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulStoreHandlersProps$PlainMap(backingMap); - } - } + _$$TestStatefulStoreHandlersProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -2380,42 +1740,6 @@ abstract class _$$TestStatefulStoreHandlersProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestStatefulStoreHandlersProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$TestStatefulStoreHandlersProps$PlainMap - extends _$$TestStatefulStoreHandlersProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulStoreHandlersProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulStoreHandlersProps$JsMap - extends _$$TestStatefulStoreHandlersProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulStoreHandlersProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$TestStatefulStoreHandlersStateAccessorsMixin implements _$TestStatefulStoreHandlersState { @override @@ -2440,59 +1764,19 @@ class TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$TestStatefulStoreHandlersState - extends _$TestStatefulStoreHandlersState +class _$$TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState with _$TestStatefulStoreHandlersStateAccessorsMixin implements TestStatefulStoreHandlersState { - _$$TestStatefulStoreHandlersState._(); - - factory _$$TestStatefulStoreHandlersState(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestStatefulStoreHandlersState$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$TestStatefulStoreHandlersState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$TestStatefulStoreHandlersState$PlainMap - extends _$$TestStatefulStoreHandlersState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulStoreHandlersState$PlainMap(Map? backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$TestStatefulStoreHandlersState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} + final Map state; -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestStatefulStoreHandlersState$JsMap - extends _$$TestStatefulStoreHandlersState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulStoreHandlersState$JsMap(JsBackedMap? backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } - - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -2501,10 +1785,10 @@ class _$$TestStatefulStoreHandlersState$JsMap // generated for the associated props class. class _$TestStatefulStoreHandlersComponent extends TestStatefulStoreHandlersComponent { - late _$$TestStatefulStoreHandlersProps$JsMap _cachedTypedProps; + late _$$TestStatefulStoreHandlersProps _cachedTypedProps; @override - _$$TestStatefulStoreHandlersProps$JsMap get props => _cachedTypedProps; + _$$TestStatefulStoreHandlersProps get props => _cachedTypedProps; @override set props(Map value) { @@ -2521,17 +1805,17 @@ class _$TestStatefulStoreHandlersComponent } @override - _$$TestStatefulStoreHandlersProps$JsMap typedPropsFactoryJs( + _$$TestStatefulStoreHandlersProps typedPropsFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulStoreHandlersProps$JsMap(backingMap); + _$$TestStatefulStoreHandlersProps(backingMap); @override _$$TestStatefulStoreHandlersProps typedPropsFactory(Map? backingMap) => _$$TestStatefulStoreHandlersProps(backingMap); - late _$$TestStatefulStoreHandlersState$JsMap _cachedTypedState; + late _$$TestStatefulStoreHandlersState _cachedTypedState; @override - _$$TestStatefulStoreHandlersState$JsMap get state => _cachedTypedState; + _$$TestStatefulStoreHandlersState get state => _cachedTypedState; @override set state(Map value) { @@ -2544,9 +1828,9 @@ class _$TestStatefulStoreHandlersComponent } @override - _$$TestStatefulStoreHandlersState$JsMap typedStateFactoryJs( + _$$TestStatefulStoreHandlersState typedStateFactoryJs( JsBackedMap? backingMap) => - _$$TestStatefulStoreHandlersState$JsMap(backingMap); + _$$TestStatefulStoreHandlersState(backingMap); @override _$$TestStatefulStoreHandlersState typedStateFactory(Map? backingMap) => diff --git a/test/over_react/component_declaration/flux_component_test/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test/flux_component_test.over_react.g.dart index becc9f159..1556af37f 100644 --- a/test/over_react/component_declaration/flux_component_test/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test/flux_component_test.over_react.g.dart @@ -47,16 +47,12 @@ _$$TestBasicProps _$TestBasic([Map? backingProps]) => class _$$TestBasicProps extends _$TestBasicProps with _$TestBasicPropsAccessorsMixin implements TestBasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestBasicProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestBasicProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -146,16 +142,12 @@ _$$TestHandlerLifecycleProps _$TestHandlerLifecycle([Map? backingProps]) => class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps with _$TestHandlerLifecyclePropsAccessorsMixin implements TestHandlerLifecycleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestHandlerLifecycleProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestHandlerLifecycleProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -245,16 +237,12 @@ _$$TestHandlerPrecedenceProps _$TestHandlerPrecedence([Map? backingProps]) => class _$$TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps with _$TestHandlerPrecedencePropsAccessorsMixin implements TestHandlerPrecedenceProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestHandlerPrecedenceProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestHandlerPrecedenceProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -364,16 +352,12 @@ _$$TestPropValidationProps _$TestPropValidation([Map? backingProps]) => class _$$TestPropValidationProps extends _$TestPropValidationProps with _$TestPropValidationPropsAccessorsMixin implements TestPropValidationProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestPropValidationProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestPropValidationProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -462,16 +446,12 @@ _$$TestRedrawOnProps _$TestRedrawOn([Map? backingProps]) => class _$$TestRedrawOnProps extends _$TestRedrawOnProps with _$TestRedrawOnPropsAccessorsMixin implements TestRedrawOnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestRedrawOnProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestRedrawOnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -561,16 +541,12 @@ _$$TestStoreHandlersProps _$TestStoreHandlers([Map? backingProps]) => class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps with _$TestStoreHandlersPropsAccessorsMixin implements TestStoreHandlersProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStoreHandlersProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStoreHandlersProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -660,16 +636,12 @@ _$$TestStatefulBasicProps _$TestStatefulBasic([Map? backingProps]) => class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps with _$TestStatefulBasicPropsAccessorsMixin implements TestStatefulBasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulBasicProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStatefulBasicProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -720,16 +692,12 @@ class TestStatefulBasicState extends _$TestStatefulBasicState class _$$TestStatefulBasicState extends _$TestStatefulBasicState with _$TestStatefulBasicStateAccessorsMixin implements TestStatefulBasicState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulBasicState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TestStatefulBasicState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -808,16 +776,12 @@ class _$$TestStatefulHandlerLifecycleProps extends _$TestStatefulHandlerLifecycleProps with _$TestStatefulHandlerLifecyclePropsAccessorsMixin implements TestStatefulHandlerLifecycleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerLifecycleProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStatefulHandlerLifecycleProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -870,16 +834,12 @@ class _$$TestStatefulHandlerLifecycleState extends _$TestStatefulHandlerLifecycleState with _$TestStatefulHandlerLifecycleStateAccessorsMixin implements TestStatefulHandlerLifecycleState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerLifecycleState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TestStatefulHandlerLifecycleState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -959,16 +919,12 @@ class _$$TestStatefulHandlerPrecedenceProps extends _$TestStatefulHandlerPrecedenceProps with _$TestStatefulHandlerPrecedencePropsAccessorsMixin implements TestStatefulHandlerPrecedenceProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerPrecedenceProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStatefulHandlerPrecedenceProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1021,16 +977,12 @@ class _$$TestStatefulHandlerPrecedenceState extends _$TestStatefulHandlerPrecedenceState with _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements TestStatefulHandlerPrecedenceState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulHandlerPrecedenceState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TestStatefulHandlerPrecedenceState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -1133,16 +1085,12 @@ class _$$TestStatefulPropValidationProps extends _$TestStatefulPropValidationProps with _$TestStatefulPropValidationPropsAccessorsMixin implements TestStatefulPropValidationProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulPropValidationProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStatefulPropValidationProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1194,16 +1142,12 @@ class _$$TestStatefulPropValidationState extends _$TestStatefulPropValidationState with _$TestStatefulPropValidationStateAccessorsMixin implements TestStatefulPropValidationState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulPropValidationState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TestStatefulPropValidationState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -1280,16 +1224,12 @@ _$$TestStatefulRedrawOnProps _$TestStatefulRedrawOn([Map? backingProps]) => class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps with _$TestStatefulRedrawOnPropsAccessorsMixin implements TestStatefulRedrawOnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulRedrawOnProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStatefulRedrawOnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1340,16 +1280,12 @@ class TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState with _$TestStatefulRedrawOnStateAccessorsMixin implements TestStatefulRedrawOnState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulRedrawOnState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TestStatefulRedrawOnState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -1426,16 +1362,12 @@ _$$TestStatefulStoreHandlersProps _$TestStatefulStoreHandlers( class _$$TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps with _$TestStatefulStoreHandlersPropsAccessorsMixin implements TestStatefulStoreHandlersProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulStoreHandlersProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestStatefulStoreHandlersProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1486,16 +1418,12 @@ class TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState class _$$TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState with _$TestStatefulStoreHandlersStateAccessorsMixin implements TestStatefulStoreHandlersState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestStatefulStoreHandlersState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$TestStatefulStoreHandlersState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/function_type_checking_test/components.over_react.g.dart b/test/over_react/component_declaration/function_type_checking_test/components.over_react.g.dart index fac89af86..4815d5881 100644 --- a/test/over_react/component_declaration/function_type_checking_test/components.over_react.g.dart +++ b/test/over_react/component_declaration/function_type_checking_test/components.over_react.g.dart @@ -24,35 +24,24 @@ final $DoNotReferenceThisFactoryExceptForInASingleTestComponentnFactory = _$$DoNotReferenceThisFactoryExceptForInASingleTestProps _$DoNotReferenceThisFactoryExceptForInASingleTest([Map? backingProps]) => - backingProps == null - ? _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap( - JsBackedMap()) - : _$$DoNotReferenceThisFactoryExceptForInASingleTestProps( - backingProps); + _$$DoNotReferenceThisFactoryExceptForInASingleTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$DoNotReferenceThisFactoryExceptForInASingleTestProps - extends UiProps +class _$$DoNotReferenceThisFactoryExceptForInASingleTestProps extends UiProps with DoNotReferenceThisFactoryExceptForInASingleTestProps, // If this generated mixin is undefined, it's likely because DoNotReferenceThisFactoryExceptForInASingleTestProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of DoNotReferenceThisFactoryExceptForInASingleTestProps, and check that $DoNotReferenceThisFactoryExceptForInASingleTestProps is exported/imported properly. $DoNotReferenceThisFactoryExceptForInASingleTestProps { - _$$DoNotReferenceThisFactoryExceptForInASingleTestProps._(); - - factory _$$DoNotReferenceThisFactoryExceptForInASingleTestProps( - Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$PlainMap( - backingMap); - } - } + _$$DoNotReferenceThisFactoryExceptForInASingleTestProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -88,47 +77,6 @@ abstract class _$$DoNotReferenceThisFactoryExceptForInASingleTestProps const _$getPropKey$_$$DoNotReferenceThisFactoryExceptForInASingleTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$PlainMap - extends _$$DoNotReferenceThisFactoryExceptForInASingleTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$PlainMap( - Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap - extends _$$DoNotReferenceThisFactoryExceptForInASingleTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap( - JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -137,11 +85,11 @@ class _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap ' Do not reference it in your code, as it may change at any time.') class _$DoNotReferenceThisFactoryExceptForInASingleTestComponentn extends DoNotReferenceThisFactoryExceptForInASingleTestComponentn { - late _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap + late _$$DoNotReferenceThisFactoryExceptForInASingleTestProps _cachedTypedProps; @override - _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap get props => + _$$DoNotReferenceThisFactoryExceptForInASingleTestProps get props => _cachedTypedProps; @override @@ -159,10 +107,9 @@ class _$DoNotReferenceThisFactoryExceptForInASingleTestComponentn } @override - _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap - typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$DoNotReferenceThisFactoryExceptForInASingleTestProps$JsMap( - backingMap); + _$$DoNotReferenceThisFactoryExceptForInASingleTestProps typedPropsFactoryJs( + JsBackedMap? backingMap) => + _$$DoNotReferenceThisFactoryExceptForInASingleTestProps(backingMap); @override _$$DoNotReferenceThisFactoryExceptForInASingleTestProps typedPropsFactory( @@ -445,7 +392,7 @@ const PropsMeta _$metaForTestUninitializedParentProps = PropsMeta( final UiFactoryConfig<_$$TestAProps> _$TestAConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestAProps(map), - jsMap: (map) => _$$TestAProps$JsMap(map), + jsMap: (map) => _$$TestAProps(map), ), displayName: 'TestA'); @@ -459,20 +406,16 @@ final UiFactoryConfig<_$$TestAProps> $TestAConfig = _$TestAConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestAProps extends UiProps +class _$$TestAProps extends UiProps with TestAProps, // If this generated mixin is undefined, it's likely because TestAProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestAProps, and check that $TestAProps is exported/imported properly. $TestAProps { - _$$TestAProps._(); - - factory _$$TestAProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestAProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestAProps$PlainMap(backingMap); - } - } + _$$TestAProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -496,48 +439,10 @@ abstract class _$$TestAProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestAProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestAProps$PlainMap extends _$$TestAProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestAProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestAProps$JsMap extends _$$TestAProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestAProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestBProps> _$TestBConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestBProps(map), - jsMap: (map) => _$$TestBProps$JsMap(map), + jsMap: (map) => _$$TestBProps(map), ), displayName: 'TestB'); @@ -551,20 +456,16 @@ final UiFactoryConfig<_$$TestBProps> $TestBConfig = _$TestBConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestBProps extends UiProps +class _$$TestBProps extends UiProps with TestBProps, // If this generated mixin is undefined, it's likely because TestBProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestBProps, and check that $TestBProps is exported/imported properly. $TestBProps { - _$$TestBProps._(); - - factory _$$TestBProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestBProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestBProps$PlainMap(backingMap); - } - } + _$$TestBProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -588,48 +489,10 @@ abstract class _$$TestBProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestBProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestBProps$PlainMap extends _$$TestBProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestBProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestBProps$JsMap extends _$$TestBProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestBProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestParentProps> _$TestParentConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestParentProps(map), - jsMap: (map) => _$$TestParentProps$JsMap(map), + jsMap: (map) => _$$TestParentProps(map), ), displayName: 'TestParent'); @@ -644,20 +507,17 @@ final UiFactoryConfig<_$$TestParentProps> $TestParentConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestParentProps extends UiProps +class _$$TestParentProps extends UiProps with TestParentProps, // If this generated mixin is undefined, it's likely because TestParentProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestParentProps, and check that $TestParentProps is exported/imported properly. $TestParentProps { - _$$TestParentProps._(); - - factory _$$TestParentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestParentProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestParentProps$PlainMap(backingMap); - } - } + _$$TestParentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -682,49 +542,11 @@ abstract class _$$TestParentProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestParentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestParentProps$PlainMap extends _$$TestParentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestParentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestParentProps$JsMap extends _$$TestParentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestParentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestSubtypeProps> _$TestSubtypeConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestSubtypeProps(map), - jsMap: (map) => _$$TestSubtypeProps$JsMap(map), + jsMap: (map) => _$$TestSubtypeProps(map), ), displayName: 'TestSubtype'); @@ -739,20 +561,17 @@ final UiFactoryConfig<_$$TestSubtypeProps> $TestSubtypeConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestSubtypeProps extends UiProps +class _$$TestSubtypeProps extends UiProps with TestSubtypeProps, // If this generated mixin is undefined, it's likely because TestSubtypeProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestSubtypeProps, and check that $TestSubtypeProps is exported/imported properly. $TestSubtypeProps { - _$$TestSubtypeProps._(); - - factory _$$TestSubtypeProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSubtypeProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestSubtypeProps$PlainMap(backingMap); - } - } + _$$TestSubtypeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -777,49 +596,11 @@ abstract class _$$TestSubtypeProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSubtypeProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestSubtypeProps$PlainMap extends _$$TestSubtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtypeProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestSubtypeProps$JsMap extends _$$TestSubtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubtypeProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestSubsubtypeProps> _$TestSubsubtypeConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestSubsubtypeProps(map), - jsMap: (map) => _$$TestSubsubtypeProps$JsMap(map), + jsMap: (map) => _$$TestSubsubtypeProps(map), ), displayName: 'TestSubsubtype'); @@ -834,20 +615,17 @@ final UiFactoryConfig<_$$TestSubsubtypeProps> $TestSubsubtypeConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestSubsubtypeProps extends UiProps +class _$$TestSubsubtypeProps extends UiProps with TestSubsubtypeProps, // If this generated mixin is undefined, it's likely because TestSubsubtypeProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestSubsubtypeProps, and check that $TestSubsubtypeProps is exported/imported properly. $TestSubsubtypeProps { - _$$TestSubsubtypeProps._(); - - factory _$$TestSubsubtypeProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSubsubtypeProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestSubsubtypeProps$PlainMap(backingMap); - } - } + _$$TestSubsubtypeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -872,49 +650,11 @@ abstract class _$$TestSubsubtypeProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSubsubtypeProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestSubsubtypeProps$PlainMap extends _$$TestSubsubtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtypeProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestSubsubtypeProps$JsMap extends _$$TestSubsubtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSubsubtypeProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestExtendtypeProps> _$TestExtendtypeConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestExtendtypeProps(map), - jsMap: (map) => _$$TestExtendtypeProps$JsMap(map), + jsMap: (map) => _$$TestExtendtypeProps(map), ), displayName: 'TestExtendtype'); @@ -929,20 +669,17 @@ final UiFactoryConfig<_$$TestExtendtypeProps> $TestExtendtypeConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestExtendtypeProps extends UiProps +class _$$TestExtendtypeProps extends UiProps with TestExtendtypeProps, // If this generated mixin is undefined, it's likely because TestExtendtypeProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestExtendtypeProps, and check that $TestExtendtypeProps is exported/imported properly. $TestExtendtypeProps { - _$$TestExtendtypeProps._(); - - factory _$$TestExtendtypeProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestExtendtypeProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestExtendtypeProps$PlainMap(backingMap); - } - } + _$$TestExtendtypeProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -967,49 +704,11 @@ abstract class _$$TestExtendtypeProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestExtendtypeProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestExtendtypeProps$PlainMap extends _$$TestExtendtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestExtendtypeProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestExtendtypeProps$JsMap extends _$$TestExtendtypeProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestExtendtypeProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$OneLevelWrapperProps> _$OneLevelWrapperConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$OneLevelWrapperProps(map), - jsMap: (map) => _$$OneLevelWrapperProps$JsMap(map), + jsMap: (map) => _$$OneLevelWrapperProps(map), ), displayName: 'OneLevelWrapper'); @@ -1024,20 +723,17 @@ final UiFactoryConfig<_$$OneLevelWrapperProps> $OneLevelWrapperConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$OneLevelWrapperProps extends UiProps +class _$$OneLevelWrapperProps extends UiProps with OneLevelWrapperProps, // If this generated mixin is undefined, it's likely because OneLevelWrapperProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of OneLevelWrapperProps, and check that $OneLevelWrapperProps is exported/imported properly. $OneLevelWrapperProps { - _$$OneLevelWrapperProps._(); - - factory _$$OneLevelWrapperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$OneLevelWrapperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$OneLevelWrapperProps$PlainMap(backingMap); - } - } + _$$OneLevelWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1062,49 +758,11 @@ abstract class _$$OneLevelWrapperProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$OneLevelWrapperProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$OneLevelWrapperProps$PlainMap extends _$$OneLevelWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$OneLevelWrapperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$OneLevelWrapperProps$JsMap extends _$$OneLevelWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$OneLevelWrapperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TwoLevelWrapperProps> _$TwoLevelWrapperConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TwoLevelWrapperProps(map), - jsMap: (map) => _$$TwoLevelWrapperProps$JsMap(map), + jsMap: (map) => _$$TwoLevelWrapperProps(map), ), displayName: 'TwoLevelWrapper'); @@ -1119,20 +777,17 @@ final UiFactoryConfig<_$$TwoLevelWrapperProps> $TwoLevelWrapperConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TwoLevelWrapperProps extends UiProps +class _$$TwoLevelWrapperProps extends UiProps with TwoLevelWrapperProps, // If this generated mixin is undefined, it's likely because TwoLevelWrapperProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TwoLevelWrapperProps, and check that $TwoLevelWrapperProps is exported/imported properly. $TwoLevelWrapperProps { - _$$TwoLevelWrapperProps._(); - - factory _$$TwoLevelWrapperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TwoLevelWrapperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TwoLevelWrapperProps$PlainMap(backingMap); - } - } + _$$TwoLevelWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1157,49 +812,11 @@ abstract class _$$TwoLevelWrapperProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TwoLevelWrapperProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TwoLevelWrapperProps$PlainMap extends _$$TwoLevelWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TwoLevelWrapperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TwoLevelWrapperProps$JsMap extends _$$TwoLevelWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TwoLevelWrapperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestUninitializedParentProps> _$TestUninitializedParentConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestUninitializedParentProps(map), - jsMap: (map) => _$$TestUninitializedParentProps$JsMap(map), + jsMap: (map) => _$$TestUninitializedParentProps(map), ), displayName: 'TestUninitializedParent'); @@ -1215,20 +832,17 @@ final UiFactoryConfig<_$$TestUninitializedParentProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestUninitializedParentProps extends UiProps +class _$$TestUninitializedParentProps extends UiProps with TestUninitializedParentProps, // If this generated mixin is undefined, it's likely because TestUninitializedParentProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestUninitializedParentProps, and check that $TestUninitializedParentProps is exported/imported properly. $TestUninitializedParentProps { - _$$TestUninitializedParentProps._(); - - factory _$$TestUninitializedParentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestUninitializedParentProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestUninitializedParentProps$PlainMap(backingMap); - } - } + _$$TestUninitializedParentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -1253,42 +867,3 @@ abstract class _$$TestUninitializedParentProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestUninitializedParentProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestUninitializedParentProps$PlainMap - extends _$$TestUninitializedParentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestUninitializedParentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestUninitializedParentProps$JsMap - extends _$$TestUninitializedParentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestUninitializedParentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart index 621489741..db188891a 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart @@ -28,8 +28,8 @@ main() { test('state class cannot be instantiated directly', () { expect(() { StatefulComponentTestState(); - }, throwsA(isA())); - }); + }, throwsA(isA())); + }, tags: 'ddc'); test('renders a component from end to end, successfully reading state via typed getters', () { var renderedInstance = render(StatefulComponentTest()()); diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart index 83cacb474..2005a558f 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/annotation_error_integration_test.over_react.g.dart @@ -52,16 +52,12 @@ class _$$AnnotationErrorDefaultPropsProps extends _$AnnotationErrorDefaultPropsProps with _$AnnotationErrorDefaultPropsPropsAccessorsMixin implements AnnotationErrorDefaultPropsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorDefaultPropsProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorDefaultPropsProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -160,16 +156,12 @@ _$$AnnotationErrorProps _$AnnotationError([Map backingProps]) => class _$$AnnotationErrorProps extends _$AnnotationErrorProps with _$AnnotationErrorPropsAccessorsMixin implements AnnotationErrorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -265,16 +257,12 @@ _$$AnnotationErrorStatefulProps _$AnnotationErrorStateful([Map backingProps]) => class _$$AnnotationErrorStatefulProps extends _$AnnotationErrorStatefulProps with _$AnnotationErrorStatefulPropsAccessorsMixin implements AnnotationErrorStatefulProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorStatefulProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -331,16 +319,12 @@ class AnnotationErrorStatefulState extends _$AnnotationErrorStatefulState class _$$AnnotationErrorStatefulState extends _$AnnotationErrorStatefulState with _$AnnotationErrorStatefulStateAccessorsMixin implements AnnotationErrorStatefulState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulState(Map backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$AnnotationErrorStatefulState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -421,17 +405,12 @@ class _$$AnnotationErrorStatefulDefaultPropsProps extends _$AnnotationErrorStatefulDefaultPropsProps with _$AnnotationErrorStatefulDefaultPropsPropsAccessorsMixin implements AnnotationErrorStatefulDefaultPropsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulDefaultPropsProps(Map backingMap) - : this._props = {} { - this._props = backingMap ?? {}; - } + _$$AnnotationErrorStatefulDefaultPropsProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -495,17 +474,12 @@ class _$$AnnotationErrorStatefulDefaultPropsState extends _$AnnotationErrorStatefulDefaultPropsState with _$AnnotationErrorStatefulDefaultPropsStateAccessorsMixin implements AnnotationErrorStatefulDefaultPropsState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$AnnotationErrorStatefulDefaultPropsState(Map backingMap) - : this._state = {} { - this._state = backingMap ?? {}; - } + _$$AnnotationErrorStatefulDefaultPropsState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/component_integration_test.over_react.g.dart index 47b42efe0..e8459c427 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/component_integration_test.over_react.g.dart @@ -180,25 +180,20 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? _$$ComponentTestProps$JsMap(JsBackedMap()) - : _$$ComponentTestProps(backingProps); + _$$ComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ComponentTestProps extends _$ComponentTestProps +class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ComponentTestProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$ComponentTestProps$PlainMap(backingMap); - } - } + _$$ComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -233,48 +228,15 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ComponentTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ComponentTestProps$JsMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ComponentTestComponent extends ComponentTestComponent { - _$$ComponentTestProps$JsMap _cachedTypedProps; + _$$ComponentTestProps _cachedTypedProps; @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + _$$ComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -291,8 +253,8 @@ class _$ComponentTestComponent extends ComponentTestComponent { } @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$ComponentTestProps$JsMap(backingMap); + _$$ComponentTestProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$ComponentTestProps(backingMap); @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => @@ -346,25 +308,20 @@ class IsErrorBoundaryProps extends _$IsErrorBoundaryProps } _$$IsErrorBoundaryProps _$IsErrorBoundary([Map backingProps]) => - backingProps == null - ? _$$IsErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$IsErrorBoundaryProps(backingProps); + _$$IsErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$IsErrorBoundaryProps extends _$IsErrorBoundaryProps +class _$$IsErrorBoundaryProps extends _$IsErrorBoundaryProps with _$IsErrorBoundaryPropsAccessorsMixin implements IsErrorBoundaryProps { - _$$IsErrorBoundaryProps._(); - - factory _$$IsErrorBoundaryProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$IsErrorBoundaryProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$IsErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$IsErrorBoundaryProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -395,48 +352,15 @@ abstract class _$$IsErrorBoundaryProps extends _$IsErrorBoundaryProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$IsErrorBoundaryProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$IsErrorBoundaryProps$PlainMap extends _$$IsErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsErrorBoundaryProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$IsErrorBoundaryProps$JsMap extends _$$IsErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsErrorBoundaryProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$IsErrorBoundaryComponent extends IsErrorBoundaryComponent { - _$$IsErrorBoundaryProps$JsMap _cachedTypedProps; + _$$IsErrorBoundaryProps _cachedTypedProps; @override - _$$IsErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$IsErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -453,8 +377,8 @@ class _$IsErrorBoundaryComponent extends IsErrorBoundaryComponent { } @override - _$$IsErrorBoundaryProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$IsErrorBoundaryProps$JsMap(backingMap); + _$$IsErrorBoundaryProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$IsErrorBoundaryProps(backingMap); @override _$$IsErrorBoundaryProps typedPropsFactory(Map backingMap) => @@ -508,25 +432,20 @@ class IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps } _$$IsNotErrorBoundaryProps _$IsNotErrorBoundary([Map backingProps]) => - backingProps == null - ? _$$IsNotErrorBoundaryProps$JsMap(JsBackedMap()) - : _$$IsNotErrorBoundaryProps(backingProps); + _$$IsNotErrorBoundaryProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps +class _$$IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps with _$IsNotErrorBoundaryPropsAccessorsMixin implements IsNotErrorBoundaryProps { - _$$IsNotErrorBoundaryProps._(); - - factory _$$IsNotErrorBoundaryProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$IsNotErrorBoundaryProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$IsNotErrorBoundaryProps$PlainMap(backingMap); - } - } + _$$IsNotErrorBoundaryProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -557,48 +476,15 @@ abstract class _$$IsNotErrorBoundaryProps extends _$IsNotErrorBoundaryProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$IsNotErrorBoundaryProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$IsNotErrorBoundaryProps$PlainMap extends _$$IsNotErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsNotErrorBoundaryProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$IsNotErrorBoundaryProps$JsMap extends _$$IsNotErrorBoundaryProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$IsNotErrorBoundaryProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$IsNotErrorBoundaryComponent extends IsNotErrorBoundaryComponent { - _$$IsNotErrorBoundaryProps$JsMap _cachedTypedProps; + _$$IsNotErrorBoundaryProps _cachedTypedProps; @override - _$$IsNotErrorBoundaryProps$JsMap get props => _cachedTypedProps; + _$$IsNotErrorBoundaryProps get props => _cachedTypedProps; @override set props(Map value) { @@ -615,9 +501,8 @@ class _$IsNotErrorBoundaryComponent extends IsNotErrorBoundaryComponent { } @override - _$$IsNotErrorBoundaryProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - _$$IsNotErrorBoundaryProps$JsMap(backingMap); + _$$IsNotErrorBoundaryProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$IsNotErrorBoundaryProps(backingMap); @override _$$IsNotErrorBoundaryProps typedPropsFactory(Map backingMap) => diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart index e66ea6db4..ddd037b8e 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart @@ -99,25 +99,20 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? _$$ComponentTestProps$JsMap(JsBackedMap()) - : _$$ComponentTestProps(backingProps); + _$$ComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ComponentTestProps extends _$ComponentTestProps +class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ComponentTestProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$ComponentTestProps$PlainMap(backingMap); - } - } + _$$ComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -148,48 +143,15 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ComponentTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ComponentTestProps$JsMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ComponentTestComponent extends ComponentTestComponent { - _$$ComponentTestProps$JsMap _cachedTypedProps; + _$$ComponentTestProps _cachedTypedProps; @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + _$$ComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -206,8 +168,8 @@ class _$ComponentTestComponent extends ComponentTestComponent { } @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$ComponentTestProps$JsMap(backingMap); + _$$ComponentTestProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$ComponentTestProps(backingMap); @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart index 408760823..6fe2feab0 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart @@ -102,26 +102,20 @@ class DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( [Map backingProps]) => - backingProps == null - ? _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap()) - : _$$DoNotGenerateAccessorTestProps(backingProps); + _$$DoNotGenerateAccessorTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$DoNotGenerateAccessorTestProps - extends _$DoNotGenerateAccessorTestProps +class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps with _$DoNotGenerateAccessorTestPropsAccessorsMixin implements DoNotGenerateAccessorTestProps { - _$$DoNotGenerateAccessorTestProps._(); - - factory _$$DoNotGenerateAccessorTestProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DoNotGenerateAccessorTestProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); - } - } + _$$DoNotGenerateAccessorTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -151,42 +145,6 @@ abstract class _$$DoNotGenerateAccessorTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DoNotGenerateAccessorTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$DoNotGenerateAccessorTestProps$PlainMap - extends _$$DoNotGenerateAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$DoNotGenerateAccessorTestProps$JsMap - extends _$$DoNotGenerateAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$DoNotGenerateAccessorTestStateAccessorsMixin implements _$DoNotGenerateAccessorTestState { @override @@ -271,58 +229,19 @@ class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$DoNotGenerateAccessorTestState - extends _$DoNotGenerateAccessorTestState +class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { - _$$DoNotGenerateAccessorTestState._(); - - factory _$$DoNotGenerateAccessorTestState(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DoNotGenerateAccessorTestState$JsMap(backingMap as JsBackedMap); - } else { - return _$$DoNotGenerateAccessorTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$DoNotGenerateAccessorTestState$PlainMap - extends _$$DoNotGenerateAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestState$PlainMap(Map backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$DoNotGenerateAccessorTestState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$DoNotGenerateAccessorTestState$JsMap - extends _$$DoNotGenerateAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestState$JsMap(JsBackedMap backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -331,10 +250,10 @@ class _$$DoNotGenerateAccessorTestState$JsMap // generated for the associated props class. class _$DoNotGenerateAccessorTestComponent extends DoNotGenerateAccessorTestComponent { - _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; + _$$DoNotGenerateAccessorTestProps _cachedTypedProps; @override - _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; + _$$DoNotGenerateAccessorTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -351,17 +270,17 @@ class _$DoNotGenerateAccessorTestComponent } @override - _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( + _$$DoNotGenerateAccessorTestProps typedPropsFactoryJs( JsBackedMap backingMap) => - _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); + _$$DoNotGenerateAccessorTestProps(backingMap); @override _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => _$$DoNotGenerateAccessorTestProps(backingMap); - _$$DoNotGenerateAccessorTestState$JsMap _cachedTypedState; + _$$DoNotGenerateAccessorTestState _cachedTypedState; @override - _$$DoNotGenerateAccessorTestState$JsMap get state => _cachedTypedState; + _$$DoNotGenerateAccessorTestState get state => _cachedTypedState; @override set state(Map value) { @@ -374,9 +293,9 @@ class _$DoNotGenerateAccessorTestComponent } @override - _$$DoNotGenerateAccessorTestState$JsMap typedStateFactoryJs( + _$$DoNotGenerateAccessorTestState typedStateFactoryJs( JsBackedMap backingMap) => - _$$DoNotGenerateAccessorTestState$JsMap(backingMap); + _$$DoNotGenerateAccessorTestState(backingMap); @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart index 549fc2786..5b93f778b 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart @@ -159,26 +159,20 @@ class NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps } _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => - backingProps == null - ? _$$NamespacedAccessorTestProps$JsMap(JsBackedMap()) - : _$$NamespacedAccessorTestProps(backingProps); + _$$NamespacedAccessorTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$NamespacedAccessorTestProps - extends _$NamespacedAccessorTestProps +class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps with _$NamespacedAccessorTestPropsAccessorsMixin implements NamespacedAccessorTestProps { - _$$NamespacedAccessorTestProps._(); - - factory _$$NamespacedAccessorTestProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$NamespacedAccessorTestProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$NamespacedAccessorTestProps$PlainMap(backingMap); - } - } + _$$NamespacedAccessorTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -208,42 +202,6 @@ abstract class _$$NamespacedAccessorTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$NamespacedAccessorTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$NamespacedAccessorTestProps$PlainMap - extends _$$NamespacedAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$NamespacedAccessorTestProps$JsMap - extends _$$NamespacedAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$NamespacedAccessorTestStateAccessorsMixin implements _$NamespacedAccessorTestState { @override @@ -387,58 +345,19 @@ class NamespacedAccessorTestState extends _$NamespacedAccessorTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$NamespacedAccessorTestState - extends _$NamespacedAccessorTestState +class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { - _$$NamespacedAccessorTestState._(); - - factory _$$NamespacedAccessorTestState(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$NamespacedAccessorTestState$JsMap(backingMap as JsBackedMap); - } else { - return _$$NamespacedAccessorTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$NamespacedAccessorTestState$PlainMap - extends _$$NamespacedAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestState$PlainMap(Map backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$NamespacedAccessorTestState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$NamespacedAccessorTestState$JsMap - extends _$$NamespacedAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestState$JsMap(JsBackedMap backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -447,10 +366,10 @@ class _$$NamespacedAccessorTestState$JsMap // generated for the associated props class. class _$NamespacedAccessorTestComponent extends NamespacedAccessorTestComponent { - _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; + _$$NamespacedAccessorTestProps _cachedTypedProps; @override - _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; + _$$NamespacedAccessorTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -467,17 +386,16 @@ class _$NamespacedAccessorTestComponent } @override - _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - _$$NamespacedAccessorTestProps$JsMap(backingMap); + _$$NamespacedAccessorTestProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$NamespacedAccessorTestProps(backingMap); @override _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => _$$NamespacedAccessorTestProps(backingMap); - _$$NamespacedAccessorTestState$JsMap _cachedTypedState; + _$$NamespacedAccessorTestState _cachedTypedState; @override - _$$NamespacedAccessorTestState$JsMap get state => _cachedTypedState; + _$$NamespacedAccessorTestState get state => _cachedTypedState; @override set state(Map value) { @@ -490,9 +408,8 @@ class _$NamespacedAccessorTestComponent } @override - _$$NamespacedAccessorTestState$JsMap typedStateFactoryJs( - JsBackedMap backingMap) => - _$$NamespacedAccessorTestState$JsMap(backingMap); + _$$NamespacedAccessorTestState typedStateFactoryJs(JsBackedMap backingMap) => + _$$NamespacedAccessorTestState(backingMap); @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart index f1b07f847..efb5e2b42 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart @@ -50,25 +50,19 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map backingProps]) => backingProps == null - ? _$$FooProps$JsMap(JsBackedMap()) - : _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => _$$FooProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FooProps extends _$FooProps +class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - - factory _$$FooProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FooProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$FooProps$PlainMap(backingMap); - } - } + _$$FooProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -101,48 +95,15 @@ abstract class _$$FooProps extends _$FooProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FooProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FooProps$PlainMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FooProps$JsMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FooComponent extends FooComponent { - _$$FooProps$JsMap _cachedTypedProps; + _$$FooProps _cachedTypedProps; @override - _$$FooProps$JsMap get props => _cachedTypedProps; + _$$FooProps get props => _cachedTypedProps; @override set props(Map value) { @@ -159,8 +120,8 @@ class _$FooComponent extends FooComponent { } @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$FooProps$JsMap(backingMap); + _$$FooProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$FooProps(backingMap); @override _$$FooProps typedPropsFactory(Map backingMap) => _$$FooProps(backingMap); diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart index 592153477..07ea39570 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart @@ -120,25 +120,20 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? _$$ComponentTestProps$JsMap(JsBackedMap()) - : _$$ComponentTestProps(backingProps); + _$$ComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ComponentTestProps extends _$ComponentTestProps +class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ComponentTestProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$ComponentTestProps$PlainMap(backingMap); - } - } + _$$ComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -169,48 +164,15 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ComponentTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ComponentTestProps$JsMap extends _$$ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ComponentTestComponent extends ComponentTestComponent { - _$$ComponentTestProps$JsMap _cachedTypedProps; + _$$ComponentTestProps _cachedTypedProps; @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + _$$ComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -227,8 +189,8 @@ class _$ComponentTestComponent extends ComponentTestComponent { } @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$ComponentTestProps$JsMap(backingMap); + _$$ComponentTestProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$ComponentTestProps(backingMap); @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.dart index 42921cedc..0ffc6555b 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.dart @@ -27,8 +27,8 @@ main() { test('state class cannot be instantiated directly', () { expect(() { StatefulComponentTestState(); - }, throwsA(isA())); - }); + }, throwsA(isA())); + }, tags: 'ddc'); test('renders a component from end to end, successfully reading state via typed getters', () { var renderedInstance = render(StatefulComponentTest()()); diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart index 534a62315..5c58eb9e0 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart @@ -64,26 +64,20 @@ class StatefulComponentTestProps extends _$StatefulComponentTestProps } _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => - backingProps == null - ? _$$StatefulComponentTestProps$JsMap(JsBackedMap()) - : _$$StatefulComponentTestProps(backingProps); + _$$StatefulComponentTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$StatefulComponentTestProps - extends _$StatefulComponentTestProps +class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps with _$StatefulComponentTestPropsAccessorsMixin implements StatefulComponentTestProps { - _$$StatefulComponentTestProps._(); - - factory _$$StatefulComponentTestProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$StatefulComponentTestProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$StatefulComponentTestProps$PlainMap(backingMap); - } - } + _$$StatefulComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -117,42 +111,6 @@ abstract class _$$StatefulComponentTestProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$StatefulComponentTestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$StatefulComponentTestProps$PlainMap - extends _$$StatefulComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$StatefulComponentTestProps$JsMap - extends _$$StatefulComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$StatefulComponentTestStateAccessorsMixin implements _$StatefulComponentTestState { @override @@ -296,58 +254,19 @@ class StatefulComponentTestState extends _$StatefulComponentTestState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$StatefulComponentTestState - extends _$StatefulComponentTestState +class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { - _$$StatefulComponentTestState._(); - - factory _$$StatefulComponentTestState(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$StatefulComponentTestState$JsMap(backingMap as JsBackedMap); - } else { - return _$$StatefulComponentTestState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$StatefulComponentTestState$PlainMap - extends _$$StatefulComponentTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestState$PlainMap(Map backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$StatefulComponentTestState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$StatefulComponentTestState$JsMap - extends _$$StatefulComponentTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestState$JsMap(JsBackedMap backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -355,10 +274,10 @@ class _$$StatefulComponentTestState$JsMap // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { - _$$StatefulComponentTestProps$JsMap _cachedTypedProps; + _$$StatefulComponentTestProps _cachedTypedProps; @override - _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; + _$$StatefulComponentTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -375,17 +294,16 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { } @override - _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - _$$StatefulComponentTestProps$JsMap(backingMap); + _$$StatefulComponentTestProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$StatefulComponentTestProps(backingMap); @override _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => _$$StatefulComponentTestProps(backingMap); - _$$StatefulComponentTestState$JsMap _cachedTypedState; + _$$StatefulComponentTestState _cachedTypedState; @override - _$$StatefulComponentTestState$JsMap get state => _cachedTypedState; + _$$StatefulComponentTestState get state => _cachedTypedState; @override set state(Map value) { @@ -398,9 +316,8 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { } @override - _$$StatefulComponentTestState$JsMap typedStateFactoryJs( - JsBackedMap backingMap) => - _$$StatefulComponentTestState$JsMap(backingMap); + _$$StatefulComponentTestState typedStateFactoryJs(JsBackedMap backingMap) => + _$$StatefulComponentTestState(backingMap); @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart index cb10db046..b81c1e138 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart @@ -69,25 +69,19 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map backingProps]) => backingProps == null - ? _$$FooProps$JsMap(JsBackedMap()) - : _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => _$$FooProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FooProps extends _$FooProps +class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - - factory _$$FooProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FooProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$FooProps$PlainMap(backingMap); - } - } + _$$FooProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -120,48 +114,15 @@ abstract class _$$FooProps extends _$FooProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FooProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FooProps$PlainMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FooProps$JsMap extends _$$FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FooComponent extends FooComponent { - _$$FooProps$JsMap _cachedTypedProps; + _$$FooProps _cachedTypedProps; @override - _$$FooProps$JsMap get props => _cachedTypedProps; + _$$FooProps get props => _cachedTypedProps; @override set props(Map value) { @@ -178,8 +139,8 @@ class _$FooComponent extends FooComponent { } @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$FooProps$JsMap(backingMap); + _$$FooProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$FooProps(backingMap); @override _$$FooProps typedPropsFactory(Map backingMap) => _$$FooProps(backingMap); diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component_integration_test.over_react.g.dart index c54c81425..19849cc96 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/component_integration_test.over_react.g.dart @@ -154,16 +154,12 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart index d6801df9e..f1df427a1 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/constant_required_accessor_integration_test.over_react.g.dart @@ -86,16 +86,12 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart index f43a7f8f8..19c391140 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/do_not_generate_accessor_integration_test.over_react.g.dart @@ -110,16 +110,12 @@ _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps with _$DoNotGenerateAccessorTestPropsAccessorsMixin implements DoNotGenerateAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$DoNotGenerateAccessorTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -236,16 +232,12 @@ class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoNotGenerateAccessorTestState(Map backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$DoNotGenerateAccessorTestState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart index e350260fd..ecdfd3726 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/namespaced_accessor_integration_test.over_react.g.dart @@ -167,16 +167,12 @@ _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps with _$NamespacedAccessorTestPropsAccessorsMixin implements NamespacedAccessorTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$NamespacedAccessorTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -352,16 +348,12 @@ class NamespacedAccessorTestState extends _$NamespacedAccessorTestState class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NamespacedAccessorTestState(Map backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$NamespacedAccessorTestState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/private_props_ddc_bug.over_react.g.dart index e1ee25e58..a81d699d7 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/private_props_ddc_bug.over_react.g.dart @@ -58,16 +58,11 @@ _$$FooProps _$Foo([Map backingProps]) => _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$FooProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/required_accessor_integration_test.over_react.g.dart index 49ac0d994..a7e32430d 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/required_accessor_integration_test.over_react.g.dart @@ -100,16 +100,12 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.dart index faab8f2ea..d125976bd 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.dart @@ -28,8 +28,8 @@ main() { test('state class cannot be instantiated directly', () { expect(() { StatefulComponentTestState(); - }, throwsA(isA())); - }); + }, throwsA(isA())); + }, tags: 'ddc'); test('renders a component from end to end, successfully reading state via typed getters', () { var renderedInstance = render(StatefulComponentTest()()); diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.over_react.g.dart index 67aebe8a1..186244cbe 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/stateful_component_integration_test.over_react.g.dart @@ -49,16 +49,12 @@ _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps with _$StatefulComponentTestPropsAccessorsMixin implements StatefulComponentTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$StatefulComponentTestProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -234,16 +230,12 @@ class StatefulComponentTestState extends _$StatefulComponentTestState class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$StatefulComponentTestState(Map backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$StatefulComponentTestState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart index 4ba7da897..f61fd5aa9 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/unassigned_prop_integration_test.over_react.g.dart @@ -77,16 +77,11 @@ _$$FooProps _$Foo([Map backingProps]) => _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FooProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$FooProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/component_declaration/ui_props_self_typed_extension_test.over_react.g.dart b/test/over_react/component_declaration/ui_props_self_typed_extension_test.over_react.g.dart index 33865f5fd..009ab2633 100644 --- a/test/over_react/component_declaration/ui_props_self_typed_extension_test.over_react.g.dart +++ b/test/over_react/component_declaration/ui_props_self_typed_extension_test.over_react.g.dart @@ -83,29 +83,23 @@ const PropsMeta _$metaForTestProps = PropsMeta( keys: $TestProps.$propKeys, ); -_$$TestProps _$Test([Map? backingProps]) => backingProps == null - ? _$$TestProps$JsMap(JsBackedMap()) - : _$$TestProps(backingProps); +_$$TestProps _$Test([Map? backingProps]) => _$$TestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestProps extends UiProps +class _$$TestProps extends UiProps with TestProps, // If this generated mixin is undefined, it's likely because TestProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestProps, and check that $TestProps is exported/imported properly. $TestProps { - _$$TestProps._(); + _$$TestProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); - factory _$$TestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -129,40 +123,3 @@ abstract class _$$TestProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestProps$PlainMap extends _$$TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestProps$JsMap extends _$$TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/dom/fixtures/dummy_composite_component.over_react.g.dart b/test/over_react/dom/fixtures/dummy_composite_component.over_react.g.dart index b612f00eb..5d82871b9 100644 --- a/test/over_react/dom/fixtures/dummy_composite_component.over_react.g.dart +++ b/test/over_react/dom/fixtures/dummy_composite_component.over_react.g.dart @@ -109,16 +109,12 @@ _$$TestCompositeComponentProps _$TestCompositeComponent([Map? backingProps]) => class _$$TestCompositeComponentProps extends _$TestCompositeComponentProps with _$TestCompositeComponentPropsAccessorsMixin implements TestCompositeComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestCompositeComponentProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestCompositeComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/util/cast_ui_factory_test.over_react.g.dart b/test/over_react/util/cast_ui_factory_test.over_react.g.dart index 2554192d0..d388b298f 100644 --- a/test/over_react/util/cast_ui_factory_test.over_react.g.dart +++ b/test/over_react/util/cast_ui_factory_test.over_react.g.dart @@ -20,29 +20,23 @@ final $BasicComponentFactory = registerComponent2( parentType: null, ); -_$$BasicProps _$Basic([Map? backingProps]) => backingProps == null - ? _$$BasicProps$JsMap(JsBackedMap()) - : _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map? backingProps]) => _$$BasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicProps extends UiProps +class _$$BasicProps extends UiProps with BasicProps, // If this generated mixin is undefined, it's likely because BasicProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicProps, and check that $BasicProps is exported/imported properly. $BasicProps { - _$$BasicProps._(); - - factory _$$BasicProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicProps$PlainMap(backingMap); - } - } + _$$BasicProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -72,43 +66,6 @@ abstract class _$$BasicProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$PlainMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$JsMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -116,10 +73,10 @@ class _$$BasicProps$JsMap extends _$$BasicProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$BasicComponent extends BasicComponent { - late _$$BasicProps$JsMap _cachedTypedProps; + late _$$BasicProps _cachedTypedProps; @override - _$$BasicProps$JsMap get props => _cachedTypedProps; + _$$BasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -136,8 +93,8 @@ class _$BasicComponent extends BasicComponent { } @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$BasicProps$JsMap(backingMap); + _$$BasicProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$BasicProps(backingMap); @override _$$BasicProps typedPropsFactory(Map? backingMap) => _$$BasicProps(backingMap); diff --git a/test/over_react/util/component_debug_name_test.over_react.g.dart b/test/over_react/util/component_debug_name_test.over_react.g.dart index 8eb1be42a..0ef007be6 100644 --- a/test/over_react/util/component_debug_name_test.over_react.g.dart +++ b/test/over_react/util/component_debug_name_test.over_react.g.dart @@ -21,29 +21,24 @@ final $TestComponent2ComponentFactory = registerComponent2( ); _$$TestComponent2Props _$TestComponent2([Map? backingProps]) => - backingProps == null - ? _$$TestComponent2Props$JsMap(JsBackedMap()) - : _$$TestComponent2Props(backingProps); + _$$TestComponent2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestComponent2Props extends UiProps +class _$$TestComponent2Props extends UiProps with TestComponent2Props, // If this generated mixin is undefined, it's likely because TestComponent2Props is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestComponent2Props, and check that $TestComponent2Props is exported/imported properly. $TestComponent2Props { - _$$TestComponent2Props._(); - - factory _$$TestComponent2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestComponent2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestComponent2Props$PlainMap(backingMap); - } - } + _$$TestComponent2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -74,43 +69,6 @@ abstract class _$$TestComponent2Props extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestComponent2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestComponent2Props$PlainMap extends _$$TestComponent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestComponent2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestComponent2Props$JsMap extends _$$TestComponent2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestComponent2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -118,10 +76,10 @@ class _$$TestComponent2Props$JsMap extends _$$TestComponent2Props { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$TestComponent2Component extends TestComponent2Component { - late _$$TestComponent2Props$JsMap _cachedTypedProps; + late _$$TestComponent2Props _cachedTypedProps; @override - _$$TestComponent2Props$JsMap get props => _cachedTypedProps; + _$$TestComponent2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -138,8 +96,8 @@ class _$TestComponent2Component extends TestComponent2Component { } @override - _$$TestComponent2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestComponent2Props$JsMap(backingMap); + _$$TestComponent2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestComponent2Props(backingMap); @override _$$TestComponent2Props typedPropsFactory(Map? backingMap) => @@ -199,16 +157,12 @@ _$$TestComponentProps _$TestComponent([Map? backingProps]) => class _$$TestComponentProps extends _$TestComponentProps with _$TestComponentPropsAccessorsMixin implements TestComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestComponentProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react/util/dom_util_test.over_react.g.dart b/test/over_react/util/dom_util_test.over_react.g.dart index 3ab08bce3..e5e206232 100644 --- a/test/over_react/util/dom_util_test.over_react.g.dart +++ b/test/over_react/util/dom_util_test.over_react.g.dart @@ -37,25 +37,19 @@ class DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin { static const PropsMeta meta = _$metaForDomTestProps; } -_$$DomTestProps _$DomTest([Map? backingProps]) => backingProps == null - ? _$$DomTestProps$JsMap(JsBackedMap()) - : _$$DomTestProps(backingProps); +_$$DomTestProps _$DomTest([Map? backingProps]) => _$$DomTestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$DomTestProps extends _$DomTestProps +class _$$DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin implements DomTestProps { - _$$DomTestProps._(); - - factory _$$DomTestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DomTestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$DomTestProps$PlainMap(backingMap); - } - } + _$$DomTestProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -79,48 +73,15 @@ abstract class _$$DomTestProps extends _$DomTestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DomTestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$DomTestProps$PlainMap extends _$$DomTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DomTestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$DomTestProps$JsMap extends _$$DomTestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DomTestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$DomTestComponent extends DomTestComponent { - late _$$DomTestProps$JsMap _cachedTypedProps; + late _$$DomTestProps _cachedTypedProps; @override - _$$DomTestProps$JsMap get props => _cachedTypedProps; + _$$DomTestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -137,8 +98,8 @@ class _$DomTestComponent extends DomTestComponent { } @override - _$$DomTestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$DomTestProps$JsMap(backingMap); + _$$DomTestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$DomTestProps(backingMap); @override _$$DomTestProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react/util/js_component_test.over_react.g.dart b/test/over_react/util/js_component_test.over_react.g.dart index c41d800cf..aab32505d 100644 --- a/test/over_react/util/js_component_test.over_react.g.dart +++ b/test/over_react/util/js_component_test.over_react.g.dart @@ -137,7 +137,7 @@ const PropsMeta _$metaForASecondPropsMixin = PropsMeta( final UiFactoryConfig<_$$TestProps> _$TestConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestProps(map), - jsMap: (map) => _$$TestProps$JsMap(map), + jsMap: (map) => _$$TestProps(map), ), displayName: 'Test'); @@ -149,7 +149,7 @@ final UiFactoryConfig<_$$TestProps> $TestConfig = _$TestConfig; final UiFactoryConfig<_$$TestProps> _$NoLHSTestConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestProps(map), - jsMap: (map) => _$$TestProps$JsMap(map), + jsMap: (map) => _$$TestProps(map), ), displayName: 'NoLHSTest'); @@ -161,7 +161,7 @@ final UiFactoryConfig<_$$TestProps> $NoLHSTestConfig = _$NoLHSTestConfig; final UiFactoryConfig<_$$TestProps> _$_TestConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestProps(map), - jsMap: (map) => _$$TestProps$JsMap(map), + jsMap: (map) => _$$TestProps(map), ), displayName: '_Test'); @@ -175,7 +175,7 @@ final UiFactoryConfig<_$$TestProps> $_TestConfig = _$_TestConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestProps extends UiProps +class _$$TestProps extends UiProps with TestPropsMixin, // If this generated mixin is undefined, it's likely because TestPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestPropsMixin, and check that $TestPropsMixin is exported/imported properly. @@ -185,15 +185,11 @@ abstract class _$$TestProps extends UiProps $ASecondPropsMixin implements TestProps { - _$$TestProps._(); + _$$TestProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); - factory _$$TestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -219,40 +215,3 @@ abstract class _$$TestProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestProps$PlainMap extends _$$TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestProps$JsMap extends _$$TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/util/prop_conversion_test.over_react.g.dart b/test/over_react/util/prop_conversion_test.over_react.g.dart index cfed61250..84875784f 100644 --- a/test/over_react/util/prop_conversion_test.over_react.g.dart +++ b/test/over_react/util/prop_conversion_test.over_react.g.dart @@ -21,29 +21,24 @@ final $ClassComponentComponentFactory = registerComponent2( ); _$$ClassComponentProps _$ClassComponent([Map? backingProps]) => - backingProps == null - ? _$$ClassComponentProps$JsMap(JsBackedMap()) - : _$$ClassComponentProps(backingProps); + _$$ClassComponentProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ClassComponentProps extends UiProps +class _$$ClassComponentProps extends UiProps with ClassComponentProps, // If this generated mixin is undefined, it's likely because ClassComponentProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ClassComponentProps, and check that $ClassComponentProps is exported/imported properly. $ClassComponentProps { - _$$ClassComponentProps._(); - - factory _$$ClassComponentProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ClassComponentProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ClassComponentProps$PlainMap(backingMap); - } - } + _$$ClassComponentProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -74,43 +69,6 @@ abstract class _$$ClassComponentProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ClassComponentProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ClassComponentProps$PlainMap extends _$$ClassComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ClassComponentProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ClassComponentProps$JsMap extends _$$ClassComponentProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ClassComponentProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -118,10 +76,10 @@ class _$$ClassComponentProps$JsMap extends _$$ClassComponentProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$ClassComponentComponent extends ClassComponentComponent { - late _$$ClassComponentProps$JsMap _cachedTypedProps; + late _$$ClassComponentProps _cachedTypedProps; @override - _$$ClassComponentProps$JsMap get props => _cachedTypedProps; + _$$ClassComponentProps get props => _cachedTypedProps; @override set props(Map value) { @@ -138,8 +96,8 @@ class _$ClassComponentComponent extends ClassComponentComponent { } @override - _$$ClassComponentProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$ClassComponentProps$JsMap(backingMap); + _$$ClassComponentProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ClassComponentProps(backingMap); @override _$$ClassComponentProps typedPropsFactory(Map? backingMap) => @@ -462,7 +420,7 @@ final UiFactoryConfig<_$$ExpectsDartMapPropProps> _$ExpectsDartMapPropConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ExpectsDartMapPropProps(map), - jsMap: (map) => _$$ExpectsDartMapPropProps$JsMap(map), + jsMap: (map) => _$$ExpectsDartMapPropProps(map), ), displayName: 'ExpectsDartMapProp'); @@ -477,20 +435,17 @@ final UiFactoryConfig<_$$ExpectsDartMapPropProps> $ExpectsDartMapPropConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ExpectsDartMapPropProps extends UiProps +class _$$ExpectsDartMapPropProps extends UiProps with ExpectsDartMapPropProps, // If this generated mixin is undefined, it's likely because ExpectsDartMapPropProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ExpectsDartMapPropProps, and check that $ExpectsDartMapPropProps is exported/imported properly. $ExpectsDartMapPropProps { - _$$ExpectsDartMapPropProps._(); - - factory _$$ExpectsDartMapPropProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ExpectsDartMapPropProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ExpectsDartMapPropProps$PlainMap(backingMap); - } - } + _$$ExpectsDartMapPropProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -515,49 +470,11 @@ abstract class _$$ExpectsDartMapPropProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ExpectsDartMapPropProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ExpectsDartMapPropProps$PlainMap extends _$$ExpectsDartMapPropProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ExpectsDartMapPropProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ExpectsDartMapPropProps$JsMap extends _$$ExpectsDartMapPropProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ExpectsDartMapPropProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$ExpectsDartStylePropProps> _$ExpectsDartStylePropConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ExpectsDartStylePropProps(map), - jsMap: (map) => _$$ExpectsDartStylePropProps$JsMap(map), + jsMap: (map) => _$$ExpectsDartStylePropProps(map), ), displayName: 'ExpectsDartStyleProp'); @@ -572,20 +489,17 @@ final UiFactoryConfig<_$$ExpectsDartStylePropProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ExpectsDartStylePropProps extends UiProps +class _$$ExpectsDartStylePropProps extends UiProps with ExpectsDartStylePropProps, // If this generated mixin is undefined, it's likely because ExpectsDartStylePropProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ExpectsDartStylePropProps, and check that $ExpectsDartStylePropProps is exported/imported properly. $ExpectsDartStylePropProps { - _$$ExpectsDartStylePropProps._(); - - factory _$$ExpectsDartStylePropProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ExpectsDartStylePropProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ExpectsDartStylePropProps$PlainMap(backingMap); - } - } + _$$ExpectsDartStylePropProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -610,50 +524,11 @@ abstract class _$$ExpectsDartStylePropProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ExpectsDartStylePropProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ExpectsDartStylePropProps$PlainMap - extends _$$ExpectsDartStylePropProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ExpectsDartStylePropProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ExpectsDartStylePropProps$JsMap extends _$$ExpectsDartStylePropProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ExpectsDartStylePropProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$ExpectsListChildrenPropProps> _$ExpectsListChildrenPropConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ExpectsListChildrenPropProps(map), - jsMap: (map) => _$$ExpectsListChildrenPropProps$JsMap(map), + jsMap: (map) => _$$ExpectsListChildrenPropProps(map), ), displayName: 'ExpectsListChildrenProp'); @@ -669,20 +544,17 @@ final UiFactoryConfig<_$$ExpectsListChildrenPropProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ExpectsListChildrenPropProps extends UiProps +class _$$ExpectsListChildrenPropProps extends UiProps with ExpectsListChildrenPropProps, // If this generated mixin is undefined, it's likely because ExpectsListChildrenPropProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ExpectsListChildrenPropProps, and check that $ExpectsListChildrenPropProps is exported/imported properly. $ExpectsListChildrenPropProps { - _$$ExpectsListChildrenPropProps._(); - - factory _$$ExpectsListChildrenPropProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ExpectsListChildrenPropProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ExpectsListChildrenPropProps$PlainMap(backingMap); - } - } + _$$ExpectsListChildrenPropProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -707,51 +579,11 @@ abstract class _$$ExpectsListChildrenPropProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ExpectsListChildrenPropProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ExpectsListChildrenPropProps$PlainMap - extends _$$ExpectsListChildrenPropProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ExpectsListChildrenPropProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ExpectsListChildrenPropProps$JsMap - extends _$$ExpectsListChildrenPropProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ExpectsListChildrenPropProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$BasicForwardRefProps> _$BasicForwardRefConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$BasicForwardRefProps(map), - jsMap: (map) => _$$BasicForwardRefProps$JsMap(map), + jsMap: (map) => _$$BasicForwardRefProps(map), ), displayName: 'BasicForwardRef'); @@ -766,20 +598,17 @@ final UiFactoryConfig<_$$BasicForwardRefProps> $BasicForwardRefConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicForwardRefProps extends UiProps +class _$$BasicForwardRefProps extends UiProps with BasicForwardRefProps, // If this generated mixin is undefined, it's likely because BasicForwardRefProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicForwardRefProps, and check that $BasicForwardRefProps is exported/imported properly. $BasicForwardRefProps { - _$$BasicForwardRefProps._(); - - factory _$$BasicForwardRefProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicForwardRefProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$BasicForwardRefProps$PlainMap(backingMap); - } - } + _$$BasicForwardRefProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -804,49 +633,11 @@ abstract class _$$BasicForwardRefProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicForwardRefProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicForwardRefProps$PlainMap extends _$$BasicForwardRefProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicForwardRefProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicForwardRefProps$JsMap extends _$$BasicForwardRefProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicForwardRefProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$DartTestJsWrapperProps> _$DartTestJsWrapperConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$DartTestJsWrapperProps(map), - jsMap: (map) => _$$DartTestJsWrapperProps$JsMap(map), + jsMap: (map) => _$$DartTestJsWrapperProps(map), ), displayName: 'DartTestJsWrapper'); @@ -861,7 +652,7 @@ final UiFactoryConfig<_$$DartTestJsWrapperProps> $DartTestJsWrapperConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$DartTestJsWrapperProps extends UiProps +class _$$DartTestJsWrapperProps extends UiProps with TestJsProps, // If this generated mixin is undefined, it's likely because TestJsProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestJsProps, and check that $TestJsProps is exported/imported properly. @@ -871,15 +662,12 @@ abstract class _$$DartTestJsWrapperProps extends UiProps $DartTestJsWrapperPropsMixin implements DartTestJsWrapperProps { - _$$DartTestJsWrapperProps._(); - - factory _$$DartTestJsWrapperProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DartTestJsWrapperProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$DartTestJsWrapperProps$PlainMap(backingMap); - } - } + _$$DartTestJsWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -906,48 +694,10 @@ abstract class _$$DartTestJsWrapperProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DartTestJsWrapperProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DartTestJsWrapperProps$PlainMap extends _$$DartTestJsWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DartTestJsWrapperProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DartTestJsWrapperProps$JsMap extends _$$DartTestJsWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DartTestJsWrapperProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestJsProps> _$TestJsConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestJsProps(map), - jsMap: (map) => _$$TestJsProps$JsMap(map), + jsMap: (map) => _$$TestJsProps(map), ), displayName: 'TestJs'); @@ -961,20 +711,16 @@ final UiFactoryConfig<_$$TestJsProps> $TestJsConfig = _$TestJsConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestJsProps extends UiProps +class _$$TestJsProps extends UiProps with TestJsProps, // If this generated mixin is undefined, it's likely because TestJsProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestJsProps, and check that $TestJsProps is exported/imported properly. $TestJsProps { - _$$TestJsProps._(); - - factory _$$TestJsProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestJsProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestJsProps$PlainMap(backingMap); - } - } + _$$TestJsProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -998,40 +744,3 @@ abstract class _$$TestJsProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestJsProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestJsProps$PlainMap extends _$$TestJsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestJsProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestJsProps$JsMap extends _$$TestJsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestJsProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react/util/prop_key_util_test_dart2.over_react.g.dart b/test/over_react/util/prop_key_util_test_dart2.over_react.g.dart index 0e80b0f5a..71685dad8 100644 --- a/test/over_react/util/prop_key_util_test_dart2.over_react.g.dart +++ b/test/over_react/util/prop_key_util_test_dart2.over_react.g.dart @@ -64,25 +64,19 @@ class TestProps extends _$TestProps with _$TestPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestProps; } -_$$TestProps _$Test([Map? backingProps]) => backingProps == null - ? _$$TestProps$JsMap(JsBackedMap()) - : _$$TestProps(backingProps); +_$$TestProps _$Test([Map? backingProps]) => _$$TestProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TestProps extends _$TestProps +class _$$TestProps extends _$TestProps with _$TestPropsAccessorsMixin implements TestProps { - _$$TestProps._(); - - factory _$$TestProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestProps$PlainMap(backingMap); - } - } + _$$TestProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -106,48 +100,15 @@ abstract class _$$TestProps extends _$TestProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TestProps$PlainMap extends _$$TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TestProps$JsMap extends _$$TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TestComponent extends TestComponent { - late _$$TestProps$JsMap _cachedTypedProps; + late _$$TestProps _cachedTypedProps; @override - _$$TestProps$JsMap get props => _cachedTypedProps; + _$$TestProps get props => _cachedTypedProps; @override set props(Map value) { @@ -164,8 +125,8 @@ class _$TestComponent extends TestComponent { } @override - _$$TestProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TestProps$JsMap(backingMap); + _$$TestProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TestProps(backingMap); @override _$$TestProps typedPropsFactory(Map? backingMap) => _$$TestProps(backingMap); diff --git a/test/over_react/util/safe_render_manager/test_component.over_react.g.dart b/test/over_react/util/safe_render_manager/test_component.over_react.g.dart index 0bedcb31c..d4bfd3806 100644 --- a/test/over_react/util/safe_render_manager/test_component.over_react.g.dart +++ b/test/over_react/util/safe_render_manager/test_component.over_react.g.dart @@ -146,16 +146,11 @@ _$$TestProps _$Test([Map? backingProps]) => _$$TestProps(backingProps); class _$$TestProps extends _$TestProps with _$TestPropsAccessorsMixin implements TestProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TestProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react_redux/fixtures/connect_flux_counter.over_react.g.dart b/test/over_react_redux/fixtures/connect_flux_counter.over_react.g.dart index 4f4e6391d..f54c10294 100644 --- a/test/over_react_redux/fixtures/connect_flux_counter.over_react.g.dart +++ b/test/over_react_redux/fixtures/connect_flux_counter.over_react.g.dart @@ -160,25 +160,20 @@ class ConnectFluxCounterProps extends _$ConnectFluxCounterProps } _$$ConnectFluxCounterProps _$ConnectFluxCounter([Map? backingProps]) => - backingProps == null - ? _$$ConnectFluxCounterProps$JsMap(JsBackedMap()) - : _$$ConnectFluxCounterProps(backingProps); + _$$ConnectFluxCounterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ConnectFluxCounterProps extends _$ConnectFluxCounterProps +class _$$ConnectFluxCounterProps extends _$ConnectFluxCounterProps with _$ConnectFluxCounterPropsAccessorsMixin implements ConnectFluxCounterProps { - _$$ConnectFluxCounterProps._(); - - factory _$$ConnectFluxCounterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ConnectFluxCounterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ConnectFluxCounterProps$PlainMap(backingMap); - } - } + _$$ConnectFluxCounterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -203,48 +198,15 @@ abstract class _$$ConnectFluxCounterProps extends _$ConnectFluxCounterProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ConnectFluxCounterProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$ConnectFluxCounterProps$PlainMap extends _$$ConnectFluxCounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConnectFluxCounterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$ConnectFluxCounterProps$JsMap extends _$$ConnectFluxCounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConnectFluxCounterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ConnectFluxCounterComponent extends ConnectFluxCounterComponent { - late _$$ConnectFluxCounterProps$JsMap _cachedTypedProps; + late _$$ConnectFluxCounterProps _cachedTypedProps; @override - _$$ConnectFluxCounterProps$JsMap get props => _cachedTypedProps; + _$$ConnectFluxCounterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -261,9 +223,8 @@ class _$ConnectFluxCounterComponent extends ConnectFluxCounterComponent { } @override - _$$ConnectFluxCounterProps$JsMap typedPropsFactoryJs( - JsBackedMap? backingMap) => - _$$ConnectFluxCounterProps$JsMap(backingMap); + _$$ConnectFluxCounterProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$ConnectFluxCounterProps(backingMap); @override _$$ConnectFluxCounterProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react_redux/fixtures/counter.over_react.g.dart b/test/over_react_redux/fixtures/counter.over_react.g.dart index aa09eccf3..1bd900f0b 100644 --- a/test/over_react_redux/fixtures/counter.over_react.g.dart +++ b/test/over_react_redux/fixtures/counter.over_react.g.dart @@ -103,25 +103,19 @@ class CounterProps extends _$CounterProps with _$CounterPropsAccessorsMixin { static const PropsMeta meta = _$metaForCounterProps; } -_$$CounterProps _$Counter([Map? backingProps]) => backingProps == null - ? _$$CounterProps$JsMap(JsBackedMap()) - : _$$CounterProps(backingProps); +_$$CounterProps _$Counter([Map? backingProps]) => _$$CounterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$CounterProps extends _$CounterProps +class _$$CounterProps extends _$CounterProps with _$CounterPropsAccessorsMixin implements CounterProps { - _$$CounterProps._(); - - factory _$$CounterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CounterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CounterProps$PlainMap(backingMap); - } - } + _$$CounterProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -145,48 +139,15 @@ abstract class _$$CounterProps extends _$CounterProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CounterProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$CounterProps$PlainMap extends _$$CounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CounterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$CounterProps$JsMap extends _$$CounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CounterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$CounterComponent extends CounterComponent { - late _$$CounterProps$JsMap _cachedTypedProps; + late _$$CounterProps _cachedTypedProps; @override - _$$CounterProps$JsMap get props => _cachedTypedProps; + _$$CounterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -203,8 +164,8 @@ class _$CounterComponent extends CounterComponent { } @override - _$$CounterProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$CounterProps$JsMap(backingMap); + _$$CounterProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$CounterProps(backingMap); @override _$$CounterProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react_redux/fixtures/counter_fn.over_react.g.dart b/test/over_react_redux/fixtures/counter_fn.over_react.g.dart index ff0e970ef..af9295010 100644 --- a/test/over_react_redux/fixtures/counter_fn.over_react.g.dart +++ b/test/over_react_redux/fixtures/counter_fn.over_react.g.dart @@ -140,7 +140,7 @@ const PropsMeta _$metaForCustomContextCounterFnPropsMixin = PropsMeta( final UiFactoryConfig<_$$CounterFnProps> _$CounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$CounterFnProps(map), - jsMap: (map) => _$$CounterFnProps$JsMap(map), + jsMap: (map) => _$$CounterFnProps(map), ), displayName: 'CounterFn'); @@ -154,20 +154,17 @@ final UiFactoryConfig<_$$CounterFnProps> $CounterFnConfig = _$CounterFnConfig; // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CounterFnProps extends UiProps +class _$$CounterFnProps extends UiProps with CounterFnProps, // If this generated mixin is undefined, it's likely because CounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CounterFnProps, and check that $CounterFnProps is exported/imported properly. $CounterFnProps { - _$$CounterFnProps._(); - - factory _$$CounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CounterFnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CounterFnProps$PlainMap(backingMap); - } - } + _$$CounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -192,49 +189,11 @@ abstract class _$$CounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CounterFnProps$PlainMap extends _$$CounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CounterFnProps$JsMap extends _$$CounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$ModelCounterFnProps> _$ModelCounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$ModelCounterFnProps(map), - jsMap: (map) => _$$ModelCounterFnProps$JsMap(map), + jsMap: (map) => _$$ModelCounterFnProps(map), ), displayName: 'ModelCounterFn'); @@ -249,7 +208,7 @@ final UiFactoryConfig<_$$ModelCounterFnProps> $ModelCounterFnConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ModelCounterFnProps extends UiProps +class _$$ModelCounterFnProps extends UiProps with CounterFnProps, // If this generated mixin is undefined, it's likely because CounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CounterFnProps, and check that $CounterFnProps is exported/imported properly. @@ -259,15 +218,12 @@ abstract class _$$ModelCounterFnProps extends UiProps $ModelCounterFnPropsMixin implements ModelCounterFnProps { - _$$ModelCounterFnProps._(); - - factory _$$ModelCounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ModelCounterFnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$ModelCounterFnProps$PlainMap(backingMap); - } - } + _$$ModelCounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -294,49 +250,11 @@ abstract class _$$ModelCounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ModelCounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ModelCounterFnProps$PlainMap extends _$$ModelCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ModelCounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ModelCounterFnProps$JsMap extends _$$ModelCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ModelCounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$CustomContextCounterFnProps> _$CustomContextCounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$CustomContextCounterFnProps(map), - jsMap: (map) => _$$CustomContextCounterFnProps$JsMap(map), + jsMap: (map) => _$$CustomContextCounterFnProps(map), ), displayName: 'CustomContextCounterFn'); @@ -352,7 +270,7 @@ final UiFactoryConfig<_$$CustomContextCounterFnProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CustomContextCounterFnProps extends UiProps +class _$$CustomContextCounterFnProps extends UiProps with CounterFnProps, // If this generated mixin is undefined, it's likely because CounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CounterFnProps, and check that $CounterFnProps is exported/imported properly. @@ -362,15 +280,12 @@ abstract class _$$CustomContextCounterFnProps extends UiProps $CustomContextCounterFnPropsMixin implements CustomContextCounterFnProps { - _$$CustomContextCounterFnProps._(); - - factory _$$CustomContextCounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomContextCounterFnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$CustomContextCounterFnProps$PlainMap(backingMap); - } - } + _$$CustomContextCounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -398,42 +313,3 @@ abstract class _$$CustomContextCounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CustomContextCounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomContextCounterFnProps$PlainMap - extends _$$CustomContextCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomContextCounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomContextCounterFnProps$JsMap - extends _$$CustomContextCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomContextCounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react_redux/fixtures/flux_counter.over_react.g.dart b/test/over_react_redux/fixtures/flux_counter.over_react.g.dart index f144401c7..c2c4e9784 100644 --- a/test/over_react_redux/fixtures/flux_counter.over_react.g.dart +++ b/test/over_react_redux/fixtures/flux_counter.over_react.g.dart @@ -38,25 +38,21 @@ class FluxCounterProps extends _$FluxCounterProps static const PropsMeta meta = _$metaForFluxCounterProps; } -_$$FluxCounterProps _$FluxCounter([Map? backingProps]) => backingProps == null - ? _$$FluxCounterProps$JsMap(JsBackedMap()) - : _$$FluxCounterProps(backingProps); +_$$FluxCounterProps _$FluxCounter([Map? backingProps]) => + _$$FluxCounterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$FluxCounterProps extends _$FluxCounterProps +class _$$FluxCounterProps extends _$FluxCounterProps with _$FluxCounterPropsAccessorsMixin implements FluxCounterProps { - _$$FluxCounterProps._(); - - factory _$$FluxCounterProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$FluxCounterProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$FluxCounterProps$PlainMap(backingMap); - } - } + _$$FluxCounterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -81,48 +77,15 @@ abstract class _$$FluxCounterProps extends _$FluxCounterProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$FluxCounterProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$FluxCounterProps$PlainMap extends _$$FluxCounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FluxCounterProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$FluxCounterProps$JsMap extends _$$FluxCounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$FluxCounterProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$FluxCounterComponent extends FluxCounterComponent { - late _$$FluxCounterProps$JsMap _cachedTypedProps; + late _$$FluxCounterProps _cachedTypedProps; @override - _$$FluxCounterProps$JsMap get props => _cachedTypedProps; + _$$FluxCounterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -139,8 +102,8 @@ class _$FluxCounterComponent extends FluxCounterComponent { } @override - _$$FluxCounterProps$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$FluxCounterProps$JsMap(backingMap); + _$$FluxCounterProps typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$FluxCounterProps(backingMap); @override _$$FluxCounterProps typedPropsFactory(Map? backingMap) => diff --git a/test/over_react_redux/fixtures/non_component_two_counter.over_react.g.dart b/test/over_react_redux/fixtures/non_component_two_counter.over_react.g.dart index 5486b354c..05c5c84a0 100644 --- a/test/over_react_redux/fixtures/non_component_two_counter.over_react.g.dart +++ b/test/over_react_redux/fixtures/non_component_two_counter.over_react.g.dart @@ -48,16 +48,12 @@ _$$NonComponentTwoCounterProps _$NonComponentTwoCounter([Map? backingProps]) => class _$$NonComponentTwoCounterProps extends _$NonComponentTwoCounterProps with _$NonComponentTwoCounterPropsAccessorsMixin implements NonComponentTwoCounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$NonComponentTwoCounterProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$NonComponentTwoCounterProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/over_react_redux/hooks/use_dispatch_test.over_react.g.dart b/test/over_react_redux/hooks/use_dispatch_test.over_react.g.dart index a59c0a0c5..dbd81993b 100644 --- a/test/over_react_redux/hooks/use_dispatch_test.over_react.g.dart +++ b/test/over_react_redux/hooks/use_dispatch_test.over_react.g.dart @@ -62,7 +62,7 @@ final UiFactoryConfig<_$$UseDispatchCounterFnProps> _$UseDispatchCounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$UseDispatchCounterFnProps(map), - jsMap: (map) => _$$UseDispatchCounterFnProps$JsMap(map), + jsMap: (map) => _$$UseDispatchCounterFnProps(map), ), displayName: 'UseDispatchCounterFn'); @@ -77,20 +77,17 @@ final UiFactoryConfig<_$$UseDispatchCounterFnProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$UseDispatchCounterFnProps extends UiProps +class _$$UseDispatchCounterFnProps extends UiProps with UseDispatchCounterFnProps, // If this generated mixin is undefined, it's likely because UseDispatchCounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of UseDispatchCounterFnProps, and check that $UseDispatchCounterFnProps is exported/imported properly. $UseDispatchCounterFnProps { - _$$UseDispatchCounterFnProps._(); + _$$UseDispatchCounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$UseDispatchCounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$UseDispatchCounterFnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$UseDispatchCounterFnProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -115,50 +112,11 @@ abstract class _$$UseDispatchCounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$UseDispatchCounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$UseDispatchCounterFnProps$PlainMap - extends _$$UseDispatchCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$UseDispatchCounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$UseDispatchCounterFnProps$JsMap extends _$$UseDispatchCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$UseDispatchCounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$CustomContextUseDispatchCounterFnProps> _$CustomContextUseDispatchCounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$CustomContextUseDispatchCounterFnProps(map), - jsMap: (map) => _$$CustomContextUseDispatchCounterFnProps$JsMap(map), + jsMap: (map) => _$$CustomContextUseDispatchCounterFnProps(map), ), displayName: 'CustomContextUseDispatchCounterFn'); @@ -175,21 +133,17 @@ final UiFactoryConfig<_$$CustomContextUseDispatchCounterFnProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CustomContextUseDispatchCounterFnProps extends UiProps +class _$$CustomContextUseDispatchCounterFnProps extends UiProps with CustomContextUseDispatchCounterFnProps, // If this generated mixin is undefined, it's likely because CustomContextUseDispatchCounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CustomContextUseDispatchCounterFnProps, and check that $CustomContextUseDispatchCounterFnProps is exported/imported properly. $CustomContextUseDispatchCounterFnProps { - _$$CustomContextUseDispatchCounterFnProps._(); + _$$CustomContextUseDispatchCounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$CustomContextUseDispatchCounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomContextUseDispatchCounterFnProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$CustomContextUseDispatchCounterFnProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -215,42 +169,3 @@ abstract class _$$CustomContextUseDispatchCounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CustomContextUseDispatchCounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomContextUseDispatchCounterFnProps$PlainMap - extends _$$CustomContextUseDispatchCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomContextUseDispatchCounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomContextUseDispatchCounterFnProps$JsMap - extends _$$CustomContextUseDispatchCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomContextUseDispatchCounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react_redux/hooks/use_store_test.over_react.g.dart b/test/over_react_redux/hooks/use_store_test.over_react.g.dart index 34f72f6ac..5ff37cb57 100644 --- a/test/over_react_redux/hooks/use_store_test.over_react.g.dart +++ b/test/over_react_redux/hooks/use_store_test.over_react.g.dart @@ -62,7 +62,7 @@ final UiFactoryConfig<_$$UseStoreCounterFnProps> _$UseStoreCounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$UseStoreCounterFnProps(map), - jsMap: (map) => _$$UseStoreCounterFnProps$JsMap(map), + jsMap: (map) => _$$UseStoreCounterFnProps(map), ), displayName: 'UseStoreCounterFn'); @@ -77,20 +77,17 @@ final UiFactoryConfig<_$$UseStoreCounterFnProps> $UseStoreCounterFnConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$UseStoreCounterFnProps extends UiProps +class _$$UseStoreCounterFnProps extends UiProps with UseStoreCounterFnProps, // If this generated mixin is undefined, it's likely because UseStoreCounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of UseStoreCounterFnProps, and check that $UseStoreCounterFnProps is exported/imported properly. $UseStoreCounterFnProps { - _$$UseStoreCounterFnProps._(); - - factory _$$UseStoreCounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$UseStoreCounterFnProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$UseStoreCounterFnProps$PlainMap(backingMap); - } - } + _$$UseStoreCounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -115,49 +112,11 @@ abstract class _$$UseStoreCounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$UseStoreCounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$UseStoreCounterFnProps$PlainMap extends _$$UseStoreCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$UseStoreCounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$UseStoreCounterFnProps$JsMap extends _$$UseStoreCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$UseStoreCounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$CustomContextUseStoreCounterFnProps> _$CustomContextUseStoreCounterFnConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$CustomContextUseStoreCounterFnProps(map), - jsMap: (map) => _$$CustomContextUseStoreCounterFnProps$JsMap(map), + jsMap: (map) => _$$CustomContextUseStoreCounterFnProps(map), ), displayName: 'CustomContextUseStoreCounterFn'); @@ -174,21 +133,17 @@ final UiFactoryConfig<_$$CustomContextUseStoreCounterFnProps> // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CustomContextUseStoreCounterFnProps extends UiProps +class _$$CustomContextUseStoreCounterFnProps extends UiProps with CustomContextUseStoreCounterFnProps, // If this generated mixin is undefined, it's likely because CustomContextUseStoreCounterFnProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CustomContextUseStoreCounterFnProps, and check that $CustomContextUseStoreCounterFnProps is exported/imported properly. $CustomContextUseStoreCounterFnProps { - _$$CustomContextUseStoreCounterFnProps._(); - - factory _$$CustomContextUseStoreCounterFnProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CustomContextUseStoreCounterFnProps$JsMap( - backingMap as JsBackedMap?); - } else { - return _$$CustomContextUseStoreCounterFnProps$PlainMap(backingMap); - } - } + _$$CustomContextUseStoreCounterFnProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -214,42 +169,3 @@ abstract class _$$CustomContextUseStoreCounterFnProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CustomContextUseStoreCounterFnProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomContextUseStoreCounterFnProps$PlainMap - extends _$$CustomContextUseStoreCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomContextUseStoreCounterFnProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CustomContextUseStoreCounterFnProps$JsMap - extends _$$CustomContextUseStoreCounterFnProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CustomContextUseStoreCounterFnProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/over_react_redux/store_bindings_tests.over_react.g.dart b/test/over_react_redux/store_bindings_tests.over_react.g.dart index 1af3ab464..0f8d20935 100644 --- a/test/over_react_redux/store_bindings_tests.over_react.g.dart +++ b/test/over_react_redux/store_bindings_tests.over_react.g.dart @@ -104,7 +104,7 @@ final UiFactoryConfig<_$$TestSelectorProps> _$TestSelectorConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestSelectorProps(map), - jsMap: (map) => _$$TestSelectorProps$JsMap(map), + jsMap: (map) => _$$TestSelectorProps(map), ), displayName: 'TestSelector'); @@ -119,20 +119,17 @@ final UiFactoryConfig<_$$TestSelectorProps> $TestSelectorConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestSelectorProps extends UiProps +class _$$TestSelectorProps extends UiProps with TestSelectorProps, // If this generated mixin is undefined, it's likely because TestSelectorProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestSelectorProps, and check that $TestSelectorProps is exported/imported properly. $TestSelectorProps { - _$$TestSelectorProps._(); + _$$TestSelectorProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$TestSelectorProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestSelectorProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestSelectorProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -157,49 +154,11 @@ abstract class _$$TestSelectorProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestSelectorProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestSelectorProps$PlainMap extends _$$TestSelectorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSelectorProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestSelectorProps$JsMap extends _$$TestSelectorProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestSelectorProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - final UiFactoryConfig<_$$TestConnectProps> _$TestConnectMapViewConfig = UiFactoryConfig( propsFactory: PropsFactory( map: (map) => _$$TestConnectProps(map), - jsMap: (map) => _$$TestConnectProps$JsMap(map), + jsMap: (map) => _$$TestConnectProps(map), ), displayName: 'TestConnectMapView'); @@ -214,7 +173,7 @@ final UiFactoryConfig<_$$TestConnectProps> $TestConnectMapViewConfig = // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$TestConnectProps extends UiProps +class _$$TestConnectProps extends UiProps with TestSelectorProps, // If this generated mixin is undefined, it's likely because TestSelectorProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of TestSelectorProps, and check that $TestSelectorProps is exported/imported properly. @@ -224,15 +183,12 @@ abstract class _$$TestConnectProps extends UiProps $TestConnectPropsMixin implements TestConnectProps { - _$$TestConnectProps._(); + _$$TestConnectProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); - factory _$$TestConnectProps(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TestConnectProps$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TestConnectProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -259,40 +215,3 @@ abstract class _$$TestConnectProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TestConnectProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestConnectProps$PlainMap extends _$$TestConnectProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestConnectProps$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$TestConnectProps$JsMap extends _$$TestConnectProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TestConnectProps$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/test/test_util/component2/one_level_wrapper2.over_react.g.dart b/test/test_util/component2/one_level_wrapper2.over_react.g.dart index c9b1ab29b..3606df694 100644 --- a/test/test_util/component2/one_level_wrapper2.over_react.g.dart +++ b/test/test_util/component2/one_level_wrapper2.over_react.g.dart @@ -39,25 +39,20 @@ class OneLevelWrapper2Props extends _$OneLevelWrapper2Props } _$$OneLevelWrapper2Props _$OneLevelWrapper2([Map? backingProps]) => - backingProps == null - ? _$$OneLevelWrapper2Props$JsMap(JsBackedMap()) - : _$$OneLevelWrapper2Props(backingProps); + _$$OneLevelWrapper2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$OneLevelWrapper2Props extends _$OneLevelWrapper2Props +class _$$OneLevelWrapper2Props extends _$OneLevelWrapper2Props with _$OneLevelWrapper2PropsAccessorsMixin implements OneLevelWrapper2Props { - _$$OneLevelWrapper2Props._(); - - factory _$$OneLevelWrapper2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$OneLevelWrapper2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$OneLevelWrapper2Props$PlainMap(backingMap); - } - } + _$$OneLevelWrapper2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -82,48 +77,15 @@ abstract class _$$OneLevelWrapper2Props extends _$OneLevelWrapper2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$OneLevelWrapper2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$OneLevelWrapper2Props$PlainMap extends _$$OneLevelWrapper2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$OneLevelWrapper2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$OneLevelWrapper2Props$JsMap extends _$$OneLevelWrapper2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$OneLevelWrapper2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$OneLevelWrapper2Component extends OneLevelWrapper2Component { - late _$$OneLevelWrapper2Props$JsMap _cachedTypedProps; + late _$$OneLevelWrapper2Props _cachedTypedProps; @override - _$$OneLevelWrapper2Props$JsMap get props => _cachedTypedProps; + _$$OneLevelWrapper2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -140,8 +102,8 @@ class _$OneLevelWrapper2Component extends OneLevelWrapper2Component { } @override - _$$OneLevelWrapper2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$OneLevelWrapper2Props$JsMap(backingMap); + _$$OneLevelWrapper2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$OneLevelWrapper2Props(backingMap); @override _$$OneLevelWrapper2Props typedPropsFactory(Map? backingMap) => diff --git a/test/test_util/component2/two_level_wrapper2.over_react.g.dart b/test/test_util/component2/two_level_wrapper2.over_react.g.dart index 5c5e56031..865c55eaf 100644 --- a/test/test_util/component2/two_level_wrapper2.over_react.g.dart +++ b/test/test_util/component2/two_level_wrapper2.over_react.g.dart @@ -39,25 +39,20 @@ class TwoLevelWrapper2Props extends _$TwoLevelWrapper2Props } _$$TwoLevelWrapper2Props _$TwoLevelWrapper2([Map? backingProps]) => - backingProps == null - ? _$$TwoLevelWrapper2Props$JsMap(JsBackedMap()) - : _$$TwoLevelWrapper2Props(backingProps); + _$$TwoLevelWrapper2Props(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TwoLevelWrapper2Props extends _$TwoLevelWrapper2Props +class _$$TwoLevelWrapper2Props extends _$TwoLevelWrapper2Props with _$TwoLevelWrapper2PropsAccessorsMixin implements TwoLevelWrapper2Props { - _$$TwoLevelWrapper2Props._(); - - factory _$$TwoLevelWrapper2Props(Map? backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$TwoLevelWrapper2Props$JsMap(backingMap as JsBackedMap?); - } else { - return _$$TwoLevelWrapper2Props$PlainMap(backingMap); - } - } + _$$TwoLevelWrapper2Props([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -82,48 +77,15 @@ abstract class _$$TwoLevelWrapper2Props extends _$TwoLevelWrapper2Props /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$TwoLevelWrapper2Props = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$TwoLevelWrapper2Props$PlainMap extends _$$TwoLevelWrapper2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TwoLevelWrapper2Props$PlainMap(Map? backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$TwoLevelWrapper2Props$JsMap extends _$$TwoLevelWrapper2Props { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TwoLevelWrapper2Props$JsMap(JsBackedMap? backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TwoLevelWrapper2Component extends TwoLevelWrapper2Component { - late _$$TwoLevelWrapper2Props$JsMap _cachedTypedProps; + late _$$TwoLevelWrapper2Props _cachedTypedProps; @override - _$$TwoLevelWrapper2Props$JsMap get props => _cachedTypedProps; + _$$TwoLevelWrapper2Props get props => _cachedTypedProps; @override set props(Map value) { @@ -140,8 +102,8 @@ class _$TwoLevelWrapper2Component extends TwoLevelWrapper2Component { } @override - _$$TwoLevelWrapper2Props$JsMap typedPropsFactoryJs(JsBackedMap? backingMap) => - _$$TwoLevelWrapper2Props$JsMap(backingMap); + _$$TwoLevelWrapper2Props typedPropsFactoryJs(JsBackedMap? backingMap) => + _$$TwoLevelWrapper2Props(backingMap); @override _$$TwoLevelWrapper2Props typedPropsFactory(Map? backingMap) => diff --git a/test/test_util/one_level_wrapper.over_react.g.dart b/test/test_util/one_level_wrapper.over_react.g.dart index cb3ecfe4a..494a753c4 100644 --- a/test/test_util/one_level_wrapper.over_react.g.dart +++ b/test/test_util/one_level_wrapper.over_react.g.dart @@ -47,16 +47,12 @@ _$$OneLevelWrapperProps _$OneLevelWrapper([Map? backingProps]) => class _$$OneLevelWrapperProps extends _$OneLevelWrapperProps with _$OneLevelWrapperPropsAccessorsMixin implements OneLevelWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$OneLevelWrapperProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$OneLevelWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/test_util/two_level_wrapper.over_react.g.dart b/test/test_util/two_level_wrapper.over_react.g.dart index f29882a8b..243d7b04b 100644 --- a/test/test_util/two_level_wrapper.over_react.g.dart +++ b/test/test_util/two_level_wrapper.over_react.g.dart @@ -47,16 +47,12 @@ _$$TwoLevelWrapperProps _$TwoLevelWrapper([Map? backingProps]) => class _$$TwoLevelWrapperProps extends _$TwoLevelWrapperProps with _$TwoLevelWrapperPropsAccessorsMixin implements TwoLevelWrapperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TwoLevelWrapperProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TwoLevelWrapperProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test/vm_tests/builder/codegen/names_test.dart b/test/vm_tests/builder/codegen/names_test.dart index 112b409a9..216442266 100644 --- a/test/vm_tests/builder/codegen/names_test.dart +++ b/test/vm_tests/builder/codegen/names_test.dart @@ -81,8 +81,6 @@ main() { test('consumerName', () => expect(names.consumerName, r'_$FooProps')); test('implName', () => expect(names.implName, r'_$$FooProps')); - test('plainMapImplName', () => expect(names.plainMapImplName, r'_$$FooProps$PlainMap')); - test('jsMapImplName', () => expect(names.jsMapImplName, r'_$$FooProps$JsMap')); test('publicName', () => expect(names.publicName, r'FooProps')); test('legacyAccessorsMixinName', () => expect(names.legacyAccessorsMixinName, r'_$FooPropsAccessorsMixin')); test('generatedMixinName', () => expect(names.generatedMixinName, r'FooProps')); @@ -97,8 +95,6 @@ main() { test('consumerName', () => expect(names.consumerName, r'FooProps')); test('implName', () => expect(names.implName, r'_$$FooProps')); - test('plainMapImplName', () => expect(names.plainMapImplName, r'_$$FooProps$PlainMap')); - test('jsMapImplName', () => expect(names.jsMapImplName, r'_$$FooProps$JsMap')); test('publicName', () => expect(names.publicName, r'FooProps')); // legacyAccessorsMixinName not applicable test('generatedMixinName', () => expect(names.generatedMixinName, r'$FooProps')); @@ -115,8 +111,6 @@ main() { test('consumerName', () => expect(names.consumerName, r'foo._$FooProps')); test('implName', () => expect(names.implName, r'foo._$$FooProps')); - test('plainMapImplName', () => expect(names.plainMapImplName, r'foo._$$FooProps$PlainMap')); - test('jsMapImplName', () => expect(names.jsMapImplName, r'foo._$$FooProps$JsMap')); test('publicName', () => expect(names.publicName, r'foo.FooProps')); test('legacyAccessorsMixinName', () => expect(names.legacyAccessorsMixinName, r'foo._$FooPropsAccessorsMixin')); test('generatedMixinName', () => expect(names.generatedMixinName, r'foo.FooProps')); @@ -131,8 +125,6 @@ main() { test('consumerName', () => expect(names.consumerName, r'foo.FooProps')); test('implName', () => expect(names.implName, r'foo._$$FooProps')); - test('plainMapImplName', () => expect(names.plainMapImplName, r'foo._$$FooProps$PlainMap')); - test('jsMapImplName', () => expect(names.jsMapImplName, r'foo._$$FooProps$JsMap')); test('publicName', () => expect(names.publicName, r'foo.FooProps')); // legacyAccessorsMixinName not applicable test('generatedMixinName', () => expect(names.generatedMixinName, r'foo.$FooProps')); diff --git a/test/vm_tests/builder/codegen_test.dart b/test/vm_tests/builder/codegen_test.dart index 4a7ca0a99..7ec6c50df 100644 --- a/test/vm_tests/builder/codegen_test.dart +++ b/test/vm_tests/builder/codegen_test.dart @@ -360,16 +360,13 @@ main() { test('with the correct constructor', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( - ' _\$\$${ors.prefixedBaseName}Props(Map backingMap) : this._props = {} {\n' - ' this._props = backingMap ?? {};\n' - ' }')); + ' _\$\$${ors.prefixedBaseName}Props([Map backingMap]) : this.props = backingMap ?? JsBackedMap();')); }); - test('with props backing map getter', () { + test('with props backing map impl', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' Map get props => _props;\n' - ' Map _props;')); + ' final Map props;')); }); test('overrides `\$isClassGenerated` to return `true`', () { @@ -432,16 +429,13 @@ main() { test('with the correct constructor', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( - ' _\$\$${ors.prefixedBaseName}State(Map backingMap) : this._state = {} {\n' - ' this._state = backingMap ?? {};\n' - ' }')); + ' _\$\$${ors.prefixedBaseName}State([Map backingMap]) : this.state = backingMap ?? JsBackedMap();')); }); - test('with state backing map getter', () { + test('with state backing map impl', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' Map get state => _state;\n' - ' Map _state;')); + ' final Map state;')); }); test('overrides `\$isClassGenerated` to return `true`', () { @@ -664,7 +658,7 @@ main() { '_\$${factoryName}Config = UiFactoryConfig(\n' 'propsFactory: PropsFactory(\n' 'map: (map) => _\$\$$propsName(map),\n' - 'jsMap: (map) => _\$\$$propsName\$JsMap(map),),\n' + 'jsMap: (map) => _\$\$$propsName(map),),\n' 'displayName: \'$factoryName\');\n\n' '@Deprecated(r\'Use the private variable, _\$${factoryName}Config, instead \'\n' '\'and update the `over_react` lower bound to version 4.1.0. \'\n' @@ -673,34 +667,10 @@ main() { '\$${factoryName}Config = _\$${factoryName}Config;\n\n'; } - String generatedPropsMapsForConfig(String propsName) { - return '// Concrete props implementation that can be backed by any [Map].\n' - '@Deprecated(\'This API is for use only within generated code.\'\' Do not reference it in your code, as it may change at any time.\')\n' - 'class _\$\$$propsName\$PlainMap extends _\$\$$propsName {\n' - ' // This initializer of `_props` to an empty map, as well as the reassignment\n' - ' // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217\n' - ' _\$\$$propsName\$PlainMap(Map backingMap) : this._props = {}, super._() {\n' - ' this._props = backingMap ?? {};\n' - ' }\n' - ' /// The backing props map proxied by this class.\n' - ' @override\n' - ' Map get props => _props;\n' - ' Map _props;\n' - '}\n' - '// Concrete props implementation that can only be backed by [JsMap],\n' - '// allowing dart2js to compile more optimal code for key-value pair reads/writes.\n' - '@Deprecated(\'This API is for use only within generated code.\'\' Do not reference it in your code, as it may change at any time.\')\n' - 'class _\$\$$propsName\$JsMap extends _\$\$$propsName {\n' - ' // This initializer of `_props` to an empty map, as well as the reassignment\n' - ' // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217\n' - ' _\$\$$propsName\$JsMap(JsBackedMap backingMap) : this._props = JsBackedMap(), super._() {\n' - ' this._props = backingMap ?? JsBackedMap();\n' - ' }\n' - ' /// The backing props map proxied by this class.\n' - ' @override\n' - ' JsBackedMap get props => _props;\n' - ' JsBackedMap _props;\n' - '}\n'; + String generatedPropsMapForConfig(String propsName) { + // No need to validate the whole implementation; that's tedious to reconstruct here, and it's tested elsewhere. + return '@Deprecated(\'This API is for use only within generated code.\'\' Do not reference it in your code, as it may change at any time.\')\n' + 'class _\$\$$propsName extends UiProps with'; } void sharedUiConfigGenerationTests(String wrapperFunction) { @@ -735,9 +705,9 @@ main() { mixin UnusedPropsMixin on UiProps {} '''); - expect(implGenerator!.outputContentsBuffer.toString().contains(generatedPropsMapsForConfig('UnusedPropsMixin')), isFalse); - expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapsForConfig('BarPropsMixin'))); - expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapsForConfig('FooProps'))); + expect(implGenerator!.outputContentsBuffer.toString().contains(generatedPropsMapForConfig('UnusedPropsMixin')), isFalse); + expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapForConfig('BarPropsMixin'))); + expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapForConfig('FooProps'))); expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedConfig('BarPropsMixin', 'Bar'))); expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedConfig('BarPropsMixin', 'Foo'))); @@ -756,7 +726,7 @@ main() { mixin FooPropsMixin on UiProps {} '''); - expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapsForConfig('FooPropsMixin'))); + expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapForConfig('FooPropsMixin'))); expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedConfig('FooPropsMixin', 'Foo'))); }); @@ -773,7 +743,7 @@ main() { mixin FooProps on UiProps {} '''); - expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapsForConfig('FooProps'))); + expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapForConfig('FooProps'))); expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedConfig('FooProps', 'Foo'))); }); @@ -824,7 +794,7 @@ main() { ); '''); - expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapsForConfig('UiForwardRefFooProps'))); + expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapForConfig('UiForwardRefFooProps'))); expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedConfig('UiForwardRefFooProps', 'UiForwardRefFoo'))); }); }); @@ -880,7 +850,7 @@ main() { ); '''); - expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapsForConfig('FooPropsMixin'))); + expect(implGenerator!.outputContentsBuffer.toString(), contains(generatedPropsMapForConfig('FooPropsMixin'))); expect(implGenerator!.outputContentsBuffer.toString().contains(generatedConfig('UiProps', 'Bar')), isFalse, reason: '2'); expect(implGenerator!.outputContentsBuffer.toString().contains(generatedConfig('FooPropsMixin', 'ArbitraryFoo')), isFalse, reason: '2'); diff --git a/test_fixtures/gold_output_files/backwards_compatible/basic.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/backwards_compatible/basic.over_react.g.dart.goldFile index 97953bc92..c9dad6aeb 100644 --- a/test_fixtures/gold_output_files/backwards_compatible/basic.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/backwards_compatible/basic.over_react.g.dart.goldFile @@ -130,16 +130,11 @@ _$$BasicProps _$Basic([Map backingProps]) => _$$BasicProps(backingProps); class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test_fixtures/gold_output_files/backwards_compatible/basic_library.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/backwards_compatible/basic_library.over_react.g.dart.goldFile index 529e8729f..0604d488c 100644 --- a/test_fixtures/gold_output_files/backwards_compatible/basic_library.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/backwards_compatible/basic_library.over_react.g.dart.goldFile @@ -144,16 +144,12 @@ _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps with _$BasicPartOfLibPropsAccessorsMixin implements BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -224,16 +220,12 @@ const StateMeta _$metaForBasicPartOfLibState = StateMeta( class _$$BasicPartOfLibState extends _$BasicPartOfLibState with _$BasicPartOfLibStateAccessorsMixin implements BasicPartOfLibState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibState(Map backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$BasicPartOfLibState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -318,16 +310,12 @@ _$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => class _$$SubPartOfLibProps extends _$SubPartOfLibProps with _$SubPartOfLibPropsAccessorsMixin implements SubPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SubPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$SubPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test_fixtures/gold_output_files/dart2_only/basic.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/dart2_only/basic.over_react.g.dart.goldFile index 40adb283b..23cc8811c 100644 --- a/test_fixtures/gold_output_files/dart2_only/basic.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/dart2_only/basic.over_react.g.dart.goldFile @@ -138,16 +138,11 @@ _$$BasicProps _$Basic([Map backingProps]) => _$$BasicProps(backingProps); class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test_fixtures/gold_output_files/dart2_only/basic_library.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/dart2_only/basic_library.over_react.g.dart.goldFile index 4db37e942..1241e104c 100644 --- a/test_fixtures/gold_output_files/dart2_only/basic_library.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/dart2_only/basic_library.over_react.g.dart.goldFile @@ -149,16 +149,12 @@ _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps with _$BasicPartOfLibPropsAccessorsMixin implements BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -234,16 +230,12 @@ class BasicPartOfLibState extends _$BasicPartOfLibState class _$$BasicPartOfLibState extends _$BasicPartOfLibState with _$BasicPartOfLibStateAccessorsMixin implements BasicPartOfLibState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibState(Map backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$BasicPartOfLibState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override @@ -333,16 +325,12 @@ _$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => class _$$SubPartOfLibProps extends _$SubPartOfLibProps with _$SubPartOfLibPropsAccessorsMixin implements SubPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SubPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$SubPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test_fixtures/gold_output_files/dart2_only/component2/basic.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/dart2_only/component2/basic.over_react.g.dart.goldFile index 883eb676d..33eacf32d 100644 --- a/test_fixtures/gold_output_files/dart2_only/component2/basic.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/dart2_only/component2/basic.over_react.g.dart.goldFile @@ -128,25 +128,19 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => backingProps == null - ? _$$BasicProps$JsMap(JsBackedMap()) - : _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => _$$BasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$BasicProps extends _$BasicProps +class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - _$$BasicProps._(); - - factory _$$BasicProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicProps$PlainMap(backingMap); - } - } + _$$BasicProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -180,48 +174,15 @@ abstract class _$$BasicProps extends _$BasicProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$BasicProps$PlainMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$BasicProps$JsMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$Basic2Component extends Basic2Component { - _$$BasicProps$JsMap _cachedTypedProps; + _$$BasicProps _cachedTypedProps; @override - _$$BasicProps$JsMap get props => _cachedTypedProps; + _$$BasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -238,8 +199,8 @@ class _$Basic2Component extends Basic2Component { } @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$BasicProps$JsMap(backingMap); + _$$BasicProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$BasicProps(backingMap); @override _$$BasicProps typedPropsFactory(Map backingMap) => _$$BasicProps(backingMap); diff --git a/test_fixtures/gold_output_files/dart2_only/component2/basic_library.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/dart2_only/component2/basic_library.over_react.g.dart.goldFile index c49f58364..133328db7 100644 --- a/test_fixtures/gold_output_files/dart2_only/component2/basic_library.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/dart2_only/component2/basic_library.over_react.g.dart.goldFile @@ -141,25 +141,20 @@ class BasicPartOfLibProps extends _$BasicPartOfLibProps } _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => - backingProps == null - ? _$$BasicPartOfLibProps$JsMap(JsBackedMap()) - : _$$BasicPartOfLibProps(backingProps); + _$$BasicPartOfLibProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps +class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps with _$BasicPartOfLibPropsAccessorsMixin implements BasicPartOfLibProps { - _$$BasicPartOfLibProps._(); - - factory _$$BasicPartOfLibProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicPartOfLibProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicPartOfLibProps$PlainMap(backingMap); - } - } + _$$BasicPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -192,40 +187,6 @@ abstract class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicPartOfLibProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -class _$$BasicPartOfLibProps$PlainMap extends _$$BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$BasicPartOfLibProps$JsMap extends _$$BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - mixin _$BasicPartOfLibStateAccessorsMixin implements _$BasicPartOfLibState { @override Map get state; @@ -266,55 +227,19 @@ class BasicPartOfLibState extends _$BasicPartOfLibState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$BasicPartOfLibState extends _$BasicPartOfLibState +class _$$BasicPartOfLibState extends _$BasicPartOfLibState with _$BasicPartOfLibStateAccessorsMixin implements BasicPartOfLibState { - _$$BasicPartOfLibState._(); - - factory _$$BasicPartOfLibState(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicPartOfLibState$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicPartOfLibState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -class _$$BasicPartOfLibState$PlainMap extends _$$BasicPartOfLibState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibState$PlainMap(Map backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$BasicPartOfLibState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} - -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$BasicPartOfLibState$JsMap extends _$$BasicPartOfLibState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibState$JsMap(JsBackedMap backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } + final Map state; - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -322,10 +247,10 @@ class _$$BasicPartOfLibState$JsMap extends _$$BasicPartOfLibState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { - _$$BasicPartOfLibProps$JsMap _cachedTypedProps; + _$$BasicPartOfLibProps _cachedTypedProps; @override - _$$BasicPartOfLibProps$JsMap get props => _cachedTypedProps; + _$$BasicPartOfLibProps get props => _cachedTypedProps; @override set props(Map value) { @@ -342,16 +267,16 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { } @override - _$$BasicPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$BasicPartOfLibProps$JsMap(backingMap); + _$$BasicPartOfLibProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$BasicPartOfLibProps(backingMap); @override _$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => _$$BasicPartOfLibProps(backingMap); - _$$BasicPartOfLibState$JsMap _cachedTypedState; + _$$BasicPartOfLibState _cachedTypedState; @override - _$$BasicPartOfLibState$JsMap get state => _cachedTypedState; + _$$BasicPartOfLibState get state => _cachedTypedState; @override set state(Map value) { @@ -364,8 +289,8 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { } @override - _$$BasicPartOfLibState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - _$$BasicPartOfLibState$JsMap(backingMap); + _$$BasicPartOfLibState typedStateFactoryJs(JsBackedMap backingMap) => + _$$BasicPartOfLibState(backingMap); @override _$$BasicPartOfLibState typedStateFactory(Map backingMap) => @@ -432,25 +357,21 @@ class SubPartOfLibProps extends _$SubPartOfLibProps static const PropsMeta meta = _$metaForSubPartOfLibProps; } -_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => backingProps == null - ? _$$SubPartOfLibProps$JsMap(JsBackedMap()) - : _$$SubPartOfLibProps(backingProps); +_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => + _$$SubPartOfLibProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$SubPartOfLibProps extends _$SubPartOfLibProps +class _$$SubPartOfLibProps extends _$SubPartOfLibProps with _$SubPartOfLibPropsAccessorsMixin implements SubPartOfLibProps { - _$$SubPartOfLibProps._(); - - factory _$$SubPartOfLibProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SubPartOfLibProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$SubPartOfLibProps$PlainMap(backingMap); - } - } + _$$SubPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -484,48 +405,15 @@ abstract class _$$SubPartOfLibProps extends _$SubPartOfLibProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SubPartOfLibProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -class _$$SubPartOfLibProps$PlainMap extends _$$SubPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SubPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -class _$$SubPartOfLibProps$JsMap extends _$$SubPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SubPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$SubPartOfLibComponent extends SubPartOfLibComponent { - _$$SubPartOfLibProps$JsMap _cachedTypedProps; + _$$SubPartOfLibProps _cachedTypedProps; @override - _$$SubPartOfLibProps$JsMap get props => _cachedTypedProps; + _$$SubPartOfLibProps get props => _cachedTypedProps; @override set props(Map value) { @@ -542,8 +430,8 @@ class _$SubPartOfLibComponent extends SubPartOfLibComponent { } @override - _$$SubPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$SubPartOfLibProps$JsMap(backingMap); + _$$SubPartOfLibProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$SubPartOfLibProps(backingMap); @override _$$SubPartOfLibProps typedPropsFactory(Map backingMap) => diff --git a/test_fixtures/gold_output_files/dart2_only/missing_over_react_g_part/library.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/dart2_only/missing_over_react_g_part/library.over_react.g.dart.goldFile index 63aae2737..c5a5cfaab 100644 --- a/test_fixtures/gold_output_files/dart2_only/missing_over_react_g_part/library.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/dart2_only/missing_over_react_g_part/library.over_react.g.dart.goldFile @@ -65,16 +65,12 @@ _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps with _$BasicPartOfLibPropsAccessorsMixin implements BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$BasicPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/test_fixtures/gold_output_files/mixin_based/basic.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/mixin_based/basic.over_react.g.dart.goldFile index 08bb767f2..60832ea4d 100644 --- a/test_fixtures/gold_output_files/mixin_based/basic.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/mixin_based/basic.over_react.g.dart.goldFile @@ -21,29 +21,23 @@ final $BasicComponentFactory = registerComponent2( parentType: null, ); -_$$BasicProps _$Basic([Map backingProps]) => backingProps == null - ? _$$BasicProps$JsMap(JsBackedMap()) - : _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => _$$BasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicProps extends UiProps +class _$$BasicProps extends UiProps with BasicProps, // If this generated mixin is undefined, it's likely because BasicProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicProps, and check that $BasicProps is exported/imported properly. $BasicProps { - _$$BasicProps._(); + _$$BasicProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); - factory _$$BasicProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -83,43 +77,6 @@ abstract class _$$BasicProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$PlainMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$JsMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -127,10 +84,10 @@ class _$$BasicProps$JsMap extends _$$BasicProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$BasicComponent extends BasicComponent { - _$$BasicProps$JsMap _cachedTypedProps; + _$$BasicProps _cachedTypedProps; @override - _$$BasicProps$JsMap get props => _cachedTypedProps; + _$$BasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -147,8 +104,8 @@ class _$BasicComponent extends BasicComponent { } @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$BasicProps$JsMap(backingMap); + _$$BasicProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$BasicProps(backingMap); @override _$$BasicProps typedPropsFactory(Map backingMap) => _$$BasicProps(backingMap); diff --git a/test_fixtures/gold_output_files/mixin_based/basic_library.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/mixin_based/basic_library.over_react.g.dart.goldFile index 51b213146..ee8e5dbb1 100644 --- a/test_fixtures/gold_output_files/mixin_based/basic_library.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/mixin_based/basic_library.over_react.g.dart.goldFile @@ -22,16 +22,14 @@ final $BasicPartOfLibComponentFactory = registerComponent2( ); _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => - backingProps == null - ? _$$BasicPartOfLibProps$JsMap(JsBackedMap()) - : _$$BasicPartOfLibProps(backingProps); + _$$BasicPartOfLibProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicPartOfLibProps extends UiProps +class _$$BasicPartOfLibProps extends UiProps with ExamplePropsMixin, // If this generated mixin is undefined, it's likely because ExamplePropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of ExamplePropsMixin, and check that $ExamplePropsMixin is exported/imported properly. @@ -41,15 +39,12 @@ abstract class _$$BasicPartOfLibProps extends UiProps $BasicPartOfLibPropsMixin implements BasicPartOfLibProps { - _$$BasicPartOfLibProps._(); - - factory _$$BasicPartOfLibProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicPartOfLibProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicPartOfLibProps$PlainMap(backingMap); - } - } + _$$BasicPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -91,49 +86,12 @@ abstract class _$$BasicPartOfLibProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicPartOfLibProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicPartOfLibProps$PlainMap extends _$$BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicPartOfLibProps$JsMap extends _$$BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete state implementation. // // Implements constructor and backing map. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicPartOfLibState extends UiState +class _$$BasicPartOfLibState extends UiState with ExampleStateMixin, // If this generated mixin is undefined, it's likely because ExampleStateMixin is not a valid `mixin`-based state mixin, or because it is but the generated mixin was not imported. Check the declaration of ExampleStateMixin, and check that $ExampleStateMixin is exported/imported properly. @@ -143,56 +101,16 @@ abstract class _$$BasicPartOfLibState extends UiState $BasicPartOfLibStateMixin implements BasicPartOfLibState { - _$$BasicPartOfLibState._(); - - factory _$$BasicPartOfLibState(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicPartOfLibState$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicPartOfLibState$PlainMap(backingMap); - } - } - - /// Let `UiState` internals know that this class has been generated. - @override - bool get $isClassGenerated => true; -} - -// Concrete state implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicPartOfLibState$PlainMap extends _$$BasicPartOfLibState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibState$PlainMap(Map backingMap) - : this._state = {}, - super._() { - this._state = backingMap ?? {}; - } + _$$BasicPartOfLibState([Map backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; -} + final Map state; -// Concrete state implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicPartOfLibState$JsMap extends _$$BasicPartOfLibState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibState$JsMap(JsBackedMap backingMap) - : this._state = JsBackedMap(), - super._() { - this._state = backingMap ?? JsBackedMap(); - } - - /// The backing state map proxied by this class. + /// Let `UiState` internals know that this class has been generated. @override - JsBackedMap get state => _state; - JsBackedMap _state; + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -202,10 +120,10 @@ class _$$BasicPartOfLibState$JsMap extends _$$BasicPartOfLibState { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { - _$$BasicPartOfLibProps$JsMap _cachedTypedProps; + _$$BasicPartOfLibProps _cachedTypedProps; @override - _$$BasicPartOfLibProps$JsMap get props => _cachedTypedProps; + _$$BasicPartOfLibProps get props => _cachedTypedProps; @override set props(Map value) { @@ -222,16 +140,16 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { } @override - _$$BasicPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$BasicPartOfLibProps$JsMap(backingMap); + _$$BasicPartOfLibProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$BasicPartOfLibProps(backingMap); @override _$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => _$$BasicPartOfLibProps(backingMap); - _$$BasicPartOfLibState$JsMap _cachedTypedState; + _$$BasicPartOfLibState _cachedTypedState; @override - _$$BasicPartOfLibState$JsMap get state => _cachedTypedState; + _$$BasicPartOfLibState get state => _cachedTypedState; @override set state(Map value) { @@ -244,8 +162,8 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { } @override - _$$BasicPartOfLibState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - _$$BasicPartOfLibState$JsMap(backingMap); + _$$BasicPartOfLibState typedStateFactoryJs(JsBackedMap backingMap) => + _$$BasicPartOfLibState(backingMap); @override _$$BasicPartOfLibState typedStateFactory(Map backingMap) => @@ -417,16 +335,15 @@ final $SubPartOfLibComponentFactory = registerComponent2( parentType: null, ); -_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => backingProps == null - ? _$$SubPartOfLibProps$JsMap(JsBackedMap()) - : _$$SubPartOfLibProps(backingProps); +_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => + _$$SubPartOfLibProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SubPartOfLibProps extends UiProps +class _$$SubPartOfLibProps extends UiProps with SuperPartOfLibPropsMixin, // If this generated mixin is undefined, it's likely because SuperPartOfLibPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SuperPartOfLibPropsMixin, and check that $SuperPartOfLibPropsMixin is exported/imported properly. @@ -436,15 +353,12 @@ abstract class _$$SubPartOfLibProps extends UiProps $SubPartOfLibPropsMixin implements SubPartOfLibProps { - _$$SubPartOfLibProps._(); - - factory _$$SubPartOfLibProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SubPartOfLibProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$SubPartOfLibProps$PlainMap(backingMap); - } - } + _$$SubPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -486,43 +400,6 @@ abstract class _$$SubPartOfLibProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SubPartOfLibProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SubPartOfLibProps$PlainMap extends _$$SubPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SubPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SubPartOfLibProps$JsMap extends _$$SubPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SubPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -530,10 +407,10 @@ class _$$SubPartOfLibProps$JsMap extends _$$SubPartOfLibProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$SubPartOfLibComponent extends SubPartOfLibComponent { - _$$SubPartOfLibProps$JsMap _cachedTypedProps; + _$$SubPartOfLibProps _cachedTypedProps; @override - _$$SubPartOfLibProps$JsMap get props => _cachedTypedProps; + _$$SubPartOfLibProps get props => _cachedTypedProps; @override set props(Map value) { @@ -550,8 +427,8 @@ class _$SubPartOfLibComponent extends SubPartOfLibComponent { } @override - _$$SubPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$SubPartOfLibProps$JsMap(backingMap); + _$$SubPartOfLibProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$SubPartOfLibProps(backingMap); @override _$$SubPartOfLibProps typedPropsFactory(Map backingMap) => diff --git a/test_fixtures/gold_output_files/mixin_based/basic_two_nine.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/mixin_based/basic_two_nine.over_react.g.dart.goldFile index f00d1ce44..7d886e85d 100644 --- a/test_fixtures/gold_output_files/mixin_based/basic_two_nine.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/mixin_based/basic_two_nine.over_react.g.dart.goldFile @@ -21,29 +21,23 @@ final $BasicComponentFactory = registerComponent2( parentType: null, ); -_$$BasicProps _$Basic([Map backingProps]) => backingProps == null - ? _$$BasicProps$JsMap(JsBackedMap()) - : _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => _$$BasicProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicProps extends UiProps +class _$$BasicProps extends UiProps with BasicProps, // If this generated mixin is undefined, it's likely because BasicProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicProps, and check that $BasicProps is exported/imported properly. $BasicProps { - _$$BasicProps._(); + _$$BasicProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); - factory _$$BasicProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicProps$PlainMap(backingMap); - } - } + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -83,43 +77,6 @@ abstract class _$$BasicProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$PlainMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicProps$JsMap extends _$$BasicProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -127,10 +84,10 @@ class _$$BasicProps$JsMap extends _$$BasicProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$BasicComponent extends BasicComponent { - _$$BasicProps$JsMap _cachedTypedProps; + _$$BasicProps _cachedTypedProps; @override - _$$BasicProps$JsMap get props => _cachedTypedProps; + _$$BasicProps get props => _cachedTypedProps; @override set props(Map value) { @@ -147,8 +104,8 @@ class _$BasicComponent extends BasicComponent { } @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$BasicProps$JsMap(backingMap); + _$$BasicProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$BasicProps(backingMap); @override _$$BasicProps typedPropsFactory(Map backingMap) => _$$BasicProps(backingMap); diff --git a/test_fixtures/gold_output_files/mixin_based/missing_over_react_g_part/library.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/mixin_based/missing_over_react_g_part/library.over_react.g.dart.goldFile index a946f723a..c5a17450f 100644 --- a/test_fixtures/gold_output_files/mixin_based/missing_over_react_g_part/library.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/mixin_based/missing_over_react_g_part/library.over_react.g.dart.goldFile @@ -22,29 +22,24 @@ final $BasicPartOfLibComponentFactory = registerComponent2( ); _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => - backingProps == null - ? _$$BasicPartOfLibProps$JsMap(JsBackedMap()) - : _$$BasicPartOfLibProps(backingProps); + _$$BasicPartOfLibProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$BasicPartOfLibProps extends UiProps +class _$$BasicPartOfLibProps extends UiProps with BasicPartOfLibProps, // If this generated mixin is undefined, it's likely because BasicPartOfLibProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of BasicPartOfLibProps, and check that $BasicPartOfLibProps is exported/imported properly. $BasicPartOfLibProps { - _$$BasicPartOfLibProps._(); - - factory _$$BasicPartOfLibProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$BasicPartOfLibProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$BasicPartOfLibProps$PlainMap(backingMap); - } - } + _$$BasicPartOfLibProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -81,43 +76,6 @@ abstract class _$$BasicPartOfLibProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$BasicPartOfLibProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicPartOfLibProps$PlainMap extends _$$BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$BasicPartOfLibProps$JsMap extends _$$BasicPartOfLibProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$BasicPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -125,10 +83,10 @@ class _$$BasicPartOfLibProps$JsMap extends _$$BasicPartOfLibProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { - _$$BasicPartOfLibProps$JsMap _cachedTypedProps; + _$$BasicPartOfLibProps _cachedTypedProps; @override - _$$BasicPartOfLibProps$JsMap get props => _cachedTypedProps; + _$$BasicPartOfLibProps get props => _cachedTypedProps; @override set props(Map value) { @@ -145,8 +103,8 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { } @override - _$$BasicPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$BasicPartOfLibProps$JsMap(backingMap); + _$$BasicPartOfLibProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$BasicPartOfLibProps(backingMap); @override _$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => diff --git a/test_fixtures/gold_output_files/mixin_based/two_nine_with_multiple_factories.over_react.g.dart.goldfile b/test_fixtures/gold_output_files/mixin_based/two_nine_with_multiple_factories.over_react.g.dart.goldfile index 870f87626..2a7de8bf5 100644 --- a/test_fixtures/gold_output_files/mixin_based/two_nine_with_multiple_factories.over_react.g.dart.goldfile +++ b/test_fixtures/gold_output_files/mixin_based/two_nine_with_multiple_factories.over_react.g.dart.goldfile @@ -21,16 +21,14 @@ final $CounterComponentFactory = registerComponent2( parentType: null, ); -_$$CounterProps _$_Counter([Map backingProps]) => backingProps == null - ? _$$CounterProps$JsMap(JsBackedMap()) - : _$$CounterProps(backingProps); +_$$CounterProps _$_Counter([Map backingProps]) => _$$CounterProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$CounterProps extends UiProps +class _$$CounterProps extends UiProps with CounterPropsMixin, // If this generated mixin is undefined, it's likely because CounterPropsMixin is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of CounterPropsMixin, and check that $CounterPropsMixin is exported/imported properly. @@ -40,15 +38,11 @@ abstract class _$$CounterProps extends UiProps $ConnectPropsMixin implements CounterProps { - _$$CounterProps._(); - - factory _$$CounterProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$CounterProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$CounterProps$PlainMap(backingMap); - } - } + _$$CounterProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -86,43 +80,6 @@ abstract class _$$CounterProps extends UiProps /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$CounterProps = getPropKey; -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CounterProps$PlainMap extends _$$CounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CounterProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$CounterProps$JsMap extends _$$CounterProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$CounterProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - // Concrete component implementation mixin. // // Implements typed props/state factories, defaults `consumedPropKeys` to the keys @@ -130,10 +87,10 @@ class _$$CounterProps$JsMap extends _$$CounterProps { @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') class _$CounterComponent extends CounterComponent { - _$$CounterProps$JsMap _cachedTypedProps; + _$$CounterProps _cachedTypedProps; @override - _$$CounterProps$JsMap get props => _cachedTypedProps; + _$$CounterProps get props => _cachedTypedProps; @override set props(Map value) { @@ -150,8 +107,8 @@ class _$CounterComponent extends CounterComponent { } @override - _$$CounterProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - _$$CounterProps$JsMap(backingMap); + _$$CounterProps typedPropsFactoryJs(JsBackedMap backingMap) => + _$$CounterProps(backingMap); @override _$$CounterProps typedPropsFactory(Map backingMap) => diff --git a/test_fixtures/gold_output_files/mixin_based/type_parameters.over_react.g.dart.goldFile b/test_fixtures/gold_output_files/mixin_based/type_parameters.over_react.g.dart.goldFile index 3c0691ce3..54b22a581 100644 --- a/test_fixtures/gold_output_files/mixin_based/type_parameters.over_react.g.dart.goldFile +++ b/test_fixtures/gold_output_files/mixin_based/type_parameters.over_react.g.dart.goldFile @@ -193,29 +193,23 @@ const PropsMeta _$metaForDoubleProps = PropsMeta( keys: $DoubleProps.$propKeys, ); -_$$SingleProps _$Single([Map backingProps]) => backingProps == null - ? _$$SingleProps$JsMap(JsBackedMap()) - : _$$SingleProps(backingProps); +_$$SingleProps _$Single([Map backingProps]) => _$$SingleProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SingleProps extends UiProps +class _$$SingleProps extends UiProps with SingleProps, // If this generated mixin is undefined, it's likely because SingleProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SingleProps, and check that $SingleProps is exported/imported properly. $SingleProps { - _$$SingleProps._(); - - factory _$$SingleProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SingleProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$SingleProps$PlainMap(backingMap); - } - } + _$$SingleProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -245,68 +239,25 @@ abstract class _$$SingleProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SingleProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SingleProps$PlainMap extends _$$SingleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SingleProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SingleProps$JsMap extends _$$SingleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SingleProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - _$$SingleWithBoundProps _$SingleWithBound([Map backingProps]) => - backingProps == null - ? _$$SingleWithBoundProps$JsMap(JsBackedMap()) - : _$$SingleWithBoundProps(backingProps); + _$$SingleWithBoundProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$SingleWithBoundProps extends UiProps +class _$$SingleWithBoundProps extends UiProps with SingleWithBoundProps, // If this generated mixin is undefined, it's likely because SingleWithBoundProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of SingleWithBoundProps, and check that $SingleWithBoundProps is exported/imported properly. $SingleWithBoundProps { - _$$SingleWithBoundProps._(); - - factory _$$SingleWithBoundProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$SingleWithBoundProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$SingleWithBoundProps$PlainMap(backingMap); - } - } + _$$SingleWithBoundProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -337,69 +288,23 @@ abstract class _$$SingleWithBoundProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$SingleWithBoundProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SingleWithBoundProps$PlainMap - extends _$$SingleWithBoundProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SingleWithBoundProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$SingleWithBoundProps$JsMap - extends _$$SingleWithBoundProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$SingleWithBoundProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - -_$$DoubleProps _$Double([Map backingProps]) => backingProps == null - ? _$$DoubleProps$JsMap(JsBackedMap()) - : _$$DoubleProps(backingProps); +_$$DoubleProps _$Double([Map backingProps]) => _$$DoubleProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$DoubleProps extends UiProps +class _$$DoubleProps extends UiProps with DoubleProps, // If this generated mixin is undefined, it's likely because DoubleProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of DoubleProps, and check that $DoubleProps is exported/imported properly. $DoubleProps { - _$$DoubleProps._(); - - factory _$$DoubleProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$DoubleProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$DoubleProps$PlainMap(backingMap); - } - } + _$$DoubleProps([Map backingMap]) : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -429,54 +334,15 @@ abstract class _$$DoubleProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$DoubleProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DoubleProps$PlainMap extends _$$DoubleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoubleProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$DoubleProps$JsMap extends _$$DoubleProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$DoubleProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - -_$$ConcreteNoneProps _$ConcreteNone([Map backingProps]) => backingProps == null - ? _$$ConcreteNoneProps$JsMap(JsBackedMap()) - : _$$ConcreteNoneProps(backingProps); +_$$ConcreteNoneProps _$ConcreteNone([Map backingProps]) => + _$$ConcreteNoneProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ConcreteNoneProps extends UiProps +class _$$ConcreteNoneProps extends UiProps with NoneProps, // If this generated mixin is undefined, it's likely because NoneProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of NoneProps, and check that $NoneProps is exported/imported properly. @@ -495,15 +361,12 @@ abstract class _$$ConcreteNoneProps extends UiProps $DoubleProps implements ConcreteNoneProps { - _$$ConcreteNoneProps._(); - - factory _$$ConcreteNoneProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ConcreteNoneProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$ConcreteNoneProps$PlainMap(backingMap); - } - } + _$$ConcreteNoneProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -542,54 +405,15 @@ abstract class _$$ConcreteNoneProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ConcreteNoneProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ConcreteNoneProps$PlainMap extends _$$ConcreteNoneProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConcreteNoneProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ConcreteNoneProps$JsMap extends _$$ConcreteNoneProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConcreteNoneProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - -_$$ConcreteArgsProps _$ConcreteArgs([Map backingProps]) => backingProps == null - ? _$$ConcreteArgsProps$JsMap(JsBackedMap()) - : _$$ConcreteArgsProps(backingProps); +_$$ConcreteArgsProps _$ConcreteArgs([Map backingProps]) => + _$$ConcreteArgsProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. @Deprecated('This API is for use only within generated code.' ' Do not reference it in your code, as it may change at any time.') -abstract class _$$ConcreteArgsProps extends UiProps +class _$$ConcreteArgsProps extends UiProps with NoneProps, // If this generated mixin is undefined, it's likely because NoneProps is not a valid `mixin`-based props mixin, or because it is but the generated mixin was not imported. Check the declaration of NoneProps, and check that $NoneProps is exported/imported properly. @@ -608,15 +432,12 @@ abstract class _$$ConcreteArgsProps extends UiProps $DoubleProps implements ConcreteArgsProps { - _$$ConcreteArgsProps._(); - - factory _$$ConcreteArgsProps(Map backingMap) { - if (backingMap == null || backingMap is JsBackedMap) { - return _$$ConcreteArgsProps$JsMap(backingMap as JsBackedMap); - } else { - return _$$ConcreteArgsProps$PlainMap(backingMap); - } - } + _$$ConcreteArgsProps([Map backingMap]) + : this.props = backingMap ?? JsBackedMap(); + + /// The backing props map proxied by this class. + @override + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -655,42 +476,3 @@ abstract class _$$ConcreteArgsProps extends UiProps /// An alias for [getPropKey] so it can be referenced within the props class impl /// without being shadowed by the `getPropKey` instance extension member. const _$getPropKey$_$$ConcreteArgsProps = getPropKey; - -// Concrete props implementation that can be backed by any [Map]. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ConcreteArgsProps$PlainMap - extends _$$ConcreteArgsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConcreteArgsProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; -} - -// Concrete props implementation that can only be backed by [JsMap], -// allowing dart2js to compile more optimal code for key-value pair reads/writes. -@Deprecated('This API is for use only within generated code.' - ' Do not reference it in your code, as it may change at any time.') -class _$$ConcreteArgsProps$JsMap - extends _$$ConcreteArgsProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ConcreteArgsProps$JsMap(JsBackedMap backingMap) - : this._props = JsBackedMap(), - super._() { - this._props = backingMap ?? JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} diff --git a/web/component1/src/demo_components/button.over_react.g.dart b/web/component1/src/demo_components/button.over_react.g.dart index 9b818b58a..682311c68 100644 --- a/web/component1/src/demo_components/button.over_react.g.dart +++ b/web/component1/src/demo_components/button.over_react.g.dart @@ -263,16 +263,11 @@ _$$ButtonProps _$Button([Map? backingProps]) => _$$ButtonProps(backingProps); class _$$ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin implements ButtonProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ButtonProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ButtonProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -324,16 +319,11 @@ class ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin { class _$$ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin implements ButtonState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ButtonState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$ButtonState([Map? backingMap]) : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/button_group.over_react.g.dart b/web/component1/src/demo_components/button_group.over_react.g.dart index a239e7acf..369833608 100644 --- a/web/component1/src/demo_components/button_group.over_react.g.dart +++ b/web/component1/src/demo_components/button_group.over_react.g.dart @@ -121,16 +121,12 @@ _$$ButtonGroupProps _$ButtonGroup([Map? backingProps]) => class _$$ButtonGroupProps extends _$ButtonGroupProps with _$ButtonGroupPropsAccessorsMixin implements ButtonGroupProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ButtonGroupProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ButtonGroupProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -184,16 +180,12 @@ class ButtonGroupState extends _$ButtonGroupState class _$$ButtonGroupState extends _$ButtonGroupState with _$ButtonGroupStateAccessorsMixin implements ButtonGroupState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ButtonGroupState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$ButtonGroupState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/list_group.over_react.g.dart b/web/component1/src/demo_components/list_group.over_react.g.dart index d5c35acce..cea301497 100644 --- a/web/component1/src/demo_components/list_group.over_react.g.dart +++ b/web/component1/src/demo_components/list_group.over_react.g.dart @@ -73,16 +73,12 @@ _$$ListGroupProps _$ListGroup([Map? backingProps]) => class _$$ListGroupProps extends _$ListGroupProps with _$ListGroupPropsAccessorsMixin implements ListGroupProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ListGroupProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ListGroupProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/list_group_item.over_react.g.dart b/web/component1/src/demo_components/list_group_item.over_react.g.dart index 713471ada..eb87f3822 100644 --- a/web/component1/src/demo_components/list_group_item.over_react.g.dart +++ b/web/component1/src/demo_components/list_group_item.over_react.g.dart @@ -326,16 +326,12 @@ _$$ListGroupItemProps _$ListGroupItem([Map? backingProps]) => class _$$ListGroupItemProps extends _$ListGroupItemProps with _$ListGroupItemPropsAccessorsMixin implements ListGroupItemProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ListGroupItemProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ListGroupItemProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/progress.over_react.g.dart b/web/component1/src/demo_components/progress.over_react.g.dart index 6fe198e0e..ee73727cf 100644 --- a/web/component1/src/demo_components/progress.over_react.g.dart +++ b/web/component1/src/demo_components/progress.over_react.g.dart @@ -307,16 +307,12 @@ _$$ProgressProps _$Progress([Map? backingProps]) => class _$$ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin implements ProgressProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ProgressProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ProgressProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -398,16 +394,12 @@ class ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin { class _$$ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin implements ProgressState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ProgressState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$ProgressState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/tag.over_react.g.dart b/web/component1/src/demo_components/tag.over_react.g.dart index 356ebcae8..b3cc3d541 100644 --- a/web/component1/src/demo_components/tag.over_react.g.dart +++ b/web/component1/src/demo_components/tag.over_react.g.dart @@ -98,16 +98,11 @@ _$$TagProps _$Tag([Map? backingProps]) => _$$TagProps(backingProps); class _$$TagProps extends _$TagProps with _$TagPropsAccessorsMixin implements TagProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$TagProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$TagProps([Map? backingMap]) : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/toggle_button.over_react.g.dart b/web/component1/src/demo_components/toggle_button.over_react.g.dart index 1be1a1d8f..8339e7eae 100644 --- a/web/component1/src/demo_components/toggle_button.over_react.g.dart +++ b/web/component1/src/demo_components/toggle_button.over_react.g.dart @@ -162,16 +162,12 @@ _$$ToggleButtonProps _$ToggleButton([Map? backingProps]) => class _$$ToggleButtonProps extends _$ToggleButtonProps with _$ToggleButtonPropsAccessorsMixin implements ToggleButtonProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ToggleButtonProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ToggleButtonProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -275,16 +271,12 @@ class ToggleButtonState extends _$ToggleButtonState class _$$ToggleButtonState extends _$ToggleButtonState with _$ToggleButtonStateAccessorsMixin implements ToggleButtonState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ToggleButtonState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$ToggleButtonState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override diff --git a/web/component1/src/demo_components/toggle_button_group.over_react.g.dart b/web/component1/src/demo_components/toggle_button_group.over_react.g.dart index 4c9f69066..1be1a593b 100644 --- a/web/component1/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/component1/src/demo_components/toggle_button_group.over_react.g.dart @@ -49,16 +49,12 @@ _$$ToggleButtonGroupProps _$ToggleButtonGroup([Map? backingProps]) => class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps with _$ToggleButtonGroupPropsAccessorsMixin implements ToggleButtonGroupProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ToggleButtonGroupProps(Map? backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } + _$$ToggleButtonGroupProps([Map? backingMap]) + : this.props = backingMap ?? JsBackedMap(); /// The backing props map proxied by this class. @override - Map get props => _props; - Map _props; + final Map props; /// Let `UiProps` internals know that this class has been generated. @override @@ -112,16 +108,12 @@ class ToggleButtonGroupState extends _$ToggleButtonGroupState class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState with _$ToggleButtonGroupStateAccessorsMixin implements ToggleButtonGroupState { - // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 - _$$ToggleButtonGroupState(Map? backingMap) : this._state = {} { - this._state = backingMap ?? {}; - } + _$$ToggleButtonGroupState([Map? backingMap]) + : this.state = backingMap ?? JsBackedMap(); /// The backing state map proxied by this class. @override - Map get state => _state; - Map _state; + final Map state; /// Let `UiState` internals know that this class has been generated. @override