From dc7a13d93933e64cd27cadea62fdf1097f0ca7c9 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 23 Aug 2018 12:02:49 -0600 Subject: [PATCH 01/39] Update dart2js flags for testing --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 16c8db597..a8266af89 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,7 +46,6 @@ transformers: - $dart2js: csp: true sourceMaps: true - minify: true suppressHints: false commandLineOptions: - --verbose @@ -54,3 +53,4 @@ transformers: - --use-new-source-info - --show-package-warnings - --enable-experimental-mirrors + - --trust-type-annotations From 9b47b9764b6ccb2e1dedbe0127df4617de71e9ff Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 23 Aug 2018 12:03:41 -0600 Subject: [PATCH 02/39] Support Component2 --- lib/over_react.dart | 2 + lib/src/component/dom_components.dart | 5 +- .../component_declaration/component_base.dart | 299 ++++++++++++++++++ .../transformer_helpers.dart | 63 +++- lib/src/transformer/impl_generation.dart | 4 +- lib/src/util/map_util.dart | 3 +- lib/src/util/react_wrappers.dart | 12 +- pubspec.yaml | 9 + 8 files changed, 388 insertions(+), 9 deletions(-) diff --git a/lib/over_react.dart b/lib/over_react.dart index c116547db..496dde206 100644 --- a/lib/over_react.dart +++ b/lib/over_react.dart @@ -27,6 +27,8 @@ export 'package:react/react.dart' show SyntheticUIEvent, SyntheticWheelEvent; +export 'package:react/src/react_client/js_backed_map.dart' show JsBackedMap; + export 'package:react/react_client.dart' show setClientConfiguration, ReactElement; export 'src/component/abstract_transition.dart'; diff --git a/lib/src/component/dom_components.dart b/lib/src/component/dom_components.dart index e20335b7a..47eadb8b8 100644 --- a/lib/src/component/dom_components.dart +++ b/lib/src/component/dom_components.dart @@ -20,6 +20,7 @@ import 'package:over_react/src/component_declaration/component_base.dart' as com import 'package:over_react/src/component_declaration/transformer_helpers.dart' as transformer_helpers; import 'package:react/react.dart' as react; import 'package:react/react_client.dart'; +import 'package:react/src/react_client/js_backed_map.dart'; /// Returns a new [DomProps], optionally backed by a specified Map. /// @@ -42,7 +43,7 @@ class DomProps extends component_base.UiProps with DomPropsMixin, transformer_helpers.GeneratedClass implements transformer_helpers.UiProps { // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 - DomProps(this.componentFactory, [Map props]) : this.props = props ?? ({}); + DomProps(this.componentFactory, [Map props]) : this.props = props ?? new JsBackedMap(); @override final ReactDomComponentFactoryProxy componentFactory; @@ -63,7 +64,7 @@ class SvgProps extends component_base.UiProps with DomPropsMixin, SvgPropsMixin, transformer_helpers.GeneratedClass implements DomProps { // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 - SvgProps(this.componentFactory, [Map props]) : this.props = props ?? ({}); + SvgProps(this.componentFactory, [Map props]) : this.props = props ?? new JsBackedMap(); @override final ReactDomComponentFactoryProxy componentFactory; diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index a98062955..830230aa5 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -35,6 +35,7 @@ import 'package:over_react/src/util/ddc_emulated_function_name_bug.dart' as ddc_ import 'package:over_react/src/util/test_mode.dart'; import 'package:react/react.dart' as react; import 'package:react/react_client.dart'; +import 'package:react/src/react_client/js_backed_map.dart'; import 'package:w_common/disposable.dart'; export 'package:over_react/src/component_declaration/component_type_checking.dart' show isComponentOfType, isValidElementOfType; @@ -386,6 +387,259 @@ abstract class UiComponent extends react.Component imple // ---------------------------------------------------------------------- } +abstract class UiComponent2 extends react.Component2 implements DisposableManagerV7 { + @override + Map getDefaultProps() => new JsBackedMap(); + + Disposable _disposableProxy; + + /// The props for the non-forwarding props defined in this component. + Iterable get consumedProps => null; + + /// Returns a copy of this component's props with keys found in [consumedProps] omitted. + /// + /// > Should be used alongside [forwardingClassNameBuilder]. + /// + /// > Related [copyUnconsumedDomProps] + Map copyUnconsumedProps() { + var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; + + return copyProps(keySetsToOmit: consumedPropKeys); + } + + /// Returns a copy of this component's props with keys found in [consumedProps] and non-DOM props omitted. + /// + /// > Should be used alongside [forwardingClassNameBuilder]. + /// + /// > Related [copyUnconsumedProps] + Map copyUnconsumedDomProps() { + var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; + + return copyProps(onlyCopyDomProps: true, keySetsToOmit: consumedPropKeys); + } + + /// Returns a copy of this component's props with React props optionally omitted, and + /// with the specified [keysToOmit] and [keySetsToOmit] omitted. + Map copyProps({bool omitReservedReactProps: true, bool onlyCopyDomProps: false, Iterable keysToOmit, Iterable keySetsToOmit}) { + return getPropsToForward(this.props, + omitReactProps: omitReservedReactProps, + onlyCopyDomProps: onlyCopyDomProps, + keysToOmit: keysToOmit, + keySetsToOmit: keySetsToOmit + ); + } + + /// Throws a [PropError] if [appliedProps] are invalid. + /// + /// This is called automatically with the latest props available during [componentWillReceiveProps] and + /// [componentWillMount], and can also be called manually for custom validation. + /// + /// Override with a custom implementation to easily add validation (and don't forget to call super!) + /// + /// @mustCallSuper + /// void validateProps(Map appliedProps) { + /// super.validateProps(appliedProps); + /// + /// var tProps = typedPropsFactory(appliedProps); + /// if (tProps.items.length.isOdd) { + /// throw new PropError.value(tProps.items, 'items', 'must have an even number of items, because reasons'); + /// } + /// } + @mustCallSuper + void validateProps(Map appliedProps) { + validateRequiredProps(appliedProps); + } + + /// Validates that props with the `@requiredProp` annotation are present. + void validateRequiredProps(Map appliedProps) { + consumedProps?.forEach((ConsumedProps consumedProps) { + consumedProps.props.forEach((PropDescriptor prop) { + if (!prop.isRequired) return; + if (prop.isNullable && appliedProps.containsKey(prop.key)) return; + if (!prop.isNullable && appliedProps[prop.key] != null) return; + + throw new PropError.required(prop.key, prop.errorMessage); + }); + }); + } + + /// Returns a new ClassNameBuilder with className and blacklist values added from [CssClassPropsMixin.className] and + /// [CssClassPropsMixin.classNameBlacklist], if they are specified. + /// + /// This method should be used as the basis for the classNames of components receiving forwarded props. + /// + /// > Should be used alongside [copyUnconsumedProps] or [copyUnconsumedDomProps]. + ClassNameBuilder forwardingClassNameBuilder() { + return new ClassNameBuilder.fromProps(this.props); + } + + @override + @mustCallSuper + void componentWillReceiveProps(Map nextProps) { + if (inReactDevMode) { + validateProps(nextProps); + } + } + + @override + @mustCallSuper + void componentWillMount() { + if (inReactDevMode) { + validateProps(props); + } + } + + @override + @mustCallSuper + void componentWillUnmount() { + _disposableProxy?.dispose(); + } + + + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // BEGIN Typed props helpers + // + + var _typedPropsCache = new Expando(); + + /// A typed props object corresponding to the current untyped props Map ([unwrappedProps]). + /// + /// Created using [typedPropsFactory] and cached for each Map instance. + @override + TProps get props { + var unwrappedProps = this.unwrappedProps; + var typedProps = _typedPropsCache[unwrappedProps]; + if (typedProps == null) { + typedProps = typedPropsFactory(unwrappedProps); + _typedPropsCache[unwrappedProps] = typedProps; + } + return typedProps; + } + /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. + @override + set props(Map value) => super.props = value; + + /// The props Map that will be used to create the typed [props] object. + Map get unwrappedProps => super.props; + set unwrappedProps(Map value) => super.props = value; + + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + TProps typedPropsFactory(Map propsMap); + + /// Returns a typed props object backed by a new Map. + /// + /// Convenient for use with [getDefaultProps]. + TProps newProps() => typedPropsFactory(new JsBackedMap()); + + // + // END Typed props helpers + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // BEGIN DisposableManagerV7 interface implementation + // + + @override + Future awaitBeforeDispose(Future future) => + _getDisposableProxy().awaitBeforeDispose(future); + + @override + Future getManagedDelayedFuture(Duration duration, T callback()) => + _getDisposableProxy().getManagedDelayedFuture(duration, callback); + + @override + ManagedDisposer getManagedDisposer(Disposer disposer) => _getDisposableProxy().getManagedDisposer(disposer); + + @override + Timer getManagedPeriodicTimer(Duration duration, void callback(Timer timer)) => + _getDisposableProxy().getManagedPeriodicTimer(duration, callback); + + @override + Timer getManagedTimer(Duration duration, void callback()) => + _getDisposableProxy().getManagedTimer(duration, callback); + + @override + StreamSubscription listenToStream( + Stream stream, void onData(T event), + {Function onError, void onDone(), bool cancelOnError}) => + _getDisposableProxy().listenToStream( + stream, onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); + + @override + Disposable manageAndReturnDisposable(Disposable disposable) => + _getDisposableProxy().manageAndReturnDisposable(disposable); + + @override + Completer manageCompleter(Completer completer) => + _getDisposableProxy().manageCompleter(completer); + + @override + void manageDisposable(Disposable disposable) => + _getDisposableProxy().manageDisposable(disposable); + + /// DEPRECATED. Use [getManagedDisposer] instead. + @Deprecated('2.0.0') + @override + void manageDisposer(Disposer disposer) => + _getDisposableProxy().manageDisposer(disposer); + + @override + void manageStreamController(StreamController controller) => + _getDisposableProxy().manageStreamController(controller); + + /// DEPRECATED. Use [listenToStream] instead. + @Deprecated('2.0.0') + @override + void manageStreamSubscription(StreamSubscription subscription) => + _getDisposableProxy().manageStreamSubscription(subscription); + + /// Instantiates a new [Disposable] instance on the first call to the + /// [DisposableManagerV7] method. + Disposable _getDisposableProxy() { + if (_disposableProxy == null) { + _disposableProxy = new Disposable(); + } + return _disposableProxy; + } + + /// Automatically dispose another object when this object is disposed. + /// + /// This method is an extension to `manageAndReturnDisposable` and returns the + /// passed in [Disposable] as its original type in addition to handling its + /// disposal. The method should be used when a variable is set and should + /// conditionally be managed for disposal. The most common case will be dealing + /// with optional parameters: + /// + /// class MyDisposable extends Disposable { + /// // This object also extends disposable + /// MyObject _internal; + /// + /// MyDisposable({MyObject optional}) { + /// // If optional is injected, we should not manage it. + /// // If we create our own internal reference we should manage it. + /// _internal = optional ?? + /// manageAndReturnTypedDisposable(new MyObject()); + /// } + /// + /// // ... + /// } + /// + /// The parameter may not be `null`. + @override + T manageAndReturnTypedDisposable(T disposable) => + _disposableProxy.manageAndReturnTypedDisposable(disposable); + + // + // END DisposableManagerV7 interface implementation + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- +} + /// The basis for a _stateful_ over_react component. /// /// Includes support for strongly-typed [UiState] in-addition-to the @@ -456,6 +710,51 @@ abstract class UiStatefulComponent extends UiComponent2 { + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // BEGIN Typed state helpers + // + + var _typedStateCache = new Expando(); + + /// A typed state object corresponding to the current untyped state Map ([unwrappedState]). + /// + /// Created using [typedStateFactory] and cached for each Map instance. + @override + TState get state { + var unwrappedState = this.unwrappedState; + var typedState = _typedStateCache[unwrappedState]; + if (typedState == null) { + typedState = typedStateFactory(unwrappedState); + _typedStateCache[unwrappedState] = typedState; + } + return typedState; + } + /// Equivalent to setting [unwrappedState], but needed by react-dart to effect state changes. + @override + set state(Map value) => super.state = value; + + /// The state Map that will be used to create the typed [state] object. + Map get unwrappedState => super.state; + set unwrappedState(Map value) => super.state = value; + + /// Returns a typed state object backed by the specified [stateMap]. + /// + /// Required to properly instantiate the generic [TState] class. + TState typedStateFactory(Map stateMap); + + /// Returns a typed state object backed by a new Map. + /// + /// Convenient for use with [getInitialState] and [setState]. + TState newState() => typedStateFactory(new JsBackedMap()); + + // + // END Typed state helpers + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- +} + /// A `dart.collection.MapView`-like class with strongly-typed getters/setters for React state. /// diff --git a/lib/src/component_declaration/transformer_helpers.dart b/lib/src/component_declaration/transformer_helpers.dart index 274c7f7e0..b702c2cb0 100644 --- a/lib/src/component_declaration/transformer_helpers.dart +++ b/lib/src/component_declaration/transformer_helpers.dart @@ -19,7 +19,7 @@ import './annotations.dart' as annotations; export './annotations.dart'; export './component_base.dart' - hide UiComponent, UiStatefulComponent, UiProps, UiState; + hide UiComponent, UiStatefulComponent, UiComponent2, UiStatefulComponent2, UiProps, UiState; // ---------------------------------------------------------------------- // Helpers and extras consumable by generated code and consumers of @@ -113,6 +113,30 @@ abstract class UiComponent extends component_base.UiComp TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); } +abstract class UiComponent2 extends component_base.UiComponent2 with GeneratedClass { + /// This class should not be instantiated directly, and throws an error to indicate this. + UiComponent2() { + _throwIfNotGenerated(); + } + + /// The default consumed props, taken from the keys generated in the associated @[annotations.Props] class. + @toBeGenerated + Iterable get $defaultConsumedProps => throw new UngeneratedError(member: #$defaultConsumedProps); + + /// The keys for the non-forwarding props defined in this component. + /// + /// For generated components, this defaults to the keys generated in the associated @[annotations.Props] class + /// if this getter is not overridden. + @override + Iterable get consumedProps => $defaultConsumedProps; + + /// Returns a typed props object backed by the specified [propsMap]. + /// Required to properly instantiate the generic [TProps] class. + @override + @toBeGenerated + TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); +} + /// See: [component_base.UiStatefulComponent] /// @@ -154,6 +178,43 @@ abstract class UiStatefulComponent + extends component_base.UiStatefulComponent2 with GeneratedClass { + /// This class should not be instantiated directly, and throws an error to indicate this. + UiStatefulComponent2() { + _throwIfNotGenerated(); + } + + /// The default consumed prop keys, taken from the keys generated in the associated @[annotations.Props] class. + @toBeGenerated + Iterable get $defaultConsumedProps => throw new UngeneratedError(member: #$defaultConsumedProps); + + /// The keys for the non-forwarding props defined in this component. + /// + /// For generated components, this defaults to the keys generated in the associated @[annotations.Props] class + /// if this getter is not overridden. + @override + Iterable get consumedProps => $defaultConsumedProps; + + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + @override + @toBeGenerated + TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); + + /// Returns a typed state object backed by the specified [stateMap]. + /// + /// Required to properly instantiate the generic [TState] class. + @override @toBeGenerated TState typedStateFactory(Map stateMap) => throw new UngeneratedError(member: #typedStateFactory, message: + '${#typedStateFactory}` should be implemented by code generation.\n\n' + 'This error may be due to your `UiState` class not being annotated with `@State()`,\n' + 'or because you are extending a stateful component without redeclaring your own `@State()`, like so:\n\n' + ' @State()\n' + ' class MyState extends SuperState {}\n' + ); +} + /// A [dart.collection.MapView]-like class with strongly-typed getters/setters for React props that /// is also capable of creating React component instances. /// diff --git a/lib/src/transformer/impl_generation.dart b/lib/src/transformer/impl_generation.dart index 67261504d..5c72b199f 100644 --- a/lib/src/transformer/impl_generation.dart +++ b/lib/src/transformer/impl_generation.dart @@ -179,7 +179,7 @@ class ImplGenerator { ..writeln(' final Map props;') ..writeln() // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 - ..writeln(' $propsImplName(Map backingMap) : this.props = backingMap ?? ({});') + ..writeln(' $propsImplName(Map backingMap) : this.props = backingMap ?? new JsBackedMap();') ..writeln() ..writeln(' /// Let [UiProps] internals know that this class has been generated.') ..writeln(' @override') @@ -226,7 +226,7 @@ class ImplGenerator { ..writeln(' final Map state;') ..writeln() // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 - ..writeln(' $stateImplName(Map backingMap) : this.state = backingMap ?? ({});') + ..writeln(' $stateImplName(Map backingMap) : this.state = backingMap ?? new JsBackedMap();') ..writeln() ..writeln(' /// Let [UiState] internals know that this class has been generated.') ..writeln(' @override') diff --git a/lib/src/util/map_util.dart b/lib/src/util/map_util.dart index e908ce439..c005d5eae 100644 --- a/lib/src/util/map_util.dart +++ b/lib/src/util/map_util.dart @@ -19,6 +19,7 @@ import 'dart:collection'; import 'package:over_react/src/component_declaration/transformer_helpers.dart'; import 'package:over_react/src/component/dom_components.dart'; import 'package:over_react/src/component/prop_mixins.dart'; +import 'package:react/src/react_client/js_backed_map.dart'; /// Returns a copy of the specified [props] map, omitting reserved React props by default, /// in addition to any specified [keysToOmit] or [keySetsToOmit]. @@ -32,7 +33,7 @@ Map getPropsToForward(Map props, { Iterable keysToOmit, Iterable keySetsToOmit }) { - Map propsToForward = new Map.from(props); + Map propsToForward = new JsBackedMap.from(props); if (omitReactProps) { propsToForward diff --git a/lib/src/util/react_wrappers.dart b/lib/src/util/react_wrappers.dart index e90d257c5..b8aafdff1 100644 --- a/lib/src/util/react_wrappers.dart +++ b/lib/src/util/react_wrappers.dart @@ -222,18 +222,24 @@ dynamic preparePropsChangeset(ReactElement element, Map newProps, [Iterable newC final internal = _getInternal(element); if (internal == null) { - // Plain JS component + // react-dart Component2, JS composite component, DOM component if (newProps == null) { propsChangeset = null; } else { - if (isDomElement(element)) { + final type = element.type; + if (type is String) { // DOM component // Convert props for DOM components so that style Maps and event handlers // are properly converted. Map convertedProps = new Map.from(newProps); ReactDomComponentFactoryProxy.convertProps(convertedProps); propsChangeset = jsify(convertedProps); } else { - propsChangeset = jsify(newProps); + final ReactClass reactClass = type; + if (reactClass.isDartClass == true) { + propsChangeset = ReactDartComponentFactoryProxy2.generateExtendedJsProps(newProps); + } else { + propsChangeset = jsify(newProps); + } } } } else { diff --git a/pubspec.yaml b/pubspec.yaml index a8266af89..f133ebb5c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,3 +54,12 @@ transformers: - --show-package-warnings - --enable-experimental-mirrors - --trust-type-annotations + + + +dependency_overrides: + react: + git: + url: git@github.com:greglittlefield-wf/react-dart.git + ref: 23564359c261ac2706a8027d5715cf257aac9e50 # from js_map_perf/dart_1 + From 4208192025284ffea8e32f922a00e7d42a095546 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 23 Aug 2018 15:22:17 -0600 Subject: [PATCH 03/39] Optimize typed props caching --- .../component_declaration/component_base.dart | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 830230aa5..3ac1aafc6 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -501,24 +501,20 @@ abstract class UiComponent2 extends react.Component2 imp // BEGIN Typed props helpers // - var _typedPropsCache = new Expando(); + TProps _cachedTypedProps; /// A typed props object corresponding to the current untyped props Map ([unwrappedProps]). /// /// Created using [typedPropsFactory] and cached for each Map instance. @override - TProps get props { - var unwrappedProps = this.unwrappedProps; - var typedProps = _typedPropsCache[unwrappedProps]; - if (typedProps == null) { - typedProps = typedPropsFactory(unwrappedProps); - _typedPropsCache[unwrappedProps] = typedProps; - } - return typedProps; - } + TProps get props => _cachedTypedProps ??= typedPropsFactory(unwrappedProps); + /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. @override - set props(Map value) => super.props = value; + set props(Map value) { + super.props = value; + _cachedTypedProps = null; + } /// The props Map that will be used to create the typed [props] object. Map get unwrappedProps => super.props; From 6f32516bcbfe5c017ea95d94e77094ef4950ac1a Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 23 Aug 2018 15:25:55 -0600 Subject: [PATCH 04/39] Optimize props so that dart2js knows it's always using a JsBackedMap --- .../component_declaration/component_base.dart | 5 ++- .../transformer_helpers.dart | 8 ++++ lib/src/transformer/impl_generation.dart | 37 ++++++++++++++----- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 3ac1aafc6..c377bc188 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -507,7 +507,7 @@ abstract class UiComponent2 extends react.Component2 imp /// /// Created using [typedPropsFactory] and cached for each Map instance. @override - TProps get props => _cachedTypedProps ??= typedPropsFactory(unwrappedProps); + TProps get props => _cachedTypedProps ??= typedPropsFactoryJs(unwrappedProps); /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. @override @@ -524,11 +524,12 @@ abstract class UiComponent2 extends react.Component2 imp /// /// Required to properly instantiate the generic [TProps] class. TProps typedPropsFactory(Map propsMap); + TProps typedPropsFactoryJs(JsBackedMap propsMap); /// Returns a typed props object backed by a new Map. /// /// Convenient for use with [getDefaultProps]. - TProps newProps() => typedPropsFactory(new JsBackedMap()); + TProps newProps() => typedPropsFactoryJs(new JsBackedMap()); // // END Typed props helpers diff --git a/lib/src/component_declaration/transformer_helpers.dart b/lib/src/component_declaration/transformer_helpers.dart index b702c2cb0..e74f2de2a 100644 --- a/lib/src/component_declaration/transformer_helpers.dart +++ b/lib/src/component_declaration/transformer_helpers.dart @@ -16,6 +16,7 @@ library over_react.component_declaration.transformer_helpers; import './component_base.dart' as component_base; import './annotations.dart' as annotations; +import 'package:react/src/react_client/js_backed_map.dart'; export './annotations.dart'; export './component_base.dart' @@ -135,6 +136,7 @@ abstract class UiComponent2 extends component_base.UiCom @override @toBeGenerated TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); + TProps typedPropsFactoryJs(JsBackedMap propsMap) => throw new UngeneratedError(member: #typedPropsFactoryJs); } @@ -202,6 +204,12 @@ abstract class UiStatefulComponent2 throw new UngeneratedError(member: #typedPropsFactory); + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + @override + @toBeGenerated + TProps typedPropsFactoryJs(JsBackedMap propsMap) => throw new UngeneratedError(member: #typedPropsFactoryJs); /// Returns a typed state object backed by the specified [stateMap]. /// diff --git a/lib/src/transformer/impl_generation.dart b/lib/src/transformer/impl_generation.dart index 5c72b199f..dfba291e5 100644 --- a/lib/src/transformer/impl_generation.dart +++ b/lib/src/transformer/impl_generation.dart @@ -117,7 +117,7 @@ class ImplGenerator { declarations.factory.node.variables.variables.first.name.end, declarations.factory.node.semicolon.offset ), - ' = ([Map backingProps]) => new $propsImplName(backingProps)' + ' = ([Map backingProps]) => backingProps == null ? new ${propsImplName}_JsMap(new JsBackedMap()) : new $propsImplName(backingProps)' ); String parentTypeParam = 'null'; @@ -173,13 +173,16 @@ class ImplGenerator { ..writeln('// Concrete props implementation.') ..writeln('//') ..writeln('// Implements constructor and backing map, and links up to generated component factory.') - ..writeln('class $propsImplName extends $propsName {') - ..writeln(' /// The backing props map proxied by this class.') - ..writeln(' @override') - ..writeln(' final Map props;') - ..writeln() - // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 - ..writeln(' $propsImplName(Map backingMap) : this.props = backingMap ?? new JsBackedMap();') + ..writeln('abstract class $propsImplName extends $propsName {') + // todo extra constructor for use by factory + ..writeln(' $propsImplName._();') + ..writeln(' factory $propsImplName(Map backingMap) {') + ..writeln(' if (backingMap is JsBackedMap) {') + ..writeln(' return new ${propsImplName}_JsMap(backingMap);') + ..writeln(' } else {') + ..writeln(' return new ${propsImplName}_Map(backingMap);') + ..writeln(' }') + ..writeln(' }') ..writeln() ..writeln(' /// Let [UiProps] internals know that this class has been generated.') ..writeln(' @override') @@ -198,6 +201,20 @@ class ImplGenerator { ..writeln(' @override') ..writeln(' call([children, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40]);') ..writeln('}') + ..writeln('class ${propsImplName}_Map extends $propsImplName {') + ..writeln(' /// The backing props map proxied by this class.') + ..writeln(' @override') + ..writeln(' final Map props;') + ..writeln() + ..writeln(' ${propsImplName}_Map(Map backingMap) : this.props = backingMap, super._();') + ..writeln('}') + ..writeln('class ${propsImplName}_JsMap extends $propsImplName {') + ..writeln(' /// The backing props map proxied by this class.') + ..writeln(' @override') + ..writeln(' final JsBackedMap props;') + ..writeln() + ..writeln(' ${propsImplName}_JsMap(JsBackedMap backingMap) : this.props = backingMap, super._();') + ..writeln('}') ..writeln(); typedPropsFactoryImpl = @@ -205,7 +222,9 @@ class ImplGenerator { // Don't type this so that it doesn't interfere with classes with generic parameter props type: // class FooComponent extends UiComponent {...} // TODO use long-term solution of component impl class instantiated via factory constructor - 'typedPropsFactory(Map backingMap) => new $propsImplName(backingMap) as dynamic;'; + 'typedPropsFactory(Map backingMap) => new $propsImplName(backingMap) as dynamic;' + '@override ' + '${propsImplName}_JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new ${propsImplName}_JsMap(backingMap) as dynamic;';; // ---------------------------------------------------------------------- // State implementation From 81fd68fd65ef47acb867b2d0704caf3e441d0e8e Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 23 Aug 2018 17:15:47 -0600 Subject: [PATCH 05/39] Optimize cachedTypedProps impl --- lib/src/component_declaration/component_base.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index c377bc188..f586ea854 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -507,13 +507,13 @@ abstract class UiComponent2 extends react.Component2 imp /// /// Created using [typedPropsFactory] and cached for each Map instance. @override - TProps get props => _cachedTypedProps ??= typedPropsFactoryJs(unwrappedProps); + TProps get props => _cachedTypedProps; /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. @override set props(Map value) { super.props = value; - _cachedTypedProps = null; + _cachedTypedProps = typedPropsFactoryJs(value); } /// The props Map that will be used to create the typed [props] object. From cce8d79ed620c750f5846ed13f54040fed539718 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 23 Aug 2018 17:17:36 -0600 Subject: [PATCH 06/39] Get $index to output --- .../component_declaration/component_base.dart | 5 +---- lib/src/transformer/impl_generation.dart | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index f586ea854..5c411b2e8 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -501,19 +501,16 @@ abstract class UiComponent2 extends react.Component2 imp // BEGIN Typed props helpers // - TProps _cachedTypedProps; - /// A typed props object corresponding to the current untyped props Map ([unwrappedProps]). /// /// Created using [typedPropsFactory] and cached for each Map instance. @override - TProps get props => _cachedTypedProps; + TProps get props; /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. @override set props(Map value) { super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); } /// The props Map that will be used to create the typed [props] object. diff --git a/lib/src/transformer/impl_generation.dart b/lib/src/transformer/impl_generation.dart index dfba291e5..afed981f2 100644 --- a/lib/src/transformer/impl_generation.dart +++ b/lib/src/transformer/impl_generation.dart @@ -217,6 +217,19 @@ class ImplGenerator { ..writeln('}') ..writeln(); + // This implementation here is necessary so that mixin accesses aren't compiled as index$ax + final propsGetterTyping = ''' + ${propsImplName}_JsMap _cachedTypedProps; + @override + ${propsImplName}_JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + '''.split('\n').join(' '); + typedPropsFactoryImpl = '@override ' // Don't type this so that it doesn't interfere with classes with generic parameter props type: @@ -319,6 +332,10 @@ class ImplGenerator { ' /* GENERATED IMPLEMENTATIONS */ $typedPropsFactoryImpl $typedStateFactoryImpl' ); } + transformedFile.insert( + sourceFile.location(declarations.component.node.leftBracket.end), + propsGetterTyping + ); } if (implementations.isNotEmpty) { From 16af7aa9e613d4b00776c20e39365557e9a53bd4 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 5 Mar 2019 13:54:15 -0700 Subject: [PATCH 07/39] Update Component2 check --- lib/src/util/react_wrappers.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/util/react_wrappers.dart b/lib/src/util/react_wrappers.dart index 987b72118..b36442cf2 100644 --- a/lib/src/util/react_wrappers.dart +++ b/lib/src/util/react_wrappers.dart @@ -208,7 +208,7 @@ dynamic preparePropsChangeset(ReactElement element, Map newProps, [Iterable newC propsChangeset = jsify(convertedProps); } else { final ReactClass reactClass = type; - if (reactClass.isDartClass == true) { + if (reactClass.dartComponentVersion == 2) { propsChangeset = ReactDartComponentFactoryProxy2.generateExtendedJsProps(newProps); } else { propsChangeset = jsify(newProps); From 54cd8d2e7b3df6a34eafa4f838dc0811b77d98a0 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 5 Mar 2019 16:41:57 -0700 Subject: [PATCH 08/39] Fix generated code errors/lints --- lib/src/builder/generation/impl_generation.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index 8ea0a4039..e9d780c5f 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -136,7 +136,7 @@ class ImplGenerator { '$propsImplName $privateSourcePrefix$factoryName([Map backingProps]) => ' // FIXME clean up this logic and the null-awares (or lack thereof in the two impl classes) // note: if we remove null-awares will that rbeak stuff like `typedPropsFactory(null)`? Does it even matter? - 'backingProps == null ? new $jsMapImplName(new JsBackedMap()) : new $propsImplName(backingProps)' + 'backingProps == null ? new $jsMapImplName(new JsBackedMap()) : new $propsImplName(backingProps);' ); final String propKeyNamespace = _getAccessorKeyNamespace(declarations.props); @@ -529,11 +529,11 @@ class ImplGenerator { } static String _plainMapPropsImplClassNameFromPropsImplClassName(String implName) { - return '${implName}_PlainMap'; + return '${implName}\$PlainMap'; } static String _jsMapPropsImplClassNameFromPropsImplClassName(String implName) { - return '${implName}_JsMap'; + return '${implName}\$JsMap'; } /// Converts the consumer's written props classname to the consumable props From 2e5faa34a975a122fb68fbd7b4bf6fc54591888e Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 5 Mar 2019 16:42:41 -0700 Subject: [PATCH 09/39] Fix Component2 props/state type errors --- lib/src/component_declaration/component_base.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 728b437a8..377bf03be 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -494,8 +494,11 @@ abstract class UiComponent2 extends react.Component2 imp /// A typed props object corresponding to the current untyped props Map ([unwrappedProps]). /// /// Created using [typedPropsFactory] and cached for each Map instance. + // FIXME explain that this needs to be concrete in Dart 2 for soundness; link to issue @override - TProps get props; + TProps get props { + throw new UngeneratedError(); + } /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. @override @@ -705,15 +708,11 @@ abstract class UiStatefulComponent2 Date: Wed, 6 Mar 2019 10:58:07 -0700 Subject: [PATCH 10/39] Fix bad equality check, update to latest react-dart branch --- analysis_options.yaml | 1 + lib/src/util/react_wrappers.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index c9e17d830..1b9e04758 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -24,3 +24,4 @@ linter: - type_init_formals - unnecessary_brace_in_string_interps - unnecessary_getters_setters + - unrelated_type_equality_checks diff --git a/lib/src/util/react_wrappers.dart b/lib/src/util/react_wrappers.dart index b36442cf2..e4b69042e 100644 --- a/lib/src/util/react_wrappers.dart +++ b/lib/src/util/react_wrappers.dart @@ -208,7 +208,7 @@ dynamic preparePropsChangeset(ReactElement element, Map newProps, [Iterable newC propsChangeset = jsify(convertedProps); } else { final ReactClass reactClass = type; - if (reactClass.dartComponentVersion == 2) { + if (reactClass.dartComponentVersion == '2') { propsChangeset = ReactDartComponentFactoryProxy2.generateExtendedJsProps(newProps); } else { propsChangeset = jsify(newProps); diff --git a/pubspec.yaml b/pubspec.yaml index 39001ad98..d3da39f72 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,5 +45,5 @@ dependency_overrides: react: git: url: git@github.com:greglittlefield-wf/react-dart.git - ref: ee377ec3aee23d58a5f09176e6d6485da1c3ede1 # from js_map_perf/dart_2 + ref: ee873c1843cbeb388199769cd1f4a801f6f613af # from js_map_perf/dart_2 From eb25e3b807573fa33abf264e0b66e7be65cc75b9 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 6 Mar 2019 10:59:08 -0700 Subject: [PATCH 11/39] Commit generated files --- .../abstract_inheritance.over_react.g.dart | 64 +- example/builder/basic.over_react.g.dart | 64 +- .../builder/basic_library.over_react.g.dart | 129 ++- .../basic_with_state.over_react.g.dart | 64 +- .../basic_with_type_params.over_react.g.dart | 64 +- .../generic_inheritance_sub.over_react.g.dart | 65 +- ...eneric_inheritance_super.over_react.g.dart | 65 +- .../private_component.over_react.g.dart | 65 +- ...factory_public_component.over_react.g.dart | 64 +- .../component/resize_sensor.over_react.g.dart | 65 +- ...abstract_transition_test.over_react.g.dart | 65 +- ...mponent_integration_test.over_react.g.dart | 64 +- ...ccessor_integration_test.over_react.g.dart | 64 +- ...ccessor_integration_test.over_react.g.dart | 67 +- ...ccessor_integration_test.over_react.g.dart | 67 +- .../private_props_ddc_bug.over_react.g.dart | 64 +- ...ccessor_integration_test.over_react.g.dart | 64 +- ...d_prop_integration_tests.over_react.g.dart | 64 +- ...mponent_integration_test.over_react.g.dart | 67 +- ...ed_prop_integration_test.over_react.g.dart | 64 +- ...mponent_integration_test.over_react.g.dart | 64 +- ...ccessor_integration_test.over_react.g.dart | 64 +- ...ccessor_integration_test.over_react.g.dart | 67 +- ...ccessor_integration_test.over_react.g.dart | 67 +- .../private_props_ddc_bug.over_react.g.dart | 64 +- ...ccessor_integration_test.over_react.g.dart | 64 +- ...d_prop_integration_tests.over_react.g.dart | 64 +- ...mponent_integration_test.over_react.g.dart | 67 +- ...ed_prop_integration_test.over_react.g.dart | 64 +- .../test_a.over_react.g.dart | 64 +- .../test_b.over_react.g.dart | 64 +- .../extendedtype.over_react.g.dart | 64 +- .../type_inheritance/parent.over_react.g.dart | 65 +- .../subsubtype.over_react.g.dart | 64 +- .../subtype.over_react.g.dart | 65 +- .../flux_component_test.over_react.g.dart | 790 +++++++++++++++--- .../redux_component_test.over_react.g.dart | 195 ++++- ...ummy_composite_component.over_react.g.dart | 67 +- .../util/dom_util_test.over_react.g.dart | 65 +- ...prop_key_util_test_dart2.over_react.g.dart | 64 +- .../one_level_wrapper.over_react.g.dart | 64 +- .../two_level_wrapper.over_react.g.dart | 64 +- tool/reduced_test_case.dart | 8 + web/src/demo_components/button.dart | 4 +- .../demo_components/button.over_react.g.dart | 64 +- web/src/demo_components/button_group.dart | 4 +- .../button_group.over_react.g.dart | 65 +- web/src/demo_components/list_group.dart | 3 +- .../list_group.over_react.g.dart | 65 +- web/src/demo_components/list_group_item.dart | 2 +- .../list_group_item.over_react.g.dart | 64 +- web/src/demo_components/progress.dart | 2 +- .../progress.over_react.g.dart | 65 +- web/src/demo_components/tag.dart | 2 +- web/src/demo_components/tag.over_react.g.dart | 64 +- .../toggle_button.over_react.g.dart | 65 +- .../toggle_button_group.over_react.g.dart | 64 +- 57 files changed, 3451 insertions(+), 729 deletions(-) create mode 100644 tool/reduced_test_case.dart diff --git a/example/builder/abstract_inheritance.over_react.g.dart b/example/builder/abstract_inheritance.over_react.g.dart index 5b7daf733..4fe1b01ef 100644 --- a/example/builder/abstract_inheritance.over_react.g.dart +++ b/example/builder/abstract_inheritance.over_react.g.dart @@ -48,7 +48,9 @@ class SubProps extends _$SubProps with _$SubPropsAccessorsMixin { static const PropsMeta meta = _$metaForSubProps; } -_$$SubProps _$Sub([Map backingProps]) => new _$$SubProps(backingProps); +_$$SubProps _$Sub([Map backingProps]) => backingProps == null + ? new _$$SubProps$JsMap(new JsBackedMap()) + : new _$$SubProps(backingProps); // Concrete props implementation. // @@ -56,18 +58,15 @@ _$$SubProps _$Sub([Map backingProps]) => new _$$SubProps(backingProps); class _$$SubProps extends _$SubProps with _$SubPropsAccessorsMixin implements SubProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$SubProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$SubProps._(); + factory _$$SubProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$SubProps$PlainMap(backingMap); + } else { + return new _$$SubProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -81,6 +80,38 @@ class _$$SubProps extends _$SubProps String get propKeyNamespace => 'SubProps.'; } +class _$$SubProps$PlainMap extends _$$SubProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$SubProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$SubProps$JsMap extends _$$SubProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$SubProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$SubStateAccessorsMixin implements _$SubState { @override Map get state; @@ -143,6 +174,9 @@ class _$$SubState extends _$SubState class _$SubComponent extends SubComponent { @override _$$SubProps typedPropsFactory(Map backingMap) => new _$$SubProps(backingMap); + @override + _$$SubProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$SubProps$JsMap(backingMap); @override _$$SubState typedStateFactory(Map backingMap) => new _$$SubState(backingMap); @@ -155,6 +189,14 @@ class _$SubComponent extends SubComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForSubProps]; + _$$SubProps$JsMap _cachedTypedProps; + @override + _$$SubProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } abstract class _$SuperPropsAccessorsMixin implements _$SuperProps { diff --git a/example/builder/basic.over_react.g.dart b/example/builder/basic.over_react.g.dart index 761a868d5..7603d58d7 100644 --- a/example/builder/basic.over_react.g.dart +++ b/example/builder/basic.over_react.g.dart @@ -124,7 +124,9 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => backingProps == null + ? new _$$BasicProps$JsMap(new JsBackedMap()) + : new _$$BasicProps(backingProps); // Concrete props implementation. // @@ -132,18 +134,15 @@ _$$BasicProps _$Basic([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$BasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$BasicProps._(); + factory _$$BasicProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$BasicProps$PlainMap(backingMap); + } else { + return new _$$BasicProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -157,6 +156,38 @@ class _$$BasicProps extends _$BasicProps String get propKeyNamespace => 'BasicProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$BasicProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -165,6 +196,9 @@ class _$BasicComponent extends BasicComponent { @override _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); + @override + _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$BasicProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -174,4 +208,12 @@ class _$BasicComponent extends BasicComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForBasicProps]; + _$$BasicProps$JsMap _cachedTypedProps; + @override + _$$BasicProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/example/builder/basic_library.over_react.g.dart b/example/builder/basic_library.over_react.g.dart index 1978c2106..7fc9084fc 100644 --- a/example/builder/basic_library.over_react.g.dart +++ b/example/builder/basic_library.over_react.g.dart @@ -136,7 +136,9 @@ class BasicPartOfLibProps extends _$BasicPartOfLibProps } _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => - new _$$BasicPartOfLibProps(backingProps); + backingProps == null + ? new _$$BasicPartOfLibProps$JsMap(new JsBackedMap()) + : new _$$BasicPartOfLibProps(backingProps); // Concrete props implementation. // @@ -144,18 +146,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$BasicPartOfLibProps._(); + factory _$$BasicPartOfLibProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$BasicPartOfLibProps$PlainMap(backingMap); + } else { + return new _$$BasicPartOfLibProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -170,6 +169,38 @@ class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps String get propKeyNamespace => 'BasicPartOfLibProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$BasicPartOfLibProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$BasicPartOfLibStateAccessorsMixin implements _$BasicPartOfLibState { @override @@ -239,6 +270,9 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { @override _$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => new _$$BasicPartOfLibProps(backingMap); + @override + _$$BasicPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$BasicPartOfLibProps$JsMap(backingMap); @override _$$BasicPartOfLibState typedStateFactory(Map backingMap) => @@ -254,6 +288,14 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { final List $defaultConsumedProps = const [ _$metaForBasicPartOfLibProps ]; + _$$BasicPartOfLibProps$JsMap _cachedTypedProps; + @override + _$$BasicPartOfLibProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -305,8 +347,9 @@ class SubPartOfLibProps extends _$SubPartOfLibProps static const PropsMeta meta = _$metaForSubPartOfLibProps; } -_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => - new _$$SubPartOfLibProps(backingProps); +_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => backingProps == null + ? new _$$SubPartOfLibProps$JsMap(new JsBackedMap()) + : new _$$SubPartOfLibProps(backingProps); // Concrete props implementation. // @@ -314,18 +357,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$SubPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$SubPartOfLibProps._(); + factory _$$SubPartOfLibProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$SubPartOfLibProps$PlainMap(backingMap); + } else { + return new _$$SubPartOfLibProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -340,6 +380,38 @@ class _$$SubPartOfLibProps extends _$SubPartOfLibProps String get propKeyNamespace => 'SubPartOfLibProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$SubPartOfLibProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -348,6 +420,9 @@ class _$SubPartOfLibComponent extends SubPartOfLibComponent { @override _$$SubPartOfLibProps typedPropsFactory(Map backingMap) => new _$$SubPartOfLibProps(backingMap); + @override + _$$SubPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$SubPartOfLibProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -359,6 +434,14 @@ class _$SubPartOfLibComponent extends SubPartOfLibComponent { final List $defaultConsumedProps = const [ _$metaForSubPartOfLibProps ]; + _$$SubPartOfLibProps$JsMap _cachedTypedProps; + @override + _$$SubPartOfLibProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } abstract class _$SuperPartOfLibPropsAccessorsMixin diff --git a/example/builder/basic_with_state.over_react.g.dart b/example/builder/basic_with_state.over_react.g.dart index 11a5c8a08..c58580852 100644 --- a/example/builder/basic_with_state.over_react.g.dart +++ b/example/builder/basic_with_state.over_react.g.dart @@ -120,7 +120,9 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => backingProps == null + ? new _$$BasicProps$JsMap(new JsBackedMap()) + : new _$$BasicProps(backingProps); // Concrete props implementation. // @@ -128,18 +130,15 @@ _$$BasicProps _$Basic([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$BasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$BasicProps._(); + factory _$$BasicProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$BasicProps$PlainMap(backingMap); + } else { + return new _$$BasicProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -153,6 +152,38 @@ class _$$BasicProps extends _$BasicProps String get propKeyNamespace => 'BasicProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$BasicProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$BasicStateAccessorsMixin implements _$BasicState { @override Map get state; @@ -219,6 +250,9 @@ class _$BasicComponent extends BasicComponent { @override _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); + @override + _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$BasicProps$JsMap(backingMap); @override _$$BasicState typedStateFactory(Map backingMap) => @@ -232,4 +266,12 @@ class _$BasicComponent extends BasicComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForBasicProps]; + _$$BasicProps$JsMap _cachedTypedProps; + @override + _$$BasicProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/example/builder/basic_with_type_params.over_react.g.dart b/example/builder/basic_with_type_params.over_react.g.dart index 9c10dc22f..8518b874b 100644 --- a/example/builder/basic_with_type_params.over_react.g.dart +++ b/example/builder/basic_with_type_params.over_react.g.dart @@ -70,7 +70,9 @@ class BasicProps extends _$BasicProps static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => backingProps == null + ? new _$$BasicProps$JsMap(new JsBackedMap()) + : new _$$BasicProps(backingProps); // Concrete props implementation. // @@ -78,18 +80,15 @@ _$$BasicProps _$Basic([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$BasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$BasicProps._(); + factory _$$BasicProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$BasicProps$PlainMap(backingMap); + } else { + return new _$$BasicProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -103,6 +102,38 @@ class _$$BasicProps extends _$BasicProps String get propKeyNamespace => 'BasicProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$BasicProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -111,6 +142,9 @@ class _$BasicComponent extends BasicComponent { @override _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); + @override + _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$BasicProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -120,4 +154,12 @@ class _$BasicComponent extends BasicComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForBasicProps]; + _$$BasicProps$JsMap _cachedTypedProps; + @override + _$$BasicProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/example/builder/generic_inheritance_sub.over_react.g.dart b/example/builder/generic_inheritance_sub.over_react.g.dart index 40686e60c..46882c970 100644 --- a/example/builder/generic_inheritance_sub.over_react.g.dart +++ b/example/builder/generic_inheritance_sub.over_react.g.dart @@ -53,8 +53,9 @@ class GenericSubProps extends _$GenericSubProps static const PropsMeta meta = _$metaForGenericSubProps; } -_$$GenericSubProps _$GenericSub([Map backingProps]) => - new _$$GenericSubProps(backingProps); +_$$GenericSubProps _$GenericSub([Map backingProps]) => backingProps == null + ? new _$$GenericSubProps$JsMap(new JsBackedMap()) + : new _$$GenericSubProps(backingProps); // Concrete props implementation. // @@ -62,18 +63,15 @@ _$$GenericSubProps _$GenericSub([Map backingProps]) => class _$$GenericSubProps extends _$GenericSubProps with _$GenericSubPropsAccessorsMixin implements GenericSubProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$GenericSubProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$GenericSubProps._(); + factory _$$GenericSubProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$GenericSubProps$PlainMap(backingMap); + } else { + return new _$$GenericSubProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -88,6 +86,38 @@ class _$$GenericSubProps extends _$GenericSubProps String get propKeyNamespace => 'GenericSubProps.'; } +class _$$GenericSubProps$PlainMap extends _$$GenericSubProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$GenericSubProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$GenericSubProps$JsMap extends _$$GenericSubProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$GenericSubProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$GenericSubStateAccessorsMixin implements _$GenericSubState { @override Map get state; @@ -156,6 +186,9 @@ class _$GenericSubComponent extends GenericSubComponent { @override _$$GenericSubProps typedPropsFactory(Map backingMap) => new _$$GenericSubProps(backingMap); + @override + _$$GenericSubProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$GenericSubProps$JsMap(backingMap); @override _$$GenericSubState typedStateFactory(Map backingMap) => @@ -171,4 +204,12 @@ class _$GenericSubComponent extends GenericSubComponent { final List $defaultConsumedProps = const [ _$metaForGenericSubProps ]; + _$$GenericSubProps$JsMap _cachedTypedProps; + @override + _$$GenericSubProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/example/builder/generic_inheritance_super.over_react.g.dart b/example/builder/generic_inheritance_super.over_react.g.dart index 0957136f5..000796b79 100644 --- a/example/builder/generic_inheritance_super.over_react.g.dart +++ b/example/builder/generic_inheritance_super.over_react.g.dart @@ -87,8 +87,9 @@ class GenericSuperProps extends _$GenericSuperProps static const PropsMeta meta = _$metaForGenericSuperProps; } -_$$GenericSuperProps _$GenericSuper([Map backingProps]) => - new _$$GenericSuperProps(backingProps); +_$$GenericSuperProps _$GenericSuper([Map backingProps]) => backingProps == null + ? new _$$GenericSuperProps$JsMap(new JsBackedMap()) + : new _$$GenericSuperProps(backingProps); // Concrete props implementation. // @@ -96,18 +97,15 @@ _$$GenericSuperProps _$GenericSuper([Map backingProps]) => class _$$GenericSuperProps extends _$GenericSuperProps with _$GenericSuperPropsAccessorsMixin implements GenericSuperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$GenericSuperProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$GenericSuperProps._(); + factory _$$GenericSuperProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$GenericSuperProps$PlainMap(backingMap); + } else { + return new _$$GenericSuperProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -122,6 +120,38 @@ class _$$GenericSuperProps extends _$GenericSuperProps String get propKeyNamespace => 'GenericSuperProps.'; } +class _$$GenericSuperProps$PlainMap extends _$$GenericSuperProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$GenericSuperProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$GenericSuperProps$JsMap extends _$$GenericSuperProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$GenericSuperProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$GenericSuperStateAccessorsMixin implements _$GenericSuperState { @override @@ -191,6 +221,9 @@ class _$GenericSuperComponent extends GenericSuperComponent { @override _$$GenericSuperProps typedPropsFactory(Map backingMap) => new _$$GenericSuperProps(backingMap); + @override + _$$GenericSuperProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$GenericSuperProps$JsMap(backingMap); @override _$$GenericSuperState typedStateFactory(Map backingMap) => @@ -206,4 +239,12 @@ class _$GenericSuperComponent extends GenericSuperComponent { final List $defaultConsumedProps = const [ _$metaForGenericSuperProps ]; + _$$GenericSuperProps$JsMap _cachedTypedProps; + @override + _$$GenericSuperProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/example/builder/private_component.over_react.g.dart b/example/builder/private_component.over_react.g.dart index d5488e320..a02512d3e 100644 --- a/example/builder/private_component.over_react.g.dart +++ b/example/builder/private_component.over_react.g.dart @@ -49,8 +49,9 @@ class _PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin { static const PropsMeta meta = _$metaFor_PrivateProps; } -_$$_PrivateProps _$_Private([Map backingProps]) => - new _$$_PrivateProps(backingProps); +_$$_PrivateProps _$_Private([Map backingProps]) => backingProps == null + ? new _$$_PrivateProps$JsMap(new JsBackedMap()) + : new _$$_PrivateProps(backingProps); // Concrete props implementation. // @@ -58,18 +59,15 @@ _$$_PrivateProps _$_Private([Map backingProps]) => class _$$_PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin implements _PrivateProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$_PrivateProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$_PrivateProps._(); + factory _$$_PrivateProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$_PrivateProps$PlainMap(backingMap); + } else { + return new _$$_PrivateProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -83,6 +81,38 @@ class _$$_PrivateProps extends _$_PrivateProps String get propKeyNamespace => '_PrivateProps.'; } +class _$$_PrivateProps$PlainMap extends _$$_PrivateProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$_PrivateProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$_PrivateProps$JsMap extends _$$_PrivateProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$_PrivateProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$_PrivateStateAccessorsMixin implements _$_PrivateState { @override Map get state; @@ -146,6 +176,9 @@ class _$PrivateComponent extends PrivateComponent { @override _$$_PrivateProps typedPropsFactory(Map backingMap) => new _$$_PrivateProps(backingMap); + @override + _$$_PrivateProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$_PrivateProps$JsMap(backingMap); @override _$$_PrivateState typedStateFactory(Map backingMap) => @@ -161,4 +194,12 @@ class _$PrivateComponent extends PrivateComponent { final List $defaultConsumedProps = const [ _$metaFor_PrivateProps ]; + _$$_PrivateProps$JsMap _cachedTypedProps; + @override + _$$_PrivateProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/example/builder/private_factory_public_component.over_react.g.dart b/example/builder/private_factory_public_component.over_react.g.dart index 4a19d5d49..e44e14160 100644 --- a/example/builder/private_factory_public_component.over_react.g.dart +++ b/example/builder/private_factory_public_component.over_react.g.dart @@ -56,7 +56,9 @@ class FormActionInputProps extends _$FormActionInputProps } _$$FormActionInputProps _$_FormActionInput([Map backingProps]) => - new _$$FormActionInputProps(backingProps); + backingProps == null + ? new _$$FormActionInputProps$JsMap(new JsBackedMap()) + : new _$$FormActionInputProps(backingProps); // Concrete props implementation. // @@ -64,18 +66,15 @@ _$$FormActionInputProps _$_FormActionInput([Map backingProps]) => class _$$FormActionInputProps extends _$FormActionInputProps with _$FormActionInputPropsAccessorsMixin implements FormActionInputProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$FormActionInputProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$FormActionInputProps._(); + factory _$$FormActionInputProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FormActionInputProps$PlainMap(backingMap); + } else { + return new _$$FormActionInputProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -90,6 +89,38 @@ class _$$FormActionInputProps extends _$FormActionInputProps String get propKeyNamespace => 'FormActionInputProps.'; } +class _$$FormActionInputProps$PlainMap extends _$$FormActionInputProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$FormActionInputProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$FormActionInputProps$JsMap extends _$$FormActionInputProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$FormActionInputProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -98,6 +129,9 @@ class _$FormActionInputComponent extends FormActionInputComponent { @override _$$FormActionInputProps typedPropsFactory(Map backingMap) => new _$$FormActionInputProps(backingMap); + @override + _$$FormActionInputProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FormActionInputProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -109,4 +143,12 @@ class _$FormActionInputComponent extends FormActionInputComponent { final List $defaultConsumedProps = const [ _$metaForFormActionInputProps ]; + _$$FormActionInputProps$JsMap _cachedTypedProps; + @override + _$$FormActionInputProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/lib/src/component/resize_sensor.over_react.g.dart b/lib/src/component/resize_sensor.over_react.g.dart index 56ccc4d1b..d63a365b7 100644 --- a/lib/src/component/resize_sensor.over_react.g.dart +++ b/lib/src/component/resize_sensor.over_react.g.dart @@ -38,8 +38,9 @@ class ResizeSensorProps extends _$ResizeSensorProps static const PropsMeta meta = _$metaForResizeSensorProps; } -_$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => - new _$$ResizeSensorProps(backingProps); +_$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => backingProps == null + ? new _$$ResizeSensorProps$JsMap(new JsBackedMap()) + : new _$$ResizeSensorProps(backingProps); // Concrete props implementation. // @@ -47,18 +48,15 @@ _$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => class _$$ResizeSensorProps extends _$ResizeSensorProps with _$ResizeSensorPropsAccessorsMixin implements 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 an unknown ddc issue. - // See for more details - _$$ResizeSensorProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ResizeSensorProps._(); + factory _$$ResizeSensorProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ResizeSensorProps$PlainMap(backingMap); + } else { + return new _$$ResizeSensorProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -73,6 +71,38 @@ class _$$ResizeSensorProps extends _$ResizeSensorProps String get propKeyNamespace => 'ResizeSensorProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ResizeSensorProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -81,6 +111,9 @@ class _$ResizeSensorComponent extends ResizeSensorComponent { @override _$$ResizeSensorProps typedPropsFactory(Map backingMap) => new _$$ResizeSensorProps(backingMap); + @override + _$$ResizeSensorProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ResizeSensorProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -92,6 +125,14 @@ class _$ResizeSensorComponent extends ResizeSensorComponent { final List $defaultConsumedProps = const [ _$metaForResizeSensorProps ]; + _$$ResizeSensorProps$JsMap _cachedTypedProps; + @override + _$$ResizeSensorProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } abstract class ResizeSensorPropsMixin implements _$ResizeSensorPropsMixin { 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 51e79baac..5fc4e39cd 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 @@ -199,8 +199,9 @@ class TransitionerProps extends _$TransitionerProps static const PropsMeta meta = _$metaForTransitionerProps; } -_$$TransitionerProps _$Transitioner([Map backingProps]) => - new _$$TransitionerProps(backingProps); +_$$TransitionerProps _$Transitioner([Map backingProps]) => backingProps == null + ? new _$$TransitionerProps$JsMap(new JsBackedMap()) + : new _$$TransitionerProps(backingProps); // Concrete props implementation. // @@ -208,18 +209,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TransitionerProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TransitionerProps._(); + factory _$$TransitionerProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TransitionerProps$PlainMap(backingMap); + } else { + return new _$$TransitionerProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -234,6 +232,38 @@ class _$$TransitionerProps extends _$TransitionerProps String get propKeyNamespace => 'TransitionerProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TransitionerProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TransitionerStateAccessorsMixin implements _$TransitionerState { @override @@ -286,6 +316,9 @@ class _$TransitionerComponent extends TransitionerComponent { @override _$$TransitionerProps typedPropsFactory(Map backingMap) => new _$$TransitionerProps(backingMap); + @override + _$$TransitionerProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TransitionerProps$JsMap(backingMap); @override _$$TransitionerState typedStateFactory(Map backingMap) => @@ -301,4 +334,12 @@ class _$TransitionerComponent extends TransitionerComponent { final List $defaultConsumedProps = const [ _$metaForTransitionerProps ]; + _$$TransitionerProps$JsMap _cachedTypedProps; + @override + _$$TransitionerProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart index 68e3fc712..284348456 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart @@ -140,7 +140,9 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -148,18 +150,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -174,6 +173,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -182,6 +213,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -193,4 +227,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart index e637e48ef..75d03fd7b 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart @@ -71,7 +71,9 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -79,18 +81,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -105,6 +104,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -113,6 +144,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -124,4 +158,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart index 3a1dce89b..88c866349 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart @@ -94,7 +94,9 @@ const PropsMeta _$metaForDoNotGenerateAccessorTestProps = const PropsMeta( _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( [Map backingProps]) => - new _$$DoNotGenerateAccessorTestProps(backingProps); + backingProps == null + ? new _$$DoNotGenerateAccessorTestProps$JsMap(new JsBackedMap()) + : new _$$DoNotGenerateAccessorTestProps(backingProps); // Concrete props implementation. // @@ -102,18 +104,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$DoNotGenerateAccessorTestProps._(); + factory _$$DoNotGenerateAccessorTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); + } else { + return new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -128,6 +127,40 @@ class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps String get propKeyNamespace => 'DoNotGenerateAccessorTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin implements _$DoNotGenerateAccessorTestState { @override @@ -236,6 +269,10 @@ class _$DoNotGenerateAccessorTestComponent @override _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestProps(backingMap); + @override + _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => @@ -251,4 +288,12 @@ class _$DoNotGenerateAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForDoNotGenerateAccessorTestProps ]; + _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; + @override + _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart index 9c8df8b07..aa47b696d 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart @@ -148,7 +148,9 @@ const PropsMeta _$metaForNamespacedAccessorTestProps = const PropsMeta( ); _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => - new _$$NamespacedAccessorTestProps(backingProps); + backingProps == null + ? new _$$NamespacedAccessorTestProps$JsMap(new JsBackedMap()) + : new _$$NamespacedAccessorTestProps(backingProps); // Concrete props implementation. // @@ -156,18 +158,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$NamespacedAccessorTestProps._(); + factory _$$NamespacedAccessorTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$NamespacedAccessorTestProps$PlainMap(backingMap); + } else { + return new _$$NamespacedAccessorTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -182,6 +181,40 @@ class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps String get propKeyNamespace => 'custom props class namespace**'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$NamespacedAccessorTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$NamespacedAccessorTestStateAccessorsMixin implements _$NamespacedAccessorTestState { @override @@ -345,6 +378,10 @@ class _$NamespacedAccessorTestComponent @override _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => new _$$NamespacedAccessorTestProps(backingMap); + @override + _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$NamespacedAccessorTestProps$JsMap(backingMap); @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => @@ -360,4 +397,12 @@ class _$NamespacedAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForNamespacedAccessorTestProps ]; + _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; + @override + _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart index 71f057645..b2581a57f 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart @@ -45,7 +45,9 @@ const PropsMeta _$metaForFooProps = const PropsMeta( keys: _$FooPropsAccessorsMixin.$propKeys, ); -_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => backingProps == null + ? new _$$FooProps$JsMap(new JsBackedMap()) + : new _$$FooProps(backingProps); // Concrete props implementation. // @@ -53,18 +55,15 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$FooProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$FooProps._(); + factory _$$FooProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FooProps$PlainMap(backingMap); + } else { + return new _$$FooProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -78,6 +77,38 @@ class _$$FooProps extends _$FooProps String get propKeyNamespace => 'FooProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$FooProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -85,6 +116,9 @@ class _$$FooProps extends _$FooProps class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); + @override + _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -94,4 +128,12 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; + _$$FooProps$JsMap _cachedTypedProps; + @override + _$$FooProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart index f435d424d..b1c5e1be4 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart @@ -84,7 +84,9 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -92,18 +94,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -118,6 +117,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -126,6 +157,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -137,4 +171,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart index 194b933dd..460c4ead5 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart @@ -74,7 +74,9 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -82,18 +84,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -108,6 +107,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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,6 +147,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -127,4 +161,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart index c80e97e41..dcb51d5e3 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart @@ -34,7 +34,9 @@ const PropsMeta _$metaForStatefulComponentTestProps = const PropsMeta( ); _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => - new _$$StatefulComponentTestProps(backingProps); + backingProps == null + ? new _$$StatefulComponentTestProps$JsMap(new JsBackedMap()) + : new _$$StatefulComponentTestProps(backingProps); // Concrete props implementation. // @@ -42,18 +44,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$StatefulComponentTestProps._(); + factory _$$StatefulComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$StatefulComponentTestProps$PlainMap(backingMap); + } else { + return new _$$StatefulComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -68,6 +67,40 @@ class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps String get propKeyNamespace => 'StatefulComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$StatefulComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$StatefulComponentTestStateAccessorsMixin implements _$StatefulComponentTestState { @override @@ -230,6 +263,10 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { @override _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => new _$$StatefulComponentTestProps(backingMap); + @override + _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$StatefulComponentTestProps$JsMap(backingMap); @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => @@ -245,4 +282,12 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForStatefulComponentTestProps ]; + _$$StatefulComponentTestProps$JsMap _cachedTypedProps; + @override + _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart index 24ac6b851..d2b0ab1a8 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart @@ -62,7 +62,9 @@ const PropsMeta _$metaForFooProps = const PropsMeta( keys: _$FooPropsAccessorsMixin.$propKeys, ); -_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => backingProps == null + ? new _$$FooProps$JsMap(new JsBackedMap()) + : new _$$FooProps(backingProps); // Concrete props implementation. // @@ -70,18 +72,15 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$FooProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$FooProps._(); + factory _$$FooProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FooProps$PlainMap(backingMap); + } else { + return new _$$FooProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -95,6 +94,38 @@ class _$$FooProps extends _$FooProps String get propKeyNamespace => 'FooProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$FooProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -102,6 +133,9 @@ class _$$FooProps extends _$FooProps class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); + @override + _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -111,4 +145,12 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; + _$$FooProps$JsMap _cachedTypedProps; + @override + _$$FooProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 b4e7f305f..9f4a1e5cf 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 @@ -145,7 +145,9 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -153,18 +155,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -179,6 +178,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -187,6 +218,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -198,4 +232,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 fa63fc01d..f4287dc98 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 @@ -76,7 +76,9 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -84,18 +86,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -110,6 +109,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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,6 +149,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -129,4 +163,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 f69e4161f..d86a89b36 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 @@ -99,7 +99,9 @@ class DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( [Map backingProps]) => - new _$$DoNotGenerateAccessorTestProps(backingProps); + backingProps == null + ? new _$$DoNotGenerateAccessorTestProps$JsMap(new JsBackedMap()) + : new _$$DoNotGenerateAccessorTestProps(backingProps); // Concrete props implementation. // @@ -107,18 +109,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$DoNotGenerateAccessorTestProps._(); + factory _$$DoNotGenerateAccessorTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); + } else { + return new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -133,6 +132,40 @@ class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps String get propKeyNamespace => 'DoNotGenerateAccessorTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin implements _$DoNotGenerateAccessorTestState { @override @@ -246,6 +279,10 @@ class _$DoNotGenerateAccessorTestComponent @override _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestProps(backingMap); + @override + _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => @@ -261,4 +298,12 @@ class _$DoNotGenerateAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForDoNotGenerateAccessorTestProps ]; + _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; + @override + _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 67ffff4e1..113bb4755 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 @@ -153,7 +153,9 @@ class NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps } _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => - new _$$NamespacedAccessorTestProps(backingProps); + backingProps == null + ? new _$$NamespacedAccessorTestProps$JsMap(new JsBackedMap()) + : new _$$NamespacedAccessorTestProps(backingProps); // Concrete props implementation. // @@ -161,18 +163,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$NamespacedAccessorTestProps._(); + factory _$$NamespacedAccessorTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$NamespacedAccessorTestProps$PlainMap(backingMap); + } else { + return new _$$NamespacedAccessorTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -187,6 +186,40 @@ class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps String get propKeyNamespace => 'custom props class namespace**'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$NamespacedAccessorTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$NamespacedAccessorTestStateAccessorsMixin implements _$NamespacedAccessorTestState { @override @@ -355,6 +388,10 @@ class _$NamespacedAccessorTestComponent @override _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => new _$$NamespacedAccessorTestProps(backingMap); + @override + _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$NamespacedAccessorTestProps$JsMap(backingMap); @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => @@ -370,4 +407,12 @@ class _$NamespacedAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForNamespacedAccessorTestProps ]; + _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; + @override + _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 f0b1c48fa..2ffc50804 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 @@ -49,7 +49,9 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => backingProps == null + ? new _$$FooProps$JsMap(new JsBackedMap()) + : new _$$FooProps(backingProps); // Concrete props implementation. // @@ -57,18 +59,15 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$FooProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$FooProps._(); + factory _$$FooProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FooProps$PlainMap(backingMap); + } else { + return new _$$FooProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -82,6 +81,38 @@ class _$$FooProps extends _$FooProps String get propKeyNamespace => 'FooProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$FooProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -89,6 +120,9 @@ class _$$FooProps extends _$FooProps class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); + @override + _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -98,4 +132,12 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; + _$$FooProps$JsMap _cachedTypedProps; + @override + _$$FooProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 04abc2bbb..8ae80bf8a 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 @@ -89,7 +89,9 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -97,18 +99,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -123,6 +122,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -131,6 +162,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -142,4 +176,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart index 24ce7a040..70b6cccca 100644 --- a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart @@ -79,7 +79,9 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - new _$$ComponentTestProps(backingProps); + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -87,18 +89,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ComponentTestProps._(); + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$PlainMap(backingMap); + } else { + return new _$$ComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -113,6 +112,38 @@ class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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,6 +152,9 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -132,4 +166,12 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; + _$$ComponentTestProps$JsMap _cachedTypedProps; + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 eb464e940..972b471d3 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 @@ -39,7 +39,9 @@ class StatefulComponentTestProps extends _$StatefulComponentTestProps } _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => - new _$$StatefulComponentTestProps(backingProps); + backingProps == null + ? new _$$StatefulComponentTestProps$JsMap(new JsBackedMap()) + : new _$$StatefulComponentTestProps(backingProps); // Concrete props implementation. // @@ -47,18 +49,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$StatefulComponentTestProps._(); + factory _$$StatefulComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$StatefulComponentTestProps$PlainMap(backingMap); + } else { + return new _$$StatefulComponentTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -73,6 +72,40 @@ class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps String get propKeyNamespace => 'StatefulComponentTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$StatefulComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$StatefulComponentTestStateAccessorsMixin implements _$StatefulComponentTestState { @override @@ -240,6 +273,10 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { @override _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => new _$$StatefulComponentTestProps(backingMap); + @override + _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$StatefulComponentTestProps$JsMap(backingMap); @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => @@ -255,4 +292,12 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForStatefulComponentTestProps ]; + _$$StatefulComponentTestProps$JsMap _cachedTypedProps; + @override + _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 13831b895..b9b63453a 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 @@ -66,7 +66,9 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => backingProps == null + ? new _$$FooProps$JsMap(new JsBackedMap()) + : new _$$FooProps(backingProps); // Concrete props implementation. // @@ -74,18 +76,15 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$FooProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$FooProps._(); + factory _$$FooProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FooProps$PlainMap(backingMap); + } else { + return new _$$FooProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -99,6 +98,38 @@ class _$$FooProps extends _$FooProps String get propKeyNamespace => 'FooProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$FooProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -106,6 +137,9 @@ class _$$FooProps extends _$FooProps class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); + @override + _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -115,4 +149,12 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; + _$$FooProps$JsMap _cachedTypedProps; + @override + _$$FooProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 dc65b6122..3bbb12912 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 @@ -35,7 +35,9 @@ class TestAProps extends _$TestAProps with _$TestAPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestAProps; } -_$$TestAProps _$TestA([Map backingProps]) => new _$$TestAProps(backingProps); +_$$TestAProps _$TestA([Map backingProps]) => backingProps == null + ? new _$$TestAProps$JsMap(new JsBackedMap()) + : new _$$TestAProps(backingProps); // Concrete props implementation. // @@ -43,18 +45,15 @@ _$$TestAProps _$TestA([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$TestAProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestAProps._(); + factory _$$TestAProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestAProps$PlainMap(backingMap); + } else { + return new _$$TestAProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -68,6 +67,38 @@ class _$$TestAProps extends _$TestAProps String get propKeyNamespace => 'TestAProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestAProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -76,6 +107,9 @@ class _$TestAComponent extends TestAComponent { @override _$$TestAProps typedPropsFactory(Map backingMap) => new _$$TestAProps(backingMap); + @override + _$$TestAProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestAProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -85,4 +119,12 @@ class _$TestAComponent extends TestAComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTestAProps]; + _$$TestAProps$JsMap _cachedTypedProps; + @override + _$$TestAProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 a3eb3a0e1..914ed190f 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 @@ -35,7 +35,9 @@ class TestBProps extends _$TestBProps with _$TestBPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestBProps; } -_$$TestBProps _$TestB([Map backingProps]) => new _$$TestBProps(backingProps); +_$$TestBProps _$TestB([Map backingProps]) => backingProps == null + ? new _$$TestBProps$JsMap(new JsBackedMap()) + : new _$$TestBProps(backingProps); // Concrete props implementation. // @@ -43,18 +45,15 @@ _$$TestBProps _$TestB([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$TestBProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestBProps._(); + factory _$$TestBProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestBProps$PlainMap(backingMap); + } else { + return new _$$TestBProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -68,6 +67,38 @@ class _$$TestBProps extends _$TestBProps String get propKeyNamespace => 'TestBProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestBProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -76,6 +107,9 @@ class _$TestBComponent extends TestBComponent { @override _$$TestBProps typedPropsFactory(Map backingMap) => new _$$TestBProps(backingMap); + @override + _$$TestBProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestBProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -85,4 +119,12 @@ class _$TestBComponent extends TestBComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTestBProps]; + _$$TestBProps$JsMap _cachedTypedProps; + @override + _$$TestBProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 12d545663..59e23600c 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 @@ -40,7 +40,9 @@ class TestExtendtypeProps extends _$TestExtendtypeProps } _$$TestExtendtypeProps _$TestExtendtype([Map backingProps]) => - new _$$TestExtendtypeProps(backingProps); + backingProps == null + ? new _$$TestExtendtypeProps$JsMap(new JsBackedMap()) + : new _$$TestExtendtypeProps(backingProps); // Concrete props implementation. // @@ -48,18 +50,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestExtendtypeProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestExtendtypeProps._(); + factory _$$TestExtendtypeProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestExtendtypeProps$PlainMap(backingMap); + } else { + return new _$$TestExtendtypeProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -74,6 +73,38 @@ class _$$TestExtendtypeProps extends _$TestExtendtypeProps String get propKeyNamespace => 'TestExtendtypeProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestExtendtypeProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -82,6 +113,9 @@ class _$TestExtendtypeComponent extends TestExtendtypeComponent { @override _$$TestExtendtypeProps typedPropsFactory(Map backingMap) => new _$$TestExtendtypeProps(backingMap); + @override + _$$TestExtendtypeProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestExtendtypeProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -93,4 +127,12 @@ class _$TestExtendtypeComponent extends TestExtendtypeComponent { final List $defaultConsumedProps = const [ _$metaForTestExtendtypeProps ]; + _$$TestExtendtypeProps$JsMap _cachedTypedProps; + @override + _$$TestExtendtypeProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 3e5e6f40a..d8178837c 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 @@ -37,8 +37,9 @@ class TestParentProps extends _$TestParentProps static const PropsMeta meta = _$metaForTestParentProps; } -_$$TestParentProps _$TestParent([Map backingProps]) => - new _$$TestParentProps(backingProps); +_$$TestParentProps _$TestParent([Map backingProps]) => backingProps == null + ? new _$$TestParentProps$JsMap(new JsBackedMap()) + : new _$$TestParentProps(backingProps); // Concrete props implementation. // @@ -46,18 +47,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestParentProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestParentProps._(); + factory _$$TestParentProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestParentProps$PlainMap(backingMap); + } else { + return new _$$TestParentProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -72,6 +70,38 @@ class _$$TestParentProps extends _$TestParentProps String get propKeyNamespace => 'TestParentProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestParentProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -80,6 +110,9 @@ class _$TestParentComponent extends TestParentComponent { @override _$$TestParentProps typedPropsFactory(Map backingMap) => new _$$TestParentProps(backingMap); + @override + _$$TestParentProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestParentProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -91,4 +124,12 @@ class _$TestParentComponent extends TestParentComponent { final List $defaultConsumedProps = const [ _$metaForTestParentProps ]; + _$$TestParentProps$JsMap _cachedTypedProps; + @override + _$$TestParentProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 fc7b69f4d..9c4596db5 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 @@ -40,7 +40,9 @@ class TestSubsubtypeProps extends _$TestSubsubtypeProps } _$$TestSubsubtypeProps _$TestSubsubtype([Map backingProps]) => - new _$$TestSubsubtypeProps(backingProps); + backingProps == null + ? new _$$TestSubsubtypeProps$JsMap(new JsBackedMap()) + : new _$$TestSubsubtypeProps(backingProps); // Concrete props implementation. // @@ -48,18 +50,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestSubsubtypeProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestSubsubtypeProps._(); + factory _$$TestSubsubtypeProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestSubsubtypeProps$PlainMap(backingMap); + } else { + return new _$$TestSubsubtypeProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -74,6 +73,38 @@ class _$$TestSubsubtypeProps extends _$TestSubsubtypeProps String get propKeyNamespace => 'TestSubsubtypeProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestSubsubtypeProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -82,6 +113,9 @@ class _$TestSubsubtypeComponent extends TestSubsubtypeComponent { @override _$$TestSubsubtypeProps typedPropsFactory(Map backingMap) => new _$$TestSubsubtypeProps(backingMap); + @override + _$$TestSubsubtypeProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestSubsubtypeProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -93,4 +127,12 @@ class _$TestSubsubtypeComponent extends TestSubsubtypeComponent { final List $defaultConsumedProps = const [ _$metaForTestSubsubtypeProps ]; + _$$TestSubsubtypeProps$JsMap _cachedTypedProps; + @override + _$$TestSubsubtypeProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 e16ca29b5..31a1484da 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 @@ -38,8 +38,9 @@ class TestSubtypeProps extends _$TestSubtypeProps static const PropsMeta meta = _$metaForTestSubtypeProps; } -_$$TestSubtypeProps _$TestSubtype([Map backingProps]) => - new _$$TestSubtypeProps(backingProps); +_$$TestSubtypeProps _$TestSubtype([Map backingProps]) => backingProps == null + ? new _$$TestSubtypeProps$JsMap(new JsBackedMap()) + : new _$$TestSubtypeProps(backingProps); // Concrete props implementation. // @@ -47,18 +48,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestSubtypeProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestSubtypeProps._(); + factory _$$TestSubtypeProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestSubtypeProps$PlainMap(backingMap); + } else { + return new _$$TestSubtypeProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -73,6 +71,38 @@ class _$$TestSubtypeProps extends _$TestSubtypeProps String get propKeyNamespace => 'TestSubtypeProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestSubtypeProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -81,6 +111,9 @@ class _$TestSubtypeComponent extends TestSubtypeComponent { @override _$$TestSubtypeProps typedPropsFactory(Map backingMap) => new _$$TestSubtypeProps(backingMap); + @override + _$$TestSubtypeProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestSubtypeProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -92,4 +125,12 @@ class _$TestSubtypeComponent extends TestSubtypeComponent { final List $defaultConsumedProps = const [ _$metaForTestSubtypeProps ]; + _$$TestSubtypeProps$JsMap _cachedTypedProps; + @override + _$$TestSubtypeProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test.over_react.g.dart index a9574437a..ea39ae487 100644 --- a/test/over_react/component_declaration/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test.over_react.g.dart @@ -37,8 +37,9 @@ class TestBasicProps extends _$TestBasicProps static const PropsMeta meta = _$metaForTestBasicProps; } -_$$TestBasicProps _$TestBasic([Map backingProps]) => - new _$$TestBasicProps(backingProps); +_$$TestBasicProps _$TestBasic([Map backingProps]) => backingProps == null + ? new _$$TestBasicProps$JsMap(new JsBackedMap()) + : new _$$TestBasicProps(backingProps); // Concrete props implementation. // @@ -46,18 +47,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestBasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestBasicProps._(); + factory _$$TestBasicProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestBasicProps$PlainMap(backingMap); + } else { + return new _$$TestBasicProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -71,6 +69,38 @@ class _$$TestBasicProps extends _$TestBasicProps String get propKeyNamespace => 'TestBasicProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestBasicProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -79,6 +109,9 @@ class _$TestBasicComponent extends TestBasicComponent { @override _$$TestBasicProps typedPropsFactory(Map backingMap) => new _$$TestBasicProps(backingMap); + @override + _$$TestBasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestBasicProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -90,6 +123,14 @@ class _$TestBasicComponent extends TestBasicComponent { final List $defaultConsumedProps = const [ _$metaForTestBasicProps ]; + _$$TestBasicProps$JsMap _cachedTypedProps; + @override + _$$TestBasicProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -125,7 +166,9 @@ class TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps } _$$TestHandlerLifecycleProps _$TestHandlerLifecycle([Map backingProps]) => - new _$$TestHandlerLifecycleProps(backingProps); + backingProps == null + ? new _$$TestHandlerLifecycleProps$JsMap(new JsBackedMap()) + : new _$$TestHandlerLifecycleProps(backingProps); // Concrete props implementation. // @@ -133,18 +176,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestHandlerLifecycleProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestHandlerLifecycleProps._(); + factory _$$TestHandlerLifecycleProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestHandlerLifecycleProps$PlainMap(backingMap); + } else { + return new _$$TestHandlerLifecycleProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -159,6 +199,39 @@ class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps String get propKeyNamespace => 'TestHandlerLifecycleProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestHandlerLifecycleProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -167,6 +240,10 @@ class _$TestHandlerLifecycleComponent extends TestHandlerLifecycleComponent { @override _$$TestHandlerLifecycleProps typedPropsFactory(Map backingMap) => new _$$TestHandlerLifecycleProps(backingMap); + @override + _$$TestHandlerLifecycleProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestHandlerLifecycleProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -178,6 +255,14 @@ class _$TestHandlerLifecycleComponent extends TestHandlerLifecycleComponent { final List $defaultConsumedProps = const [ _$metaForTestHandlerLifecycleProps ]; + _$$TestHandlerLifecycleProps$JsMap _cachedTypedProps; + @override + _$$TestHandlerLifecycleProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -213,7 +298,9 @@ class TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps } _$$TestHandlerPrecedenceProps _$TestHandlerPrecedence([Map backingProps]) => - new _$$TestHandlerPrecedenceProps(backingProps); + backingProps == null + ? new _$$TestHandlerPrecedenceProps$JsMap(new JsBackedMap()) + : new _$$TestHandlerPrecedenceProps(backingProps); // Concrete props implementation. // @@ -221,18 +308,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestHandlerPrecedenceProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestHandlerPrecedenceProps._(); + factory _$$TestHandlerPrecedenceProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestHandlerPrecedenceProps$PlainMap(backingMap); + } else { + return new _$$TestHandlerPrecedenceProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -247,6 +331,40 @@ class _$$TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps String get propKeyNamespace => 'TestHandlerPrecedenceProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestHandlerPrecedenceProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -255,6 +373,10 @@ class _$TestHandlerPrecedenceComponent extends TestHandlerPrecedenceComponent { @override _$$TestHandlerPrecedenceProps typedPropsFactory(Map backingMap) => new _$$TestHandlerPrecedenceProps(backingMap); + @override + _$$TestHandlerPrecedenceProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestHandlerPrecedenceProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -266,6 +388,14 @@ class _$TestHandlerPrecedenceComponent extends TestHandlerPrecedenceComponent { final List $defaultConsumedProps = const [ _$metaForTestHandlerPrecedenceProps ]; + _$$TestHandlerPrecedenceProps$JsMap _cachedTypedProps; + @override + _$$TestHandlerPrecedenceProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -321,7 +451,9 @@ class TestPropValidationProps extends _$TestPropValidationProps } _$$TestPropValidationProps _$TestPropValidation([Map backingProps]) => - new _$$TestPropValidationProps(backingProps); + backingProps == null + ? new _$$TestPropValidationProps$JsMap(new JsBackedMap()) + : new _$$TestPropValidationProps(backingProps); // Concrete props implementation. // @@ -329,18 +461,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestPropValidationProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestPropValidationProps._(); + factory _$$TestPropValidationProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestPropValidationProps$PlainMap(backingMap); + } else { + return new _$$TestPropValidationProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -355,6 +484,38 @@ class _$$TestPropValidationProps extends _$TestPropValidationProps String get propKeyNamespace => 'TestPropValidationProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestPropValidationProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -363,6 +524,10 @@ class _$TestPropValidationComponent extends TestPropValidationComponent { @override _$$TestPropValidationProps typedPropsFactory(Map backingMap) => new _$$TestPropValidationProps(backingMap); + @override + _$$TestPropValidationProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestPropValidationProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -374,6 +539,14 @@ class _$TestPropValidationComponent extends TestPropValidationComponent { final List $defaultConsumedProps = const [ _$metaForTestPropValidationProps ]; + _$$TestPropValidationProps$JsMap _cachedTypedProps; + @override + _$$TestPropValidationProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -408,8 +581,9 @@ class TestRedrawOnProps extends _$TestRedrawOnProps static const PropsMeta meta = _$metaForTestRedrawOnProps; } -_$$TestRedrawOnProps _$TestRedrawOn([Map backingProps]) => - new _$$TestRedrawOnProps(backingProps); +_$$TestRedrawOnProps _$TestRedrawOn([Map backingProps]) => backingProps == null + ? new _$$TestRedrawOnProps$JsMap(new JsBackedMap()) + : new _$$TestRedrawOnProps(backingProps); // Concrete props implementation. // @@ -417,18 +591,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestRedrawOnProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestRedrawOnProps._(); + factory _$$TestRedrawOnProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestRedrawOnProps$PlainMap(backingMap); + } else { + return new _$$TestRedrawOnProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -443,6 +614,38 @@ class _$$TestRedrawOnProps extends _$TestRedrawOnProps String get propKeyNamespace => 'TestRedrawOnProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestRedrawOnProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -451,6 +654,9 @@ class _$TestRedrawOnComponent extends TestRedrawOnComponent { @override _$$TestRedrawOnProps typedPropsFactory(Map backingMap) => new _$$TestRedrawOnProps(backingMap); + @override + _$$TestRedrawOnProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestRedrawOnProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -462,6 +668,14 @@ class _$TestRedrawOnComponent extends TestRedrawOnComponent { final List $defaultConsumedProps = const [ _$metaForTestRedrawOnProps ]; + _$$TestRedrawOnProps$JsMap _cachedTypedProps; + @override + _$$TestRedrawOnProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -497,7 +711,9 @@ class TestStoreHandlersProps extends _$TestStoreHandlersProps } _$$TestStoreHandlersProps _$TestStoreHandlers([Map backingProps]) => - new _$$TestStoreHandlersProps(backingProps); + backingProps == null + ? new _$$TestStoreHandlersProps$JsMap(new JsBackedMap()) + : new _$$TestStoreHandlersProps(backingProps); // Concrete props implementation. // @@ -505,18 +721,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestStoreHandlersProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStoreHandlersProps._(); + factory _$$TestStoreHandlersProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStoreHandlersProps$PlainMap(backingMap); + } else { + return new _$$TestStoreHandlersProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -531,6 +744,38 @@ class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps String get propKeyNamespace => 'TestStoreHandlersProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStoreHandlersProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -539,6 +784,9 @@ class _$TestStoreHandlersComponent extends TestStoreHandlersComponent { @override _$$TestStoreHandlersProps typedPropsFactory(Map backingMap) => new _$$TestStoreHandlersProps(backingMap); + @override + _$$TestStoreHandlersProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestStoreHandlersProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -550,6 +798,14 @@ class _$TestStoreHandlersComponent extends TestStoreHandlersComponent { final List $defaultConsumedProps = const [ _$metaForTestStoreHandlersProps ]; + _$$TestStoreHandlersProps$JsMap _cachedTypedProps; + @override + _$$TestStoreHandlersProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -585,7 +841,9 @@ class TestStatefulBasicProps extends _$TestStatefulBasicProps } _$$TestStatefulBasicProps _$TestStatefulBasic([Map backingProps]) => - new _$$TestStatefulBasicProps(backingProps); + backingProps == null + ? new _$$TestStatefulBasicProps$JsMap(new JsBackedMap()) + : new _$$TestStatefulBasicProps(backingProps); // Concrete props implementation. // @@ -593,18 +851,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestStatefulBasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStatefulBasicProps._(); + factory _$$TestStatefulBasicProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStatefulBasicProps$PlainMap(backingMap); + } else { + return new _$$TestStatefulBasicProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -619,6 +874,38 @@ class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps String get propKeyNamespace => 'TestStatefulBasicProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStatefulBasicProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TestStatefulBasicStateAccessorsMixin implements _$TestStatefulBasicState { @override @@ -671,6 +958,9 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { @override _$$TestStatefulBasicProps typedPropsFactory(Map backingMap) => new _$$TestStatefulBasicProps(backingMap); + @override + _$$TestStatefulBasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestStatefulBasicProps$JsMap(backingMap); @override _$$TestStatefulBasicState typedStateFactory(Map backingMap) => @@ -686,6 +976,14 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { final List $defaultConsumedProps = const [ _$metaForTestStatefulBasicProps ]; + _$$TestStatefulBasicProps$JsMap _cachedTypedProps; + @override + _$$TestStatefulBasicProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -723,7 +1021,9 @@ class TestStatefulHandlerLifecycleProps _$$TestStatefulHandlerLifecycleProps _$TestStatefulHandlerLifecycle( [Map backingProps]) => - new _$$TestStatefulHandlerLifecycleProps(backingProps); + backingProps == null + ? new _$$TestStatefulHandlerLifecycleProps$JsMap(new JsBackedMap()) + : new _$$TestStatefulHandlerLifecycleProps(backingProps); // Concrete props implementation. // @@ -732,18 +1032,15 @@ 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 an unknown ddc issue. - // See for more details - _$$TestStatefulHandlerLifecycleProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStatefulHandlerLifecycleProps._(); + factory _$$TestStatefulHandlerLifecycleProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStatefulHandlerLifecycleProps$PlainMap(backingMap); + } else { + return new _$$TestStatefulHandlerLifecycleProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -758,6 +1055,40 @@ class _$$TestStatefulHandlerLifecycleProps String get propKeyNamespace => 'TestStatefulHandlerLifecycleProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStatefulHandlerLifecycleProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TestStatefulHandlerLifecycleStateAccessorsMixin implements _$TestStatefulHandlerLifecycleState { @override @@ -813,6 +1144,10 @@ class _$TestStatefulHandlerLifecycleComponent @override _$$TestStatefulHandlerLifecycleProps typedPropsFactory(Map backingMap) => new _$$TestStatefulHandlerLifecycleProps(backingMap); + @override + _$$TestStatefulHandlerLifecycleProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestStatefulHandlerLifecycleProps$JsMap(backingMap); @override _$$TestStatefulHandlerLifecycleState typedStateFactory(Map backingMap) => @@ -828,6 +1163,14 @@ class _$TestStatefulHandlerLifecycleComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulHandlerLifecycleProps ]; + _$$TestStatefulHandlerLifecycleProps$JsMap _cachedTypedProps; + @override + _$$TestStatefulHandlerLifecycleProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -865,7 +1208,9 @@ class TestStatefulHandlerPrecedenceProps _$$TestStatefulHandlerPrecedenceProps _$TestStatefulHandlerPrecedence( [Map backingProps]) => - new _$$TestStatefulHandlerPrecedenceProps(backingProps); + backingProps == null + ? new _$$TestStatefulHandlerPrecedenceProps$JsMap(new JsBackedMap()) + : new _$$TestStatefulHandlerPrecedenceProps(backingProps); // Concrete props implementation. // @@ -874,18 +1219,15 @@ 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 an unknown ddc issue. - // See for more details - _$$TestStatefulHandlerPrecedenceProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStatefulHandlerPrecedenceProps._(); + factory _$$TestStatefulHandlerPrecedenceProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStatefulHandlerPrecedenceProps$PlainMap(backingMap); + } else { + return new _$$TestStatefulHandlerPrecedenceProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -900,6 +1242,40 @@ class _$$TestStatefulHandlerPrecedenceProps String get propKeyNamespace => 'TestStatefulHandlerPrecedenceProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStatefulHandlerPrecedenceProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements _$TestStatefulHandlerPrecedenceState { @override @@ -955,6 +1331,10 @@ class _$TestStatefulHandlerPrecedenceComponent @override _$$TestStatefulHandlerPrecedenceProps typedPropsFactory(Map backingMap) => new _$$TestStatefulHandlerPrecedenceProps(backingMap); + @override + _$$TestStatefulHandlerPrecedenceProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestStatefulHandlerPrecedenceProps$JsMap(backingMap); @override _$$TestStatefulHandlerPrecedenceState typedStateFactory(Map backingMap) => @@ -970,6 +1350,14 @@ class _$TestStatefulHandlerPrecedenceComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulHandlerPrecedenceProps ]; + _$$TestStatefulHandlerPrecedenceProps$JsMap _cachedTypedProps; + @override + _$$TestStatefulHandlerPrecedenceProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -1029,7 +1417,9 @@ class TestStatefulPropValidationProps extends _$TestStatefulPropValidationProps _$$TestStatefulPropValidationProps _$TestStatefulPropValidation( [Map backingProps]) => - new _$$TestStatefulPropValidationProps(backingProps); + backingProps == null + ? new _$$TestStatefulPropValidationProps$JsMap(new JsBackedMap()) + : new _$$TestStatefulPropValidationProps(backingProps); // Concrete props implementation. // @@ -1038,18 +1428,15 @@ 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 an unknown ddc issue. - // See for more details - _$$TestStatefulPropValidationProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStatefulPropValidationProps._(); + factory _$$TestStatefulPropValidationProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStatefulPropValidationProps$PlainMap(backingMap); + } else { + return new _$$TestStatefulPropValidationProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1064,6 +1451,40 @@ class _$$TestStatefulPropValidationProps String get propKeyNamespace => 'TestStatefulPropValidationProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStatefulPropValidationProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TestStatefulPropValidationStateAccessorsMixin implements _$TestStatefulPropValidationState { @override @@ -1118,6 +1539,10 @@ class _$TestStatefulPropValidationComponent @override _$$TestStatefulPropValidationProps typedPropsFactory(Map backingMap) => new _$$TestStatefulPropValidationProps(backingMap); + @override + _$$TestStatefulPropValidationProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestStatefulPropValidationProps$JsMap(backingMap); @override _$$TestStatefulPropValidationState typedStateFactory(Map backingMap) => @@ -1133,6 +1558,14 @@ class _$TestStatefulPropValidationComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulPropValidationProps ]; + _$$TestStatefulPropValidationProps$JsMap _cachedTypedProps; + @override + _$$TestStatefulPropValidationProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -1168,7 +1601,9 @@ class TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps } _$$TestStatefulRedrawOnProps _$TestStatefulRedrawOn([Map backingProps]) => - new _$$TestStatefulRedrawOnProps(backingProps); + backingProps == null + ? new _$$TestStatefulRedrawOnProps$JsMap(new JsBackedMap()) + : new _$$TestStatefulRedrawOnProps(backingProps); // Concrete props implementation. // @@ -1176,18 +1611,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestStatefulRedrawOnProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStatefulRedrawOnProps._(); + factory _$$TestStatefulRedrawOnProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStatefulRedrawOnProps$PlainMap(backingMap); + } else { + return new _$$TestStatefulRedrawOnProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1202,6 +1634,39 @@ class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps String get propKeyNamespace => 'TestStatefulRedrawOnProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStatefulRedrawOnProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TestStatefulRedrawOnStateAccessorsMixin implements _$TestStatefulRedrawOnState { @override @@ -1254,6 +1719,10 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { @override _$$TestStatefulRedrawOnProps typedPropsFactory(Map backingMap) => new _$$TestStatefulRedrawOnProps(backingMap); + @override + _$$TestStatefulRedrawOnProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestStatefulRedrawOnProps$JsMap(backingMap); @override _$$TestStatefulRedrawOnState typedStateFactory(Map backingMap) => @@ -1269,6 +1738,14 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { final List $defaultConsumedProps = const [ _$metaForTestStatefulRedrawOnProps ]; + _$$TestStatefulRedrawOnProps$JsMap _cachedTypedProps; + @override + _$$TestStatefulRedrawOnProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -1305,7 +1782,9 @@ class TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps _$$TestStatefulStoreHandlersProps _$TestStatefulStoreHandlers( [Map backingProps]) => - new _$$TestStatefulStoreHandlersProps(backingProps); + backingProps == null + ? new _$$TestStatefulStoreHandlersProps$JsMap(new JsBackedMap()) + : new _$$TestStatefulStoreHandlersProps(backingProps); // Concrete props implementation. // @@ -1313,18 +1792,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestStatefulStoreHandlersProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestStatefulStoreHandlersProps._(); + factory _$$TestStatefulStoreHandlersProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestStatefulStoreHandlersProps$PlainMap(backingMap); + } else { + return new _$$TestStatefulStoreHandlersProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1339,6 +1815,40 @@ class _$$TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps String get propKeyNamespace => 'TestStatefulStoreHandlersProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestStatefulStoreHandlersProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$TestStatefulStoreHandlersStateAccessorsMixin implements _$TestStatefulStoreHandlersState { @override @@ -1392,6 +1902,10 @@ class _$TestStatefulStoreHandlersComponent @override _$$TestStatefulStoreHandlersProps typedPropsFactory(Map backingMap) => new _$$TestStatefulStoreHandlersProps(backingMap); + @override + _$$TestStatefulStoreHandlersProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestStatefulStoreHandlersProps$JsMap(backingMap); @override _$$TestStatefulStoreHandlersState typedStateFactory(Map backingMap) => @@ -1407,4 +1921,12 @@ class _$TestStatefulStoreHandlersComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulStoreHandlersProps ]; + _$$TestStatefulStoreHandlersProps$JsMap _cachedTypedProps; + @override + _$$TestStatefulStoreHandlersProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/test/over_react/component_declaration/redux_component_test.over_react.g.dart b/test/over_react/component_declaration/redux_component_test.over_react.g.dart index 4d12a3192..3f3196232 100644 --- a/test/over_react/component_declaration/redux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/redux_component_test.over_react.g.dart @@ -37,8 +37,9 @@ class TestDefaultProps extends _$TestDefaultProps static const PropsMeta meta = _$metaForTestDefaultProps; } -_$$TestDefaultProps _$TestDefault([Map backingProps]) => - new _$$TestDefaultProps(backingProps); +_$$TestDefaultProps _$TestDefault([Map backingProps]) => backingProps == null + ? new _$$TestDefaultProps$JsMap(new JsBackedMap()) + : new _$$TestDefaultProps(backingProps); // Concrete props implementation. // @@ -46,18 +47,15 @@ _$$TestDefaultProps _$TestDefault([Map backingProps]) => class _$$TestDefaultProps extends _$TestDefaultProps with _$TestDefaultPropsAccessorsMixin implements TestDefaultProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$TestDefaultProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestDefaultProps._(); + factory _$$TestDefaultProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestDefaultProps$PlainMap(backingMap); + } else { + return new _$$TestDefaultProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -72,6 +70,38 @@ class _$$TestDefaultProps extends _$TestDefaultProps String get propKeyNamespace => 'TestDefaultProps.'; } +class _$$TestDefaultProps$PlainMap extends _$$TestDefaultProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$TestDefaultProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$TestDefaultProps$JsMap extends _$$TestDefaultProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$TestDefaultProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -80,6 +110,9 @@ class _$TestDefaultComponent extends TestDefaultComponent { @override _$$TestDefaultProps typedPropsFactory(Map backingMap) => new _$$TestDefaultProps(backingMap); + @override + _$$TestDefaultProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestDefaultProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -91,6 +124,14 @@ class _$TestDefaultComponent extends TestDefaultComponent { final List $defaultConsumedProps = const [ _$metaForTestDefaultProps ]; + _$$TestDefaultProps$JsMap _cachedTypedProps; + @override + _$$TestDefaultProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -124,8 +165,9 @@ class TestConnectProps extends _$TestConnectProps static const PropsMeta meta = _$metaForTestConnectProps; } -_$$TestConnectProps _$TestConnect([Map backingProps]) => - new _$$TestConnectProps(backingProps); +_$$TestConnectProps _$TestConnect([Map backingProps]) => backingProps == null + ? new _$$TestConnectProps$JsMap(new JsBackedMap()) + : new _$$TestConnectProps(backingProps); // Concrete props implementation. // @@ -133,18 +175,15 @@ _$$TestConnectProps _$TestConnect([Map backingProps]) => class _$$TestConnectProps extends _$TestConnectProps with _$TestConnectPropsAccessorsMixin implements 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 an unknown ddc issue. - // See for more details - _$$TestConnectProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestConnectProps._(); + factory _$$TestConnectProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestConnectProps$PlainMap(backingMap); + } else { + return new _$$TestConnectProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -159,6 +198,38 @@ class _$$TestConnectProps extends _$TestConnectProps String get propKeyNamespace => 'TestConnectProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestConnectProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -167,6 +238,9 @@ class _$TestConnectComponent extends TestConnectComponent { @override _$$TestConnectProps typedPropsFactory(Map backingMap) => new _$$TestConnectProps(backingMap); + @override + _$$TestConnectProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestConnectProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -178,6 +252,14 @@ class _$TestConnectComponent extends TestConnectComponent { final List $defaultConsumedProps = const [ _$metaForTestConnectProps ]; + _$$TestConnectProps$JsMap _cachedTypedProps; + @override + _$$TestConnectProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } // React component factory implementation. @@ -210,8 +292,9 @@ class TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin { static const PropsMeta meta = _$metaForTestPureProps; } -_$$TestPureProps _$TestPure([Map backingProps]) => - new _$$TestPureProps(backingProps); +_$$TestPureProps _$TestPure([Map backingProps]) => backingProps == null + ? new _$$TestPureProps$JsMap(new JsBackedMap()) + : new _$$TestPureProps(backingProps); // Concrete props implementation. // @@ -219,18 +302,15 @@ _$$TestPureProps _$TestPure([Map backingProps]) => class _$$TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin implements TestPureProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$TestPureProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestPureProps._(); + factory _$$TestPureProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestPureProps$PlainMap(backingMap); + } else { + return new _$$TestPureProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -244,6 +324,38 @@ class _$$TestPureProps extends _$TestPureProps String get propKeyNamespace => 'TestPureProps.'; } +class _$$TestPureProps$PlainMap extends _$$TestPureProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$TestPureProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$TestPureProps$JsMap extends _$$TestPureProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$TestPureProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -252,6 +364,9 @@ class _$TestPureComponent extends TestPureComponent { @override _$$TestPureProps typedPropsFactory(Map backingMap) => new _$$TestPureProps(backingMap); + @override + _$$TestPureProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestPureProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -263,4 +378,12 @@ class _$TestPureComponent extends TestPureComponent { final List $defaultConsumedProps = const [ _$metaForTestPureProps ]; + _$$TestPureProps$JsMap _cachedTypedProps; + @override + _$$TestPureProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 3071599aa..504d3ee6b 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 @@ -98,7 +98,9 @@ class TestCompositeComponentProps extends _$TestCompositeComponentProps } _$$TestCompositeComponentProps _$TestCompositeComponent([Map backingProps]) => - new _$$TestCompositeComponentProps(backingProps); + backingProps == null + ? new _$$TestCompositeComponentProps$JsMap(new JsBackedMap()) + : new _$$TestCompositeComponentProps(backingProps); // Concrete props implementation. // @@ -106,18 +108,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TestCompositeComponentProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestCompositeComponentProps._(); + factory _$$TestCompositeComponentProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestCompositeComponentProps$PlainMap(backingMap); + } else { + return new _$$TestCompositeComponentProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -132,6 +131,40 @@ class _$$TestCompositeComponentProps extends _$TestCompositeComponentProps String get propKeyNamespace => 'TestCompositeComponentProps.'; } +class _$$TestCompositeComponentProps$PlainMap + extends _$$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 an unknown ddc issue. + // See for more details + _$$TestCompositeComponentProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$TestCompositeComponentProps$JsMap + extends _$$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 an unknown ddc issue. + // See for more details + _$$TestCompositeComponentProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -141,6 +174,10 @@ class _$TestCompositeComponentComponent @override _$$TestCompositeComponentProps typedPropsFactory(Map backingMap) => new _$$TestCompositeComponentProps(backingMap); + @override + _$$TestCompositeComponentProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$TestCompositeComponentProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -152,4 +189,12 @@ class _$TestCompositeComponentComponent final List $defaultConsumedProps = const [ _$metaForTestCompositeComponentProps ]; + _$$TestCompositeComponentProps$JsMap _cachedTypedProps; + @override + _$$TestCompositeComponentProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 cede73bab..5509b44ad 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 @@ -36,8 +36,9 @@ class DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin { static const PropsMeta meta = _$metaForDomTestProps; } -_$$DomTestProps _$DomTest([Map backingProps]) => - new _$$DomTestProps(backingProps); +_$$DomTestProps _$DomTest([Map backingProps]) => backingProps == null + ? new _$$DomTestProps$JsMap(new JsBackedMap()) + : new _$$DomTestProps(backingProps); // Concrete props implementation. // @@ -45,18 +46,15 @@ _$$DomTestProps _$DomTest([Map backingProps]) => class _$$DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin implements 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 an unknown ddc issue. - // See for more details - _$$DomTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$DomTestProps._(); + factory _$$DomTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$DomTestProps$PlainMap(backingMap); + } else { + return new _$$DomTestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -70,6 +68,38 @@ class _$$DomTestProps extends _$DomTestProps String get propKeyNamespace => 'DomTestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$DomTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -78,6 +108,9 @@ class _$DomTestComponent extends DomTestComponent { @override _$$DomTestProps typedPropsFactory(Map backingMap) => new _$$DomTestProps(backingMap); + @override + _$$DomTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$DomTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -89,4 +122,12 @@ class _$DomTestComponent extends DomTestComponent { final List $defaultConsumedProps = const [ _$metaForDomTestProps ]; + _$$DomTestProps$JsMap _cachedTypedProps; + @override + _$$DomTestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 7ad0ffa12..3b24387d4 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,7 +64,9 @@ class TestProps extends _$TestProps with _$TestPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestProps; } -_$$TestProps _$Test([Map backingProps]) => new _$$TestProps(backingProps); +_$$TestProps _$Test([Map backingProps]) => backingProps == null + ? new _$$TestProps$JsMap(new JsBackedMap()) + : new _$$TestProps(backingProps); // Concrete props implementation. // @@ -72,18 +74,15 @@ _$$TestProps _$Test([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$TestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TestProps._(); + factory _$$TestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TestProps$PlainMap(backingMap); + } else { + return new _$$TestProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -97,6 +96,38 @@ class _$$TestProps extends _$TestProps String get propKeyNamespace => 'TestProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -105,6 +136,9 @@ class _$TestComponent extends TestComponent { @override _$$TestProps typedPropsFactory(Map backingMap) => new _$$TestProps(backingMap); + @override + _$$TestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -114,4 +148,12 @@ class _$TestComponent extends TestComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTestProps]; + _$$TestProps$JsMap _cachedTypedProps; + @override + _$$TestProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 96385c530..22e6e968b 100644 --- a/test/test_util/one_level_wrapper.over_react.g.dart +++ b/test/test_util/one_level_wrapper.over_react.g.dart @@ -39,7 +39,9 @@ class OneLevelWrapperProps extends _$OneLevelWrapperProps } _$$OneLevelWrapperProps _$OneLevelWrapper([Map backingProps]) => - new _$$OneLevelWrapperProps(backingProps); + backingProps == null + ? new _$$OneLevelWrapperProps$JsMap(new JsBackedMap()) + : new _$$OneLevelWrapperProps(backingProps); // Concrete props implementation. // @@ -47,18 +49,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$OneLevelWrapperProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$OneLevelWrapperProps._(); + factory _$$OneLevelWrapperProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$OneLevelWrapperProps$PlainMap(backingMap); + } else { + return new _$$OneLevelWrapperProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -73,6 +72,38 @@ class _$$OneLevelWrapperProps extends _$OneLevelWrapperProps String get propKeyNamespace => 'OneLevelWrapperProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$OneLevelWrapperProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -81,6 +112,9 @@ class _$OneLevelWrapperComponent extends OneLevelWrapperComponent { @override _$$OneLevelWrapperProps typedPropsFactory(Map backingMap) => new _$$OneLevelWrapperProps(backingMap); + @override + _$$OneLevelWrapperProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$OneLevelWrapperProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -92,4 +126,12 @@ class _$OneLevelWrapperComponent extends OneLevelWrapperComponent { final List $defaultConsumedProps = const [ _$metaForOneLevelWrapperProps ]; + _$$OneLevelWrapperProps$JsMap _cachedTypedProps; + @override + _$$OneLevelWrapperProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } 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 5bc510795..263473a42 100644 --- a/test/test_util/two_level_wrapper.over_react.g.dart +++ b/test/test_util/two_level_wrapper.over_react.g.dart @@ -39,7 +39,9 @@ class TwoLevelWrapperProps extends _$TwoLevelWrapperProps } _$$TwoLevelWrapperProps _$TwoLevelWrapper([Map backingProps]) => - new _$$TwoLevelWrapperProps(backingProps); + backingProps == null + ? new _$$TwoLevelWrapperProps$JsMap(new JsBackedMap()) + : new _$$TwoLevelWrapperProps(backingProps); // Concrete props implementation. // @@ -47,18 +49,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$TwoLevelWrapperProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TwoLevelWrapperProps._(); + factory _$$TwoLevelWrapperProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TwoLevelWrapperProps$PlainMap(backingMap); + } else { + return new _$$TwoLevelWrapperProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -73,6 +72,38 @@ class _$$TwoLevelWrapperProps extends _$TwoLevelWrapperProps String get propKeyNamespace => 'TwoLevelWrapperProps.'; } +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 an unknown ddc issue. + // See for more details + _$$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; +} + +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 an unknown ddc issue. + // See for more details + _$$TwoLevelWrapperProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -81,6 +112,9 @@ class _$TwoLevelWrapperComponent extends TwoLevelWrapperComponent { @override _$$TwoLevelWrapperProps typedPropsFactory(Map backingMap) => new _$$TwoLevelWrapperProps(backingMap); + @override + _$$TwoLevelWrapperProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TwoLevelWrapperProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -92,4 +126,12 @@ class _$TwoLevelWrapperComponent extends TwoLevelWrapperComponent { final List $defaultConsumedProps = const [ _$metaForTwoLevelWrapperProps ]; + _$$TwoLevelWrapperProps$JsMap _cachedTypedProps; + @override + _$$TwoLevelWrapperProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/tool/reduced_test_case.dart b/tool/reduced_test_case.dart new file mode 100644 index 000000000..398effcc6 --- /dev/null +++ b/tool/reduced_test_case.dart @@ -0,0 +1,8 @@ +//class Component { +// Map get props {} +//} +// +//class UiComponent extends Component { +// @override +// TProps get props; // only happens when abstract +//} diff --git a/web/src/demo_components/button.dart b/web/src/demo_components/button.dart index 7ffaeb70d..7a917eabe 100644 --- a/web/src/demo_components/button.dart +++ b/web/src/demo_components/button.dart @@ -78,7 +78,7 @@ class _$ButtonProps extends UiProps { class _$ButtonState extends UiState {} @Component() -class ButtonComponent extends UiStatefulComponent { +class ButtonComponent extends UiStatefulComponent2 { @override Map getDefaultProps() => (newProps() ..skin = ButtonSkin.PRIMARY @@ -89,6 +89,8 @@ class ButtonComponent extends UiSt ..type = ButtonType.BUTTON ); +// T get props; +// @override render() { return renderButton(props.children); diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 52f80a87b..93bfcb6cd 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -154,7 +154,9 @@ class ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin { static const PropsMeta meta = _$metaForButtonProps; } -_$$ButtonProps _$Button([Map backingProps]) => new _$$ButtonProps(backingProps); +_$$ButtonProps _$Button([Map backingProps]) => backingProps == null + ? new _$$ButtonProps$JsMap(new JsBackedMap()) + : new _$$ButtonProps(backingProps); // Concrete props implementation. // @@ -162,18 +164,15 @@ _$$ButtonProps _$Button([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$ButtonProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ButtonProps._(); + factory _$$ButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonProps$PlainMap(backingMap); + } else { + return new _$$ButtonProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -187,6 +186,38 @@ class _$$ButtonProps extends _$ButtonProps String get propKeyNamespace => 'ButtonProps.'; } +class _$$ButtonProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ButtonProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ButtonProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ButtonProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$ButtonStateAccessorsMixin implements _$ButtonState { @override Map get state; @@ -237,6 +268,9 @@ class _$ButtonComponent extends ButtonComponent { @override _$$ButtonProps typedPropsFactory(Map backingMap) => new _$$ButtonProps(backingMap); + @override + _$$ButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ButtonProps$JsMap(backingMap); @override _$$ButtonState typedStateFactory(Map backingMap) => @@ -252,4 +286,12 @@ class _$ButtonComponent extends ButtonComponent { final List $defaultConsumedProps = const [ _$metaForButtonProps ]; + _$$ButtonProps$JsMap _cachedTypedProps; + @override + _$$ButtonProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/button_group.dart b/web/src/demo_components/button_group.dart index 20ad6bb58..dabb7c387 100644 --- a/web/src/demo_components/button_group.dart +++ b/web/src/demo_components/button_group.dart @@ -34,7 +34,7 @@ class _$ButtonGroupState extends UiState {} @Component() class ButtonGroupComponent - extends UiStatefulComponent { + extends UiStatefulComponent2 { @override Map getDefaultProps() => (newProps() ..size = ButtonGroupSize.DEFAULT @@ -149,7 +149,7 @@ class ButtonGroupSize extends ClassNameConstant { /// } /// /// @Component() -/// class MyComponent extends UiComponent { +/// class MyComponent extends UiComponent2 { /// ButtonGroupSize matchingButtonGroupSize = buttonToButtonGroupSize[props.size]; /// } final Map buttonToButtonGroupSize = const { diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index 59d97bd28..77f4a8871 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -83,8 +83,9 @@ class ButtonGroupProps extends _$ButtonGroupProps static const PropsMeta meta = _$metaForButtonGroupProps; } -_$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => - new _$$ButtonGroupProps(backingProps); +_$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => backingProps == null + ? new _$$ButtonGroupProps$JsMap(new JsBackedMap()) + : new _$$ButtonGroupProps(backingProps); // Concrete props implementation. // @@ -92,18 +93,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ButtonGroupProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ButtonGroupProps._(); + factory _$$ButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonGroupProps$PlainMap(backingMap); + } else { + return new _$$ButtonGroupProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -118,6 +116,38 @@ class _$$ButtonGroupProps extends _$ButtonGroupProps String get propKeyNamespace => 'ButtonGroupProps.'; } +class _$$ButtonGroupProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ButtonGroupProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ButtonGroupProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ButtonGroupProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$ButtonGroupStateAccessorsMixin implements _$ButtonGroupState { @override Map get state; @@ -169,6 +199,9 @@ class _$ButtonGroupComponent extends ButtonGroupComponent { @override _$$ButtonGroupProps typedPropsFactory(Map backingMap) => new _$$ButtonGroupProps(backingMap); + @override + _$$ButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ButtonGroupProps$JsMap(backingMap); @override _$$ButtonGroupState typedStateFactory(Map backingMap) => @@ -184,4 +217,12 @@ class _$ButtonGroupComponent extends ButtonGroupComponent { final List $defaultConsumedProps = const [ _$metaForButtonGroupProps ]; + _$$ButtonGroupProps$JsMap _cachedTypedProps; + @override + _$$ButtonGroupProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/list_group.dart b/web/src/demo_components/list_group.dart index e0027703e..ec3e735c3 100644 --- a/web/src/demo_components/list_group.dart +++ b/web/src/demo_components/list_group.dart @@ -1,6 +1,7 @@ import 'package:over_react/over_react.dart'; import '../demo_components.dart'; +import 'package:react/react.dart' as react; part 'list_group.over_react.g.dart'; /// Bootstrap's `ListGroup` component is flexible and powerful for @@ -20,7 +21,7 @@ class _$ListGroupProps extends UiProps { } @Component() -class ListGroupComponent extends UiComponent { +class ListGroupComponent extends UiComponent2 { @override Map getDefaultProps() => (newProps() ..elementType = ListGroupElementType.DIV diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index 09d8f9c5b..92182752e 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -54,8 +54,9 @@ class ListGroupProps extends _$ListGroupProps static const PropsMeta meta = _$metaForListGroupProps; } -_$$ListGroupProps _$ListGroup([Map backingProps]) => - new _$$ListGroupProps(backingProps); +_$$ListGroupProps _$ListGroup([Map backingProps]) => backingProps == null + ? new _$$ListGroupProps$JsMap(new JsBackedMap()) + : new _$$ListGroupProps(backingProps); // Concrete props implementation. // @@ -63,18 +64,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ListGroupProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ListGroupProps._(); + factory _$$ListGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupProps$PlainMap(backingMap); + } else { + return new _$$ListGroupProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -88,6 +86,38 @@ class _$$ListGroupProps extends _$ListGroupProps String get propKeyNamespace => 'ListGroupProps.'; } +class _$$ListGroupProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ListGroupProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ListGroupProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ListGroupProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -96,6 +126,9 @@ class _$ListGroupComponent extends ListGroupComponent { @override _$$ListGroupProps typedPropsFactory(Map backingMap) => new _$$ListGroupProps(backingMap); + @override + _$$ListGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ListGroupProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -107,4 +140,12 @@ class _$ListGroupComponent extends ListGroupComponent { final List $defaultConsumedProps = const [ _$metaForListGroupProps ]; + _$$ListGroupProps$JsMap _cachedTypedProps; + @override + _$$ListGroupProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/list_group_item.dart b/web/src/demo_components/list_group_item.dart index cf00101b7..3a93b7031 100644 --- a/web/src/demo_components/list_group_item.dart +++ b/web/src/demo_components/list_group_item.dart @@ -84,7 +84,7 @@ class _$ListGroupItemProps extends UiProps { } @Component() -class ListGroupItemComponent extends UiComponent { +class ListGroupItemComponent extends UiComponent2 { @override Map getDefaultProps() => (newProps() ..elementType = ListGroupItemElementType.SPAN diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index ed0b37ebe..6f7d8e89f 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -202,7 +202,9 @@ class ListGroupItemProps extends _$ListGroupItemProps } _$$ListGroupItemProps _$ListGroupItem([Map backingProps]) => - new _$$ListGroupItemProps(backingProps); + backingProps == null + ? new _$$ListGroupItemProps$JsMap(new JsBackedMap()) + : new _$$ListGroupItemProps(backingProps); // Concrete props implementation. // @@ -210,18 +212,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ListGroupItemProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ListGroupItemProps._(); + factory _$$ListGroupItemProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupItemProps$PlainMap(backingMap); + } else { + return new _$$ListGroupItemProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -236,6 +235,38 @@ class _$$ListGroupItemProps extends _$ListGroupItemProps String get propKeyNamespace => 'ListGroupItemProps.'; } +class _$$ListGroupItemProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ListGroupItemProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ListGroupItemProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ListGroupItemProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -244,6 +275,9 @@ class _$ListGroupItemComponent extends ListGroupItemComponent { @override _$$ListGroupItemProps typedPropsFactory(Map backingMap) => new _$$ListGroupItemProps(backingMap); + @override + _$$ListGroupItemProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ListGroupItemProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -255,4 +289,12 @@ class _$ListGroupItemComponent extends ListGroupItemComponent { final List $defaultConsumedProps = const [ _$metaForListGroupItemProps ]; + _$$ListGroupItemProps$JsMap _cachedTypedProps; + @override + _$$ListGroupItemProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/progress.dart b/web/src/demo_components/progress.dart index 4077140de..b708d1df8 100644 --- a/web/src/demo_components/progress.dart +++ b/web/src/demo_components/progress.dart @@ -83,7 +83,7 @@ class _$ProgressState extends UiState { } @Component() -class ProgressComponent extends UiStatefulComponent { +class ProgressComponent extends UiStatefulComponent2 { @override Map getDefaultProps() => (newProps() ..value = 0.0 diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index af15a8ec8..61f5eab4d 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -202,8 +202,9 @@ class ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin { static const PropsMeta meta = _$metaForProgressProps; } -_$$ProgressProps _$Progress([Map backingProps]) => - new _$$ProgressProps(backingProps); +_$$ProgressProps _$Progress([Map backingProps]) => backingProps == null + ? new _$$ProgressProps$JsMap(new JsBackedMap()) + : new _$$ProgressProps(backingProps); // Concrete props implementation. // @@ -211,18 +212,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ProgressProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ProgressProps._(); + factory _$$ProgressProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ProgressProps$PlainMap(backingMap); + } else { + return new _$$ProgressProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -236,6 +234,38 @@ class _$$ProgressProps extends _$ProgressProps String get propKeyNamespace => 'ProgressProps.'; } +class _$$ProgressProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ProgressProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ProgressProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ProgressProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$ProgressStateAccessorsMixin implements _$ProgressState { @override Map get state; @@ -299,6 +329,9 @@ class _$ProgressComponent extends ProgressComponent { @override _$$ProgressProps typedPropsFactory(Map backingMap) => new _$$ProgressProps(backingMap); + @override + _$$ProgressProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ProgressProps$JsMap(backingMap); @override _$$ProgressState typedStateFactory(Map backingMap) => @@ -314,4 +347,12 @@ class _$ProgressComponent extends ProgressComponent { final List $defaultConsumedProps = const [ _$metaForProgressProps ]; + _$$ProgressProps$JsMap _cachedTypedProps; + @override + _$$ProgressProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/tag.dart b/web/src/demo_components/tag.dart index 927e5a4a9..5b6d5cb18 100644 --- a/web/src/demo_components/tag.dart +++ b/web/src/demo_components/tag.dart @@ -27,7 +27,7 @@ class _$TagProps extends UiProps { } @Component() -class TagComponent extends UiComponent { +class TagComponent extends UiComponent2 { @override Map getDefaultProps() => (newProps() ..skin = TagSkin.DEFAULT diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index 309405652..29459cb2a 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -64,7 +64,9 @@ class TagProps extends _$TagProps with _$TagPropsAccessorsMixin { static const PropsMeta meta = _$metaForTagProps; } -_$$TagProps _$Tag([Map backingProps]) => new _$$TagProps(backingProps); +_$$TagProps _$Tag([Map backingProps]) => backingProps == null + ? new _$$TagProps$JsMap(new JsBackedMap()) + : new _$$TagProps(backingProps); // Concrete props implementation. // @@ -72,18 +74,15 @@ _$$TagProps _$Tag([Map backingProps]) => new _$$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 an unknown ddc issue. - // See for more details - _$$TagProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$TagProps._(); + factory _$$TagProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TagProps$PlainMap(backingMap); + } else { + return new _$$TagProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -97,6 +96,38 @@ class _$$TagProps extends _$TagProps String get propKeyNamespace => 'TagProps.'; } +class _$$TagProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$TagProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$TagProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$TagProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 @@ -104,6 +135,9 @@ class _$$TagProps extends _$TagProps class _$TagComponent extends TagComponent { @override _$$TagProps typedPropsFactory(Map backingMap) => new _$$TagProps(backingMap); + @override + _$$TagProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TagProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -113,4 +147,12 @@ class _$TagComponent extends TagComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTagProps]; + _$$TagProps$JsMap _cachedTypedProps; + @override + _$$TagProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index 5813a21f9..d22e39ae1 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -91,8 +91,9 @@ class ToggleButtonProps extends _$ToggleButtonProps static const PropsMeta meta = _$metaForToggleButtonProps; } -_$$ToggleButtonProps _$ToggleButton([Map backingProps]) => - new _$$ToggleButtonProps(backingProps); +_$$ToggleButtonProps _$ToggleButton([Map backingProps]) => backingProps == null + ? new _$$ToggleButtonProps$JsMap(new JsBackedMap()) + : new _$$ToggleButtonProps(backingProps); // Concrete props implementation. // @@ -100,18 +101,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ToggleButtonProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ToggleButtonProps._(); + factory _$$ToggleButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonProps$PlainMap(backingMap); + } else { + return new _$$ToggleButtonProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -126,6 +124,38 @@ class _$$ToggleButtonProps extends _$ToggleButtonProps String get propKeyNamespace => 'ToggleButtonProps.'; } +class _$$ToggleButtonProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ToggleButtonProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ToggleButtonProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ToggleButtonProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$ToggleButtonStateAccessorsMixin implements _$ToggleButtonState { @override @@ -211,6 +241,9 @@ class _$ToggleButtonComponent extends ToggleButtonComponent { @override _$$ToggleButtonProps typedPropsFactory(Map backingMap) => new _$$ToggleButtonProps(backingMap); + @override + _$$ToggleButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonProps$JsMap(backingMap); @override _$$ToggleButtonState typedStateFactory(Map backingMap) => @@ -226,4 +259,12 @@ class _$ToggleButtonComponent extends ToggleButtonComponent { final List $defaultConsumedProps = const [ _$metaForToggleButtonProps ]; + _$$ToggleButtonProps$JsMap _cachedTypedProps; + @override + _$$ToggleButtonProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index 8f3a3cbd3..928d8ffdf 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -40,7 +40,9 @@ class ToggleButtonGroupProps extends _$ToggleButtonGroupProps } _$$ToggleButtonGroupProps _$ToggleButtonGroup([Map backingProps]) => - new _$$ToggleButtonGroupProps(backingProps); + backingProps == null + ? new _$$ToggleButtonGroupProps$JsMap(new JsBackedMap()) + : new _$$ToggleButtonGroupProps(backingProps); // Concrete props implementation. // @@ -48,18 +50,15 @@ _$$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 an unknown ddc issue. - // See for more details - _$$ToggleButtonGroupProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; + _$$ToggleButtonGroupProps._(); + factory _$$ToggleButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonGroupProps$PlainMap(backingMap); + } else { + return new _$$ToggleButtonGroupProps$JsMap(backingMap); + } } - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -74,6 +73,38 @@ class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps String get propKeyNamespace => 'ToggleButtonGroupProps.'; } +class _$$ToggleButtonGroupProps$PlainMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ToggleButtonGroupProps$PlainMap(Map backingMap) + : this._props = {}, + super._() { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; +} + +class _$$ToggleButtonGroupProps$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ToggleButtonGroupProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + abstract class _$ToggleButtonGroupStateAccessorsMixin implements _$ToggleButtonGroupState { @override @@ -126,6 +157,9 @@ class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { @override _$$ToggleButtonGroupProps typedPropsFactory(Map backingMap) => new _$$ToggleButtonGroupProps(backingMap); + @override + _$$ToggleButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonGroupProps$JsMap(backingMap); @override _$$ToggleButtonGroupState typedStateFactory(Map backingMap) => @@ -141,4 +175,12 @@ class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { final List $defaultConsumedProps = const [ _$metaForToggleButtonGroupProps ]; + _$$ToggleButtonGroupProps$JsMap _cachedTypedProps; + @override + _$$ToggleButtonGroupProps$JsMap get props => _cachedTypedProps; + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } } From 5933fb8364edd2ed72c4a70de152159000105b1e Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Tue, 12 Mar 2019 18:53:51 -0700 Subject: [PATCH 12/39] Get JS-backed maps working for state, conditionally generate code for Component2 --- .../generation/declaration_parsing.dart | 6 +- .../builder/generation/impl_generation.dart | 281 +++++++++++------- .../component_declaration/component_base.dart | 5 +- pubspec.yaml | 4 +- 4 files changed, 176 insertions(+), 120 deletions(-) diff --git a/lib/src/builder/generation/declaration_parsing.dart b/lib/src/builder/generation/declaration_parsing.dart index 0c5558873..f71a17b54 100644 --- a/lib/src/builder/generation/declaration_parsing.dart +++ b/lib/src/builder/generation/declaration_parsing.dart @@ -485,10 +485,14 @@ class ParsedDeclarations { class ComponentNode extends NodeWithMeta { static const String _subtypeOfParamName = 'subtypeOf'; + final bool isComponent2; + /// The value of the `subtypeOf` parameter passed in to this node's annotation. Identifier subtypeOfValue; - ComponentNode(unit) : super(unit) { + ComponentNode(ClassDeclaration node) + : this.isComponent2 = node.declaredElement.allSupertypes.any((type) => type.name == 'Component2'), + super(node) { // Perform special handling for the `subtypeOf` parameter of this node's annotation. // // If valid, omit it from `unsupportedArguments` so that the `meta` can be accessed without it diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index e9d780c5f..4347043cb 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -14,6 +14,7 @@ import 'package:analyzer/analyzer.dart'; import 'package:logging/logging.dart'; +import 'package:meta/meta.dart'; import 'package:over_react/src/component_declaration/annotations.dart' as annotations; import 'package:over_react/src/builder/generation/declaration_parsing.dart'; import 'package:over_react/src/builder/util.dart'; @@ -67,8 +68,8 @@ class ImplGenerator { final generatedComponentFactoryName = _componentFactoryName(componentClassName); - String typedPropsFactoryImpl = ''; - String typedStateFactoryImpl = ''; + StringBuffer typedPropsFactoryImpl = new StringBuffer(); + StringBuffer typedStateFactoryImpl = new StringBuffer(); // ---------------------------------------------------------------------- // Factory implementation @@ -128,42 +129,53 @@ class ImplGenerator { _generateMetaConstImpl(AccessorType.props, declarations.props)); outputContentsBuffer.write(_generateConsumablePropsOrStateClass(AccessorType.props, declarations.props)); - final jsMapImplName = _jsMapPropsImplClassNameFromPropsImplClassName(propsImplName); - - // fixme update this comment - /// _$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); - outputContentsBuffer.writeln( - '$propsImplName $privateSourcePrefix$factoryName([Map backingProps]) => ' - // FIXME clean up this logic and the null-awares (or lack thereof in the two impl classes) - // note: if we remove null-awares will that rbeak stuff like `typedPropsFactory(null)`? Does it even matter? - 'backingProps == null ? new $jsMapImplName(new JsBackedMap()) : new $propsImplName(backingProps);' - ); - - final String propKeyNamespace = _getAccessorKeyNamespace(declarations.props); - - outputContentsBuffer.write(_generateConcretePropsImpl( - AccessorType.props, consumerPropsName, propsImplName, generatedComponentFactoryName, - propKeyNamespace, declarations.props, propsAccessorsMixinName, consumablePropsName)); - - // fixme: is this implementation still needed here, or can we do it in the superclass? - // This implementation here is necessary so that mixin accesses aren't compiled as index$ax - final propsGetterTyping = ''' - $jsMapImplName _cachedTypedProps; - @override - $jsMapImplName get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - '''.split('\n').join(' '); + outputContentsBuffer.write( + '$propsImplName $privateSourcePrefix$factoryName([Map backingProps]) => '); + if (!declarations.component.isComponent2) { + /// _$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); + outputContentsBuffer.writeln('new $propsImplName(backingProps);'); + } else { + final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(propsImplName); + outputContentsBuffer.writeln( + // FIXME clean up this logic and the null-awares (or lack thereof in the two impl classes) + // note: if we remove null-awares will that rbeak stuff like `typedPropsFactory(null)`? Does it even matter? + 'backingProps == null ? new $jsMapImplName(new JsBackedMap()) : new $propsImplName(backingProps);' + ); + } - typedPropsFactoryImpl = - ' @override\n' - ' $propsImplName typedPropsFactory(Map backingMap) => new $propsImplName(backingMap);\n' - ' @override ' - ' $jsMapImplName typedPropsFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);\n\n'; + outputContentsBuffer.write(_generateConcretePropsOrStateImpl( + type: AccessorType.props, + consumerName: consumerPropsName, + implName: propsImplName, + componentFactoryName: generatedComponentFactoryName, + propKeyNamespace: _getAccessorKeyNamespace(declarations.props), + node: declarations.props, + accessorsMixinName: propsAccessorsMixinName, + consumableName: consumablePropsName, + isComponent2: declarations.component.isComponent2, + )); + + typedPropsFactoryImpl + ..writeln(' @override') + ..writeln(' $propsImplName typedPropsFactory(Map backingMap) => new $propsImplName(backingMap);'); + if (declarations.component.isComponent2) { + final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(propsImplName); + // fixme: is this implementation still needed here, or can we do it in the superclass? + // This implementation here is necessary so that mixin accesses aren't compiled as index$ax + typedPropsFactoryImpl + ..writeln(' $jsMapImplName _cachedTypedProps;') + ..writeln(' @override') + ..writeln(' $jsMapImplName get props => _cachedTypedProps;') + ..writeln(' ') + ..writeln(' @override') + ..writeln(' set props(Map value) {') + ..writeln(' super.props = value;') + ..writeln(' _cachedTypedProps = typedPropsFactoryJs(value);') + ..writeln(' }') + ..writeln() + ..writeln(' @override ') + ..writeln(' $jsMapImplName typedPropsFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);'); + } // ---------------------------------------------------------------------- @@ -174,8 +186,6 @@ class ImplGenerator { final consumableStateName = _publicPropsOrStateClassNameFromConsumerClassName(stateName); final stateImplName = _propsImplClassNameFromConsumerClassName(stateName); final stateAccessorsMixinName = _accessorsMixinNameFromConsumerName(stateName); - final typeParamsOnClass = declarations.state.node.typeParameters?.toSource() ?? ''; - final typeParamsOnSuper = removeBoundsFromTypeParameters(declarations.state.node.typeParameters); outputContentsBuffer.write(_generateAccessorsMixin( AccessorType.state, stateAccessorsMixinName, declarations.state, @@ -184,32 +194,39 @@ class ImplGenerator { _generateMetaConstImpl(AccessorType.state, declarations.state)); outputContentsBuffer.write(_generateConsumablePropsOrStateClass(AccessorType.state, declarations.state)); - outputContentsBuffer - ..writeln('// Concrete state implementation.') - ..writeln('//') - ..writeln('// Implements constructor and backing map.') - ..writeln('class $stateImplName$typeParamsOnClass extends $stateName$typeParamsOnSuper with $stateAccessorsMixinName$typeParamsOnSuper implements $consumableStateName$typeParamsOnSuper {') - ..writeln(' // This initializer of `_state` to an empty map, as well as the reassignment') - ..writeln(' // of `_state` in the constructor body is necessary to work around an unknown ddc issue.') - ..writeln(' // See for more details') - ..writeln(' $stateImplName(Map backingMap) : this._state = {} {') - ..writeln(' this._state = backingMap ?? {};') - ..writeln(' }') - ..writeln() - ..writeln(' /// The backing state map proxied by this class.') + outputContentsBuffer.write(_generateConcretePropsOrStateImpl( + type: AccessorType.state, + consumerName: stateName, + implName: stateImplName, + componentFactoryName: generatedComponentFactoryName, + propKeyNamespace: null, + node: declarations.state, + accessorsMixinName: stateAccessorsMixinName, + consumableName: consumableStateName, + isComponent2: declarations.component.isComponent2, + )); + + typedStateFactoryImpl ..writeln(' @override') - ..writeln(' Map get state => _state;') - ..writeln(' Map _state;') - ..writeln() - ..writeln(' /// Let [UiState] internals know that this class has been generated.') - ..writeln(' @override') - ..writeln(' bool get \$isClassGenerated => true;') - ..writeln('}') - ..writeln(); - - typedStateFactoryImpl = - ' @override\n' - ' $stateImplName typedStateFactory(Map backingMap) => new $stateImplName(backingMap);\n\n'; + ..writeln(' $stateImplName typedStateFactory(Map backingMap) => new $stateImplName(backingMap);'); + if (declarations.component.isComponent2) { + final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(stateImplName); + // fixme: is this implementation still needed here, or can we do it in the superclass? + // This implementation here is necessary so that mixin accesses aren't compiled as index$ax + typedStateFactoryImpl + ..writeln(' $jsMapImplName _cachedTypedState;') + ..writeln(' @override') + ..writeln(' $jsMapImplName get state => _cachedTypedState;') + ..writeln(' ') + ..writeln(' @override') + ..writeln(' set state(Map value) {') + ..writeln(' super.state = value;') + ..writeln(' _cachedTypedState = typedStateFactoryJs(value);') + ..writeln(' }') + ..writeln() + ..writeln(' @override ') + ..writeln(' $jsMapImplName typedStateFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);'); + } } // ---------------------------------------------------------------------- @@ -232,7 +249,6 @@ class ImplGenerator { ..writeln(' @override') ..writeln(' final List \$defaultConsumedProps = ' 'const [${_metaConstantName(consumablePropsName)}];') - ..writeln('$propsGetterTyping') ..writeln('}'); final implementsTypedPropsStateFactory = declarations.component.node.members.any((member) => @@ -342,7 +358,7 @@ class ImplGenerator { annotations.Accessor accessorMeta = instantiateAnnotation(field, annotations.Accessor); annotations.Accessor requiredProp = getConstantAnnotation(field, 'requiredProp', annotations.requiredProp); annotations.Accessor nullableRequiredProp = getConstantAnnotation(field, 'nullableRequiredProp', annotations.nullableRequiredProp); - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package annotations.Required requiredMeta = instantiateAnnotation(field, annotations.Required); @@ -528,12 +544,12 @@ class ImplGenerator { return className.replaceFirst(privateSourcePrefix, '$privateSourcePrefix\$'); } - static String _plainMapPropsImplClassNameFromPropsImplClassName(String implName) { - return '${implName}\$PlainMap'; + static String _plainMapAccessorsImplClassNameFromImplClassName(String implName) { + return '$implName\$PlainMap'; } - static String _jsMapPropsImplClassNameFromPropsImplClassName(String implName) { - return '${implName}\$JsMap'; + static String _jsMapAccessorImplClassNameFromImplClassName(String implName) { + return '$implName\$JsMap'; } /// Converts the consumer's written props classname to the consumable props @@ -713,35 +729,43 @@ class ImplGenerator { return buffer.toString(); } - String _generateConcretePropsImpl(AccessorType type, String consumerName, String implName, - String componentFactoryName, String propKeyNamespace, NodeWithMeta node, String accessorsMixinName, String consumableName) { + String _generateConcretePropsOrStateImpl({ + @required AccessorType type, + @required String consumerName, + @required String implName, + @required String componentFactoryName, + @required String propKeyNamespace, + @required NodeWithMeta node, + @required String accessorsMixinName, + @required String consumableName, + @required bool isComponent2, + }) { final typeParamsOnClass = node.node.typeParameters?.toSource() ?? ''; final typeParamsOnSuper = removeBoundsFromTypeParameters(node.node.typeParameters); - final plainMapImplName = _plainMapPropsImplClassNameFromPropsImplClassName(implName); - final jsMapImplName = _jsMapPropsImplClassNameFromPropsImplClassName(implName); - - - final classDeclaration = new StringBuffer() - ..write('class $implName$typeParamsOnClass extends $consumerName$typeParamsOnSuper with $accessorsMixinName$typeParamsOnSuper implements $consumableName$typeParamsOnSuper {\n'); - return (new StringBuffer() - ..writeln('// Concrete props implementation.') - ..writeln('//') - ..writeln('// Implements constructor and backing map, and links up to generated component factory.') - ..write(classDeclaration) - ..writeln(' $implName._();') - ..writeln(' factory $implName(Map backingMap) {') - ..writeln(' if (backingMap is JsBackedMap) {') - ..writeln(' return new $plainMapImplName(backingMap);') - ..writeln(' } else {') - ..writeln(' return new $jsMapImplName(backingMap);') - ..writeln(' }') - ..writeln(' }') - ..writeln() - ..writeln(' /// Let [UiProps] internals know that this class has been generated.') - ..writeln(' @override') - ..writeln(' bool get \$isClassGenerated => true;') - ..writeln() + final classDeclaration = new StringBuffer(); + if (isComponent2) { + classDeclaration.write('abstract '); + } + classDeclaration.write('class $implName$typeParamsOnClass ' + 'extends $consumerName$typeParamsOnSuper ' + 'with $accessorsMixinName$typeParamsOnSuper ' + 'implements $consumableName$typeParamsOnSuper { '); + + final propsOrState = type.isProps ? 'props' : 'state'; + + final buffer = new StringBuffer() + ..writeln('// Concrete $propsOrState implementation.') + ..writeln('//') + ..writeln('// Implements constructor and backing map, and links up to generated component factory.') + ..writeln(classDeclaration) + ..writeln(' /// Let [${type.isProps ? 'UiProps' : 'UiState'}] internals know that this class has been generated.') + ..writeln(' @override') + ..writeln(' bool get \$isClassGenerated => true;') + ..writeln(); + + if (type.isProps) { + buffer ..writeln(' /// The [ReactComponentFactory] associated with the component built by this class.') ..writeln(' @override') ..writeln(' ReactComponentFactoryProxy get componentFactory => $componentFactoryName;') @@ -749,35 +773,66 @@ class ImplGenerator { ..writeln(' /// The default namespace for the prop getters/setters generated for this class.') ..writeln(' @override') ..writeln(' String get propKeyNamespace => ${stringLiteral(propKeyNamespace)};') + ..writeln(); + } + + if (!isComponent2) { + 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 an unknown ddc issue.') + ..writeln(' // See for more details') + ..writeln(' $implName(Map backingMap) : this._$propsOrState = {} {') + ..writeln(' this._$propsOrState = backingMap ?? {};') + ..writeln(' }') + ..writeln() + ..writeln(' /// The backing $propsOrState map proxied by this class.') + ..writeln(' @override') + ..writeln(' Map get $propsOrState => _$propsOrState;') + ..writeln(' Map _$propsOrState;') + ..writeln('}'); + } else { + final plainMapImplName = _plainMapAccessorsImplClassNameFromImplClassName(implName); + final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(implName); + buffer + ..writeln(' $implName._();') + ..writeln() + ..writeln(' factory $implName(Map backingMap) {') + ..writeln(' if (backingMap is JsBackedMap) {') + ..writeln(' return new $jsMapImplName(backingMap);') + ..writeln(' } else {') + ..writeln(' return new $plainMapImplName(backingMap);') + ..writeln(' }') + ..writeln(' }') ..writeln('}') + ..writeln() ..writeln('class $plainMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') - ..writeln(' // This initializer of `_props` to an empty map, as well as the reassignment') - ..writeln(' // of `_props` in the constructor body is necessary to work around an unknown ddc issue.') + ..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 an unknown ddc issue.') ..writeln(' // See for more details') - ..writeln(' $plainMapImplName(Map backingMap) : this._props = {}, super._() {') - ..writeln(' this._props = backingMap ?? {};') + ..writeln(' $plainMapImplName(Map backingMap) : this._$propsOrState = {}, super._() {') + ..writeln(' this._$propsOrState = backingMap ?? {};') ..writeln(' }') ..writeln() - ..writeln(' /// The backing props map proxied by this class.') + ..writeln(' /// The backing $propsOrState map proxied by this class.') ..writeln(' @override') - ..writeln(' Map get props => _props;') - ..writeln(' Map _props;') + ..writeln(' Map get $propsOrState => _$propsOrState;') + ..writeln(' Map _$propsOrState;') ..writeln('}') ..writeln('class $jsMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') - ..writeln(' // This initializer of `_props` to an empty map, as well as the reassignment') - ..writeln(' // of `_props` in the constructor body is necessary to work around an unknown ddc issue.') + ..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 an unknown ddc issue.') ..writeln(' // See for more details') - ..writeln(' $jsMapImplName(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() {') - ..writeln(' this._props = backingMap ?? new JsBackedMap();') + ..writeln(' $jsMapImplName(JsBackedMap backingMap) : this._$propsOrState = new JsBackedMap(), super._() {') + ..writeln(' this._$propsOrState = backingMap ?? new JsBackedMap();') ..writeln(' }') ..writeln() - ..writeln(' /// The backing props map proxied by this class.') + ..writeln(' /// The backing $propsOrState map proxied by this class.') ..writeln(' @override') - ..writeln(' JsBackedMap get props => _props;') - ..writeln(' JsBackedMap _props;') - ..writeln('}') - ..writeln()) - .toString(); + ..writeln(' JsBackedMap get $propsOrState => _$propsOrState;') + ..writeln(' JsBackedMap _$propsOrState;') + ..writeln('}'); + } + return buffer.toString(); } String _generateConsumablePropsOrStateClass(AccessorType type, NodeWithMeta node) { diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 377bf03be..6cd0669b8 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -502,9 +502,7 @@ abstract class UiComponent2 extends react.Component2 imp /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. @override - set props(Map value) { - super.props = value; - } + set props(Map value) => super.props = value; /// The props Map that will be used to create the typed [props] object. Map get unwrappedProps => super.props; @@ -709,7 +707,6 @@ abstract class UiStatefulComponent2 Date: Tue, 12 Mar 2019 18:54:10 -0700 Subject: [PATCH 13/39] Commit generated code --- .../abstract_inheritance.over_react.g.dart | 57 +- example/builder/basic.over_react.g.dart | 46 +- .../builder/basic_library.over_react.g.dart | 104 +-- .../basic_with_state.over_react.g.dart | 57 +- .../basic_with_type_params.over_react.g.dart | 46 +- .../generic_inheritance_sub.over_react.g.dart | 58 +- ...eneric_inheritance_super.over_react.g.dart | 58 +- .../private_component.over_react.g.dart | 58 +- ...factory_public_component.over_react.g.dart | 46 +- .../component/resize_sensor.over_react.g.dart | 47 +- ...abstract_transition_test.over_react.g.dart | 58 +- ...mponent_integration_test.over_react.g.dart | 46 +- ...ccessor_integration_test.over_react.g.dart | 46 +- ...ccessor_integration_test.over_react.g.dart | 60 +- ...ccessor_integration_test.over_react.g.dart | 60 +- .../private_props_ddc_bug.over_react.g.dart | 46 +- ...ccessor_integration_test.over_react.g.dart | 46 +- ...d_prop_integration_tests.over_react.g.dart | 46 +- ...mponent_integration_test.over_react.g.dart | 60 +- ...ed_prop_integration_test.over_react.g.dart | 46 +- ...mponent_integration_test.over_react.g.dart | 46 +- ...ccessor_integration_test.over_react.g.dart | 46 +- ...ccessor_integration_test.over_react.g.dart | 60 +- ...ccessor_integration_test.over_react.g.dart | 60 +- .../private_props_ddc_bug.over_react.g.dart | 46 +- ...ccessor_integration_test.over_react.g.dart | 46 +- ...d_prop_integration_tests.over_react.g.dart | 46 +- ...mponent_integration_test.over_react.g.dart | 60 +- ...ed_prop_integration_test.over_react.g.dart | 46 +- .../test_a.over_react.g.dart | 46 +- .../test_b.over_react.g.dart | 46 +- .../extendedtype.over_react.g.dart | 46 +- .../type_inheritance/parent.over_react.g.dart | 47 +- .../subsubtype.over_react.g.dart | 46 +- .../subtype.over_react.g.dart | 47 +- .../flux_component_test.over_react.g.dart | 640 ++---------------- .../redux_component_test.over_react.g.dart | 141 +--- ...ummy_composite_component.over_react.g.dart | 49 +- .../util/dom_util_test.over_react.g.dart | 47 +- ...prop_key_util_test_dart2.over_react.g.dart | 46 +- .../one_level_wrapper.over_react.g.dart | 46 +- .../two_level_wrapper.over_react.g.dart | 46 +- .../demo_components/button.over_react.g.dart | 93 ++- .../button_group.over_react.g.dart | 93 ++- .../list_group.over_react.g.dart | 39 +- .../list_group_item.over_react.g.dart | 39 +- .../progress.over_react.g.dart | 93 ++- web/src/demo_components/tag.over_react.g.dart | 39 +- .../toggle_button.over_react.g.dart | 93 ++- .../toggle_button_group.over_react.g.dart | 93 ++- 50 files changed, 629 insertions(+), 2793 deletions(-) diff --git a/example/builder/abstract_inheritance.over_react.g.dart b/example/builder/abstract_inheritance.over_react.g.dart index 4fe1b01ef..1ea01aa92 100644 --- a/example/builder/abstract_inheritance.over_react.g.dart +++ b/example/builder/abstract_inheritance.over_react.g.dart @@ -48,9 +48,7 @@ class SubProps extends _$SubProps with _$SubPropsAccessorsMixin { static const PropsMeta meta = _$metaForSubProps; } -_$$SubProps _$Sub([Map backingProps]) => backingProps == null - ? new _$$SubProps$JsMap(new JsBackedMap()) - : new _$$SubProps(backingProps); +_$$SubProps _$Sub([Map backingProps]) => new _$$SubProps(backingProps); // Concrete props implementation. // @@ -58,15 +56,6 @@ _$$SubProps _$Sub([Map backingProps]) => backingProps == null class _$$SubProps extends _$SubProps with _$SubPropsAccessorsMixin implements SubProps { - _$$SubProps._(); - factory _$$SubProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$SubProps$PlainMap(backingMap); - } else { - return new _$$SubProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -78,15 +67,11 @@ class _$$SubProps extends _$SubProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'SubProps.'; -} -class _$$SubProps$PlainMap extends _$$SubProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$SubProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$SubProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -96,22 +81,6 @@ class _$$SubProps$PlainMap extends _$$SubProps { Map _props; } -class _$$SubProps$JsMap extends _$$SubProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$SubProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$SubStateAccessorsMixin implements _$SubState { @override Map get state; @@ -146,10 +115,14 @@ class SubState extends _$SubState with _$SubStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$SubState extends _$SubState with _$SubStateAccessorsMixin implements SubState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -161,10 +134,6 @@ class _$$SubState extends _$SubState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -174,10 +143,6 @@ class _$$SubState extends _$SubState class _$SubComponent extends SubComponent { @override _$$SubProps typedPropsFactory(Map backingMap) => new _$$SubProps(backingMap); - @override - _$$SubProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$SubProps$JsMap(backingMap); - @override _$$SubState typedStateFactory(Map backingMap) => new _$$SubState(backingMap); @@ -189,14 +154,6 @@ class _$SubComponent extends SubComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForSubProps]; - _$$SubProps$JsMap _cachedTypedProps; - @override - _$$SubProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } abstract class _$SuperPropsAccessorsMixin implements _$SuperProps { diff --git a/example/builder/basic.over_react.g.dart b/example/builder/basic.over_react.g.dart index 7603d58d7..cdf0ee98f 100644 --- a/example/builder/basic.over_react.g.dart +++ b/example/builder/basic.over_react.g.dart @@ -124,9 +124,7 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => backingProps == null - ? new _$$BasicProps$JsMap(new JsBackedMap()) - : new _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); // Concrete props implementation. // @@ -134,15 +132,6 @@ _$$BasicProps _$Basic([Map backingProps]) => backingProps == null class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - _$$BasicProps._(); - factory _$$BasicProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$BasicProps$PlainMap(backingMap); - } else { - return new _$$BasicProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -154,15 +143,11 @@ class _$$BasicProps extends _$BasicProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'BasicProps.'; -} -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 an unknown ddc issue. // See for more details - _$$BasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$BasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -172,22 +157,6 @@ class _$$BasicProps$PlainMap extends _$$BasicProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$BasicProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -196,9 +165,6 @@ class _$BasicComponent extends BasicComponent { @override _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); - @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$BasicProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -208,12 +174,4 @@ class _$BasicComponent extends BasicComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForBasicProps]; - _$$BasicProps$JsMap _cachedTypedProps; - @override - _$$BasicProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/example/builder/basic_library.over_react.g.dart b/example/builder/basic_library.over_react.g.dart index 7fc9084fc..95cfc2bf4 100644 --- a/example/builder/basic_library.over_react.g.dart +++ b/example/builder/basic_library.over_react.g.dart @@ -136,9 +136,7 @@ class BasicPartOfLibProps extends _$BasicPartOfLibProps } _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => - backingProps == null - ? new _$$BasicPartOfLibProps$JsMap(new JsBackedMap()) - : new _$$BasicPartOfLibProps(backingProps); + new _$$BasicPartOfLibProps(backingProps); // Concrete props implementation. // @@ -146,15 +144,6 @@ _$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps with _$BasicPartOfLibPropsAccessorsMixin implements BasicPartOfLibProps { - _$$BasicPartOfLibProps._(); - factory _$$BasicPartOfLibProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$BasicPartOfLibProps$PlainMap(backingMap); - } else { - return new _$$BasicPartOfLibProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -167,15 +156,11 @@ class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'BasicPartOfLibProps.'; -} -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 an unknown ddc issue. // See for more details - _$$BasicPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -185,22 +170,6 @@ class _$$BasicPartOfLibProps$PlainMap extends _$$BasicPartOfLibProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$BasicPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$BasicPartOfLibStateAccessorsMixin implements _$BasicPartOfLibState { @override @@ -241,10 +210,14 @@ class BasicPartOfLibState extends _$BasicPartOfLibState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$BasicPartOfLibState extends _$BasicPartOfLibState with _$BasicPartOfLibStateAccessorsMixin implements BasicPartOfLibState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -256,10 +229,6 @@ class _$$BasicPartOfLibState extends _$BasicPartOfLibState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -271,10 +240,6 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { _$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => new _$$BasicPartOfLibProps(backingMap); @override - _$$BasicPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$BasicPartOfLibProps$JsMap(backingMap); - - @override _$$BasicPartOfLibState typedStateFactory(Map backingMap) => new _$$BasicPartOfLibState(backingMap); @@ -288,14 +253,6 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { final List $defaultConsumedProps = const [ _$metaForBasicPartOfLibProps ]; - _$$BasicPartOfLibProps$JsMap _cachedTypedProps; - @override - _$$BasicPartOfLibProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -347,9 +304,8 @@ class SubPartOfLibProps extends _$SubPartOfLibProps static const PropsMeta meta = _$metaForSubPartOfLibProps; } -_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => backingProps == null - ? new _$$SubPartOfLibProps$JsMap(new JsBackedMap()) - : new _$$SubPartOfLibProps(backingProps); +_$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => + new _$$SubPartOfLibProps(backingProps); // Concrete props implementation. // @@ -357,15 +313,6 @@ _$$SubPartOfLibProps _$SubPartOfLib([Map backingProps]) => backingProps == null class _$$SubPartOfLibProps extends _$SubPartOfLibProps with _$SubPartOfLibPropsAccessorsMixin implements SubPartOfLibProps { - _$$SubPartOfLibProps._(); - factory _$$SubPartOfLibProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$SubPartOfLibProps$PlainMap(backingMap); - } else { - return new _$$SubPartOfLibProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -378,15 +325,11 @@ class _$$SubPartOfLibProps extends _$SubPartOfLibProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'SubPartOfLibProps.'; -} -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 an unknown ddc issue. // See for more details - _$$SubPartOfLibProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$SubPartOfLibProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -396,22 +339,6 @@ class _$$SubPartOfLibProps$PlainMap extends _$$SubPartOfLibProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$SubPartOfLibProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -420,9 +347,6 @@ class _$SubPartOfLibComponent extends SubPartOfLibComponent { @override _$$SubPartOfLibProps typedPropsFactory(Map backingMap) => new _$$SubPartOfLibProps(backingMap); - @override - _$$SubPartOfLibProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$SubPartOfLibProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -434,14 +358,6 @@ class _$SubPartOfLibComponent extends SubPartOfLibComponent { final List $defaultConsumedProps = const [ _$metaForSubPartOfLibProps ]; - _$$SubPartOfLibProps$JsMap _cachedTypedProps; - @override - _$$SubPartOfLibProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } abstract class _$SuperPartOfLibPropsAccessorsMixin diff --git a/example/builder/basic_with_state.over_react.g.dart b/example/builder/basic_with_state.over_react.g.dart index c58580852..e42248df4 100644 --- a/example/builder/basic_with_state.over_react.g.dart +++ b/example/builder/basic_with_state.over_react.g.dart @@ -120,9 +120,7 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin { static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => backingProps == null - ? new _$$BasicProps$JsMap(new JsBackedMap()) - : new _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); // Concrete props implementation. // @@ -130,15 +128,6 @@ _$$BasicProps _$Basic([Map backingProps]) => backingProps == null class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - _$$BasicProps._(); - factory _$$BasicProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$BasicProps$PlainMap(backingMap); - } else { - return new _$$BasicProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -150,15 +139,11 @@ class _$$BasicProps extends _$BasicProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'BasicProps.'; -} -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 an unknown ddc issue. // See for more details - _$$BasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$BasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -168,22 +153,6 @@ class _$$BasicProps$PlainMap extends _$$BasicProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$BasicProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$BasicStateAccessorsMixin implements _$BasicState { @override Map get state; @@ -221,10 +190,14 @@ class BasicState extends _$BasicState with _$BasicStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$BasicState extends _$BasicState with _$BasicStateAccessorsMixin implements BasicState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -236,10 +209,6 @@ class _$$BasicState extends _$BasicState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -251,10 +220,6 @@ class _$BasicComponent extends BasicComponent { _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$BasicProps$JsMap(backingMap); - - @override _$$BasicState typedStateFactory(Map backingMap) => new _$$BasicState(backingMap); @@ -266,12 +231,4 @@ class _$BasicComponent extends BasicComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForBasicProps]; - _$$BasicProps$JsMap _cachedTypedProps; - @override - _$$BasicProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/example/builder/basic_with_type_params.over_react.g.dart b/example/builder/basic_with_type_params.over_react.g.dart index 8518b874b..544b9c958 100644 --- a/example/builder/basic_with_type_params.over_react.g.dart +++ b/example/builder/basic_with_type_params.over_react.g.dart @@ -70,9 +70,7 @@ class BasicProps extends _$BasicProps static const PropsMeta meta = _$metaForBasicProps; } -_$$BasicProps _$Basic([Map backingProps]) => backingProps == null - ? new _$$BasicProps$JsMap(new JsBackedMap()) - : new _$$BasicProps(backingProps); +_$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); // Concrete props implementation. // @@ -80,15 +78,6 @@ _$$BasicProps _$Basic([Map backingProps]) => backingProps == null class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - _$$BasicProps._(); - factory _$$BasicProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$BasicProps$PlainMap(backingMap); - } else { - return new _$$BasicProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -100,15 +89,11 @@ class _$$BasicProps extends _$BasicProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'BasicProps.'; -} -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 an unknown ddc issue. // See for more details - _$$BasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$BasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -118,22 +103,6 @@ class _$$BasicProps$PlainMap extends _$$BasicProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$BasicProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -142,9 +111,6 @@ class _$BasicComponent extends BasicComponent { @override _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); - @override - _$$BasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$BasicProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -154,12 +120,4 @@ class _$BasicComponent extends BasicComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForBasicProps]; - _$$BasicProps$JsMap _cachedTypedProps; - @override - _$$BasicProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/example/builder/generic_inheritance_sub.over_react.g.dart b/example/builder/generic_inheritance_sub.over_react.g.dart index 46882c970..d6f4f9734 100644 --- a/example/builder/generic_inheritance_sub.over_react.g.dart +++ b/example/builder/generic_inheritance_sub.over_react.g.dart @@ -53,9 +53,8 @@ class GenericSubProps extends _$GenericSubProps static const PropsMeta meta = _$metaForGenericSubProps; } -_$$GenericSubProps _$GenericSub([Map backingProps]) => backingProps == null - ? new _$$GenericSubProps$JsMap(new JsBackedMap()) - : new _$$GenericSubProps(backingProps); +_$$GenericSubProps _$GenericSub([Map backingProps]) => + new _$$GenericSubProps(backingProps); // Concrete props implementation. // @@ -63,15 +62,6 @@ _$$GenericSubProps _$GenericSub([Map backingProps]) => backingProps == null class _$$GenericSubProps extends _$GenericSubProps with _$GenericSubPropsAccessorsMixin implements GenericSubProps { - _$$GenericSubProps._(); - factory _$$GenericSubProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$GenericSubProps$PlainMap(backingMap); - } else { - return new _$$GenericSubProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -84,15 +74,11 @@ class _$$GenericSubProps extends _$GenericSubProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'GenericSubProps.'; -} -class _$$GenericSubProps$PlainMap extends _$$GenericSubProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$GenericSubProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$GenericSubProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -102,22 +88,6 @@ class _$$GenericSubProps$PlainMap extends _$$GenericSubProps { Map _props; } -class _$$GenericSubProps$JsMap extends _$$GenericSubProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$GenericSubProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$GenericSubStateAccessorsMixin implements _$GenericSubState { @override Map get state; @@ -157,10 +127,14 @@ class GenericSubState extends _$GenericSubState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$GenericSubState extends _$GenericSubState with _$GenericSubStateAccessorsMixin implements GenericSubState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -172,10 +146,6 @@ class _$$GenericSubState extends _$GenericSubState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -187,10 +157,6 @@ class _$GenericSubComponent extends GenericSubComponent { _$$GenericSubProps typedPropsFactory(Map backingMap) => new _$$GenericSubProps(backingMap); @override - _$$GenericSubProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$GenericSubProps$JsMap(backingMap); - - @override _$$GenericSubState typedStateFactory(Map backingMap) => new _$$GenericSubState(backingMap); @@ -204,12 +170,4 @@ class _$GenericSubComponent extends GenericSubComponent { final List $defaultConsumedProps = const [ _$metaForGenericSubProps ]; - _$$GenericSubProps$JsMap _cachedTypedProps; - @override - _$$GenericSubProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/example/builder/generic_inheritance_super.over_react.g.dart b/example/builder/generic_inheritance_super.over_react.g.dart index 000796b79..6e3d24c2d 100644 --- a/example/builder/generic_inheritance_super.over_react.g.dart +++ b/example/builder/generic_inheritance_super.over_react.g.dart @@ -87,9 +87,8 @@ class GenericSuperProps extends _$GenericSuperProps static const PropsMeta meta = _$metaForGenericSuperProps; } -_$$GenericSuperProps _$GenericSuper([Map backingProps]) => backingProps == null - ? new _$$GenericSuperProps$JsMap(new JsBackedMap()) - : new _$$GenericSuperProps(backingProps); +_$$GenericSuperProps _$GenericSuper([Map backingProps]) => + new _$$GenericSuperProps(backingProps); // Concrete props implementation. // @@ -97,15 +96,6 @@ _$$GenericSuperProps _$GenericSuper([Map backingProps]) => backingProps == null class _$$GenericSuperProps extends _$GenericSuperProps with _$GenericSuperPropsAccessorsMixin implements GenericSuperProps { - _$$GenericSuperProps._(); - factory _$$GenericSuperProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$GenericSuperProps$PlainMap(backingMap); - } else { - return new _$$GenericSuperProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -118,15 +108,11 @@ class _$$GenericSuperProps extends _$GenericSuperProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'GenericSuperProps.'; -} -class _$$GenericSuperProps$PlainMap extends _$$GenericSuperProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$GenericSuperProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$GenericSuperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -136,22 +122,6 @@ class _$$GenericSuperProps$PlainMap extends _$$GenericSuperProps { Map _props; } -class _$$GenericSuperProps$JsMap extends _$$GenericSuperProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$GenericSuperProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$GenericSuperStateAccessorsMixin implements _$GenericSuperState { @override @@ -192,10 +162,14 @@ class GenericSuperState extends _$GenericSuperState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$GenericSuperState extends _$GenericSuperState with _$GenericSuperStateAccessorsMixin implements GenericSuperState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -207,10 +181,6 @@ class _$$GenericSuperState extends _$GenericSuperState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -222,10 +192,6 @@ class _$GenericSuperComponent extends GenericSuperComponent { _$$GenericSuperProps typedPropsFactory(Map backingMap) => new _$$GenericSuperProps(backingMap); @override - _$$GenericSuperProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$GenericSuperProps$JsMap(backingMap); - - @override _$$GenericSuperState typedStateFactory(Map backingMap) => new _$$GenericSuperState(backingMap); @@ -239,12 +205,4 @@ class _$GenericSuperComponent extends GenericSuperComponent { final List $defaultConsumedProps = const [ _$metaForGenericSuperProps ]; - _$$GenericSuperProps$JsMap _cachedTypedProps; - @override - _$$GenericSuperProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/example/builder/private_component.over_react.g.dart b/example/builder/private_component.over_react.g.dart index a02512d3e..79f1ae0ae 100644 --- a/example/builder/private_component.over_react.g.dart +++ b/example/builder/private_component.over_react.g.dart @@ -49,9 +49,8 @@ class _PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin { static const PropsMeta meta = _$metaFor_PrivateProps; } -_$$_PrivateProps _$_Private([Map backingProps]) => backingProps == null - ? new _$$_PrivateProps$JsMap(new JsBackedMap()) - : new _$$_PrivateProps(backingProps); +_$$_PrivateProps _$_Private([Map backingProps]) => + new _$$_PrivateProps(backingProps); // Concrete props implementation. // @@ -59,15 +58,6 @@ _$$_PrivateProps _$_Private([Map backingProps]) => backingProps == null class _$$_PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin implements _PrivateProps { - _$$_PrivateProps._(); - factory _$$_PrivateProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$_PrivateProps$PlainMap(backingMap); - } else { - return new _$$_PrivateProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -79,15 +69,11 @@ class _$$_PrivateProps extends _$_PrivateProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '_PrivateProps.'; -} -class _$$_PrivateProps$PlainMap extends _$$_PrivateProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$_PrivateProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$_PrivateProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -97,22 +83,6 @@ class _$$_PrivateProps$PlainMap extends _$$_PrivateProps { Map _props; } -class _$$_PrivateProps$JsMap extends _$$_PrivateProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$_PrivateProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$_PrivateStateAccessorsMixin implements _$_PrivateState { @override Map get state; @@ -147,10 +117,14 @@ class _PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$_PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin implements _PrivateState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -162,10 +136,6 @@ class _$$_PrivateState extends _$_PrivateState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -177,10 +147,6 @@ class _$PrivateComponent extends PrivateComponent { _$$_PrivateProps typedPropsFactory(Map backingMap) => new _$$_PrivateProps(backingMap); @override - _$$_PrivateProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$_PrivateProps$JsMap(backingMap); - - @override _$$_PrivateState typedStateFactory(Map backingMap) => new _$$_PrivateState(backingMap); @@ -194,12 +160,4 @@ class _$PrivateComponent extends PrivateComponent { final List $defaultConsumedProps = const [ _$metaFor_PrivateProps ]; - _$$_PrivateProps$JsMap _cachedTypedProps; - @override - _$$_PrivateProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/example/builder/private_factory_public_component.over_react.g.dart b/example/builder/private_factory_public_component.over_react.g.dart index e44e14160..8822123e2 100644 --- a/example/builder/private_factory_public_component.over_react.g.dart +++ b/example/builder/private_factory_public_component.over_react.g.dart @@ -56,9 +56,7 @@ class FormActionInputProps extends _$FormActionInputProps } _$$FormActionInputProps _$_FormActionInput([Map backingProps]) => - backingProps == null - ? new _$$FormActionInputProps$JsMap(new JsBackedMap()) - : new _$$FormActionInputProps(backingProps); + new _$$FormActionInputProps(backingProps); // Concrete props implementation. // @@ -66,15 +64,6 @@ _$$FormActionInputProps _$_FormActionInput([Map backingProps]) => class _$$FormActionInputProps extends _$FormActionInputProps with _$FormActionInputPropsAccessorsMixin implements FormActionInputProps { - _$$FormActionInputProps._(); - factory _$$FormActionInputProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$FormActionInputProps$PlainMap(backingMap); - } else { - return new _$$FormActionInputProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -87,15 +76,11 @@ class _$$FormActionInputProps extends _$FormActionInputProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'FormActionInputProps.'; -} -class _$$FormActionInputProps$PlainMap extends _$$FormActionInputProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$FormActionInputProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$FormActionInputProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -105,22 +90,6 @@ class _$$FormActionInputProps$PlainMap extends _$$FormActionInputProps { Map _props; } -class _$$FormActionInputProps$JsMap extends _$$FormActionInputProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$FormActionInputProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -129,9 +98,6 @@ class _$FormActionInputComponent extends FormActionInputComponent { @override _$$FormActionInputProps typedPropsFactory(Map backingMap) => new _$$FormActionInputProps(backingMap); - @override - _$$FormActionInputProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$FormActionInputProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -143,12 +109,4 @@ class _$FormActionInputComponent extends FormActionInputComponent { final List $defaultConsumedProps = const [ _$metaForFormActionInputProps ]; - _$$FormActionInputProps$JsMap _cachedTypedProps; - @override - _$$FormActionInputProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/lib/src/component/resize_sensor.over_react.g.dart b/lib/src/component/resize_sensor.over_react.g.dart index d63a365b7..e3bf0b495 100644 --- a/lib/src/component/resize_sensor.over_react.g.dart +++ b/lib/src/component/resize_sensor.over_react.g.dart @@ -38,9 +38,8 @@ class ResizeSensorProps extends _$ResizeSensorProps static const PropsMeta meta = _$metaForResizeSensorProps; } -_$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => backingProps == null - ? new _$$ResizeSensorProps$JsMap(new JsBackedMap()) - : new _$$ResizeSensorProps(backingProps); +_$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => + new _$$ResizeSensorProps(backingProps); // Concrete props implementation. // @@ -48,15 +47,6 @@ _$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => backingProps == null class _$$ResizeSensorProps extends _$ResizeSensorProps with _$ResizeSensorPropsAccessorsMixin implements ResizeSensorProps { - _$$ResizeSensorProps._(); - factory _$$ResizeSensorProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ResizeSensorProps$PlainMap(backingMap); - } else { - return new _$$ResizeSensorProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -69,15 +59,11 @@ class _$$ResizeSensorProps extends _$ResizeSensorProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ResizeSensorProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ResizeSensorProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ResizeSensorProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -87,22 +73,6 @@ class _$$ResizeSensorProps$PlainMap extends _$$ResizeSensorProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ResizeSensorProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -111,9 +81,6 @@ class _$ResizeSensorComponent extends ResizeSensorComponent { @override _$$ResizeSensorProps typedPropsFactory(Map backingMap) => new _$$ResizeSensorProps(backingMap); - @override - _$$ResizeSensorProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ResizeSensorProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -125,14 +92,6 @@ class _$ResizeSensorComponent extends ResizeSensorComponent { final List $defaultConsumedProps = const [ _$metaForResizeSensorProps ]; - _$$ResizeSensorProps$JsMap _cachedTypedProps; - @override - _$$ResizeSensorProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } abstract class ResizeSensorPropsMixin implements _$ResizeSensorPropsMixin { 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 5fc4e39cd..5d450fabe 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 @@ -199,9 +199,8 @@ class TransitionerProps extends _$TransitionerProps static const PropsMeta meta = _$metaForTransitionerProps; } -_$$TransitionerProps _$Transitioner([Map backingProps]) => backingProps == null - ? new _$$TransitionerProps$JsMap(new JsBackedMap()) - : new _$$TransitionerProps(backingProps); +_$$TransitionerProps _$Transitioner([Map backingProps]) => + new _$$TransitionerProps(backingProps); // Concrete props implementation. // @@ -209,15 +208,6 @@ _$$TransitionerProps _$Transitioner([Map backingProps]) => backingProps == null class _$$TransitionerProps extends _$TransitionerProps with _$TransitionerPropsAccessorsMixin implements TransitionerProps { - _$$TransitionerProps._(); - factory _$$TransitionerProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TransitionerProps$PlainMap(backingMap); - } else { - return new _$$TransitionerProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -230,15 +220,11 @@ class _$$TransitionerProps extends _$TransitionerProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TransitionerProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TransitionerProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TransitionerProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -248,22 +234,6 @@ class _$$TransitionerProps$PlainMap extends _$$TransitionerProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TransitionerProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TransitionerStateAccessorsMixin implements _$TransitionerState { @override @@ -287,10 +257,14 @@ class TransitionerState extends _$TransitionerState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TransitionerState extends _$TransitionerState with _$TransitionerStateAccessorsMixin implements TransitionerState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -302,10 +276,6 @@ class _$$TransitionerState extends _$TransitionerState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -317,10 +287,6 @@ class _$TransitionerComponent extends TransitionerComponent { _$$TransitionerProps typedPropsFactory(Map backingMap) => new _$$TransitionerProps(backingMap); @override - _$$TransitionerProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TransitionerProps$JsMap(backingMap); - - @override _$$TransitionerState typedStateFactory(Map backingMap) => new _$$TransitionerState(backingMap); @@ -334,12 +300,4 @@ class _$TransitionerComponent extends TransitionerComponent { final List $defaultConsumedProps = const [ _$metaForTransitionerProps ]; - _$$TransitionerProps$JsMap _cachedTypedProps; - @override - _$$TransitionerProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart index 284348456..bfed4ccaa 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart @@ -140,9 +140,7 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -150,15 +148,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -171,15 +160,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -189,22 +174,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -213,9 +182,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -227,12 +193,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart index 75d03fd7b..826a8bb36 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart @@ -71,9 +71,7 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -81,15 +79,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -102,15 +91,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -120,22 +105,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -144,9 +113,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -158,12 +124,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart index 88c866349..21a2ed630 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart @@ -94,9 +94,7 @@ const PropsMeta _$metaForDoNotGenerateAccessorTestProps = const PropsMeta( _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( [Map backingProps]) => - backingProps == null - ? new _$$DoNotGenerateAccessorTestProps$JsMap(new JsBackedMap()) - : new _$$DoNotGenerateAccessorTestProps(backingProps); + new _$$DoNotGenerateAccessorTestProps(backingProps); // Concrete props implementation. // @@ -104,15 +102,6 @@ _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps with _$DoNotGenerateAccessorTestPropsAccessorsMixin implements DoNotGenerateAccessorTestProps { - _$$DoNotGenerateAccessorTestProps._(); - factory _$$DoNotGenerateAccessorTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); - } else { - return new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -125,16 +114,11 @@ class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'DoNotGenerateAccessorTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$DoNotGenerateAccessorTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -144,23 +128,6 @@ class _$$DoNotGenerateAccessorTestProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin implements _$DoNotGenerateAccessorTestState { @override @@ -239,10 +206,14 @@ const StateMeta _$metaForDoNotGenerateAccessorTestState = const StateMeta( // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -254,10 +225,6 @@ class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -270,11 +237,6 @@ class _$DoNotGenerateAccessorTestComponent _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestProps(backingMap); @override - _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); - - @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestState(backingMap); @@ -288,12 +250,4 @@ class _$DoNotGenerateAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForDoNotGenerateAccessorTestProps ]; - _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; - @override - _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart index aa47b696d..12074d1ec 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart @@ -148,9 +148,7 @@ const PropsMeta _$metaForNamespacedAccessorTestProps = const PropsMeta( ); _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => - backingProps == null - ? new _$$NamespacedAccessorTestProps$JsMap(new JsBackedMap()) - : new _$$NamespacedAccessorTestProps(backingProps); + new _$$NamespacedAccessorTestProps(backingProps); // Concrete props implementation. // @@ -158,15 +156,6 @@ _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps with _$NamespacedAccessorTestPropsAccessorsMixin implements NamespacedAccessorTestProps { - _$$NamespacedAccessorTestProps._(); - factory _$$NamespacedAccessorTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$NamespacedAccessorTestProps$PlainMap(backingMap); - } else { - return new _$$NamespacedAccessorTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -179,16 +168,11 @@ class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'custom props class namespace**'; -} -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 an unknown ddc issue. // See for more details - _$$NamespacedAccessorTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -198,23 +182,6 @@ class _$$NamespacedAccessorTestProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$NamespacedAccessorTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$NamespacedAccessorTestStateAccessorsMixin implements _$NamespacedAccessorTestState { @override @@ -348,10 +315,14 @@ const StateMeta _$metaForNamespacedAccessorTestState = const StateMeta( // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -363,10 +334,6 @@ class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -379,11 +346,6 @@ class _$NamespacedAccessorTestComponent _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => new _$$NamespacedAccessorTestProps(backingMap); @override - _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$NamespacedAccessorTestProps$JsMap(backingMap); - - @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => new _$$NamespacedAccessorTestState(backingMap); @@ -397,12 +359,4 @@ class _$NamespacedAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForNamespacedAccessorTestProps ]; - _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; - @override - _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart index b2581a57f..84f650f37 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart @@ -45,9 +45,7 @@ const PropsMeta _$metaForFooProps = const PropsMeta( keys: _$FooPropsAccessorsMixin.$propKeys, ); -_$$FooProps _$Foo([Map backingProps]) => backingProps == null - ? new _$$FooProps$JsMap(new JsBackedMap()) - : new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); // Concrete props implementation. // @@ -55,15 +53,6 @@ _$$FooProps _$Foo([Map backingProps]) => backingProps == null class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - factory _$$FooProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$FooProps$PlainMap(backingMap); - } else { - return new _$$FooProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -75,15 +64,11 @@ class _$$FooProps extends _$FooProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'FooProps.'; -} -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 an unknown ddc issue. // See for more details - _$$FooProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$FooProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -93,22 +78,6 @@ class _$$FooProps$PlainMap extends _$$FooProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$FooProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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,9 +85,6 @@ class _$$FooProps$JsMap extends _$$FooProps { class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); - @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -128,12 +94,4 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; - _$$FooProps$JsMap _cachedTypedProps; - @override - _$$FooProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart index b1c5e1be4..d5addef55 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart @@ -84,9 +84,7 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -94,15 +92,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -115,15 +104,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -133,22 +118,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -157,9 +126,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -171,12 +137,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart index 460c4ead5..6de66da2c 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart @@ -74,9 +74,7 @@ const PropsMeta _$metaForComponentTestProps = const PropsMeta( ); _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -84,15 +82,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -105,15 +94,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -123,22 +108,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -147,9 +116,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -161,12 +127,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart index dcb51d5e3..bc0a4ef79 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart @@ -34,9 +34,7 @@ const PropsMeta _$metaForStatefulComponentTestProps = const PropsMeta( ); _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => - backingProps == null - ? new _$$StatefulComponentTestProps$JsMap(new JsBackedMap()) - : new _$$StatefulComponentTestProps(backingProps); + new _$$StatefulComponentTestProps(backingProps); // Concrete props implementation. // @@ -44,15 +42,6 @@ _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps with _$StatefulComponentTestPropsAccessorsMixin implements StatefulComponentTestProps { - _$$StatefulComponentTestProps._(); - factory _$$StatefulComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$StatefulComponentTestProps$PlainMap(backingMap); - } else { - return new _$$StatefulComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -65,16 +54,11 @@ class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'StatefulComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$StatefulComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -84,23 +68,6 @@ class _$$StatefulComponentTestProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$StatefulComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$StatefulComponentTestStateAccessorsMixin implements _$StatefulComponentTestState { @override @@ -234,10 +201,14 @@ const StateMeta _$metaForStatefulComponentTestState = const StateMeta( // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -249,10 +220,6 @@ class _$$StatefulComponentTestState extends _$StatefulComponentTestState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -264,11 +231,6 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => new _$$StatefulComponentTestProps(backingMap); @override - _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$StatefulComponentTestProps$JsMap(backingMap); - - @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => new _$$StatefulComponentTestState(backingMap); @@ -282,12 +244,4 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForStatefulComponentTestProps ]; - _$$StatefulComponentTestProps$JsMap _cachedTypedProps; - @override - _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart index d2b0ab1a8..76c842905 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart @@ -62,9 +62,7 @@ const PropsMeta _$metaForFooProps = const PropsMeta( keys: _$FooPropsAccessorsMixin.$propKeys, ); -_$$FooProps _$Foo([Map backingProps]) => backingProps == null - ? new _$$FooProps$JsMap(new JsBackedMap()) - : new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); // Concrete props implementation. // @@ -72,15 +70,6 @@ _$$FooProps _$Foo([Map backingProps]) => backingProps == null class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - factory _$$FooProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$FooProps$PlainMap(backingMap); - } else { - return new _$$FooProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -92,15 +81,11 @@ class _$$FooProps extends _$FooProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'FooProps.'; -} -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 an unknown ddc issue. // See for more details - _$$FooProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$FooProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -110,22 +95,6 @@ class _$$FooProps$PlainMap extends _$$FooProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$FooProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -133,9 +102,6 @@ class _$$FooProps$JsMap extends _$$FooProps { class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); - @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -145,12 +111,4 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; - _$$FooProps$JsMap _cachedTypedProps; - @override - _$$FooProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 9f4a1e5cf..7e84f3ea9 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 @@ -145,9 +145,7 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -155,15 +153,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -176,15 +165,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -194,22 +179,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -218,9 +187,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -232,12 +198,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 f4287dc98..a595d2529 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 @@ -76,9 +76,7 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -86,15 +84,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -107,15 +96,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -125,22 +110,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -149,9 +118,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -163,12 +129,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 d86a89b36..1183b470b 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 @@ -99,9 +99,7 @@ class DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( [Map backingProps]) => - backingProps == null - ? new _$$DoNotGenerateAccessorTestProps$JsMap(new JsBackedMap()) - : new _$$DoNotGenerateAccessorTestProps(backingProps); + new _$$DoNotGenerateAccessorTestProps(backingProps); // Concrete props implementation. // @@ -109,15 +107,6 @@ _$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps with _$DoNotGenerateAccessorTestPropsAccessorsMixin implements DoNotGenerateAccessorTestProps { - _$$DoNotGenerateAccessorTestProps._(); - factory _$$DoNotGenerateAccessorTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); - } else { - return new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -130,16 +119,11 @@ class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'DoNotGenerateAccessorTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$DoNotGenerateAccessorTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -149,23 +133,6 @@ class _$$DoNotGenerateAccessorTestProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin implements _$DoNotGenerateAccessorTestState { @override @@ -249,10 +216,14 @@ class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -264,10 +235,6 @@ class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -280,11 +247,6 @@ class _$DoNotGenerateAccessorTestComponent _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestProps(backingMap); @override - _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); - - @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestState(backingMap); @@ -298,12 +260,4 @@ class _$DoNotGenerateAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForDoNotGenerateAccessorTestProps ]; - _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; - @override - _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 113bb4755..5a8a88109 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 @@ -153,9 +153,7 @@ class NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps } _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => - backingProps == null - ? new _$$NamespacedAccessorTestProps$JsMap(new JsBackedMap()) - : new _$$NamespacedAccessorTestProps(backingProps); + new _$$NamespacedAccessorTestProps(backingProps); // Concrete props implementation. // @@ -163,15 +161,6 @@ _$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps with _$NamespacedAccessorTestPropsAccessorsMixin implements NamespacedAccessorTestProps { - _$$NamespacedAccessorTestProps._(); - factory _$$NamespacedAccessorTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$NamespacedAccessorTestProps$PlainMap(backingMap); - } else { - return new _$$NamespacedAccessorTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -184,16 +173,11 @@ class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'custom props class namespace**'; -} -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 an unknown ddc issue. // See for more details - _$$NamespacedAccessorTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -203,23 +187,6 @@ class _$$NamespacedAccessorTestProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$NamespacedAccessorTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$NamespacedAccessorTestStateAccessorsMixin implements _$NamespacedAccessorTestState { @override @@ -358,10 +325,14 @@ class NamespacedAccessorTestState extends _$NamespacedAccessorTestState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -373,10 +344,6 @@ class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -389,11 +356,6 @@ class _$NamespacedAccessorTestComponent _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => new _$$NamespacedAccessorTestProps(backingMap); @override - _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$NamespacedAccessorTestProps$JsMap(backingMap); - - @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => new _$$NamespacedAccessorTestState(backingMap); @@ -407,12 +369,4 @@ class _$NamespacedAccessorTestComponent final List $defaultConsumedProps = const [ _$metaForNamespacedAccessorTestProps ]; - _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; - @override - _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 2ffc50804..995b2c45c 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 @@ -49,9 +49,7 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map backingProps]) => backingProps == null - ? new _$$FooProps$JsMap(new JsBackedMap()) - : new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); // Concrete props implementation. // @@ -59,15 +57,6 @@ _$$FooProps _$Foo([Map backingProps]) => backingProps == null class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - factory _$$FooProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$FooProps$PlainMap(backingMap); - } else { - return new _$$FooProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -79,15 +68,11 @@ class _$$FooProps extends _$FooProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'FooProps.'; -} -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 an unknown ddc issue. // See for more details - _$$FooProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$FooProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -97,22 +82,6 @@ class _$$FooProps$PlainMap extends _$$FooProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$FooProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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,9 +89,6 @@ class _$$FooProps$JsMap extends _$$FooProps { class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); - @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -132,12 +98,4 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; - _$$FooProps$JsMap _cachedTypedProps; - @override - _$$FooProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 8ae80bf8a..8a95565e2 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 @@ -89,9 +89,7 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -99,15 +97,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -120,15 +109,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -138,22 +123,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -162,9 +131,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -176,12 +142,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart index 70b6cccca..d2e5d03bb 100644 --- a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart @@ -79,9 +79,7 @@ class ComponentTestProps extends _$ComponentTestProps } _$$ComponentTestProps _$ComponentTest([Map backingProps]) => - backingProps == null - ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) - : new _$$ComponentTestProps(backingProps); + new _$$ComponentTestProps(backingProps); // Concrete props implementation. // @@ -89,15 +87,6 @@ _$$ComponentTestProps _$ComponentTest([Map backingProps]) => class _$$ComponentTestProps extends _$ComponentTestProps with _$ComponentTestPropsAccessorsMixin implements ComponentTestProps { - _$$ComponentTestProps._(); - factory _$$ComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ComponentTestProps$PlainMap(backingMap); - } else { - return new _$$ComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -110,15 +99,11 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$ComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -128,22 +113,6 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -152,9 +121,6 @@ class _$ComponentTestComponent extends ComponentTestComponent { @override _$$ComponentTestProps typedPropsFactory(Map backingMap) => new _$$ComponentTestProps(backingMap); - @override - _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ComponentTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -166,12 +132,4 @@ class _$ComponentTestComponent extends ComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForComponentTestProps ]; - _$$ComponentTestProps$JsMap _cachedTypedProps; - @override - _$$ComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 972b471d3..10242cdbd 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 @@ -39,9 +39,7 @@ class StatefulComponentTestProps extends _$StatefulComponentTestProps } _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => - backingProps == null - ? new _$$StatefulComponentTestProps$JsMap(new JsBackedMap()) - : new _$$StatefulComponentTestProps(backingProps); + new _$$StatefulComponentTestProps(backingProps); // Concrete props implementation. // @@ -49,15 +47,6 @@ _$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps with _$StatefulComponentTestPropsAccessorsMixin implements StatefulComponentTestProps { - _$$StatefulComponentTestProps._(); - factory _$$StatefulComponentTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$StatefulComponentTestProps$PlainMap(backingMap); - } else { - return new _$$StatefulComponentTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -70,16 +59,11 @@ class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'StatefulComponentTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$StatefulComponentTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -89,23 +73,6 @@ class _$$StatefulComponentTestProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$StatefulComponentTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$StatefulComponentTestStateAccessorsMixin implements _$StatefulComponentTestState { @override @@ -244,10 +211,14 @@ class StatefulComponentTestState extends _$StatefulComponentTestState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -259,10 +230,6 @@ class _$$StatefulComponentTestState extends _$StatefulComponentTestState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -274,11 +241,6 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => new _$$StatefulComponentTestProps(backingMap); @override - _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$StatefulComponentTestProps$JsMap(backingMap); - - @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => new _$$StatefulComponentTestState(backingMap); @@ -292,12 +254,4 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { final List $defaultConsumedProps = const [ _$metaForStatefulComponentTestProps ]; - _$$StatefulComponentTestProps$JsMap _cachedTypedProps; - @override - _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 b9b63453a..b0ce17cb9 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 @@ -66,9 +66,7 @@ class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { static const PropsMeta meta = _$metaForFooProps; } -_$$FooProps _$Foo([Map backingProps]) => backingProps == null - ? new _$$FooProps$JsMap(new JsBackedMap()) - : new _$$FooProps(backingProps); +_$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); // Concrete props implementation. // @@ -76,15 +74,6 @@ _$$FooProps _$Foo([Map backingProps]) => backingProps == null class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - _$$FooProps._(); - factory _$$FooProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$FooProps$PlainMap(backingMap); - } else { - return new _$$FooProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -96,15 +85,11 @@ class _$$FooProps extends _$FooProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'FooProps.'; -} -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 an unknown ddc issue. // See for more details - _$$FooProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$FooProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -114,22 +99,6 @@ class _$$FooProps$PlainMap extends _$$FooProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$FooProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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,9 +106,6 @@ class _$$FooProps$JsMap extends _$$FooProps { class _$FooComponent extends FooComponent { @override _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); - @override - _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$FooProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -149,12 +115,4 @@ class _$FooComponent extends FooComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForFooProps]; - _$$FooProps$JsMap _cachedTypedProps; - @override - _$$FooProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 3bbb12912..00d5ed922 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 @@ -35,9 +35,7 @@ class TestAProps extends _$TestAProps with _$TestAPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestAProps; } -_$$TestAProps _$TestA([Map backingProps]) => backingProps == null - ? new _$$TestAProps$JsMap(new JsBackedMap()) - : new _$$TestAProps(backingProps); +_$$TestAProps _$TestA([Map backingProps]) => new _$$TestAProps(backingProps); // Concrete props implementation. // @@ -45,15 +43,6 @@ _$$TestAProps _$TestA([Map backingProps]) => backingProps == null class _$$TestAProps extends _$TestAProps with _$TestAPropsAccessorsMixin implements TestAProps { - _$$TestAProps._(); - factory _$$TestAProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestAProps$PlainMap(backingMap); - } else { - return new _$$TestAProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -65,15 +54,11 @@ class _$$TestAProps extends _$TestAProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestAProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestAProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestAProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -83,22 +68,6 @@ class _$$TestAProps$PlainMap extends _$$TestAProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestAProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -107,9 +76,6 @@ class _$TestAComponent extends TestAComponent { @override _$$TestAProps typedPropsFactory(Map backingMap) => new _$$TestAProps(backingMap); - @override - _$$TestAProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestAProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -119,12 +85,4 @@ class _$TestAComponent extends TestAComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTestAProps]; - _$$TestAProps$JsMap _cachedTypedProps; - @override - _$$TestAProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 914ed190f..4ab879d79 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 @@ -35,9 +35,7 @@ class TestBProps extends _$TestBProps with _$TestBPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestBProps; } -_$$TestBProps _$TestB([Map backingProps]) => backingProps == null - ? new _$$TestBProps$JsMap(new JsBackedMap()) - : new _$$TestBProps(backingProps); +_$$TestBProps _$TestB([Map backingProps]) => new _$$TestBProps(backingProps); // Concrete props implementation. // @@ -45,15 +43,6 @@ _$$TestBProps _$TestB([Map backingProps]) => backingProps == null class _$$TestBProps extends _$TestBProps with _$TestBPropsAccessorsMixin implements TestBProps { - _$$TestBProps._(); - factory _$$TestBProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestBProps$PlainMap(backingMap); - } else { - return new _$$TestBProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -65,15 +54,11 @@ class _$$TestBProps extends _$TestBProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestBProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestBProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestBProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -83,22 +68,6 @@ class _$$TestBProps$PlainMap extends _$$TestBProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestBProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -107,9 +76,6 @@ class _$TestBComponent extends TestBComponent { @override _$$TestBProps typedPropsFactory(Map backingMap) => new _$$TestBProps(backingMap); - @override - _$$TestBProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestBProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -119,12 +85,4 @@ class _$TestBComponent extends TestBComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTestBProps]; - _$$TestBProps$JsMap _cachedTypedProps; - @override - _$$TestBProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 59e23600c..f254ccbf3 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 @@ -40,9 +40,7 @@ class TestExtendtypeProps extends _$TestExtendtypeProps } _$$TestExtendtypeProps _$TestExtendtype([Map backingProps]) => - backingProps == null - ? new _$$TestExtendtypeProps$JsMap(new JsBackedMap()) - : new _$$TestExtendtypeProps(backingProps); + new _$$TestExtendtypeProps(backingProps); // Concrete props implementation. // @@ -50,15 +48,6 @@ _$$TestExtendtypeProps _$TestExtendtype([Map backingProps]) => class _$$TestExtendtypeProps extends _$TestExtendtypeProps with _$TestExtendtypePropsAccessorsMixin implements TestExtendtypeProps { - _$$TestExtendtypeProps._(); - factory _$$TestExtendtypeProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestExtendtypeProps$PlainMap(backingMap); - } else { - return new _$$TestExtendtypeProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -71,15 +60,11 @@ class _$$TestExtendtypeProps extends _$TestExtendtypeProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestExtendtypeProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestExtendtypeProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestExtendtypeProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -89,22 +74,6 @@ class _$$TestExtendtypeProps$PlainMap extends _$$TestExtendtypeProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestExtendtypeProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -113,9 +82,6 @@ class _$TestExtendtypeComponent extends TestExtendtypeComponent { @override _$$TestExtendtypeProps typedPropsFactory(Map backingMap) => new _$$TestExtendtypeProps(backingMap); - @override - _$$TestExtendtypeProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestExtendtypeProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -127,12 +93,4 @@ class _$TestExtendtypeComponent extends TestExtendtypeComponent { final List $defaultConsumedProps = const [ _$metaForTestExtendtypeProps ]; - _$$TestExtendtypeProps$JsMap _cachedTypedProps; - @override - _$$TestExtendtypeProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 d8178837c..f97bf96e7 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 @@ -37,9 +37,8 @@ class TestParentProps extends _$TestParentProps static const PropsMeta meta = _$metaForTestParentProps; } -_$$TestParentProps _$TestParent([Map backingProps]) => backingProps == null - ? new _$$TestParentProps$JsMap(new JsBackedMap()) - : new _$$TestParentProps(backingProps); +_$$TestParentProps _$TestParent([Map backingProps]) => + new _$$TestParentProps(backingProps); // Concrete props implementation. // @@ -47,15 +46,6 @@ _$$TestParentProps _$TestParent([Map backingProps]) => backingProps == null class _$$TestParentProps extends _$TestParentProps with _$TestParentPropsAccessorsMixin implements TestParentProps { - _$$TestParentProps._(); - factory _$$TestParentProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestParentProps$PlainMap(backingMap); - } else { - return new _$$TestParentProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -68,15 +58,11 @@ class _$$TestParentProps extends _$TestParentProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestParentProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestParentProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestParentProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -86,22 +72,6 @@ class _$$TestParentProps$PlainMap extends _$$TestParentProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestParentProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -110,9 +80,6 @@ class _$TestParentComponent extends TestParentComponent { @override _$$TestParentProps typedPropsFactory(Map backingMap) => new _$$TestParentProps(backingMap); - @override - _$$TestParentProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestParentProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -124,12 +91,4 @@ class _$TestParentComponent extends TestParentComponent { final List $defaultConsumedProps = const [ _$metaForTestParentProps ]; - _$$TestParentProps$JsMap _cachedTypedProps; - @override - _$$TestParentProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 9c4596db5..0fd5fad25 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 @@ -40,9 +40,7 @@ class TestSubsubtypeProps extends _$TestSubsubtypeProps } _$$TestSubsubtypeProps _$TestSubsubtype([Map backingProps]) => - backingProps == null - ? new _$$TestSubsubtypeProps$JsMap(new JsBackedMap()) - : new _$$TestSubsubtypeProps(backingProps); + new _$$TestSubsubtypeProps(backingProps); // Concrete props implementation. // @@ -50,15 +48,6 @@ _$$TestSubsubtypeProps _$TestSubsubtype([Map backingProps]) => class _$$TestSubsubtypeProps extends _$TestSubsubtypeProps with _$TestSubsubtypePropsAccessorsMixin implements TestSubsubtypeProps { - _$$TestSubsubtypeProps._(); - factory _$$TestSubsubtypeProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestSubsubtypeProps$PlainMap(backingMap); - } else { - return new _$$TestSubsubtypeProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -71,15 +60,11 @@ class _$$TestSubsubtypeProps extends _$TestSubsubtypeProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestSubsubtypeProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestSubsubtypeProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestSubsubtypeProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -89,22 +74,6 @@ class _$$TestSubsubtypeProps$PlainMap extends _$$TestSubsubtypeProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestSubsubtypeProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -113,9 +82,6 @@ class _$TestSubsubtypeComponent extends TestSubsubtypeComponent { @override _$$TestSubsubtypeProps typedPropsFactory(Map backingMap) => new _$$TestSubsubtypeProps(backingMap); - @override - _$$TestSubsubtypeProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestSubsubtypeProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -127,12 +93,4 @@ class _$TestSubsubtypeComponent extends TestSubsubtypeComponent { final List $defaultConsumedProps = const [ _$metaForTestSubsubtypeProps ]; - _$$TestSubsubtypeProps$JsMap _cachedTypedProps; - @override - _$$TestSubsubtypeProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 31a1484da..f0d1fa3d6 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 @@ -38,9 +38,8 @@ class TestSubtypeProps extends _$TestSubtypeProps static const PropsMeta meta = _$metaForTestSubtypeProps; } -_$$TestSubtypeProps _$TestSubtype([Map backingProps]) => backingProps == null - ? new _$$TestSubtypeProps$JsMap(new JsBackedMap()) - : new _$$TestSubtypeProps(backingProps); +_$$TestSubtypeProps _$TestSubtype([Map backingProps]) => + new _$$TestSubtypeProps(backingProps); // Concrete props implementation. // @@ -48,15 +47,6 @@ _$$TestSubtypeProps _$TestSubtype([Map backingProps]) => backingProps == null class _$$TestSubtypeProps extends _$TestSubtypeProps with _$TestSubtypePropsAccessorsMixin implements TestSubtypeProps { - _$$TestSubtypeProps._(); - factory _$$TestSubtypeProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestSubtypeProps$PlainMap(backingMap); - } else { - return new _$$TestSubtypeProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -69,15 +59,11 @@ class _$$TestSubtypeProps extends _$TestSubtypeProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestSubtypeProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestSubtypeProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestSubtypeProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -87,22 +73,6 @@ class _$$TestSubtypeProps$PlainMap extends _$$TestSubtypeProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestSubtypeProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -111,9 +81,6 @@ class _$TestSubtypeComponent extends TestSubtypeComponent { @override _$$TestSubtypeProps typedPropsFactory(Map backingMap) => new _$$TestSubtypeProps(backingMap); - @override - _$$TestSubtypeProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestSubtypeProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -125,12 +92,4 @@ class _$TestSubtypeComponent extends TestSubtypeComponent { final List $defaultConsumedProps = const [ _$metaForTestSubtypeProps ]; - _$$TestSubtypeProps$JsMap _cachedTypedProps; - @override - _$$TestSubtypeProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test.over_react.g.dart index ea39ae487..e5b2a18ef 100644 --- a/test/over_react/component_declaration/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test.over_react.g.dart @@ -37,9 +37,8 @@ class TestBasicProps extends _$TestBasicProps static const PropsMeta meta = _$metaForTestBasicProps; } -_$$TestBasicProps _$TestBasic([Map backingProps]) => backingProps == null - ? new _$$TestBasicProps$JsMap(new JsBackedMap()) - : new _$$TestBasicProps(backingProps); +_$$TestBasicProps _$TestBasic([Map backingProps]) => + new _$$TestBasicProps(backingProps); // Concrete props implementation. // @@ -47,15 +46,6 @@ _$$TestBasicProps _$TestBasic([Map backingProps]) => backingProps == null class _$$TestBasicProps extends _$TestBasicProps with _$TestBasicPropsAccessorsMixin implements TestBasicProps { - _$$TestBasicProps._(); - factory _$$TestBasicProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestBasicProps$PlainMap(backingMap); - } else { - return new _$$TestBasicProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -67,15 +57,11 @@ class _$$TestBasicProps extends _$TestBasicProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestBasicProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestBasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestBasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -85,22 +71,6 @@ class _$$TestBasicProps$PlainMap extends _$$TestBasicProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestBasicProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -109,9 +79,6 @@ class _$TestBasicComponent extends TestBasicComponent { @override _$$TestBasicProps typedPropsFactory(Map backingMap) => new _$$TestBasicProps(backingMap); - @override - _$$TestBasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestBasicProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -123,14 +90,6 @@ class _$TestBasicComponent extends TestBasicComponent { final List $defaultConsumedProps = const [ _$metaForTestBasicProps ]; - _$$TestBasicProps$JsMap _cachedTypedProps; - @override - _$$TestBasicProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -166,9 +125,7 @@ class TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps } _$$TestHandlerLifecycleProps _$TestHandlerLifecycle([Map backingProps]) => - backingProps == null - ? new _$$TestHandlerLifecycleProps$JsMap(new JsBackedMap()) - : new _$$TestHandlerLifecycleProps(backingProps); + new _$$TestHandlerLifecycleProps(backingProps); // Concrete props implementation. // @@ -176,15 +133,6 @@ _$$TestHandlerLifecycleProps _$TestHandlerLifecycle([Map backingProps]) => class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps with _$TestHandlerLifecyclePropsAccessorsMixin implements TestHandlerLifecycleProps { - _$$TestHandlerLifecycleProps._(); - factory _$$TestHandlerLifecycleProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestHandlerLifecycleProps$PlainMap(backingMap); - } else { - return new _$$TestHandlerLifecycleProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -197,16 +145,11 @@ class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestHandlerLifecycleProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestHandlerLifecycleProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestHandlerLifecycleProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -216,22 +159,6 @@ class _$$TestHandlerLifecycleProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestHandlerLifecycleProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -240,10 +167,6 @@ class _$TestHandlerLifecycleComponent extends TestHandlerLifecycleComponent { @override _$$TestHandlerLifecycleProps typedPropsFactory(Map backingMap) => new _$$TestHandlerLifecycleProps(backingMap); - @override - _$$TestHandlerLifecycleProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestHandlerLifecycleProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -255,14 +178,6 @@ class _$TestHandlerLifecycleComponent extends TestHandlerLifecycleComponent { final List $defaultConsumedProps = const [ _$metaForTestHandlerLifecycleProps ]; - _$$TestHandlerLifecycleProps$JsMap _cachedTypedProps; - @override - _$$TestHandlerLifecycleProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -298,9 +213,7 @@ class TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps } _$$TestHandlerPrecedenceProps _$TestHandlerPrecedence([Map backingProps]) => - backingProps == null - ? new _$$TestHandlerPrecedenceProps$JsMap(new JsBackedMap()) - : new _$$TestHandlerPrecedenceProps(backingProps); + new _$$TestHandlerPrecedenceProps(backingProps); // Concrete props implementation. // @@ -308,15 +221,6 @@ _$$TestHandlerPrecedenceProps _$TestHandlerPrecedence([Map backingProps]) => class _$$TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps with _$TestHandlerPrecedencePropsAccessorsMixin implements TestHandlerPrecedenceProps { - _$$TestHandlerPrecedenceProps._(); - factory _$$TestHandlerPrecedenceProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestHandlerPrecedenceProps$PlainMap(backingMap); - } else { - return new _$$TestHandlerPrecedenceProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -329,16 +233,11 @@ class _$$TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestHandlerPrecedenceProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestHandlerPrecedenceProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestHandlerPrecedenceProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -348,23 +247,6 @@ class _$$TestHandlerPrecedenceProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestHandlerPrecedenceProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -373,10 +255,6 @@ class _$TestHandlerPrecedenceComponent extends TestHandlerPrecedenceComponent { @override _$$TestHandlerPrecedenceProps typedPropsFactory(Map backingMap) => new _$$TestHandlerPrecedenceProps(backingMap); - @override - _$$TestHandlerPrecedenceProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestHandlerPrecedenceProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -388,14 +266,6 @@ class _$TestHandlerPrecedenceComponent extends TestHandlerPrecedenceComponent { final List $defaultConsumedProps = const [ _$metaForTestHandlerPrecedenceProps ]; - _$$TestHandlerPrecedenceProps$JsMap _cachedTypedProps; - @override - _$$TestHandlerPrecedenceProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -451,9 +321,7 @@ class TestPropValidationProps extends _$TestPropValidationProps } _$$TestPropValidationProps _$TestPropValidation([Map backingProps]) => - backingProps == null - ? new _$$TestPropValidationProps$JsMap(new JsBackedMap()) - : new _$$TestPropValidationProps(backingProps); + new _$$TestPropValidationProps(backingProps); // Concrete props implementation. // @@ -461,15 +329,6 @@ _$$TestPropValidationProps _$TestPropValidation([Map backingProps]) => class _$$TestPropValidationProps extends _$TestPropValidationProps with _$TestPropValidationPropsAccessorsMixin implements TestPropValidationProps { - _$$TestPropValidationProps._(); - factory _$$TestPropValidationProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestPropValidationProps$PlainMap(backingMap); - } else { - return new _$$TestPropValidationProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -482,15 +341,11 @@ class _$$TestPropValidationProps extends _$TestPropValidationProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestPropValidationProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestPropValidationProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestPropValidationProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -500,22 +355,6 @@ class _$$TestPropValidationProps$PlainMap extends _$$TestPropValidationProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestPropValidationProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -524,10 +363,6 @@ class _$TestPropValidationComponent extends TestPropValidationComponent { @override _$$TestPropValidationProps typedPropsFactory(Map backingMap) => new _$$TestPropValidationProps(backingMap); - @override - _$$TestPropValidationProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestPropValidationProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -539,14 +374,6 @@ class _$TestPropValidationComponent extends TestPropValidationComponent { final List $defaultConsumedProps = const [ _$metaForTestPropValidationProps ]; - _$$TestPropValidationProps$JsMap _cachedTypedProps; - @override - _$$TestPropValidationProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -581,9 +408,8 @@ class TestRedrawOnProps extends _$TestRedrawOnProps static const PropsMeta meta = _$metaForTestRedrawOnProps; } -_$$TestRedrawOnProps _$TestRedrawOn([Map backingProps]) => backingProps == null - ? new _$$TestRedrawOnProps$JsMap(new JsBackedMap()) - : new _$$TestRedrawOnProps(backingProps); +_$$TestRedrawOnProps _$TestRedrawOn([Map backingProps]) => + new _$$TestRedrawOnProps(backingProps); // Concrete props implementation. // @@ -591,15 +417,6 @@ _$$TestRedrawOnProps _$TestRedrawOn([Map backingProps]) => backingProps == null class _$$TestRedrawOnProps extends _$TestRedrawOnProps with _$TestRedrawOnPropsAccessorsMixin implements TestRedrawOnProps { - _$$TestRedrawOnProps._(); - factory _$$TestRedrawOnProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestRedrawOnProps$PlainMap(backingMap); - } else { - return new _$$TestRedrawOnProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -612,15 +429,11 @@ class _$$TestRedrawOnProps extends _$TestRedrawOnProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestRedrawOnProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestRedrawOnProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestRedrawOnProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -630,22 +443,6 @@ class _$$TestRedrawOnProps$PlainMap extends _$$TestRedrawOnProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestRedrawOnProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -654,9 +451,6 @@ class _$TestRedrawOnComponent extends TestRedrawOnComponent { @override _$$TestRedrawOnProps typedPropsFactory(Map backingMap) => new _$$TestRedrawOnProps(backingMap); - @override - _$$TestRedrawOnProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestRedrawOnProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -668,14 +462,6 @@ class _$TestRedrawOnComponent extends TestRedrawOnComponent { final List $defaultConsumedProps = const [ _$metaForTestRedrawOnProps ]; - _$$TestRedrawOnProps$JsMap _cachedTypedProps; - @override - _$$TestRedrawOnProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -711,9 +497,7 @@ class TestStoreHandlersProps extends _$TestStoreHandlersProps } _$$TestStoreHandlersProps _$TestStoreHandlers([Map backingProps]) => - backingProps == null - ? new _$$TestStoreHandlersProps$JsMap(new JsBackedMap()) - : new _$$TestStoreHandlersProps(backingProps); + new _$$TestStoreHandlersProps(backingProps); // Concrete props implementation. // @@ -721,15 +505,6 @@ _$$TestStoreHandlersProps _$TestStoreHandlers([Map backingProps]) => class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps with _$TestStoreHandlersPropsAccessorsMixin implements TestStoreHandlersProps { - _$$TestStoreHandlersProps._(); - factory _$$TestStoreHandlersProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStoreHandlersProps$PlainMap(backingMap); - } else { - return new _$$TestStoreHandlersProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -742,15 +517,11 @@ class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStoreHandlersProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStoreHandlersProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStoreHandlersProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -760,22 +531,6 @@ class _$$TestStoreHandlersProps$PlainMap extends _$$TestStoreHandlersProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStoreHandlersProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -784,9 +539,6 @@ class _$TestStoreHandlersComponent extends TestStoreHandlersComponent { @override _$$TestStoreHandlersProps typedPropsFactory(Map backingMap) => new _$$TestStoreHandlersProps(backingMap); - @override - _$$TestStoreHandlersProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestStoreHandlersProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -798,14 +550,6 @@ class _$TestStoreHandlersComponent extends TestStoreHandlersComponent { final List $defaultConsumedProps = const [ _$metaForTestStoreHandlersProps ]; - _$$TestStoreHandlersProps$JsMap _cachedTypedProps; - @override - _$$TestStoreHandlersProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -841,9 +585,7 @@ class TestStatefulBasicProps extends _$TestStatefulBasicProps } _$$TestStatefulBasicProps _$TestStatefulBasic([Map backingProps]) => - backingProps == null - ? new _$$TestStatefulBasicProps$JsMap(new JsBackedMap()) - : new _$$TestStatefulBasicProps(backingProps); + new _$$TestStatefulBasicProps(backingProps); // Concrete props implementation. // @@ -851,15 +593,6 @@ _$$TestStatefulBasicProps _$TestStatefulBasic([Map backingProps]) => class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps with _$TestStatefulBasicPropsAccessorsMixin implements TestStatefulBasicProps { - _$$TestStatefulBasicProps._(); - factory _$$TestStatefulBasicProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStatefulBasicProps$PlainMap(backingMap); - } else { - return new _$$TestStatefulBasicProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -872,15 +605,11 @@ class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStatefulBasicProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStatefulBasicProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStatefulBasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -890,22 +619,6 @@ class _$$TestStatefulBasicProps$PlainMap extends _$$TestStatefulBasicProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStatefulBasicProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TestStatefulBasicStateAccessorsMixin implements _$TestStatefulBasicState { @override @@ -929,10 +642,14 @@ class TestStatefulBasicState extends _$TestStatefulBasicState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TestStatefulBasicState extends _$TestStatefulBasicState with _$TestStatefulBasicStateAccessorsMixin implements TestStatefulBasicState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -944,10 +661,6 @@ class _$$TestStatefulBasicState extends _$TestStatefulBasicState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -959,10 +672,6 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { _$$TestStatefulBasicProps typedPropsFactory(Map backingMap) => new _$$TestStatefulBasicProps(backingMap); @override - _$$TestStatefulBasicProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestStatefulBasicProps$JsMap(backingMap); - - @override _$$TestStatefulBasicState typedStateFactory(Map backingMap) => new _$$TestStatefulBasicState(backingMap); @@ -976,14 +685,6 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { final List $defaultConsumedProps = const [ _$metaForTestStatefulBasicProps ]; - _$$TestStatefulBasicProps$JsMap _cachedTypedProps; - @override - _$$TestStatefulBasicProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -1021,9 +722,7 @@ class TestStatefulHandlerLifecycleProps _$$TestStatefulHandlerLifecycleProps _$TestStatefulHandlerLifecycle( [Map backingProps]) => - backingProps == null - ? new _$$TestStatefulHandlerLifecycleProps$JsMap(new JsBackedMap()) - : new _$$TestStatefulHandlerLifecycleProps(backingProps); + new _$$TestStatefulHandlerLifecycleProps(backingProps); // Concrete props implementation. // @@ -1032,15 +731,6 @@ class _$$TestStatefulHandlerLifecycleProps extends _$TestStatefulHandlerLifecycleProps with _$TestStatefulHandlerLifecyclePropsAccessorsMixin implements TestStatefulHandlerLifecycleProps { - _$$TestStatefulHandlerLifecycleProps._(); - factory _$$TestStatefulHandlerLifecycleProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStatefulHandlerLifecycleProps$PlainMap(backingMap); - } else { - return new _$$TestStatefulHandlerLifecycleProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1053,16 +743,11 @@ class _$$TestStatefulHandlerLifecycleProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStatefulHandlerLifecycleProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStatefulHandlerLifecycleProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStatefulHandlerLifecycleProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1072,23 +757,6 @@ class _$$TestStatefulHandlerLifecycleProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStatefulHandlerLifecycleProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TestStatefulHandlerLifecycleStateAccessorsMixin implements _$TestStatefulHandlerLifecycleState { @override @@ -1113,11 +781,15 @@ class TestStatefulHandlerLifecycleState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TestStatefulHandlerLifecycleState extends _$TestStatefulHandlerLifecycleState with _$TestStatefulHandlerLifecycleStateAccessorsMixin implements TestStatefulHandlerLifecycleState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1129,10 +801,6 @@ class _$$TestStatefulHandlerLifecycleState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1145,11 +813,6 @@ class _$TestStatefulHandlerLifecycleComponent _$$TestStatefulHandlerLifecycleProps typedPropsFactory(Map backingMap) => new _$$TestStatefulHandlerLifecycleProps(backingMap); @override - _$$TestStatefulHandlerLifecycleProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestStatefulHandlerLifecycleProps$JsMap(backingMap); - - @override _$$TestStatefulHandlerLifecycleState typedStateFactory(Map backingMap) => new _$$TestStatefulHandlerLifecycleState(backingMap); @@ -1163,14 +826,6 @@ class _$TestStatefulHandlerLifecycleComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulHandlerLifecycleProps ]; - _$$TestStatefulHandlerLifecycleProps$JsMap _cachedTypedProps; - @override - _$$TestStatefulHandlerLifecycleProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -1208,9 +863,7 @@ class TestStatefulHandlerPrecedenceProps _$$TestStatefulHandlerPrecedenceProps _$TestStatefulHandlerPrecedence( [Map backingProps]) => - backingProps == null - ? new _$$TestStatefulHandlerPrecedenceProps$JsMap(new JsBackedMap()) - : new _$$TestStatefulHandlerPrecedenceProps(backingProps); + new _$$TestStatefulHandlerPrecedenceProps(backingProps); // Concrete props implementation. // @@ -1219,15 +872,6 @@ class _$$TestStatefulHandlerPrecedenceProps extends _$TestStatefulHandlerPrecedenceProps with _$TestStatefulHandlerPrecedencePropsAccessorsMixin implements TestStatefulHandlerPrecedenceProps { - _$$TestStatefulHandlerPrecedenceProps._(); - factory _$$TestStatefulHandlerPrecedenceProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStatefulHandlerPrecedenceProps$PlainMap(backingMap); - } else { - return new _$$TestStatefulHandlerPrecedenceProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1240,16 +884,11 @@ class _$$TestStatefulHandlerPrecedenceProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStatefulHandlerPrecedenceProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStatefulHandlerPrecedenceProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStatefulHandlerPrecedenceProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1259,23 +898,6 @@ class _$$TestStatefulHandlerPrecedenceProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStatefulHandlerPrecedenceProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements _$TestStatefulHandlerPrecedenceState { @override @@ -1300,11 +922,15 @@ class TestStatefulHandlerPrecedenceState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TestStatefulHandlerPrecedenceState extends _$TestStatefulHandlerPrecedenceState with _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements TestStatefulHandlerPrecedenceState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1316,10 +942,6 @@ class _$$TestStatefulHandlerPrecedenceState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1332,11 +954,6 @@ class _$TestStatefulHandlerPrecedenceComponent _$$TestStatefulHandlerPrecedenceProps typedPropsFactory(Map backingMap) => new _$$TestStatefulHandlerPrecedenceProps(backingMap); @override - _$$TestStatefulHandlerPrecedenceProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestStatefulHandlerPrecedenceProps$JsMap(backingMap); - - @override _$$TestStatefulHandlerPrecedenceState typedStateFactory(Map backingMap) => new _$$TestStatefulHandlerPrecedenceState(backingMap); @@ -1350,14 +967,6 @@ class _$TestStatefulHandlerPrecedenceComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulHandlerPrecedenceProps ]; - _$$TestStatefulHandlerPrecedenceProps$JsMap _cachedTypedProps; - @override - _$$TestStatefulHandlerPrecedenceProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -1417,9 +1026,7 @@ class TestStatefulPropValidationProps extends _$TestStatefulPropValidationProps _$$TestStatefulPropValidationProps _$TestStatefulPropValidation( [Map backingProps]) => - backingProps == null - ? new _$$TestStatefulPropValidationProps$JsMap(new JsBackedMap()) - : new _$$TestStatefulPropValidationProps(backingProps); + new _$$TestStatefulPropValidationProps(backingProps); // Concrete props implementation. // @@ -1428,15 +1035,6 @@ class _$$TestStatefulPropValidationProps extends _$TestStatefulPropValidationProps with _$TestStatefulPropValidationPropsAccessorsMixin implements TestStatefulPropValidationProps { - _$$TestStatefulPropValidationProps._(); - factory _$$TestStatefulPropValidationProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStatefulPropValidationProps$PlainMap(backingMap); - } else { - return new _$$TestStatefulPropValidationProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1449,16 +1047,11 @@ class _$$TestStatefulPropValidationProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStatefulPropValidationProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStatefulPropValidationProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStatefulPropValidationProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1468,23 +1061,6 @@ class _$$TestStatefulPropValidationProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStatefulPropValidationProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TestStatefulPropValidationStateAccessorsMixin implements _$TestStatefulPropValidationState { @override @@ -1508,11 +1084,15 @@ class TestStatefulPropValidationState extends _$TestStatefulPropValidationState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TestStatefulPropValidationState extends _$TestStatefulPropValidationState with _$TestStatefulPropValidationStateAccessorsMixin implements TestStatefulPropValidationState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1524,10 +1104,6 @@ class _$$TestStatefulPropValidationState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1540,11 +1116,6 @@ class _$TestStatefulPropValidationComponent _$$TestStatefulPropValidationProps typedPropsFactory(Map backingMap) => new _$$TestStatefulPropValidationProps(backingMap); @override - _$$TestStatefulPropValidationProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestStatefulPropValidationProps$JsMap(backingMap); - - @override _$$TestStatefulPropValidationState typedStateFactory(Map backingMap) => new _$$TestStatefulPropValidationState(backingMap); @@ -1558,14 +1129,6 @@ class _$TestStatefulPropValidationComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulPropValidationProps ]; - _$$TestStatefulPropValidationProps$JsMap _cachedTypedProps; - @override - _$$TestStatefulPropValidationProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -1601,9 +1164,7 @@ class TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps } _$$TestStatefulRedrawOnProps _$TestStatefulRedrawOn([Map backingProps]) => - backingProps == null - ? new _$$TestStatefulRedrawOnProps$JsMap(new JsBackedMap()) - : new _$$TestStatefulRedrawOnProps(backingProps); + new _$$TestStatefulRedrawOnProps(backingProps); // Concrete props implementation. // @@ -1611,15 +1172,6 @@ _$$TestStatefulRedrawOnProps _$TestStatefulRedrawOn([Map backingProps]) => class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps with _$TestStatefulRedrawOnPropsAccessorsMixin implements TestStatefulRedrawOnProps { - _$$TestStatefulRedrawOnProps._(); - factory _$$TestStatefulRedrawOnProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStatefulRedrawOnProps$PlainMap(backingMap); - } else { - return new _$$TestStatefulRedrawOnProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1632,16 +1184,11 @@ class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStatefulRedrawOnProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStatefulRedrawOnProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStatefulRedrawOnProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1651,22 +1198,6 @@ class _$$TestStatefulRedrawOnProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStatefulRedrawOnProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TestStatefulRedrawOnStateAccessorsMixin implements _$TestStatefulRedrawOnState { @override @@ -1690,10 +1221,14 @@ class TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState with _$TestStatefulRedrawOnStateAccessorsMixin implements TestStatefulRedrawOnState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1705,10 +1240,6 @@ class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1720,11 +1251,6 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { _$$TestStatefulRedrawOnProps typedPropsFactory(Map backingMap) => new _$$TestStatefulRedrawOnProps(backingMap); @override - _$$TestStatefulRedrawOnProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestStatefulRedrawOnProps$JsMap(backingMap); - - @override _$$TestStatefulRedrawOnState typedStateFactory(Map backingMap) => new _$$TestStatefulRedrawOnState(backingMap); @@ -1738,14 +1264,6 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { final List $defaultConsumedProps = const [ _$metaForTestStatefulRedrawOnProps ]; - _$$TestStatefulRedrawOnProps$JsMap _cachedTypedProps; - @override - _$$TestStatefulRedrawOnProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -1782,9 +1300,7 @@ class TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps _$$TestStatefulStoreHandlersProps _$TestStatefulStoreHandlers( [Map backingProps]) => - backingProps == null - ? new _$$TestStatefulStoreHandlersProps$JsMap(new JsBackedMap()) - : new _$$TestStatefulStoreHandlersProps(backingProps); + new _$$TestStatefulStoreHandlersProps(backingProps); // Concrete props implementation. // @@ -1792,15 +1308,6 @@ _$$TestStatefulStoreHandlersProps _$TestStatefulStoreHandlers( class _$$TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps with _$TestStatefulStoreHandlersPropsAccessorsMixin implements TestStatefulStoreHandlersProps { - _$$TestStatefulStoreHandlersProps._(); - factory _$$TestStatefulStoreHandlersProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestStatefulStoreHandlersProps$PlainMap(backingMap); - } else { - return new _$$TestStatefulStoreHandlersProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1813,16 +1320,11 @@ class _$$TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestStatefulStoreHandlersProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestStatefulStoreHandlersProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestStatefulStoreHandlersProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1832,23 +1334,6 @@ class _$$TestStatefulStoreHandlersProps$PlainMap Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestStatefulStoreHandlersProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$TestStatefulStoreHandlersStateAccessorsMixin implements _$TestStatefulStoreHandlersState { @override @@ -1872,10 +1357,14 @@ class TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState // Concrete state implementation. // -// Implements constructor and backing map. +// Implements constructor and backing map, and links up to generated component factory. class _$$TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState with _$TestStatefulStoreHandlersStateAccessorsMixin implements TestStatefulStoreHandlersState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1887,10 +1376,6 @@ class _$$TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState @override Map get state => _state; Map _state; - - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1903,11 +1388,6 @@ class _$TestStatefulStoreHandlersComponent _$$TestStatefulStoreHandlersProps typedPropsFactory(Map backingMap) => new _$$TestStatefulStoreHandlersProps(backingMap); @override - _$$TestStatefulStoreHandlersProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestStatefulStoreHandlersProps$JsMap(backingMap); - - @override _$$TestStatefulStoreHandlersState typedStateFactory(Map backingMap) => new _$$TestStatefulStoreHandlersState(backingMap); @@ -1921,12 +1401,4 @@ class _$TestStatefulStoreHandlersComponent final List $defaultConsumedProps = const [ _$metaForTestStatefulStoreHandlersProps ]; - _$$TestStatefulStoreHandlersProps$JsMap _cachedTypedProps; - @override - _$$TestStatefulStoreHandlersProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/test/over_react/component_declaration/redux_component_test.over_react.g.dart b/test/over_react/component_declaration/redux_component_test.over_react.g.dart index 3f3196232..275373650 100644 --- a/test/over_react/component_declaration/redux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/redux_component_test.over_react.g.dart @@ -37,9 +37,8 @@ class TestDefaultProps extends _$TestDefaultProps static const PropsMeta meta = _$metaForTestDefaultProps; } -_$$TestDefaultProps _$TestDefault([Map backingProps]) => backingProps == null - ? new _$$TestDefaultProps$JsMap(new JsBackedMap()) - : new _$$TestDefaultProps(backingProps); +_$$TestDefaultProps _$TestDefault([Map backingProps]) => + new _$$TestDefaultProps(backingProps); // Concrete props implementation. // @@ -47,15 +46,6 @@ _$$TestDefaultProps _$TestDefault([Map backingProps]) => backingProps == null class _$$TestDefaultProps extends _$TestDefaultProps with _$TestDefaultPropsAccessorsMixin implements TestDefaultProps { - _$$TestDefaultProps._(); - factory _$$TestDefaultProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestDefaultProps$PlainMap(backingMap); - } else { - return new _$$TestDefaultProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -68,15 +58,11 @@ class _$$TestDefaultProps extends _$TestDefaultProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestDefaultProps.'; -} -class _$$TestDefaultProps$PlainMap extends _$$TestDefaultProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$TestDefaultProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestDefaultProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -86,22 +72,6 @@ class _$$TestDefaultProps$PlainMap extends _$$TestDefaultProps { Map _props; } -class _$$TestDefaultProps$JsMap extends _$$TestDefaultProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$TestDefaultProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -110,9 +80,6 @@ class _$TestDefaultComponent extends TestDefaultComponent { @override _$$TestDefaultProps typedPropsFactory(Map backingMap) => new _$$TestDefaultProps(backingMap); - @override - _$$TestDefaultProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestDefaultProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -124,14 +91,6 @@ class _$TestDefaultComponent extends TestDefaultComponent { final List $defaultConsumedProps = const [ _$metaForTestDefaultProps ]; - _$$TestDefaultProps$JsMap _cachedTypedProps; - @override - _$$TestDefaultProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -165,9 +124,8 @@ class TestConnectProps extends _$TestConnectProps static const PropsMeta meta = _$metaForTestConnectProps; } -_$$TestConnectProps _$TestConnect([Map backingProps]) => backingProps == null - ? new _$$TestConnectProps$JsMap(new JsBackedMap()) - : new _$$TestConnectProps(backingProps); +_$$TestConnectProps _$TestConnect([Map backingProps]) => + new _$$TestConnectProps(backingProps); // Concrete props implementation. // @@ -175,15 +133,6 @@ _$$TestConnectProps _$TestConnect([Map backingProps]) => backingProps == null class _$$TestConnectProps extends _$TestConnectProps with _$TestConnectPropsAccessorsMixin implements TestConnectProps { - _$$TestConnectProps._(); - factory _$$TestConnectProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestConnectProps$PlainMap(backingMap); - } else { - return new _$$TestConnectProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -196,15 +145,11 @@ class _$$TestConnectProps extends _$TestConnectProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestConnectProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestConnectProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestConnectProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -214,22 +159,6 @@ class _$$TestConnectProps$PlainMap extends _$$TestConnectProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestConnectProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -238,9 +167,6 @@ class _$TestConnectComponent extends TestConnectComponent { @override _$$TestConnectProps typedPropsFactory(Map backingMap) => new _$$TestConnectProps(backingMap); - @override - _$$TestConnectProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestConnectProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -252,14 +178,6 @@ class _$TestConnectComponent extends TestConnectComponent { final List $defaultConsumedProps = const [ _$metaForTestConnectProps ]; - _$$TestConnectProps$JsMap _cachedTypedProps; - @override - _$$TestConnectProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } // React component factory implementation. @@ -292,9 +210,8 @@ class TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin { static const PropsMeta meta = _$metaForTestPureProps; } -_$$TestPureProps _$TestPure([Map backingProps]) => backingProps == null - ? new _$$TestPureProps$JsMap(new JsBackedMap()) - : new _$$TestPureProps(backingProps); +_$$TestPureProps _$TestPure([Map backingProps]) => + new _$$TestPureProps(backingProps); // Concrete props implementation. // @@ -302,15 +219,6 @@ _$$TestPureProps _$TestPure([Map backingProps]) => backingProps == null class _$$TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin implements TestPureProps { - _$$TestPureProps._(); - factory _$$TestPureProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestPureProps$PlainMap(backingMap); - } else { - return new _$$TestPureProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -322,15 +230,11 @@ class _$$TestPureProps extends _$TestPureProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestPureProps.'; -} -class _$$TestPureProps$PlainMap extends _$$TestPureProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details - _$$TestPureProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestPureProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -340,22 +244,6 @@ class _$$TestPureProps$PlainMap extends _$$TestPureProps { Map _props; } -class _$$TestPureProps$JsMap extends _$$TestPureProps { - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$TestPureProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -364,9 +252,6 @@ class _$TestPureComponent extends TestPureComponent { @override _$$TestPureProps typedPropsFactory(Map backingMap) => new _$$TestPureProps(backingMap); - @override - _$$TestPureProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestPureProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -378,12 +263,4 @@ class _$TestPureComponent extends TestPureComponent { final List $defaultConsumedProps = const [ _$metaForTestPureProps ]; - _$$TestPureProps$JsMap _cachedTypedProps; - @override - _$$TestPureProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 504d3ee6b..40baab94b 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 @@ -98,9 +98,7 @@ class TestCompositeComponentProps extends _$TestCompositeComponentProps } _$$TestCompositeComponentProps _$TestCompositeComponent([Map backingProps]) => - backingProps == null - ? new _$$TestCompositeComponentProps$JsMap(new JsBackedMap()) - : new _$$TestCompositeComponentProps(backingProps); + new _$$TestCompositeComponentProps(backingProps); // Concrete props implementation. // @@ -108,15 +106,6 @@ _$$TestCompositeComponentProps _$TestCompositeComponent([Map backingProps]) => class _$$TestCompositeComponentProps extends _$TestCompositeComponentProps with _$TestCompositeComponentPropsAccessorsMixin implements TestCompositeComponentProps { - _$$TestCompositeComponentProps._(); - factory _$$TestCompositeComponentProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestCompositeComponentProps$PlainMap(backingMap); - } else { - return new _$$TestCompositeComponentProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -129,16 +118,11 @@ class _$$TestCompositeComponentProps extends _$TestCompositeComponentProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestCompositeComponentProps.'; -} -class _$$TestCompositeComponentProps$PlainMap - extends _$$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 an unknown ddc issue. // See for more details - _$$TestCompositeComponentProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestCompositeComponentProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -148,23 +132,6 @@ class _$$TestCompositeComponentProps$PlainMap Map _props; } -class _$$TestCompositeComponentProps$JsMap - extends _$$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 an unknown ddc issue. - // See for more details - _$$TestCompositeComponentProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -174,10 +141,6 @@ class _$TestCompositeComponentComponent @override _$$TestCompositeComponentProps typedPropsFactory(Map backingMap) => new _$$TestCompositeComponentProps(backingMap); - @override - _$$TestCompositeComponentProps$JsMap typedPropsFactoryJs( - JsBackedMap backingMap) => - new _$$TestCompositeComponentProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -189,12 +152,4 @@ class _$TestCompositeComponentComponent final List $defaultConsumedProps = const [ _$metaForTestCompositeComponentProps ]; - _$$TestCompositeComponentProps$JsMap _cachedTypedProps; - @override - _$$TestCompositeComponentProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 5509b44ad..ca0ac6cf6 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 @@ -36,9 +36,8 @@ class DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin { static const PropsMeta meta = _$metaForDomTestProps; } -_$$DomTestProps _$DomTest([Map backingProps]) => backingProps == null - ? new _$$DomTestProps$JsMap(new JsBackedMap()) - : new _$$DomTestProps(backingProps); +_$$DomTestProps _$DomTest([Map backingProps]) => + new _$$DomTestProps(backingProps); // Concrete props implementation. // @@ -46,15 +45,6 @@ _$$DomTestProps _$DomTest([Map backingProps]) => backingProps == null class _$$DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin implements DomTestProps { - _$$DomTestProps._(); - factory _$$DomTestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$DomTestProps$PlainMap(backingMap); - } else { - return new _$$DomTestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -66,15 +56,11 @@ class _$$DomTestProps extends _$DomTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'DomTestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$DomTestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$DomTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -84,22 +70,6 @@ class _$$DomTestProps$PlainMap extends _$$DomTestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$DomTestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -108,9 +78,6 @@ class _$DomTestComponent extends DomTestComponent { @override _$$DomTestProps typedPropsFactory(Map backingMap) => new _$$DomTestProps(backingMap); - @override - _$$DomTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$DomTestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -122,12 +89,4 @@ class _$DomTestComponent extends DomTestComponent { final List $defaultConsumedProps = const [ _$metaForDomTestProps ]; - _$$DomTestProps$JsMap _cachedTypedProps; - @override - _$$DomTestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 3b24387d4..4ed62dc4f 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,9 +64,7 @@ class TestProps extends _$TestProps with _$TestPropsAccessorsMixin { static const PropsMeta meta = _$metaForTestProps; } -_$$TestProps _$Test([Map backingProps]) => backingProps == null - ? new _$$TestProps$JsMap(new JsBackedMap()) - : new _$$TestProps(backingProps); +_$$TestProps _$Test([Map backingProps]) => new _$$TestProps(backingProps); // Concrete props implementation. // @@ -74,15 +72,6 @@ _$$TestProps _$Test([Map backingProps]) => backingProps == null class _$$TestProps extends _$TestProps with _$TestPropsAccessorsMixin implements TestProps { - _$$TestProps._(); - factory _$$TestProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TestProps$PlainMap(backingMap); - } else { - return new _$$TestProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -94,15 +83,11 @@ class _$$TestProps extends _$TestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TestProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -112,22 +97,6 @@ class _$$TestProps$PlainMap extends _$$TestProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TestProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -136,9 +105,6 @@ class _$TestComponent extends TestComponent { @override _$$TestProps typedPropsFactory(Map backingMap) => new _$$TestProps(backingMap); - @override - _$$TestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TestProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -148,12 +114,4 @@ class _$TestComponent extends TestComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTestProps]; - _$$TestProps$JsMap _cachedTypedProps; - @override - _$$TestProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 22e6e968b..131a33f09 100644 --- a/test/test_util/one_level_wrapper.over_react.g.dart +++ b/test/test_util/one_level_wrapper.over_react.g.dart @@ -39,9 +39,7 @@ class OneLevelWrapperProps extends _$OneLevelWrapperProps } _$$OneLevelWrapperProps _$OneLevelWrapper([Map backingProps]) => - backingProps == null - ? new _$$OneLevelWrapperProps$JsMap(new JsBackedMap()) - : new _$$OneLevelWrapperProps(backingProps); + new _$$OneLevelWrapperProps(backingProps); // Concrete props implementation. // @@ -49,15 +47,6 @@ _$$OneLevelWrapperProps _$OneLevelWrapper([Map backingProps]) => class _$$OneLevelWrapperProps extends _$OneLevelWrapperProps with _$OneLevelWrapperPropsAccessorsMixin implements OneLevelWrapperProps { - _$$OneLevelWrapperProps._(); - factory _$$OneLevelWrapperProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$OneLevelWrapperProps$PlainMap(backingMap); - } else { - return new _$$OneLevelWrapperProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -70,15 +59,11 @@ class _$$OneLevelWrapperProps extends _$OneLevelWrapperProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'OneLevelWrapperProps.'; -} -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 an unknown ddc issue. // See for more details - _$$OneLevelWrapperProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$OneLevelWrapperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -88,22 +73,6 @@ class _$$OneLevelWrapperProps$PlainMap extends _$$OneLevelWrapperProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$OneLevelWrapperProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -112,9 +81,6 @@ class _$OneLevelWrapperComponent extends OneLevelWrapperComponent { @override _$$OneLevelWrapperProps typedPropsFactory(Map backingMap) => new _$$OneLevelWrapperProps(backingMap); - @override - _$$OneLevelWrapperProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$OneLevelWrapperProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -126,12 +92,4 @@ class _$OneLevelWrapperComponent extends OneLevelWrapperComponent { final List $defaultConsumedProps = const [ _$metaForOneLevelWrapperProps ]; - _$$OneLevelWrapperProps$JsMap _cachedTypedProps; - @override - _$$OneLevelWrapperProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } 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 263473a42..6bdf0984a 100644 --- a/test/test_util/two_level_wrapper.over_react.g.dart +++ b/test/test_util/two_level_wrapper.over_react.g.dart @@ -39,9 +39,7 @@ class TwoLevelWrapperProps extends _$TwoLevelWrapperProps } _$$TwoLevelWrapperProps _$TwoLevelWrapper([Map backingProps]) => - backingProps == null - ? new _$$TwoLevelWrapperProps$JsMap(new JsBackedMap()) - : new _$$TwoLevelWrapperProps(backingProps); + new _$$TwoLevelWrapperProps(backingProps); // Concrete props implementation. // @@ -49,15 +47,6 @@ _$$TwoLevelWrapperProps _$TwoLevelWrapper([Map backingProps]) => class _$$TwoLevelWrapperProps extends _$TwoLevelWrapperProps with _$TwoLevelWrapperPropsAccessorsMixin implements TwoLevelWrapperProps { - _$$TwoLevelWrapperProps._(); - factory _$$TwoLevelWrapperProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TwoLevelWrapperProps$PlainMap(backingMap); - } else { - return new _$$TwoLevelWrapperProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -70,15 +59,11 @@ class _$$TwoLevelWrapperProps extends _$TwoLevelWrapperProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TwoLevelWrapperProps.'; -} -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 an unknown ddc issue. // See for more details - _$$TwoLevelWrapperProps$PlainMap(Map backingMap) - : this._props = {}, - super._() { + _$$TwoLevelWrapperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -88,22 +73,6 @@ class _$$TwoLevelWrapperProps$PlainMap extends _$$TwoLevelWrapperProps { Map _props; } -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 an unknown ddc issue. - // See for more details - _$$TwoLevelWrapperProps$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 @@ -112,9 +81,6 @@ class _$TwoLevelWrapperComponent extends TwoLevelWrapperComponent { @override _$$TwoLevelWrapperProps typedPropsFactory(Map backingMap) => new _$$TwoLevelWrapperProps(backingMap); - @override - _$$TwoLevelWrapperProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TwoLevelWrapperProps$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -126,12 +92,4 @@ class _$TwoLevelWrapperComponent extends TwoLevelWrapperComponent { final List $defaultConsumedProps = const [ _$metaForTwoLevelWrapperProps ]; - _$$TwoLevelWrapperProps$JsMap _cachedTypedProps; - @override - _$$TwoLevelWrapperProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 93bfcb6cd..2a831e128 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -161,18 +161,9 @@ _$$ButtonProps _$Button([Map backingProps]) => backingProps == null // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ButtonProps extends _$ButtonProps +abstract class _$$ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin implements ButtonProps { - _$$ButtonProps._(); - factory _$$ButtonProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonProps$PlainMap(backingMap); - } else { - return new _$$ButtonProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -184,6 +175,16 @@ class _$$ButtonProps extends _$ButtonProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ButtonProps.'; + + _$$ButtonProps._(); + + factory _$$ButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonProps$JsMap(backingMap); + } else { + return new _$$ButtonProps$PlainMap(backingMap); + } + } } class _$$ButtonProps$PlainMap extends _$$ButtonProps { @@ -239,14 +240,32 @@ class ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map. -class _$$ButtonState extends _$ButtonState +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin implements ButtonState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + _$$ButtonState._(); + + factory _$$ButtonState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonState$JsMap(backingMap); + } else { + return new _$$ButtonState$PlainMap(backingMap); + } + } +} + +class _$$ButtonState$PlainMap extends _$$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 an unknown ddc issue. // See for more details - _$$ButtonState(Map backingMap) : this._state = {} { + _$$ButtonState$PlainMap(Map backingMap) + : this._state = {}, + super._() { this._state = backingMap ?? {}; } @@ -254,10 +273,22 @@ class _$$ButtonState extends _$ButtonState @override Map get state => _state; Map _state; +} - /// Let [UiState] internals know that this class has been generated. +class _$$ButtonState$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ButtonState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. @override - bool get $isClassGenerated => true; + JsBackedMap get state => _state; + JsBackedMap _state; } // Concrete component implementation mixin. @@ -268,13 +299,35 @@ class _$ButtonComponent extends ButtonComponent { @override _$$ButtonProps typedPropsFactory(Map backingMap) => new _$$ButtonProps(backingMap); + _$$ButtonProps$JsMap _cachedTypedProps; + @override + _$$ButtonProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ButtonProps$JsMap(backingMap); - @override _$$ButtonState typedStateFactory(Map backingMap) => new _$$ButtonState(backingMap); + _$$ButtonState$JsMap _cachedTypedState; + @override + _$$ButtonState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ButtonState$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -286,12 +339,4 @@ class _$ButtonComponent extends ButtonComponent { final List $defaultConsumedProps = const [ _$metaForButtonProps ]; - _$$ButtonProps$JsMap _cachedTypedProps; - @override - _$$ButtonProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index 77f4a8871..dbc915919 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -90,18 +90,9 @@ _$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => backingProps == null // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ButtonGroupProps extends _$ButtonGroupProps +abstract class _$$ButtonGroupProps extends _$ButtonGroupProps with _$ButtonGroupPropsAccessorsMixin implements ButtonGroupProps { - _$$ButtonGroupProps._(); - factory _$$ButtonGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonGroupProps$PlainMap(backingMap); - } else { - return new _$$ButtonGroupProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -114,6 +105,16 @@ class _$$ButtonGroupProps extends _$ButtonGroupProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ButtonGroupProps.'; + + _$$ButtonGroupProps._(); + + factory _$$ButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonGroupProps$JsMap(backingMap); + } else { + return new _$$ButtonGroupProps$PlainMap(backingMap); + } + } } class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { @@ -170,14 +171,32 @@ class ButtonGroupState extends _$ButtonGroupState // Concrete state implementation. // -// Implements constructor and backing map. -class _$$ButtonGroupState extends _$ButtonGroupState +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ButtonGroupState extends _$ButtonGroupState with _$ButtonGroupStateAccessorsMixin implements ButtonGroupState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + _$$ButtonGroupState._(); + + factory _$$ButtonGroupState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonGroupState$JsMap(backingMap); + } else { + return new _$$ButtonGroupState$PlainMap(backingMap); + } + } +} + +class _$$ButtonGroupState$PlainMap extends _$$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 an unknown ddc issue. // See for more details - _$$ButtonGroupState(Map backingMap) : this._state = {} { + _$$ButtonGroupState$PlainMap(Map backingMap) + : this._state = {}, + super._() { this._state = backingMap ?? {}; } @@ -185,10 +204,22 @@ class _$$ButtonGroupState extends _$ButtonGroupState @override Map get state => _state; Map _state; +} - /// Let [UiState] internals know that this class has been generated. +class _$$ButtonGroupState$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ButtonGroupState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. @override - bool get $isClassGenerated => true; + JsBackedMap get state => _state; + JsBackedMap _state; } // Concrete component implementation mixin. @@ -199,13 +230,35 @@ class _$ButtonGroupComponent extends ButtonGroupComponent { @override _$$ButtonGroupProps typedPropsFactory(Map backingMap) => new _$$ButtonGroupProps(backingMap); + _$$ButtonGroupProps$JsMap _cachedTypedProps; + @override + _$$ButtonGroupProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ButtonGroupProps$JsMap(backingMap); - @override _$$ButtonGroupState typedStateFactory(Map backingMap) => new _$$ButtonGroupState(backingMap); + _$$ButtonGroupState$JsMap _cachedTypedState; + @override + _$$ButtonGroupState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ButtonGroupState$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -217,12 +270,4 @@ class _$ButtonGroupComponent extends ButtonGroupComponent { final List $defaultConsumedProps = const [ _$metaForButtonGroupProps ]; - _$$ButtonGroupProps$JsMap _cachedTypedProps; - @override - _$$ButtonGroupProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index 92182752e..7b0878ec2 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -61,18 +61,9 @@ _$$ListGroupProps _$ListGroup([Map backingProps]) => backingProps == null // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ListGroupProps extends _$ListGroupProps +abstract class _$$ListGroupProps extends _$ListGroupProps with _$ListGroupPropsAccessorsMixin implements ListGroupProps { - _$$ListGroupProps._(); - factory _$$ListGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ListGroupProps$PlainMap(backingMap); - } else { - return new _$$ListGroupProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -84,6 +75,16 @@ class _$$ListGroupProps extends _$ListGroupProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ListGroupProps.'; + + _$$ListGroupProps._(); + + factory _$$ListGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupProps$JsMap(backingMap); + } else { + return new _$$ListGroupProps$PlainMap(backingMap); + } + } } class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { @@ -126,6 +127,16 @@ class _$ListGroupComponent extends ListGroupComponent { @override _$$ListGroupProps typedPropsFactory(Map backingMap) => new _$$ListGroupProps(backingMap); + _$$ListGroupProps$JsMap _cachedTypedProps; + @override + _$$ListGroupProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ListGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ListGroupProps$JsMap(backingMap); @@ -140,12 +151,4 @@ class _$ListGroupComponent extends ListGroupComponent { final List $defaultConsumedProps = const [ _$metaForListGroupProps ]; - _$$ListGroupProps$JsMap _cachedTypedProps; - @override - _$$ListGroupProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index 6f7d8e89f..7b1c93125 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -209,18 +209,9 @@ _$$ListGroupItemProps _$ListGroupItem([Map backingProps]) => // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ListGroupItemProps extends _$ListGroupItemProps +abstract class _$$ListGroupItemProps extends _$ListGroupItemProps with _$ListGroupItemPropsAccessorsMixin implements ListGroupItemProps { - _$$ListGroupItemProps._(); - factory _$$ListGroupItemProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ListGroupItemProps$PlainMap(backingMap); - } else { - return new _$$ListGroupItemProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -233,6 +224,16 @@ class _$$ListGroupItemProps extends _$ListGroupItemProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ListGroupItemProps.'; + + _$$ListGroupItemProps._(); + + factory _$$ListGroupItemProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupItemProps$JsMap(backingMap); + } else { + return new _$$ListGroupItemProps$PlainMap(backingMap); + } + } } class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { @@ -275,6 +276,16 @@ class _$ListGroupItemComponent extends ListGroupItemComponent { @override _$$ListGroupItemProps typedPropsFactory(Map backingMap) => new _$$ListGroupItemProps(backingMap); + _$$ListGroupItemProps$JsMap _cachedTypedProps; + @override + _$$ListGroupItemProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ListGroupItemProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ListGroupItemProps$JsMap(backingMap); @@ -289,12 +300,4 @@ class _$ListGroupItemComponent extends ListGroupItemComponent { final List $defaultConsumedProps = const [ _$metaForListGroupItemProps ]; - _$$ListGroupItemProps$JsMap _cachedTypedProps; - @override - _$$ListGroupItemProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index 61f5eab4d..0775baf20 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -209,18 +209,9 @@ _$$ProgressProps _$Progress([Map backingProps]) => backingProps == null // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ProgressProps extends _$ProgressProps +abstract class _$$ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin implements ProgressProps { - _$$ProgressProps._(); - factory _$$ProgressProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ProgressProps$PlainMap(backingMap); - } else { - return new _$$ProgressProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -232,6 +223,16 @@ class _$$ProgressProps extends _$ProgressProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ProgressProps.'; + + _$$ProgressProps._(); + + factory _$$ProgressProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ProgressProps$JsMap(backingMap); + } else { + return new _$$ProgressProps$PlainMap(backingMap); + } + } } class _$$ProgressProps$PlainMap extends _$$ProgressProps { @@ -300,14 +301,32 @@ class ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map. -class _$$ProgressState extends _$ProgressState +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin implements ProgressState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + _$$ProgressState._(); + + factory _$$ProgressState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ProgressState$JsMap(backingMap); + } else { + return new _$$ProgressState$PlainMap(backingMap); + } + } +} + +class _$$ProgressState$PlainMap extends _$$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 an unknown ddc issue. // See for more details - _$$ProgressState(Map backingMap) : this._state = {} { + _$$ProgressState$PlainMap(Map backingMap) + : this._state = {}, + super._() { this._state = backingMap ?? {}; } @@ -315,10 +334,22 @@ class _$$ProgressState extends _$ProgressState @override Map get state => _state; Map _state; +} - /// Let [UiState] internals know that this class has been generated. +class _$$ProgressState$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ProgressState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. @override - bool get $isClassGenerated => true; + JsBackedMap get state => _state; + JsBackedMap _state; } // Concrete component implementation mixin. @@ -329,13 +360,35 @@ class _$ProgressComponent extends ProgressComponent { @override _$$ProgressProps typedPropsFactory(Map backingMap) => new _$$ProgressProps(backingMap); + _$$ProgressProps$JsMap _cachedTypedProps; + @override + _$$ProgressProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ProgressProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ProgressProps$JsMap(backingMap); - @override _$$ProgressState typedStateFactory(Map backingMap) => new _$$ProgressState(backingMap); + _$$ProgressState$JsMap _cachedTypedState; + @override + _$$ProgressState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ProgressState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ProgressState$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -347,12 +400,4 @@ class _$ProgressComponent extends ProgressComponent { final List $defaultConsumedProps = const [ _$metaForProgressProps ]; - _$$ProgressProps$JsMap _cachedTypedProps; - @override - _$$ProgressProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index 29459cb2a..1f9e16ae2 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -71,18 +71,9 @@ _$$TagProps _$Tag([Map backingProps]) => backingProps == null // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$TagProps extends _$TagProps +abstract class _$$TagProps extends _$TagProps with _$TagPropsAccessorsMixin implements TagProps { - _$$TagProps._(); - factory _$$TagProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TagProps$PlainMap(backingMap); - } else { - return new _$$TagProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -94,6 +85,16 @@ class _$$TagProps extends _$TagProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TagProps.'; + + _$$TagProps._(); + + factory _$$TagProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TagProps$JsMap(backingMap); + } else { + return new _$$TagProps$PlainMap(backingMap); + } + } } class _$$TagProps$PlainMap extends _$$TagProps { @@ -135,6 +136,16 @@ class _$$TagProps$JsMap extends _$$TagProps { class _$TagComponent extends TagComponent { @override _$$TagProps typedPropsFactory(Map backingMap) => new _$$TagProps(backingMap); + _$$TagProps$JsMap _cachedTypedProps; + @override + _$$TagProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$TagProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$TagProps$JsMap(backingMap); @@ -147,12 +158,4 @@ class _$TagComponent extends TagComponent { /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. @override final List $defaultConsumedProps = const [_$metaForTagProps]; - _$$TagProps$JsMap _cachedTypedProps; - @override - _$$TagProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index d22e39ae1..cd6c61aa5 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -98,18 +98,9 @@ _$$ToggleButtonProps _$ToggleButton([Map backingProps]) => backingProps == null // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ToggleButtonProps extends _$ToggleButtonProps +abstract class _$$ToggleButtonProps extends _$ToggleButtonProps with _$ToggleButtonPropsAccessorsMixin implements ToggleButtonProps { - _$$ToggleButtonProps._(); - factory _$$ToggleButtonProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonProps$PlainMap(backingMap); - } else { - return new _$$ToggleButtonProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -122,6 +113,16 @@ class _$$ToggleButtonProps extends _$ToggleButtonProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ToggleButtonProps.'; + + _$$ToggleButtonProps._(); + + factory _$$ToggleButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonProps$JsMap(backingMap); + } else { + return new _$$ToggleButtonProps$PlainMap(backingMap); + } + } } class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { @@ -212,14 +213,32 @@ class ToggleButtonState extends _$ToggleButtonState // Concrete state implementation. // -// Implements constructor and backing map. -class _$$ToggleButtonState extends _$ToggleButtonState +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ToggleButtonState extends _$ToggleButtonState with _$ToggleButtonStateAccessorsMixin implements ToggleButtonState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + _$$ToggleButtonState._(); + + factory _$$ToggleButtonState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonState$JsMap(backingMap); + } else { + return new _$$ToggleButtonState$PlainMap(backingMap); + } + } +} + +class _$$ToggleButtonState$PlainMap extends _$$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 an unknown ddc issue. // See for more details - _$$ToggleButtonState(Map backingMap) : this._state = {} { + _$$ToggleButtonState$PlainMap(Map backingMap) + : this._state = {}, + super._() { this._state = backingMap ?? {}; } @@ -227,10 +246,22 @@ class _$$ToggleButtonState extends _$ToggleButtonState @override Map get state => _state; Map _state; +} - /// Let [UiState] internals know that this class has been generated. +class _$$ToggleButtonState$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ToggleButtonState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. @override - bool get $isClassGenerated => true; + JsBackedMap get state => _state; + JsBackedMap _state; } // Concrete component implementation mixin. @@ -241,13 +272,35 @@ class _$ToggleButtonComponent extends ToggleButtonComponent { @override _$$ToggleButtonProps typedPropsFactory(Map backingMap) => new _$$ToggleButtonProps(backingMap); + _$$ToggleButtonProps$JsMap _cachedTypedProps; + @override + _$$ToggleButtonProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ToggleButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ToggleButtonProps$JsMap(backingMap); - @override _$$ToggleButtonState typedStateFactory(Map backingMap) => new _$$ToggleButtonState(backingMap); + _$$ToggleButtonState$JsMap _cachedTypedState; + @override + _$$ToggleButtonState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ToggleButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonState$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -259,12 +312,4 @@ class _$ToggleButtonComponent extends ToggleButtonComponent { final List $defaultConsumedProps = const [ _$metaForToggleButtonProps ]; - _$$ToggleButtonProps$JsMap _cachedTypedProps; - @override - _$$ToggleButtonProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index 928d8ffdf..ff3d37073 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -47,18 +47,9 @@ _$$ToggleButtonGroupProps _$ToggleButtonGroup([Map backingProps]) => // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps +abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps with _$ToggleButtonGroupPropsAccessorsMixin implements ToggleButtonGroupProps { - _$$ToggleButtonGroupProps._(); - factory _$$ToggleButtonGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonGroupProps$PlainMap(backingMap); - } else { - return new _$$ToggleButtonGroupProps$JsMap(backingMap); - } - } - /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -71,6 +62,16 @@ class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ToggleButtonGroupProps.'; + + _$$ToggleButtonGroupProps._(); + + factory _$$ToggleButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonGroupProps$JsMap(backingMap); + } else { + return new _$$ToggleButtonGroupProps$PlainMap(backingMap); + } + } } class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { @@ -128,14 +129,32 @@ class ToggleButtonGroupState extends _$ToggleButtonGroupState // Concrete state implementation. // -// Implements constructor and backing map. -class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState with _$ToggleButtonGroupStateAccessorsMixin implements ToggleButtonGroupState { + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + _$$ToggleButtonGroupState._(); + + factory _$$ToggleButtonGroupState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonGroupState$JsMap(backingMap); + } else { + return new _$$ToggleButtonGroupState$PlainMap(backingMap); + } + } +} + +class _$$ToggleButtonGroupState$PlainMap extends _$$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 an unknown ddc issue. // See for more details - _$$ToggleButtonGroupState(Map backingMap) : this._state = {} { + _$$ToggleButtonGroupState$PlainMap(Map backingMap) + : this._state = {}, + super._() { this._state = backingMap ?? {}; } @@ -143,10 +162,22 @@ class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState @override Map get state => _state; Map _state; +} - /// Let [UiState] internals know that this class has been generated. +class _$$ToggleButtonGroupState$JsMap extends _$$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 an unknown ddc issue. + // See for more details + _$$ToggleButtonGroupState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. @override - bool get $isClassGenerated => true; + JsBackedMap get state => _state; + JsBackedMap _state; } // Concrete component implementation mixin. @@ -157,13 +188,35 @@ class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { @override _$$ToggleButtonGroupProps typedPropsFactory(Map backingMap) => new _$$ToggleButtonGroupProps(backingMap); + _$$ToggleButtonGroupProps$JsMap _cachedTypedProps; + @override + _$$ToggleButtonGroupProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + @override _$$ToggleButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ToggleButtonGroupProps$JsMap(backingMap); - @override _$$ToggleButtonGroupState typedStateFactory(Map backingMap) => new _$$ToggleButtonGroupState(backingMap); + _$$ToggleButtonGroupState$JsMap _cachedTypedState; + @override + _$$ToggleButtonGroupState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ToggleButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonGroupState$JsMap(backingMap); /// Let [UiComponent] internals know that this class has been generated. @override @@ -175,12 +228,4 @@ class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { final List $defaultConsumedProps = const [ _$metaForToggleButtonGroupProps ]; - _$$ToggleButtonGroupProps$JsMap _cachedTypedProps; - @override - _$$ToggleButtonGroupProps$JsMap get props => _cachedTypedProps; - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } } From a67049c596f8da4a8a60615d3a42d831a535d04d Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 13 Mar 2019 14:43:39 -0700 Subject: [PATCH 14/39] Fix tests that use non-resolved AST --- lib/src/builder/generation/declaration_parsing.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/builder/generation/declaration_parsing.dart b/lib/src/builder/generation/declaration_parsing.dart index f71a17b54..dd6329cbe 100644 --- a/lib/src/builder/generation/declaration_parsing.dart +++ b/lib/src/builder/generation/declaration_parsing.dart @@ -491,7 +491,10 @@ class ComponentNode extends NodeWithMeta type.name == 'Component2'), + : this.isComponent2 = node.declaredElement == null + // This can be null when using non-resolved AST in tests; fixme do we need to update that setup? + ? false + : node.declaredElement.allSupertypes.any((type) => type.name == 'Component2'), super(node) { // Perform special handling for the `subtypeOf` parameter of this node's annotation. // From 4a1dc43b351ef5c08179e460625228577923a0a3 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 13 Mar 2019 14:54:04 -0700 Subject: [PATCH 15/39] Improve ordering of generated props impl members --- .../builder/generation/impl_generation.dart | 85 +++++++++++-------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index 4347043cb..1cf28c46b 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -155,18 +155,16 @@ class ImplGenerator { isComponent2: declarations.component.isComponent2, )); - typedPropsFactoryImpl - ..writeln(' @override') - ..writeln(' $propsImplName typedPropsFactory(Map backingMap) => new $propsImplName(backingMap);'); if (declarations.component.isComponent2) { final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(propsImplName); // fixme: is this implementation still needed here, or can we do it in the superclass? // This implementation here is necessary so that mixin accesses aren't compiled as index$ax typedPropsFactoryImpl ..writeln(' $jsMapImplName _cachedTypedProps;') + ..writeln() ..writeln(' @override') ..writeln(' $jsMapImplName get props => _cachedTypedProps;') - ..writeln(' ') + ..writeln() ..writeln(' @override') ..writeln(' set props(Map value) {') ..writeln(' super.props = value;') @@ -174,8 +172,12 @@ class ImplGenerator { ..writeln(' }') ..writeln() ..writeln(' @override ') - ..writeln(' $jsMapImplName typedPropsFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);'); + ..writeln(' $jsMapImplName typedPropsFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);') + ..writeln(); } + typedPropsFactoryImpl + ..writeln(' @override') + ..writeln(' $propsImplName typedPropsFactory(Map backingMap) => new $propsImplName(backingMap);'); // ---------------------------------------------------------------------- @@ -206,9 +208,6 @@ class ImplGenerator { isComponent2: declarations.component.isComponent2, )); - typedStateFactoryImpl - ..writeln(' @override') - ..writeln(' $stateImplName typedStateFactory(Map backingMap) => new $stateImplName(backingMap);'); if (declarations.component.isComponent2) { final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(stateImplName); // fixme: is this implementation still needed here, or can we do it in the superclass? @@ -217,7 +216,7 @@ class ImplGenerator { ..writeln(' $jsMapImplName _cachedTypedState;') ..writeln(' @override') ..writeln(' $jsMapImplName get state => _cachedTypedState;') - ..writeln(' ') + ..writeln() ..writeln(' @override') ..writeln(' set state(Map value) {') ..writeln(' super.state = value;') @@ -225,8 +224,12 @@ class ImplGenerator { ..writeln(' }') ..writeln() ..writeln(' @override ') - ..writeln(' $jsMapImplName typedStateFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);'); + ..writeln(' $jsMapImplName typedStateFactoryJs(JsBackedMap backingMap) => new $jsMapImplName(backingMap);') + ..writeln(); } + typedStateFactoryImpl + ..writeln(' @override') + ..writeln(' $stateImplName typedStateFactory(Map backingMap) => new $stateImplName(backingMap);'); } // ---------------------------------------------------------------------- @@ -753,37 +756,59 @@ class ImplGenerator { 'implements $consumableName$typeParamsOnSuper { '); final propsOrState = type.isProps ? 'props' : 'state'; - + + // Class declaration final buffer = new StringBuffer() ..writeln('// Concrete $propsOrState implementation.') ..writeln('//') ..writeln('// Implements constructor and backing map, and links up to generated component factory.') - ..writeln(classDeclaration) + ..writeln(classDeclaration); + + // Constructors + if (isComponent2) { + final plainMapImplName = _plainMapAccessorsImplClassNameFromImplClassName(implName); + final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(implName); + buffer + ..writeln(' $implName._();') + ..writeln() + ..writeln(' factory $implName(Map backingMap) {') + ..writeln(' if (backingMap is JsBackedMap) {') + ..writeln(' return new $jsMapImplName(backingMap);') + ..writeln(' } else {') + ..writeln(' return new $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 an unknown ddc issue.') + ..writeln(' // See for more details') + ..writeln(' $implName(Map backingMap) : this._$propsOrState = {} {') + ..writeln(' this._$propsOrState = backingMap ?? {};') + ..writeln(' }'); + } + + // Members + buffer + ..writeln() ..writeln(' /// Let [${type.isProps ? 'UiProps' : 'UiState'}] internals know that this class has been generated.') ..writeln(' @override') - ..writeln(' bool get \$isClassGenerated => true;') - ..writeln(); - + ..writeln(' bool get \$isClassGenerated => true;'); if (type.isProps) { buffer + ..writeln() ..writeln(' /// The [ReactComponentFactory] associated with the component built by this class.') ..writeln(' @override') ..writeln(' ReactComponentFactoryProxy get componentFactory => $componentFactoryName;') ..writeln() ..writeln(' /// The default namespace for the prop getters/setters generated for this class.') ..writeln(' @override') - ..writeln(' String get propKeyNamespace => ${stringLiteral(propKeyNamespace)};') - ..writeln(); + ..writeln(' String get propKeyNamespace => ${stringLiteral(propKeyNamespace)};'); } - + + // Other members/classes if (!isComponent2) { 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 an unknown ddc issue.') - ..writeln(' // See for more details') - ..writeln(' $implName(Map backingMap) : this._$propsOrState = {} {') - ..writeln(' this._$propsOrState = backingMap ?? {};') - ..writeln(' }') ..writeln() ..writeln(' /// The backing $propsOrState map proxied by this class.') ..writeln(' @override') @@ -794,15 +819,6 @@ class ImplGenerator { final plainMapImplName = _plainMapAccessorsImplClassNameFromImplClassName(implName); final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(implName); buffer - ..writeln(' $implName._();') - ..writeln() - ..writeln(' factory $implName(Map backingMap) {') - ..writeln(' if (backingMap is JsBackedMap) {') - ..writeln(' return new $jsMapImplName(backingMap);') - ..writeln(' } else {') - ..writeln(' return new $plainMapImplName(backingMap);') - ..writeln(' }') - ..writeln(' }') ..writeln('}') ..writeln() ..writeln('class $plainMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') @@ -818,6 +834,7 @@ class ImplGenerator { ..writeln(' Map get $propsOrState => _$propsOrState;') ..writeln(' Map _$propsOrState;') ..writeln('}') + ..writeln() ..writeln('class $jsMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..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 an unknown ddc issue.') @@ -831,7 +848,7 @@ class ImplGenerator { ..writeln(' JsBackedMap get $propsOrState => _$propsOrState;') ..writeln(' JsBackedMap _$propsOrState;') ..writeln('}'); - } + } return buffer.toString(); } From b1b62f5f5c12b2d939a869f6bb9f3d9a74fcd441 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 13 Mar 2019 16:02:55 -0700 Subject: [PATCH 16/39] Further updates to generated code to improve readability and restore previous member order --- .../builder/generation/impl_generation.dart | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index 1cf28c46b..364bc5253 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -177,7 +177,8 @@ class ImplGenerator { } typedPropsFactoryImpl ..writeln(' @override') - ..writeln(' $propsImplName typedPropsFactory(Map backingMap) => new $propsImplName(backingMap);'); + ..writeln(' $propsImplName typedPropsFactory(Map backingMap) => new $propsImplName(backingMap);') + ..writeln(); // ---------------------------------------------------------------------- @@ -229,7 +230,8 @@ class ImplGenerator { } typedStateFactoryImpl ..writeln(' @override') - ..writeln(' $stateImplName typedStateFactory(Map backingMap) => new $stateImplName(backingMap);'); + ..writeln(' $stateImplName typedStateFactory(Map backingMap) => new $stateImplName(backingMap);') + ..writeln(); } // ---------------------------------------------------------------------- @@ -761,7 +763,7 @@ class ImplGenerator { final buffer = new StringBuffer() ..writeln('// Concrete $propsOrState implementation.') ..writeln('//') - ..writeln('// Implements constructor and backing map, and links up to generated component factory.') + ..writeln('// Implements constructor and backing map${type.isProps ? ', and links up to generated component factory' : ''}.') ..writeln(classDeclaration); // Constructors @@ -789,6 +791,14 @@ class ImplGenerator { } // 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(' /// Let [${type.isProps ? 'UiProps' : 'UiState'}] internals know that this class has been generated.') @@ -806,20 +816,14 @@ class ImplGenerator { ..writeln(' String get propKeyNamespace => ${stringLiteral(propKeyNamespace)};'); } - // Other members/classes - if (!isComponent2) { - buffer - ..writeln() - ..writeln(' /// The backing $propsOrState map proxied by this class.') - ..writeln(' @override') - ..writeln(' Map get $propsOrState => _$propsOrState;') - ..writeln(' Map _$propsOrState;') - ..writeln('}'); - } else { + // End of class body + buffer.writeln('}'); + + // Component2-specific classes + if (isComponent2) { final plainMapImplName = _plainMapAccessorsImplClassNameFromImplClassName(implName); final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(implName); buffer - ..writeln('}') ..writeln() ..writeln('class $plainMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..writeln(' // This initializer of `_$propsOrState` to an empty map, as well as the reassignment') From 61cf306c15435e981a8aa6512699b7910e05f3b6 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 13 Mar 2019 16:03:11 -0700 Subject: [PATCH 17/39] Commit generated files --- .../abstract_inheritance.over_react.g.dart | 35 +- example/builder/basic.over_react.g.dart | 24 +- .../builder/basic_library.over_react.g.dart | 59 +-- .../basic_with_state.over_react.g.dart | 35 +- .../basic_with_type_params.over_react.g.dart | 24 +- .../generic_inheritance_sub.over_react.g.dart | 35 +- ...eneric_inheritance_super.over_react.g.dart | 35 +- .../private_component.over_react.g.dart | 35 +- ...factory_public_component.over_react.g.dart | 24 +- .../component/resize_sensor.over_react.g.dart | 24 +- ...abstract_transition_test.over_react.g.dart | 35 +- ...mponent_integration_test.over_react.g.dart | 24 +- ...ccessor_integration_test.over_react.g.dart | 24 +- ...ccessor_integration_test.over_react.g.dart | 35 +- ...ccessor_integration_test.over_react.g.dart | 35 +- .../private_props_ddc_bug.over_react.g.dart | 24 +- ...ccessor_integration_test.over_react.g.dart | 24 +- ...d_prop_integration_tests.over_react.g.dart | 24 +- ...mponent_integration_test.over_react.g.dart | 35 +- ...ed_prop_integration_test.over_react.g.dart | 24 +- ...mponent_integration_test.over_react.g.dart | 24 +- ...ccessor_integration_test.over_react.g.dart | 24 +- ...ccessor_integration_test.over_react.g.dart | 35 +- ...ccessor_integration_test.over_react.g.dart | 35 +- .../private_props_ddc_bug.over_react.g.dart | 24 +- ...ccessor_integration_test.over_react.g.dart | 24 +- ...d_prop_integration_tests.over_react.g.dart | 24 +- ...mponent_integration_test.over_react.g.dart | 35 +- ...ed_prop_integration_test.over_react.g.dart | 24 +- .../test_a.over_react.g.dart | 24 +- .../test_b.over_react.g.dart | 24 +- .../extendedtype.over_react.g.dart | 24 +- .../type_inheritance/parent.over_react.g.dart | 24 +- .../subsubtype.over_react.g.dart | 24 +- .../subtype.over_react.g.dart | 24 +- .../flux_component_test.over_react.g.dart | 354 +++++++++--------- .../redux_component_test.over_react.g.dart | 72 ++-- ...ummy_composite_component.over_react.g.dart | 24 +- .../util/dom_util_test.over_react.g.dart | 24 +- ...prop_key_util_test_dart2.over_react.g.dart | 24 +- .../one_level_wrapper.over_react.g.dart | 24 +- .../two_level_wrapper.over_react.g.dart | 24 +- .../demo_components/button.over_react.g.dart | 44 ++- .../button_group.over_react.g.dart | 44 ++- .../list_group.over_react.g.dart | 28 +- .../list_group_item.over_react.g.dart | 28 +- .../progress.over_react.g.dart | 44 ++- web/src/demo_components/tag.over_react.g.dart | 26 +- .../toggle_button.over_react.g.dart | 44 ++- .../toggle_button_group.over_react.g.dart | 44 ++- 50 files changed, 950 insertions(+), 905 deletions(-) diff --git a/example/builder/abstract_inheritance.over_react.g.dart b/example/builder/abstract_inheritance.over_react.g.dart index 1ea01aa92..5b7daf733 100644 --- a/example/builder/abstract_inheritance.over_react.g.dart +++ b/example/builder/abstract_inheritance.over_react.g.dart @@ -56,18 +56,6 @@ _$$SubProps _$Sub([Map backingProps]) => new _$$SubProps(backingProps); class _$$SubProps extends _$SubProps with _$SubPropsAccessorsMixin implements SubProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $SubComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => 'SubProps.'; - // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -79,6 +67,18 @@ class _$$SubProps extends _$SubProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $SubComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'SubProps.'; } abstract class _$SubStateAccessorsMixin implements _$SubState { @@ -115,14 +115,10 @@ class SubState extends _$SubState with _$SubStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$SubState extends _$SubState with _$SubStateAccessorsMixin implements SubState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -134,6 +130,10 @@ class _$$SubState extends _$SubState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -143,6 +143,7 @@ class _$$SubState extends _$SubState class _$SubComponent extends SubComponent { @override _$$SubProps typedPropsFactory(Map backingMap) => new _$$SubProps(backingMap); + @override _$$SubState typedStateFactory(Map backingMap) => new _$$SubState(backingMap); diff --git a/example/builder/basic.over_react.g.dart b/example/builder/basic.over_react.g.dart index cdf0ee98f..761a868d5 100644 --- a/example/builder/basic.over_react.g.dart +++ b/example/builder/basic.over_react.g.dart @@ -132,18 +132,6 @@ _$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $BasicComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -155,6 +143,18 @@ class _$$BasicProps extends _$BasicProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $BasicComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'BasicProps.'; } // Concrete component implementation mixin. diff --git a/example/builder/basic_library.over_react.g.dart b/example/builder/basic_library.over_react.g.dart index 95cfc2bf4..1978c2106 100644 --- a/example/builder/basic_library.over_react.g.dart +++ b/example/builder/basic_library.over_react.g.dart @@ -144,6 +144,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -156,18 +168,6 @@ class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$BasicPartOfLibStateAccessorsMixin @@ -210,14 +210,10 @@ class BasicPartOfLibState extends _$BasicPartOfLibState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$BasicPartOfLibState extends _$BasicPartOfLibState with _$BasicPartOfLibStateAccessorsMixin implements BasicPartOfLibState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -229,6 +225,10 @@ class _$$BasicPartOfLibState extends _$BasicPartOfLibState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -239,6 +239,7 @@ class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { @override _$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => new _$$BasicPartOfLibProps(backingMap); + @override _$$BasicPartOfLibState typedStateFactory(Map backingMap) => new _$$BasicPartOfLibState(backingMap); @@ -313,6 +314,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$SubPartOfLibProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -325,18 +338,6 @@ class _$$SubPartOfLibProps extends _$SubPartOfLibProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$SubPartOfLibProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/example/builder/basic_with_state.over_react.g.dart b/example/builder/basic_with_state.over_react.g.dart index e42248df4..11a5c8a08 100644 --- a/example/builder/basic_with_state.over_react.g.dart +++ b/example/builder/basic_with_state.over_react.g.dart @@ -128,18 +128,6 @@ _$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $BasicComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -151,6 +139,18 @@ class _$$BasicProps extends _$BasicProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $BasicComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'BasicProps.'; } abstract class _$BasicStateAccessorsMixin implements _$BasicState { @@ -190,14 +190,10 @@ class BasicState extends _$BasicState with _$BasicStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$BasicState extends _$BasicState with _$BasicStateAccessorsMixin implements BasicState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -209,6 +205,10 @@ class _$$BasicState extends _$BasicState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -219,6 +219,7 @@ class _$BasicComponent extends BasicComponent { @override _$$BasicProps typedPropsFactory(Map backingMap) => new _$$BasicProps(backingMap); + @override _$$BasicState typedStateFactory(Map backingMap) => new _$$BasicState(backingMap); diff --git a/example/builder/basic_with_type_params.over_react.g.dart b/example/builder/basic_with_type_params.over_react.g.dart index 544b9c958..9c10dc22f 100644 --- a/example/builder/basic_with_type_params.over_react.g.dart +++ b/example/builder/basic_with_type_params.over_react.g.dart @@ -78,18 +78,6 @@ _$$BasicProps _$Basic([Map backingProps]) => new _$$BasicProps(backingProps); class _$$BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin implements BasicProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $BasicComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -101,6 +89,18 @@ class _$$BasicProps extends _$BasicProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $BasicComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'BasicProps.'; } // Concrete component implementation mixin. diff --git a/example/builder/generic_inheritance_sub.over_react.g.dart b/example/builder/generic_inheritance_sub.over_react.g.dart index d6f4f9734..40686e60c 100644 --- a/example/builder/generic_inheritance_sub.over_react.g.dart +++ b/example/builder/generic_inheritance_sub.over_react.g.dart @@ -62,6 +62,18 @@ _$$GenericSubProps _$GenericSub([Map backingProps]) => class _$$GenericSubProps extends _$GenericSubProps with _$GenericSubPropsAccessorsMixin implements GenericSubProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$GenericSubProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -74,18 +86,6 @@ class _$$GenericSubProps extends _$GenericSubProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'GenericSubProps.'; - - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$GenericSubProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$GenericSubStateAccessorsMixin implements _$GenericSubState { @@ -127,14 +127,10 @@ class GenericSubState extends _$GenericSubState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$GenericSubState extends _$GenericSubState with _$GenericSubStateAccessorsMixin implements GenericSubState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -146,6 +142,10 @@ class _$$GenericSubState extends _$GenericSubState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -156,6 +156,7 @@ class _$GenericSubComponent extends GenericSubComponent { @override _$$GenericSubProps typedPropsFactory(Map backingMap) => new _$$GenericSubProps(backingMap); + @override _$$GenericSubState typedStateFactory(Map backingMap) => new _$$GenericSubState(backingMap); diff --git a/example/builder/generic_inheritance_super.over_react.g.dart b/example/builder/generic_inheritance_super.over_react.g.dart index 6e3d24c2d..0957136f5 100644 --- a/example/builder/generic_inheritance_super.over_react.g.dart +++ b/example/builder/generic_inheritance_super.over_react.g.dart @@ -96,6 +96,18 @@ _$$GenericSuperProps _$GenericSuper([Map backingProps]) => class _$$GenericSuperProps extends _$GenericSuperProps with _$GenericSuperPropsAccessorsMixin implements GenericSuperProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$GenericSuperProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -108,18 +120,6 @@ class _$$GenericSuperProps extends _$GenericSuperProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'GenericSuperProps.'; - - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$GenericSuperProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$GenericSuperStateAccessorsMixin @@ -162,14 +162,10 @@ class GenericSuperState extends _$GenericSuperState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$GenericSuperState extends _$GenericSuperState with _$GenericSuperStateAccessorsMixin implements GenericSuperState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -181,6 +177,10 @@ class _$$GenericSuperState extends _$GenericSuperState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -191,6 +191,7 @@ class _$GenericSuperComponent extends GenericSuperComponent { @override _$$GenericSuperProps typedPropsFactory(Map backingMap) => new _$$GenericSuperProps(backingMap); + @override _$$GenericSuperState typedStateFactory(Map backingMap) => new _$$GenericSuperState(backingMap); diff --git a/example/builder/private_component.over_react.g.dart b/example/builder/private_component.over_react.g.dart index 79f1ae0ae..d5488e320 100644 --- a/example/builder/private_component.over_react.g.dart +++ b/example/builder/private_component.over_react.g.dart @@ -58,18 +58,6 @@ _$$_PrivateProps _$_Private([Map backingProps]) => class _$$_PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin implements _PrivateProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $PrivateComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '_PrivateProps.'; - // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -81,6 +69,18 @@ class _$$_PrivateProps extends _$_PrivateProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $PrivateComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => '_PrivateProps.'; } abstract class _$_PrivateStateAccessorsMixin implements _$_PrivateState { @@ -117,14 +117,10 @@ class _PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$_PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin implements _PrivateState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -136,6 +132,10 @@ class _$$_PrivateState extends _$_PrivateState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -146,6 +146,7 @@ class _$PrivateComponent extends PrivateComponent { @override _$$_PrivateProps typedPropsFactory(Map backingMap) => new _$$_PrivateProps(backingMap); + @override _$$_PrivateState typedStateFactory(Map backingMap) => new _$$_PrivateState(backingMap); diff --git a/example/builder/private_factory_public_component.over_react.g.dart b/example/builder/private_factory_public_component.over_react.g.dart index 8822123e2..4a19d5d49 100644 --- a/example/builder/private_factory_public_component.over_react.g.dart +++ b/example/builder/private_factory_public_component.over_react.g.dart @@ -64,6 +64,18 @@ _$$FormActionInputProps _$_FormActionInput([Map backingProps]) => class _$$FormActionInputProps extends _$FormActionInputProps with _$FormActionInputPropsAccessorsMixin implements FormActionInputProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$FormActionInputProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -76,18 +88,6 @@ class _$$FormActionInputProps extends _$FormActionInputProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'FormActionInputProps.'; - - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$FormActionInputProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/lib/src/component/resize_sensor.over_react.g.dart b/lib/src/component/resize_sensor.over_react.g.dart index e3bf0b495..56ccc4d1b 100644 --- a/lib/src/component/resize_sensor.over_react.g.dart +++ b/lib/src/component/resize_sensor.over_react.g.dart @@ -47,6 +47,18 @@ _$$ResizeSensorProps _$ResizeSensor([Map backingProps]) => class _$$ResizeSensorProps extends _$ResizeSensorProps with _$ResizeSensorPropsAccessorsMixin implements 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 an unknown ddc issue. + // See for more details + _$$ResizeSensorProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -59,18 +71,6 @@ class _$$ResizeSensorProps extends _$ResizeSensorProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ResizeSensorProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 5d450fabe..51e79baac 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 @@ -208,6 +208,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TransitionerProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -220,18 +232,6 @@ class _$$TransitionerProps extends _$TransitionerProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TransitionerProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TransitionerStateAccessorsMixin @@ -257,14 +257,10 @@ class TransitionerState extends _$TransitionerState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TransitionerState extends _$TransitionerState with _$TransitionerStateAccessorsMixin implements TransitionerState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -276,6 +272,10 @@ class _$$TransitionerState extends _$TransitionerState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -286,6 +286,7 @@ class _$TransitionerComponent extends TransitionerComponent { @override _$$TransitionerProps typedPropsFactory(Map backingMap) => new _$$TransitionerProps(backingMap); + @override _$$TransitionerState typedStateFactory(Map backingMap) => new _$$TransitionerState(backingMap); diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart index bfed4ccaa..68e3fc712 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart @@ -148,6 +148,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -160,18 +172,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart index 826a8bb36..e637e48ef 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart @@ -79,6 +79,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -91,18 +103,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart index 21a2ed630..3a1dce89b 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart @@ -102,6 +102,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -114,18 +126,6 @@ class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin @@ -206,14 +206,10 @@ const StateMeta _$metaForDoNotGenerateAccessorTestState = const StateMeta( // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -225,6 +221,10 @@ class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -236,6 +236,7 @@ class _$DoNotGenerateAccessorTestComponent @override _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestProps(backingMap); + @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestState(backingMap); diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart index 12074d1ec..9c8df8b07 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart @@ -156,6 +156,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -168,18 +180,6 @@ class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'custom props class namespace**'; - - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$NamespacedAccessorTestStateAccessorsMixin @@ -315,14 +315,10 @@ const StateMeta _$metaForNamespacedAccessorTestState = const StateMeta( // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -334,6 +330,10 @@ class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -345,6 +345,7 @@ class _$NamespacedAccessorTestComponent @override _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => new _$$NamespacedAccessorTestProps(backingMap); + @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => new _$$NamespacedAccessorTestState(backingMap); diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart index 84f650f37..71f057645 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart @@ -53,18 +53,6 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -76,6 +64,18 @@ class _$$FooProps extends _$FooProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'FooProps.'; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart index d5addef55..f435d424d 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart @@ -92,6 +92,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -104,18 +116,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart index 6de66da2c..194b933dd 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart @@ -82,6 +82,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -94,18 +106,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart index bc0a4ef79..c80e97e41 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart @@ -42,6 +42,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -54,18 +66,6 @@ class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$StatefulComponentTestStateAccessorsMixin @@ -201,14 +201,10 @@ const StateMeta _$metaForStatefulComponentTestState = const StateMeta( // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -220,6 +216,10 @@ class _$$StatefulComponentTestState extends _$StatefulComponentTestState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -230,6 +230,7 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { @override _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => new _$$StatefulComponentTestProps(backingMap); + @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => new _$$StatefulComponentTestState(backingMap); diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart index 76c842905..24ac6b851 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart @@ -70,18 +70,6 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -93,6 +81,18 @@ class _$$FooProps extends _$FooProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'FooProps.'; } // Concrete component implementation mixin. 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 7e84f3ea9..b4e7f305f 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,6 +153,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -165,18 +177,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 a595d2529..fa63fc01d 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 @@ -84,6 +84,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -96,18 +108,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 1183b470b..f69e4161f 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 @@ -107,6 +107,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -119,18 +131,6 @@ class _$$DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin @@ -216,14 +216,10 @@ class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState with _$DoNotGenerateAccessorTestStateAccessorsMixin implements DoNotGenerateAccessorTestState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -235,6 +231,10 @@ class _$$DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -246,6 +246,7 @@ class _$DoNotGenerateAccessorTestComponent @override _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestProps(backingMap); + @override _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => new _$$DoNotGenerateAccessorTestState(backingMap); 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 5a8a88109..67ffff4e1 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 @@ -161,6 +161,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -173,18 +185,6 @@ class _$$NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'custom props class namespace**'; - - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$NamespacedAccessorTestStateAccessorsMixin @@ -325,14 +325,10 @@ class NamespacedAccessorTestState extends _$NamespacedAccessorTestState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState with _$NamespacedAccessorTestStateAccessorsMixin implements NamespacedAccessorTestState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -344,6 +340,10 @@ class _$$NamespacedAccessorTestState extends _$NamespacedAccessorTestState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -355,6 +355,7 @@ class _$NamespacedAccessorTestComponent @override _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => new _$$NamespacedAccessorTestProps(backingMap); + @override _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => new _$$NamespacedAccessorTestState(backingMap); 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 995b2c45c..f0b1c48fa 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,18 +57,6 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -80,6 +68,18 @@ class _$$FooProps extends _$FooProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'FooProps.'; } // Concrete component implementation mixin. 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 8a95565e2..04abc2bbb 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 @@ -97,6 +97,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -109,18 +121,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart index d2e5d03bb..24ce7a040 100644 --- a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart @@ -87,6 +87,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$ComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -99,18 +111,6 @@ class _$$ComponentTestProps extends _$ComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$ComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 10242cdbd..eb464e940 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 @@ -47,6 +47,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -59,18 +71,6 @@ class _$$StatefulComponentTestProps extends _$StatefulComponentTestProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$StatefulComponentTestStateAccessorsMixin @@ -211,14 +211,10 @@ class StatefulComponentTestState extends _$StatefulComponentTestState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$StatefulComponentTestState extends _$StatefulComponentTestState with _$StatefulComponentTestStateAccessorsMixin implements StatefulComponentTestState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -230,6 +226,10 @@ class _$$StatefulComponentTestState extends _$StatefulComponentTestState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -240,6 +240,7 @@ class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { @override _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => new _$$StatefulComponentTestProps(backingMap); + @override _$$StatefulComponentTestState typedStateFactory(Map backingMap) => new _$$StatefulComponentTestState(backingMap); 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 b0ce17cb9..13831b895 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 @@ -74,18 +74,6 @@ _$$FooProps _$Foo([Map backingProps]) => new _$$FooProps(backingProps); class _$$FooProps extends _$FooProps with _$FooPropsAccessorsMixin implements FooProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -97,6 +85,18 @@ class _$$FooProps extends _$FooProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'FooProps.'; } // Concrete component implementation mixin. 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 00d5ed922..dc65b6122 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 @@ -43,18 +43,6 @@ _$$TestAProps _$TestA([Map backingProps]) => new _$$TestAProps(backingProps); class _$$TestAProps extends _$TestAProps with _$TestAPropsAccessorsMixin implements TestAProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $TestAComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -66,6 +54,18 @@ class _$$TestAProps extends _$TestAProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $TestAComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'TestAProps.'; } // Concrete component implementation mixin. 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 4ab879d79..a3eb3a0e1 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 @@ -43,18 +43,6 @@ _$$TestBProps _$TestB([Map backingProps]) => new _$$TestBProps(backingProps); class _$$TestBProps extends _$TestBProps with _$TestBPropsAccessorsMixin implements TestBProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $TestBComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -66,6 +54,18 @@ class _$$TestBProps extends _$TestBProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $TestBComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'TestBProps.'; } // Concrete component implementation mixin. 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 f254ccbf3..12d545663 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,6 +48,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestExtendtypeProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -60,18 +72,6 @@ class _$$TestExtendtypeProps extends _$TestExtendtypeProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestExtendtypeProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 f97bf96e7..3e5e6f40a 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 @@ -46,6 +46,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestParentProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -58,18 +70,6 @@ class _$$TestParentProps extends _$TestParentProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestParentProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 0fd5fad25..fc7b69f4d 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,6 +48,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestSubsubtypeProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -60,18 +72,6 @@ class _$$TestSubsubtypeProps extends _$TestSubsubtypeProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestSubsubtypeProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 f0d1fa3d6..e16ca29b5 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 @@ -47,6 +47,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestSubtypeProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -59,18 +71,6 @@ class _$$TestSubtypeProps extends _$TestSubtypeProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestSubtypeProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/test/over_react/component_declaration/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test.over_react.g.dart index e5b2a18ef..a9574437a 100644 --- a/test/over_react/component_declaration/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test.over_react.g.dart @@ -46,18 +46,6 @@ _$$TestBasicProps _$TestBasic([Map backingProps]) => class _$$TestBasicProps extends _$TestBasicProps with _$TestBasicPropsAccessorsMixin implements TestBasicProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $TestBasicComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -69,6 +57,18 @@ class _$$TestBasicProps extends _$TestBasicProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $TestBasicComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'TestBasicProps.'; } // Concrete component implementation mixin. @@ -133,6 +133,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestHandlerLifecycleProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -145,18 +157,6 @@ class _$$TestHandlerLifecycleProps extends _$TestHandlerLifecycleProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestHandlerLifecycleProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -221,6 +221,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestHandlerPrecedenceProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -233,18 +245,6 @@ class _$$TestHandlerPrecedenceProps extends _$TestHandlerPrecedenceProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestHandlerPrecedenceProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -329,6 +329,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestPropValidationProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -341,18 +353,6 @@ class _$$TestPropValidationProps extends _$TestPropValidationProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestPropValidationProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -417,6 +417,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestRedrawOnProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -429,18 +441,6 @@ class _$$TestRedrawOnProps extends _$TestRedrawOnProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestRedrawOnProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -505,6 +505,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestStoreHandlersProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -517,18 +529,6 @@ class _$$TestStoreHandlersProps extends _$TestStoreHandlersProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStoreHandlersProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -593,6 +593,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestStatefulBasicProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -605,18 +617,6 @@ class _$$TestStatefulBasicProps extends _$TestStatefulBasicProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStatefulBasicProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TestStatefulBasicStateAccessorsMixin @@ -642,14 +642,10 @@ class TestStatefulBasicState extends _$TestStatefulBasicState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TestStatefulBasicState extends _$TestStatefulBasicState with _$TestStatefulBasicStateAccessorsMixin implements TestStatefulBasicState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -661,6 +657,10 @@ class _$$TestStatefulBasicState extends _$TestStatefulBasicState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -671,6 +671,7 @@ class _$TestStatefulBasicComponent extends TestStatefulBasicComponent { @override _$$TestStatefulBasicProps typedPropsFactory(Map backingMap) => new _$$TestStatefulBasicProps(backingMap); + @override _$$TestStatefulBasicState typedStateFactory(Map backingMap) => new _$$TestStatefulBasicState(backingMap); @@ -731,6 +732,18 @@ 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 an unknown ddc issue. + // See for more details + _$$TestStatefulHandlerLifecycleProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -743,18 +756,6 @@ class _$$TestStatefulHandlerLifecycleProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStatefulHandlerLifecycleProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TestStatefulHandlerLifecycleStateAccessorsMixin @@ -781,15 +782,11 @@ class TestStatefulHandlerLifecycleState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TestStatefulHandlerLifecycleState extends _$TestStatefulHandlerLifecycleState with _$TestStatefulHandlerLifecycleStateAccessorsMixin implements TestStatefulHandlerLifecycleState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -801,6 +798,10 @@ class _$$TestStatefulHandlerLifecycleState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -812,6 +813,7 @@ class _$TestStatefulHandlerLifecycleComponent @override _$$TestStatefulHandlerLifecycleProps typedPropsFactory(Map backingMap) => new _$$TestStatefulHandlerLifecycleProps(backingMap); + @override _$$TestStatefulHandlerLifecycleState typedStateFactory(Map backingMap) => new _$$TestStatefulHandlerLifecycleState(backingMap); @@ -872,6 +874,18 @@ 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 an unknown ddc issue. + // See for more details + _$$TestStatefulHandlerPrecedenceProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -884,18 +898,6 @@ class _$$TestStatefulHandlerPrecedenceProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStatefulHandlerPrecedenceProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TestStatefulHandlerPrecedenceStateAccessorsMixin @@ -922,15 +924,11 @@ class TestStatefulHandlerPrecedenceState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TestStatefulHandlerPrecedenceState extends _$TestStatefulHandlerPrecedenceState with _$TestStatefulHandlerPrecedenceStateAccessorsMixin implements TestStatefulHandlerPrecedenceState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -942,6 +940,10 @@ class _$$TestStatefulHandlerPrecedenceState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -953,6 +955,7 @@ class _$TestStatefulHandlerPrecedenceComponent @override _$$TestStatefulHandlerPrecedenceProps typedPropsFactory(Map backingMap) => new _$$TestStatefulHandlerPrecedenceProps(backingMap); + @override _$$TestStatefulHandlerPrecedenceState typedStateFactory(Map backingMap) => new _$$TestStatefulHandlerPrecedenceState(backingMap); @@ -1035,6 +1038,18 @@ 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 an unknown ddc issue. + // See for more details + _$$TestStatefulPropValidationProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1047,18 +1062,6 @@ class _$$TestStatefulPropValidationProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStatefulPropValidationProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TestStatefulPropValidationStateAccessorsMixin @@ -1084,15 +1087,11 @@ class TestStatefulPropValidationState extends _$TestStatefulPropValidationState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TestStatefulPropValidationState extends _$TestStatefulPropValidationState with _$TestStatefulPropValidationStateAccessorsMixin implements TestStatefulPropValidationState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1104,6 +1103,10 @@ class _$$TestStatefulPropValidationState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1115,6 +1118,7 @@ class _$TestStatefulPropValidationComponent @override _$$TestStatefulPropValidationProps typedPropsFactory(Map backingMap) => new _$$TestStatefulPropValidationProps(backingMap); + @override _$$TestStatefulPropValidationState typedStateFactory(Map backingMap) => new _$$TestStatefulPropValidationState(backingMap); @@ -1172,6 +1176,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestStatefulRedrawOnProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1184,18 +1200,6 @@ class _$$TestStatefulRedrawOnProps extends _$TestStatefulRedrawOnProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStatefulRedrawOnProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TestStatefulRedrawOnStateAccessorsMixin @@ -1221,14 +1225,10 @@ class TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState with _$TestStatefulRedrawOnStateAccessorsMixin implements TestStatefulRedrawOnState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1240,6 +1240,10 @@ class _$$TestStatefulRedrawOnState extends _$TestStatefulRedrawOnState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1250,6 +1254,7 @@ class _$TestStatefulRedrawOnComponent extends TestStatefulRedrawOnComponent { @override _$$TestStatefulRedrawOnProps typedPropsFactory(Map backingMap) => new _$$TestStatefulRedrawOnProps(backingMap); + @override _$$TestStatefulRedrawOnState typedStateFactory(Map backingMap) => new _$$TestStatefulRedrawOnState(backingMap); @@ -1308,6 +1313,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestStatefulStoreHandlersProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -1320,18 +1337,6 @@ class _$$TestStatefulStoreHandlersProps extends _$TestStatefulStoreHandlersProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestStatefulStoreHandlersProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } abstract class _$TestStatefulStoreHandlersStateAccessorsMixin @@ -1357,14 +1362,10 @@ class TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. class _$$TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState with _$TestStatefulStoreHandlersStateAccessorsMixin implements TestStatefulStoreHandlersState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -1376,6 +1377,10 @@ class _$$TestStatefulStoreHandlersState extends _$TestStatefulStoreHandlersState @override Map get state => _state; Map _state; + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } // Concrete component implementation mixin. @@ -1387,6 +1392,7 @@ class _$TestStatefulStoreHandlersComponent @override _$$TestStatefulStoreHandlersProps typedPropsFactory(Map backingMap) => new _$$TestStatefulStoreHandlersProps(backingMap); + @override _$$TestStatefulStoreHandlersState typedStateFactory(Map backingMap) => new _$$TestStatefulStoreHandlersState(backingMap); diff --git a/test/over_react/component_declaration/redux_component_test.over_react.g.dart b/test/over_react/component_declaration/redux_component_test.over_react.g.dart index 275373650..4d12a3192 100644 --- a/test/over_react/component_declaration/redux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/redux_component_test.over_react.g.dart @@ -46,6 +46,18 @@ _$$TestDefaultProps _$TestDefault([Map backingProps]) => class _$$TestDefaultProps extends _$TestDefaultProps with _$TestDefaultPropsAccessorsMixin implements TestDefaultProps { + // This initializer of `_props` to an empty map, as well as the reassignment + // of `_props` in the constructor body is necessary to work around an unknown ddc issue. + // See for more details + _$$TestDefaultProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -58,18 +70,6 @@ class _$$TestDefaultProps extends _$TestDefaultProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TestDefaultProps.'; - - // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details - _$$TestDefaultProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -133,6 +133,18 @@ _$$TestConnectProps _$TestConnect([Map backingProps]) => class _$$TestConnectProps extends _$TestConnectProps with _$TestConnectPropsAccessorsMixin implements 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 an unknown ddc issue. + // See for more details + _$$TestConnectProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -145,18 +157,6 @@ class _$$TestConnectProps extends _$TestConnectProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestConnectProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. @@ -219,18 +219,6 @@ _$$TestPureProps _$TestPure([Map backingProps]) => class _$$TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin implements TestPureProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $TestPureComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => 'TestPureProps.'; - // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary to work around an unknown ddc issue. // See for more details @@ -242,6 +230,18 @@ class _$$TestPureProps extends _$TestPureProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $TestPureComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'TestPureProps.'; } // Concrete component implementation mixin. 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 40baab94b..3071599aa 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 @@ -106,6 +106,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TestCompositeComponentProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -118,18 +130,6 @@ class _$$TestCompositeComponentProps extends _$TestCompositeComponentProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TestCompositeComponentProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 ca0ac6cf6..cede73bab 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 @@ -45,18 +45,6 @@ _$$DomTestProps _$DomTest([Map backingProps]) => class _$$DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin implements DomTestProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $DomTestComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -68,6 +56,18 @@ class _$$DomTestProps extends _$DomTestProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $DomTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'DomTestProps.'; } // Concrete component implementation mixin. 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 4ed62dc4f..7ad0ffa12 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 @@ -72,18 +72,6 @@ _$$TestProps _$Test([Map backingProps]) => new _$$TestProps(backingProps); class _$$TestProps extends _$TestProps with _$TestPropsAccessorsMixin implements TestProps { - /// Let [UiProps] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - - /// The [ReactComponentFactory] associated with the component built by this class. - @override - ReactComponentFactoryProxy get componentFactory => $TestComponentFactory; - - /// The default namespace for the prop getters/setters generated for this class. - @override - String get propKeyNamespace => '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 an unknown ddc issue. // See for more details @@ -95,6 +83,18 @@ class _$$TestProps extends _$TestProps @override Map get props => _props; Map _props; + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $TestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'TestProps.'; } // Concrete component implementation mixin. 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 131a33f09..96385c530 100644 --- a/test/test_util/one_level_wrapper.over_react.g.dart +++ b/test/test_util/one_level_wrapper.over_react.g.dart @@ -47,6 +47,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$OneLevelWrapperProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -59,18 +71,6 @@ class _$$OneLevelWrapperProps extends _$OneLevelWrapperProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$OneLevelWrapperProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. 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 6bdf0984a..5bc510795 100644 --- a/test/test_util/two_level_wrapper.over_react.g.dart +++ b/test/test_util/two_level_wrapper.over_react.g.dart @@ -47,6 +47,18 @@ _$$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 an unknown ddc issue. + // See for more details + _$$TwoLevelWrapperProps(Map backingMap) : this._props = {} { + this._props = backingMap ?? {}; + } + + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -59,18 +71,6 @@ class _$$TwoLevelWrapperProps extends _$TwoLevelWrapperProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => '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 an unknown ddc issue. - // See for more details - _$$TwoLevelWrapperProps(Map backingMap) : this._props = {} { - this._props = backingMap ?? {}; - } - - /// The backing props map proxied by this class. - @override - Map get props => _props; - Map _props; } // Concrete component implementation mixin. diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 2a831e128..41dbe35f4 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -164,6 +164,16 @@ _$$ButtonProps _$Button([Map backingProps]) => backingProps == null abstract class _$$ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin implements ButtonProps { + _$$ButtonProps._(); + + factory _$$ButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonProps$JsMap(backingMap); + } else { + return new _$$ButtonProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -175,16 +185,6 @@ abstract class _$$ButtonProps extends _$ButtonProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ButtonProps.'; - - _$$ButtonProps._(); - - factory _$$ButtonProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonProps$JsMap(backingMap); - } else { - return new _$$ButtonProps$PlainMap(backingMap); - } - } } class _$$ButtonProps$PlainMap extends _$$ButtonProps { @@ -240,14 +240,10 @@ class ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. abstract class _$$ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin implements ButtonState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - _$$ButtonState._(); factory _$$ButtonState(Map backingMap) { @@ -257,6 +253,10 @@ abstract class _$$ButtonState extends _$ButtonState return new _$$ButtonState$PlainMap(backingMap); } } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } class _$$ButtonState$PlainMap extends _$$ButtonState { @@ -296,10 +296,8 @@ class _$$ButtonState$JsMap extends _$$ButtonState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ButtonComponent extends ButtonComponent { - @override - _$$ButtonProps typedPropsFactory(Map backingMap) => - new _$$ButtonProps(backingMap); _$$ButtonProps$JsMap _cachedTypedProps; + @override _$$ButtonProps$JsMap get props => _cachedTypedProps; @@ -312,9 +310,11 @@ class _$ButtonComponent extends ButtonComponent { @override _$$ButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ButtonProps$JsMap(backingMap); + @override - _$$ButtonState typedStateFactory(Map backingMap) => - new _$$ButtonState(backingMap); + _$$ButtonProps typedPropsFactory(Map backingMap) => + new _$$ButtonProps(backingMap); + _$$ButtonState$JsMap _cachedTypedState; @override _$$ButtonState$JsMap get state => _cachedTypedState; @@ -329,6 +329,10 @@ class _$ButtonComponent extends ButtonComponent { _$$ButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => new _$$ButtonState$JsMap(backingMap); + @override + _$$ButtonState typedStateFactory(Map backingMap) => + new _$$ButtonState(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index dbc915919..739d9b8c5 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -93,6 +93,16 @@ _$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => backingProps == null abstract class _$$ButtonGroupProps extends _$ButtonGroupProps with _$ButtonGroupPropsAccessorsMixin implements ButtonGroupProps { + _$$ButtonGroupProps._(); + + factory _$$ButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonGroupProps$JsMap(backingMap); + } else { + return new _$$ButtonGroupProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -105,16 +115,6 @@ abstract class _$$ButtonGroupProps extends _$ButtonGroupProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ButtonGroupProps.'; - - _$$ButtonGroupProps._(); - - factory _$$ButtonGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonGroupProps$JsMap(backingMap); - } else { - return new _$$ButtonGroupProps$PlainMap(backingMap); - } - } } class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { @@ -171,14 +171,10 @@ class ButtonGroupState extends _$ButtonGroupState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. abstract class _$$ButtonGroupState extends _$ButtonGroupState with _$ButtonGroupStateAccessorsMixin implements ButtonGroupState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - _$$ButtonGroupState._(); factory _$$ButtonGroupState(Map backingMap) { @@ -188,6 +184,10 @@ abstract class _$$ButtonGroupState extends _$ButtonGroupState return new _$$ButtonGroupState$PlainMap(backingMap); } } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { @@ -227,10 +227,8 @@ class _$$ButtonGroupState$JsMap extends _$$ButtonGroupState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ButtonGroupComponent extends ButtonGroupComponent { - @override - _$$ButtonGroupProps typedPropsFactory(Map backingMap) => - new _$$ButtonGroupProps(backingMap); _$$ButtonGroupProps$JsMap _cachedTypedProps; + @override _$$ButtonGroupProps$JsMap get props => _cachedTypedProps; @@ -243,9 +241,11 @@ class _$ButtonGroupComponent extends ButtonGroupComponent { @override _$$ButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ButtonGroupProps$JsMap(backingMap); + @override - _$$ButtonGroupState typedStateFactory(Map backingMap) => - new _$$ButtonGroupState(backingMap); + _$$ButtonGroupProps typedPropsFactory(Map backingMap) => + new _$$ButtonGroupProps(backingMap); + _$$ButtonGroupState$JsMap _cachedTypedState; @override _$$ButtonGroupState$JsMap get state => _cachedTypedState; @@ -260,6 +260,10 @@ class _$ButtonGroupComponent extends ButtonGroupComponent { _$$ButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => new _$$ButtonGroupState$JsMap(backingMap); + @override + _$$ButtonGroupState typedStateFactory(Map backingMap) => + new _$$ButtonGroupState(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index 7b0878ec2..95373d5ad 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -64,6 +64,16 @@ _$$ListGroupProps _$ListGroup([Map backingProps]) => backingProps == null abstract class _$$ListGroupProps extends _$ListGroupProps with _$ListGroupPropsAccessorsMixin implements ListGroupProps { + _$$ListGroupProps._(); + + factory _$$ListGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupProps$JsMap(backingMap); + } else { + return new _$$ListGroupProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -75,16 +85,6 @@ abstract class _$$ListGroupProps extends _$ListGroupProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ListGroupProps.'; - - _$$ListGroupProps._(); - - factory _$$ListGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ListGroupProps$JsMap(backingMap); - } else { - return new _$$ListGroupProps$PlainMap(backingMap); - } - } } class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { @@ -124,10 +124,8 @@ class _$$ListGroupProps$JsMap extends _$$ListGroupProps { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ListGroupComponent extends ListGroupComponent { - @override - _$$ListGroupProps typedPropsFactory(Map backingMap) => - new _$$ListGroupProps(backingMap); _$$ListGroupProps$JsMap _cachedTypedProps; + @override _$$ListGroupProps$JsMap get props => _cachedTypedProps; @@ -141,6 +139,10 @@ class _$ListGroupComponent extends ListGroupComponent { _$$ListGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ListGroupProps$JsMap(backingMap); + @override + _$$ListGroupProps typedPropsFactory(Map backingMap) => + new _$$ListGroupProps(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index 7b1c93125..6f4f47628 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -212,6 +212,16 @@ _$$ListGroupItemProps _$ListGroupItem([Map backingProps]) => abstract class _$$ListGroupItemProps extends _$ListGroupItemProps with _$ListGroupItemPropsAccessorsMixin implements ListGroupItemProps { + _$$ListGroupItemProps._(); + + factory _$$ListGroupItemProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupItemProps$JsMap(backingMap); + } else { + return new _$$ListGroupItemProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -224,16 +234,6 @@ abstract class _$$ListGroupItemProps extends _$ListGroupItemProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ListGroupItemProps.'; - - _$$ListGroupItemProps._(); - - factory _$$ListGroupItemProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ListGroupItemProps$JsMap(backingMap); - } else { - return new _$$ListGroupItemProps$PlainMap(backingMap); - } - } } class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { @@ -273,10 +273,8 @@ class _$$ListGroupItemProps$JsMap extends _$$ListGroupItemProps { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ListGroupItemComponent extends ListGroupItemComponent { - @override - _$$ListGroupItemProps typedPropsFactory(Map backingMap) => - new _$$ListGroupItemProps(backingMap); _$$ListGroupItemProps$JsMap _cachedTypedProps; + @override _$$ListGroupItemProps$JsMap get props => _cachedTypedProps; @@ -290,6 +288,10 @@ class _$ListGroupItemComponent extends ListGroupItemComponent { _$$ListGroupItemProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ListGroupItemProps$JsMap(backingMap); + @override + _$$ListGroupItemProps typedPropsFactory(Map backingMap) => + new _$$ListGroupItemProps(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index 0775baf20..52a9e6fca 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -212,6 +212,16 @@ _$$ProgressProps _$Progress([Map backingProps]) => backingProps == null abstract class _$$ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin implements ProgressProps { + _$$ProgressProps._(); + + factory _$$ProgressProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ProgressProps$JsMap(backingMap); + } else { + return new _$$ProgressProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -223,16 +233,6 @@ abstract class _$$ProgressProps extends _$ProgressProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ProgressProps.'; - - _$$ProgressProps._(); - - factory _$$ProgressProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ProgressProps$JsMap(backingMap); - } else { - return new _$$ProgressProps$PlainMap(backingMap); - } - } } class _$$ProgressProps$PlainMap extends _$$ProgressProps { @@ -301,14 +301,10 @@ class ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin { // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. abstract class _$$ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin implements ProgressState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - _$$ProgressState._(); factory _$$ProgressState(Map backingMap) { @@ -318,6 +314,10 @@ abstract class _$$ProgressState extends _$ProgressState return new _$$ProgressState$PlainMap(backingMap); } } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } class _$$ProgressState$PlainMap extends _$$ProgressState { @@ -357,10 +357,8 @@ class _$$ProgressState$JsMap extends _$$ProgressState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ProgressComponent extends ProgressComponent { - @override - _$$ProgressProps typedPropsFactory(Map backingMap) => - new _$$ProgressProps(backingMap); _$$ProgressProps$JsMap _cachedTypedProps; + @override _$$ProgressProps$JsMap get props => _cachedTypedProps; @@ -373,9 +371,11 @@ class _$ProgressComponent extends ProgressComponent { @override _$$ProgressProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ProgressProps$JsMap(backingMap); + @override - _$$ProgressState typedStateFactory(Map backingMap) => - new _$$ProgressState(backingMap); + _$$ProgressProps typedPropsFactory(Map backingMap) => + new _$$ProgressProps(backingMap); + _$$ProgressState$JsMap _cachedTypedState; @override _$$ProgressState$JsMap get state => _cachedTypedState; @@ -390,6 +390,10 @@ class _$ProgressComponent extends ProgressComponent { _$$ProgressState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => new _$$ProgressState$JsMap(backingMap); + @override + _$$ProgressState typedStateFactory(Map backingMap) => + new _$$ProgressState(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index 1f9e16ae2..118e07cfe 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -74,6 +74,16 @@ _$$TagProps _$Tag([Map backingProps]) => backingProps == null abstract class _$$TagProps extends _$TagProps with _$TagPropsAccessorsMixin implements TagProps { + _$$TagProps._(); + + factory _$$TagProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TagProps$JsMap(backingMap); + } else { + return new _$$TagProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -85,16 +95,6 @@ abstract class _$$TagProps extends _$TagProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'TagProps.'; - - _$$TagProps._(); - - factory _$$TagProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TagProps$JsMap(backingMap); - } else { - return new _$$TagProps$PlainMap(backingMap); - } - } } class _$$TagProps$PlainMap extends _$$TagProps { @@ -134,9 +134,8 @@ class _$$TagProps$JsMap extends _$$TagProps { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$TagComponent extends TagComponent { - @override - _$$TagProps typedPropsFactory(Map backingMap) => new _$$TagProps(backingMap); _$$TagProps$JsMap _cachedTypedProps; + @override _$$TagProps$JsMap get props => _cachedTypedProps; @@ -150,6 +149,9 @@ class _$TagComponent extends TagComponent { _$$TagProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$TagProps$JsMap(backingMap); + @override + _$$TagProps typedPropsFactory(Map backingMap) => new _$$TagProps(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index cd6c61aa5..8ef187711 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -101,6 +101,16 @@ _$$ToggleButtonProps _$ToggleButton([Map backingProps]) => backingProps == null abstract class _$$ToggleButtonProps extends _$ToggleButtonProps with _$ToggleButtonPropsAccessorsMixin implements ToggleButtonProps { + _$$ToggleButtonProps._(); + + factory _$$ToggleButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonProps$JsMap(backingMap); + } else { + return new _$$ToggleButtonProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -113,16 +123,6 @@ abstract class _$$ToggleButtonProps extends _$ToggleButtonProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ToggleButtonProps.'; - - _$$ToggleButtonProps._(); - - factory _$$ToggleButtonProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonProps$JsMap(backingMap); - } else { - return new _$$ToggleButtonProps$PlainMap(backingMap); - } - } } class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { @@ -213,14 +213,10 @@ class ToggleButtonState extends _$ToggleButtonState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. abstract class _$$ToggleButtonState extends _$ToggleButtonState with _$ToggleButtonStateAccessorsMixin implements ToggleButtonState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - _$$ToggleButtonState._(); factory _$$ToggleButtonState(Map backingMap) { @@ -230,6 +226,10 @@ abstract class _$$ToggleButtonState extends _$ToggleButtonState return new _$$ToggleButtonState$PlainMap(backingMap); } } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { @@ -269,10 +269,8 @@ class _$$ToggleButtonState$JsMap extends _$$ToggleButtonState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ToggleButtonComponent extends ToggleButtonComponent { - @override - _$$ToggleButtonProps typedPropsFactory(Map backingMap) => - new _$$ToggleButtonProps(backingMap); _$$ToggleButtonProps$JsMap _cachedTypedProps; + @override _$$ToggleButtonProps$JsMap get props => _cachedTypedProps; @@ -285,9 +283,11 @@ class _$ToggleButtonComponent extends ToggleButtonComponent { @override _$$ToggleButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ToggleButtonProps$JsMap(backingMap); + @override - _$$ToggleButtonState typedStateFactory(Map backingMap) => - new _$$ToggleButtonState(backingMap); + _$$ToggleButtonProps typedPropsFactory(Map backingMap) => + new _$$ToggleButtonProps(backingMap); + _$$ToggleButtonState$JsMap _cachedTypedState; @override _$$ToggleButtonState$JsMap get state => _cachedTypedState; @@ -302,6 +302,10 @@ class _$ToggleButtonComponent extends ToggleButtonComponent { _$$ToggleButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => new _$$ToggleButtonState$JsMap(backingMap); + @override + _$$ToggleButtonState typedStateFactory(Map backingMap) => + new _$$ToggleButtonState(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index ff3d37073..c172b2b00 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -50,6 +50,16 @@ _$$ToggleButtonGroupProps _$ToggleButtonGroup([Map backingProps]) => abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps with _$ToggleButtonGroupPropsAccessorsMixin implements ToggleButtonGroupProps { + _$$ToggleButtonGroupProps._(); + + factory _$$ToggleButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonGroupProps$JsMap(backingMap); + } else { + return new _$$ToggleButtonGroupProps$PlainMap(backingMap); + } + } + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -62,16 +72,6 @@ abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps /// The default namespace for the prop getters/setters generated for this class. @override String get propKeyNamespace => 'ToggleButtonGroupProps.'; - - _$$ToggleButtonGroupProps._(); - - factory _$$ToggleButtonGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonGroupProps$JsMap(backingMap); - } else { - return new _$$ToggleButtonGroupProps$PlainMap(backingMap); - } - } } class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { @@ -129,14 +129,10 @@ class ToggleButtonGroupState extends _$ToggleButtonGroupState // Concrete state implementation. // -// Implements constructor and backing map, and links up to generated component factory. +// Implements constructor and backing map. abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState with _$ToggleButtonGroupStateAccessorsMixin implements ToggleButtonGroupState { - /// Let [UiState] internals know that this class has been generated. - @override - bool get $isClassGenerated => true; - _$$ToggleButtonGroupState._(); factory _$$ToggleButtonGroupState(Map backingMap) { @@ -146,6 +142,10 @@ abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState return new _$$ToggleButtonGroupState$PlainMap(backingMap); } } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; } class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { @@ -185,10 +185,8 @@ class _$$ToggleButtonGroupState$JsMap extends _$$ToggleButtonGroupState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { - @override - _$$ToggleButtonGroupProps typedPropsFactory(Map backingMap) => - new _$$ToggleButtonGroupProps(backingMap); _$$ToggleButtonGroupProps$JsMap _cachedTypedProps; + @override _$$ToggleButtonGroupProps$JsMap get props => _cachedTypedProps; @@ -201,9 +199,11 @@ class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { @override _$$ToggleButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => new _$$ToggleButtonGroupProps$JsMap(backingMap); + @override - _$$ToggleButtonGroupState typedStateFactory(Map backingMap) => - new _$$ToggleButtonGroupState(backingMap); + _$$ToggleButtonGroupProps typedPropsFactory(Map backingMap) => + new _$$ToggleButtonGroupProps(backingMap); + _$$ToggleButtonGroupState$JsMap _cachedTypedState; @override _$$ToggleButtonGroupState$JsMap get state => _cachedTypedState; @@ -218,6 +218,10 @@ class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { _$$ToggleButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => new _$$ToggleButtonGroupState$JsMap(backingMap); + @override + _$$ToggleButtonGroupState typedStateFactory(Map backingMap) => + new _$$ToggleButtonGroupState(backingMap); + /// Let [UiComponent] internals know that this class has been generated. @override bool get $isClassGenerated => true; From fc210c48fda3fc3987ff3ff6c3b577fd16d4b88a Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Wed, 13 Mar 2019 16:03:27 -0700 Subject: [PATCH 18/39] Remove leftover file --- tool/reduced_test_case.dart | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tool/reduced_test_case.dart b/tool/reduced_test_case.dart index 398effcc6..e69de29bb 100644 --- a/tool/reduced_test_case.dart +++ b/tool/reduced_test_case.dart @@ -1,8 +0,0 @@ -//class Component { -// Map get props {} -//} -// -//class UiComponent extends Component { -// @override -// TProps get props; // only happens when abstract -//} From 29d194fbe5af7c90ccde0eefeda4988f46ee0286 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 14 Mar 2019 12:58:05 -0700 Subject: [PATCH 19/39] Add notes about inlining and updated constructor bug --- lib/src/builder/generation/impl_generation.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index 364bc5253..cb5e000aa 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -460,10 +460,14 @@ class ImplGenerator { String generatedAccessor = ' /// Go to [$consumerClassName.$accessorName] to see the source code for this prop\n' + // TODO reinstate inlining once https://github.com/dart-lang/sdk/issues/36217 is fixed and all workarounds are removed + // inlining is necessary to get mixins to use $index/$indexSet instead of $index$asx + // ' @tryInline\n' ' @override\n' '${metadataSrc.toString()}' ' ${typeString}get $accessorName => $proxiedMapName[$keyConstantName] ?? null; // Add ` ?? null` to workaround DDC bug: ;\n' ' /// Go to [$consumerClassName.$accessorName] to see the source code for this prop\n' + // ' @tryInline\n' ' @override\n' '${metadataSrc.toString()}' ' set $accessorName(${setterTypeString}value) => $proxiedMapName[$keyConstantName] = value;\n'; @@ -783,8 +787,8 @@ class ImplGenerator { } 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 an unknown ddc issue.') - ..writeln(' // See for more details') + ..writeln(' // of `_$propsOrState` in the constructor body is necessary 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(' $implName(Map backingMap) : this._$propsOrState = {} {') ..writeln(' this._$propsOrState = backingMap ?? {};') ..writeln(' }'); @@ -827,8 +831,8 @@ class ImplGenerator { ..writeln() ..writeln('class $plainMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..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 an unknown ddc issue.') - ..writeln(' // See for more details') + ..writeln(' // of `_$propsOrState` in the constructor body is necessary 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(' $plainMapImplName(Map backingMap) : this._$propsOrState = {}, super._() {') ..writeln(' this._$propsOrState = backingMap ?? {};') ..writeln(' }') @@ -841,8 +845,8 @@ class ImplGenerator { ..writeln() ..writeln('class $jsMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..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 an unknown ddc issue.') - ..writeln(' // See for more details') + ..writeln(' // of `_$propsOrState` in the constructor body is necessary 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(' $jsMapImplName(JsBackedMap backingMap) : this._$propsOrState = new JsBackedMap(), super._() {') ..writeln(' this._$propsOrState = backingMap ?? new JsBackedMap();') ..writeln(' }') From a7fb937edbe62788f3461b7cffb732ce324c1494 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 14 Mar 2019 13:03:59 -0700 Subject: [PATCH 20/39] Recommit generated files --- .../abstract_inheritance.over_react.g.dart | 6 +-- example/builder/basic.over_react.g.dart | 3 +- .../builder/basic_library.over_react.g.dart | 9 ++-- .../basic_with_state.over_react.g.dart | 6 +-- .../basic_with_type_params.over_react.g.dart | 3 +- .../generic_inheritance_sub.over_react.g.dart | 6 +-- ...eneric_inheritance_super.over_react.g.dart | 6 +-- .../private_component.over_react.g.dart | 6 +-- ...factory_public_component.over_react.g.dart | 3 +- .../component/resize_sensor.over_react.g.dart | 3 +- ...abstract_transition_test.over_react.g.dart | 6 +-- ...mponent_integration_test.over_react.g.dart | 3 +- ...ccessor_integration_test.over_react.g.dart | 3 +- ...ccessor_integration_test.over_react.g.dart | 6 +-- ...ccessor_integration_test.over_react.g.dart | 6 +-- .../private_props_ddc_bug.over_react.g.dart | 3 +- ...ccessor_integration_test.over_react.g.dart | 3 +- ...d_prop_integration_tests.over_react.g.dart | 3 +- ...mponent_integration_test.over_react.g.dart | 6 +-- ...ed_prop_integration_test.over_react.g.dart | 3 +- ...mponent_integration_test.over_react.g.dart | 3 +- ...ccessor_integration_test.over_react.g.dart | 3 +- ...ccessor_integration_test.over_react.g.dart | 6 +-- ...ccessor_integration_test.over_react.g.dart | 6 +-- .../private_props_ddc_bug.over_react.g.dart | 3 +- ...ccessor_integration_test.over_react.g.dart | 3 +- ...d_prop_integration_tests.over_react.g.dart | 3 +- ...mponent_integration_test.over_react.g.dart | 6 +-- ...ed_prop_integration_test.over_react.g.dart | 3 +- .../test_a.over_react.g.dart | 3 +- .../test_b.over_react.g.dart | 3 +- .../extendedtype.over_react.g.dart | 3 +- .../type_inheritance/parent.over_react.g.dart | 3 +- .../subsubtype.over_react.g.dart | 3 +- .../subtype.over_react.g.dart | 3 +- .../flux_component_test.over_react.g.dart | 54 +++++++------------ .../redux_component_test.over_react.g.dart | 9 ++-- ...ummy_composite_component.over_react.g.dart | 3 +- .../util/dom_util_test.over_react.g.dart | 3 +- ...prop_key_util_test_dart2.over_react.g.dart | 3 +- .../one_level_wrapper.over_react.g.dart | 3 +- .../two_level_wrapper.over_react.g.dart | 3 +- .../demo_components/button.over_react.g.dart | 12 ++--- .../button_group.over_react.g.dart | 12 ++--- .../list_group.over_react.g.dart | 6 +-- .../list_group_item.over_react.g.dart | 6 +-- .../progress.over_react.g.dart | 12 ++--- web/src/demo_components/tag.over_react.g.dart | 6 +-- .../toggle_button.over_react.g.dart | 12 ++--- .../toggle_button_group.over_react.g.dart | 12 ++--- 50 files changed, 101 insertions(+), 202 deletions(-) diff --git a/example/builder/abstract_inheritance.over_react.g.dart b/example/builder/abstract_inheritance.over_react.g.dart index 5b7daf733..f2f8d999c 100644 --- a/example/builder/abstract_inheritance.over_react.g.dart +++ b/example/builder/abstract_inheritance.over_react.g.dart @@ -57,8 +57,7 @@ class _$$SubProps extends _$SubProps with _$SubPropsAccessorsMixin implements SubProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$SubProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -120,8 +119,7 @@ class _$$SubState extends _$SubState with _$SubStateAccessorsMixin implements SubState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$SubState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/basic.over_react.g.dart b/example/builder/basic.over_react.g.dart index 761a868d5..9b79de6d3 100644 --- a/example/builder/basic.over_react.g.dart +++ b/example/builder/basic.over_react.g.dart @@ -133,8 +133,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/example/builder/basic_library.over_react.g.dart b/example/builder/basic_library.over_react.g.dart index 1978c2106..9fa777cdd 100644 --- a/example/builder/basic_library.over_react.g.dart +++ b/example/builder/basic_library.over_react.g.dart @@ -145,8 +145,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicPartOfLibProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -215,8 +214,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicPartOfLibState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -315,8 +313,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$SubPartOfLibProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/example/builder/basic_with_state.over_react.g.dart b/example/builder/basic_with_state.over_react.g.dart index 11a5c8a08..bbc0ed258 100644 --- a/example/builder/basic_with_state.over_react.g.dart +++ b/example/builder/basic_with_state.over_react.g.dart @@ -129,8 +129,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -195,8 +194,7 @@ class _$$BasicState extends _$BasicState with _$BasicStateAccessorsMixin implements BasicState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/basic_with_type_params.over_react.g.dart b/example/builder/basic_with_type_params.over_react.g.dart index 9c10dc22f..e52074e1a 100644 --- a/example/builder/basic_with_type_params.over_react.g.dart +++ b/example/builder/basic_with_type_params.over_react.g.dart @@ -79,8 +79,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/example/builder/generic_inheritance_sub.over_react.g.dart b/example/builder/generic_inheritance_sub.over_react.g.dart index 40686e60c..3055648b3 100644 --- a/example/builder/generic_inheritance_sub.over_react.g.dart +++ b/example/builder/generic_inheritance_sub.over_react.g.dart @@ -63,8 +63,7 @@ class _$$GenericSubProps extends _$GenericSubProps with _$GenericSubPropsAccessorsMixin implements GenericSubProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSubProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -132,8 +131,7 @@ class _$$GenericSubState extends _$GenericSubState with _$GenericSubStateAccessorsMixin implements GenericSubState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSubState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/generic_inheritance_super.over_react.g.dart b/example/builder/generic_inheritance_super.over_react.g.dart index 0957136f5..e256012d2 100644 --- a/example/builder/generic_inheritance_super.over_react.g.dart +++ b/example/builder/generic_inheritance_super.over_react.g.dart @@ -97,8 +97,7 @@ class _$$GenericSuperProps extends _$GenericSuperProps with _$GenericSuperPropsAccessorsMixin implements GenericSuperProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSuperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -167,8 +166,7 @@ class _$$GenericSuperState extends _$GenericSuperState with _$GenericSuperStateAccessorsMixin implements GenericSuperState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSuperState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/private_component.over_react.g.dart b/example/builder/private_component.over_react.g.dart index d5488e320..6e734995e 100644 --- a/example/builder/private_component.over_react.g.dart +++ b/example/builder/private_component.over_react.g.dart @@ -59,8 +59,7 @@ class _$$_PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin implements _PrivateProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$_PrivateProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -122,8 +121,7 @@ class _$$_PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin implements _PrivateState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$_PrivateState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/private_factory_public_component.over_react.g.dart b/example/builder/private_factory_public_component.over_react.g.dart index 4a19d5d49..31e0e7725 100644 --- a/example/builder/private_factory_public_component.over_react.g.dart +++ b/example/builder/private_factory_public_component.over_react.g.dart @@ -65,8 +65,7 @@ class _$$FormActionInputProps extends _$FormActionInputProps with _$FormActionInputPropsAccessorsMixin implements FormActionInputProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$FormActionInputProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/lib/src/component/resize_sensor.over_react.g.dart b/lib/src/component/resize_sensor.over_react.g.dart index 56ccc4d1b..07831ee9c 100644 --- a/lib/src/component/resize_sensor.over_react.g.dart +++ b/lib/src/component/resize_sensor.over_react.g.dart @@ -48,8 +48,7 @@ class _$$ResizeSensorProps extends _$ResizeSensorProps with _$ResizeSensorPropsAccessorsMixin implements 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ResizeSensorProps(Map backingMap) : this._props = {} { this._props = 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 51e79baac..0ec496aac 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 @@ -209,8 +209,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TransitionerProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -262,8 +261,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TransitionerState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart index 68e3fc712..fa8bf5dfa 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart @@ -149,8 +149,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart index e637e48ef..3d1c90bbd 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart @@ -80,8 +80,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart index 3a1dce89b..53af450ae 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart @@ -103,8 +103,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -211,8 +210,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$DoNotGenerateAccessorTestState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart index 9c8df8b07..ff7c64954 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart @@ -157,8 +157,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -320,8 +319,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$NamespacedAccessorTestState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart index 71f057645..ee7483c73 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart @@ -54,8 +54,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$FooProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart index f435d424d..032adbc8f 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart @@ -93,8 +93,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart index 194b933dd..0d0b3d809 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart @@ -83,8 +83,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart index c80e97e41..d8a9eda9a 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart @@ -43,8 +43,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -206,8 +205,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$StatefulComponentTestState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart index 24ac6b851..ef603740e 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart @@ -71,8 +71,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$FooProps(Map backingMap) : this._props = {} { this._props = 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 b4e7f305f..a3e685d91 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 @@ -154,8 +154,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 fa63fc01d..1294d2453 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,8 +85,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 f69e4161f..5a9b71b5c 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 @@ -108,8 +108,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$DoNotGenerateAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -221,8 +220,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$DoNotGenerateAccessorTestState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } 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 67ffff4e1..f465dbda6 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 @@ -162,8 +162,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$NamespacedAccessorTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -330,8 +329,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$NamespacedAccessorTestState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } 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 f0b1c48fa..58b95d1ae 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 @@ -58,8 +58,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$FooProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 04abc2bbb..32a950d28 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 @@ -98,8 +98,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart index 24ce7a040..518b42b41 100644 --- a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart @@ -88,8 +88,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 eb464e940..63b3add97 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,8 +48,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$StatefulComponentTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -216,8 +215,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$StatefulComponentTestState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } 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 13831b895..a71d83c91 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 @@ -75,8 +75,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$FooProps(Map backingMap) : this._props = {} { this._props = 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 dc65b6122..353558f37 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 @@ -44,8 +44,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestAProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 a3eb3a0e1..56c39e9f3 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 @@ -44,8 +44,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestBProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 12d545663..e781c3596 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 @@ -49,8 +49,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestExtendtypeProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 3e5e6f40a..2c65b7a59 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,8 +47,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestParentProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 fc7b69f4d..33da10f09 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 @@ -49,8 +49,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestSubsubtypeProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 e16ca29b5..f5ba8afdc 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,8 +48,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestSubtypeProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test.over_react.g.dart index a9574437a..5a0e31d3f 100644 --- a/test/over_react/component_declaration/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test.over_react.g.dart @@ -47,8 +47,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestBasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -134,8 +133,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestHandlerLifecycleProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -222,8 +220,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestHandlerPrecedenceProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -330,8 +327,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestPropValidationProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -418,8 +414,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestRedrawOnProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -506,8 +501,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStoreHandlersProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -594,8 +588,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulBasicProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -647,8 +640,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulBasicState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -733,8 +725,7 @@ class _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulHandlerLifecycleProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -788,8 +779,7 @@ class _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulHandlerLifecycleState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -875,8 +865,7 @@ class _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulHandlerPrecedenceProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -930,8 +919,7 @@ class _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulHandlerPrecedenceState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -1039,8 +1027,7 @@ class _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulPropValidationProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1093,8 +1080,7 @@ class _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulPropValidationState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -1177,8 +1163,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulRedrawOnProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1230,8 +1215,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulRedrawOnState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -1314,8 +1298,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulStoreHandlersProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -1367,8 +1350,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestStatefulStoreHandlersState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/test/over_react/component_declaration/redux_component_test.over_react.g.dart b/test/over_react/component_declaration/redux_component_test.over_react.g.dart index 4d12a3192..325941663 100644 --- a/test/over_react/component_declaration/redux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/redux_component_test.over_react.g.dart @@ -47,8 +47,7 @@ class _$$TestDefaultProps extends _$TestDefaultProps with _$TestDefaultPropsAccessorsMixin implements TestDefaultProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestDefaultProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -134,8 +133,7 @@ class _$$TestConnectProps extends _$TestConnectProps with _$TestConnectPropsAccessorsMixin implements 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestConnectProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -220,8 +218,7 @@ class _$$TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin implements TestPureProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary to work around an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestPureProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 3071599aa..f8974c36d 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 @@ -107,8 +107,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestCompositeComponentProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 cede73bab..865443934 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 @@ -46,8 +46,7 @@ class _$$DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin implements 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$DomTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 7ad0ffa12..eb76cce40 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 @@ -73,8 +73,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestProps(Map backingMap) : this._props = {} { this._props = 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 96385c530..4ceaaa248 100644 --- a/test/test_util/one_level_wrapper.over_react.g.dart +++ b/test/test_util/one_level_wrapper.over_react.g.dart @@ -48,8 +48,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$OneLevelWrapperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 5bc510795..150c4f824 100644 --- a/test/test_util/two_level_wrapper.over_react.g.dart +++ b/test/test_util/two_level_wrapper.over_react.g.dart @@ -48,8 +48,7 @@ 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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TwoLevelWrapperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 41dbe35f4..4d7905c23 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -189,8 +189,7 @@ abstract class _$$ButtonProps extends _$ButtonProps class _$$ButtonProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -205,8 +204,7 @@ class _$$ButtonProps$PlainMap extends _$$ButtonProps { class _$$ButtonProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -261,8 +259,7 @@ abstract class _$$ButtonState extends _$ButtonState class _$$ButtonState$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -277,8 +274,7 @@ class _$$ButtonState$PlainMap extends _$$ButtonState { class _$$ButtonState$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index 739d9b8c5..faafe0786 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -119,8 +119,7 @@ abstract class _$$ButtonGroupProps extends _$ButtonGroupProps class _$$ButtonGroupProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -135,8 +134,7 @@ class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { class _$$ButtonGroupProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -192,8 +190,7 @@ abstract class _$$ButtonGroupState extends _$ButtonGroupState class _$$ButtonGroupState$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -208,8 +205,7 @@ class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { class _$$ButtonGroupState$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index 95373d5ad..19752ef00 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -89,8 +89,7 @@ abstract class _$$ListGroupProps extends _$ListGroupProps class _$$ListGroupProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -105,8 +104,7 @@ class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { class _$$ListGroupProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index 6f4f47628..f6307f89a 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -238,8 +238,7 @@ abstract class _$$ListGroupItemProps extends _$ListGroupItemProps class _$$ListGroupItemProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupItemProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -254,8 +253,7 @@ class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { class _$$ListGroupItemProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupItemProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index 52a9e6fca..55d15cf00 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -237,8 +237,7 @@ abstract class _$$ProgressProps extends _$ProgressProps class _$$ProgressProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -253,8 +252,7 @@ class _$$ProgressProps$PlainMap extends _$$ProgressProps { class _$$ProgressProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -322,8 +320,7 @@ abstract class _$$ProgressState extends _$ProgressState class _$$ProgressState$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -338,8 +335,7 @@ class _$$ProgressState$PlainMap extends _$$ProgressState { class _$$ProgressState$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index 118e07cfe..08f466d66 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -99,8 +99,7 @@ abstract class _$$TagProps extends _$TagProps class _$$TagProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TagProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -115,8 +114,7 @@ class _$$TagProps$PlainMap extends _$$TagProps { class _$$TagProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TagProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index 8ef187711..8b08db78e 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -127,8 +127,7 @@ abstract class _$$ToggleButtonProps extends _$ToggleButtonProps class _$$ToggleButtonProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -143,8 +142,7 @@ class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { class _$$ToggleButtonProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -234,8 +232,7 @@ abstract class _$$ToggleButtonState extends _$ToggleButtonState class _$$ToggleButtonState$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -250,8 +247,7 @@ class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { class _$$ToggleButtonState$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index c172b2b00..acb926bc4 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -76,8 +76,7 @@ abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps class _$$ToggleButtonGroupProps$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -92,8 +91,7 @@ class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { class _$$ToggleButtonGroupProps$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -150,8 +148,7 @@ abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState class _$$ToggleButtonGroupState$PlainMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -166,8 +163,7 @@ class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { class _$$ToggleButtonGroupState$JsMap extends _$$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 an unknown ddc issue. - // See for more details + // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { From 9f5c0639aa9ec514b74b9b12c4b0eb77fc1ac998 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 14 Mar 2019 13:27:51 -0700 Subject: [PATCH 21/39] Add integration tests for Component2 --- .../abstract_accessor_integration_test.dart | 240 ++++++++ ...ccessor_integration_test.over_react.g.dart | 545 ++++++++++++++++++ .../accessor_mixin_integration_test.dart | 241 ++++++++ ...r_mixin_integration_test.over_react.g.dart | 522 +++++++++++++++++ .../component_integration_test.dart | 161 ++++++ ...mponent_integration_test.over_react.g.dart | 246 ++++++++ ...nt_required_accessor_integration_test.dart | 153 +++++ ...ccessor_integration_test.over_react.g.dart | 177 ++++++ ...ot_generate_accessor_integration_test.dart | 121 ++++ ...ccessor_integration_test.over_react.g.dart | 359 ++++++++++++ .../namespaced_accessor_integration_test.dart | 147 +++++ ...ccessor_integration_test.over_react.g.dart | 468 +++++++++++++++ .../component2/private_props_ddc_bug.dart | 36 ++ .../private_props_ddc_bug.over_react.g.dart | 146 +++++ .../required_accessor_integration_test.dart | 153 +++++ ...ccessor_integration_test.over_react.g.dart | 190 ++++++ .../required_prop_integration_tests.dart | 155 +++++ ...d_prop_integration_tests.over_react.g.dart | 180 ++++++ .../stateful_component_integration_test.dart | 127 ++++ ...mponent_integration_test.over_react.g.dart | 353 ++++++++++++ .../unassigned_prop_integration_test.dart | 42 ++ ...ed_prop_integration_test.over_react.g.dart | 163 ++++++ ...over_react_component_declaration_test.dart | 21 + 23 files changed, 4946 insertions(+) create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.dart create mode 100644 test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.dart new file mode 100644 index 000000000..61bfe7614 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.dart @@ -0,0 +1,240 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +// ignore: uri_has_not_been_generated +part 'abstract_accessor_integration_test.over_react.g.dart'; + +main() { + group('abstract accessor integration:', () { + group('@AbstractProps()', () { + group('generates prop getters/setters with', () { + test('the props class name as a namespace and the prop name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestAbstractPropsSubclass()..stringProp = 'test'; + expect(mixinsTest.props, containsPair('TestAbstractProps.stringProp', 'test')); + + mixinsTest = new TestAbstractPropsSubclass()..dynamicProp = 2; + expect(mixinsTest.props, containsPair('TestAbstractProps.dynamicProp', 2)); + + mixinsTest = new TestAbstractPropsSubclass()..untypedProp = false; + expect(mixinsTest.props, containsPair('TestAbstractProps.untypedProp', false)); + }); + + test('custom prop keys', () { + var mixinsTest = new TestAbstractPropsSubclass()..customKeyProp = 'test'; + expect(mixinsTest.props, containsPair('TestAbstractProps.custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + var mixinsTest = new TestAbstractPropsSubclass()..customNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~customNamespaceProp', 'test')); + }); + + test('custom prop keys and namespaces', () { + var mixinsTest = new TestAbstractPropsSubclass()..customKeyAndNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + + group('generates prop getters/setters, when there is a custom key namespace, with', () { + test('the custom namespace and the prop name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestCustomNamespaceAbstractPropsSubclass()..stringProp = 'test'; + expect(mixinsTest.props, containsPair('custom mixin namespace**stringProp', 'test')); + + mixinsTest = new TestCustomNamespaceAbstractPropsSubclass()..dynamicProp = 2; + expect(mixinsTest.props, containsPair('custom mixin namespace**dynamicProp', 2)); + + mixinsTest = new TestCustomNamespaceAbstractPropsSubclass()..untypedProp = false; + expect(mixinsTest.props, containsPair('custom mixin namespace**untypedProp', false)); + }); + + test('custom prop keys', () { + var mixinsTest = new TestCustomNamespaceAbstractPropsSubclass()..customKeyProp = 'test'; + expect(mixinsTest.props, containsPair('custom mixin namespace**custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + var mixinsTest = new TestCustomNamespaceAbstractPropsSubclass()..customNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~customNamespaceProp', 'test')); + }); + + test('custom prop keys and namespaces', () { + var mixinsTest = new TestCustomNamespaceAbstractPropsSubclass()..customKeyAndNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + }); + + group('@AbstractState()', () { + group('generates state getters/setters with', () { + test('the state class name as a namespace and the state name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestAbstractStateSubclass()..stringState = 'test'; + expect(mixinsTest.state, containsPair('TestAbstractState.stringState', 'test')); + + mixinsTest = new TestAbstractStateSubclass()..dynamicState = 2; + expect(mixinsTest.state, containsPair('TestAbstractState.dynamicState', 2)); + + mixinsTest = new TestAbstractStateSubclass()..untypedState = false; + expect(mixinsTest.state, containsPair('TestAbstractState.untypedState', false)); + }); + + test('custom state keys', () { + var mixinsTest = new TestAbstractStateSubclass()..customKeyState = 'test'; + expect(mixinsTest.state, containsPair('TestAbstractState.custom key!', 'test')); + }); + + test('custom state key namespaces', () { + var mixinsTest = new TestAbstractStateSubclass()..customNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~customNamespaceState', 'test')); + }); + + test('custom state keys and namespaces', () { + var mixinsTest = new TestAbstractStateSubclass()..customKeyAndNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + + group('generates state getters/setters, when there is a custom key namespace, with', () { + test('the custom namespace and the state name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestCustomNamespaceAbstractStateSubclass()..stringState = 'test'; + expect(mixinsTest.state, containsPair('custom mixin namespace**stringState', 'test')); + + mixinsTest = new TestCustomNamespaceAbstractStateSubclass()..dynamicState = 2; + expect(mixinsTest.state, containsPair('custom mixin namespace**dynamicState', 2)); + + mixinsTest = new TestCustomNamespaceAbstractStateSubclass()..untypedState = false; + expect(mixinsTest.state, containsPair('custom mixin namespace**untypedState', false)); + }); + + test('custom state keys', () { + var mixinsTest = new TestCustomNamespaceAbstractStateSubclass()..customKeyState = 'test'; + expect(mixinsTest.state, containsPair('custom mixin namespace**custom key!', 'test')); + }); + + test('custom state key namespaces', () { + var mixinsTest = new TestCustomNamespaceAbstractStateSubclass()..customNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~customNamespaceState', 'test')); + }); + + test('custom state keys and namespaces', () { + var mixinsTest = new TestCustomNamespaceAbstractStateSubclass()..customKeyAndNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + }); + }); +} + + +@AbstractProps() +abstract class _$TestAbstractProps extends UiProps { + String stringProp; + dynamic dynamicProp; + var untypedProp; + + @Accessor(key: 'custom key!') + var customKeyProp; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceProp; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceProp; +} + +class TestAbstractPropsSubclass extends TestAbstractProps { + @override final Map props = {}; + @override bool get $isClassGenerated => true; + + @override String get propKeyNamespace => null; + @override ReactComponentFactoryProxy get componentFactory => null; +} + + +@AbstractProps(keyNamespace: 'custom mixin namespace**') +abstract class _$TestCustomNamespaceAbstractProps extends UiProps { + String stringProp; + dynamic dynamicProp; + var untypedProp; + + @Accessor(key: 'custom key!') + var customKeyProp; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceProp; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceProp; +} + +class TestCustomNamespaceAbstractPropsSubclass extends TestCustomNamespaceAbstractProps { + @override final Map props = {}; + @override bool get $isClassGenerated => true; + + @override String get propKeyNamespace => null; + @override ReactComponentFactoryProxy get componentFactory => null; +} + + +@AbstractState() +abstract class _$TestAbstractState extends UiState { + String stringState; + dynamic dynamicState; + var untypedState; + + @Accessor(key: 'custom key!') + var customKeyState; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceState; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceState; +} + +class TestAbstractStateSubclass extends TestAbstractState { + @override final Map state = {}; + @override bool get $isClassGenerated => true; +} + + +@AbstractState(keyNamespace: 'custom mixin namespace**') +abstract class _$TestCustomNamespaceAbstractState extends UiState { + String stringState; + dynamic dynamicState; + var untypedState; + + @Accessor(key: 'custom key!') + var customKeyState; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceState; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceState; +} + +class TestCustomNamespaceAbstractStateSubclass extends TestCustomNamespaceAbstractState { + @override final Map state = {}; + @override bool get $isClassGenerated => true; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.over_react.g.dart new file mode 100644 index 000000000..297ba1685 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.over_react.g.dart @@ -0,0 +1,545 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'abstract_accessor_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +abstract class _$TestAbstractPropsAccessorsMixin + implements _$TestAbstractProps { + @override + Map get props; + + /// Go to [_$TestAbstractProps.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$TestAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractProps.stringProp] to see the source code for this prop + @override + set stringProp(String value) => + props[_$key__stringProp___$TestAbstractProps] = value; + + /// Go to [_$TestAbstractProps.dynamicProp] to see the source code for this prop + @override + dynamic get dynamicProp => + props[_$key__dynamicProp___$TestAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractProps.dynamicProp] to see the source code for this prop + @override + set dynamicProp(dynamic value) => + props[_$key__dynamicProp___$TestAbstractProps] = value; + + /// Go to [_$TestAbstractProps.untypedProp] to see the source code for this prop + @override + get untypedProp => + props[_$key__untypedProp___$TestAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractProps.untypedProp] to see the source code for this prop + @override + set untypedProp(value) => + props[_$key__untypedProp___$TestAbstractProps] = value; + + /// Go to [_$TestAbstractProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyProp => + props[_$key__customKeyProp___$TestAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyProp(value) => + props[_$key__customKeyProp___$TestAbstractProps] = value; + + /// Go to [_$TestAbstractProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceProp => + props[_$key__customNamespaceProp___$TestAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceProp(value) => + props[_$key__customNamespaceProp___$TestAbstractProps] = value; + + /// Go to [_$TestAbstractProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceProp => + props[_$key__customKeyAndNamespaceProp___$TestAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceProp(value) => + props[_$key__customKeyAndNamespaceProp___$TestAbstractProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__stringProp___$TestAbstractProps = + const PropDescriptor(_$key__stringProp___$TestAbstractProps); + static const PropDescriptor _$prop__dynamicProp___$TestAbstractProps = + const PropDescriptor(_$key__dynamicProp___$TestAbstractProps); + static const PropDescriptor _$prop__untypedProp___$TestAbstractProps = + const PropDescriptor(_$key__untypedProp___$TestAbstractProps); + static const PropDescriptor _$prop__customKeyProp___$TestAbstractProps = + const PropDescriptor(_$key__customKeyProp___$TestAbstractProps); + static const PropDescriptor _$prop__customNamespaceProp___$TestAbstractProps = + const PropDescriptor(_$key__customNamespaceProp___$TestAbstractProps); + static const PropDescriptor + _$prop__customKeyAndNamespaceProp___$TestAbstractProps = + const PropDescriptor( + _$key__customKeyAndNamespaceProp___$TestAbstractProps); + static const String _$key__stringProp___$TestAbstractProps = + 'TestAbstractProps.stringProp'; + static const String _$key__dynamicProp___$TestAbstractProps = + 'TestAbstractProps.dynamicProp'; + static const String _$key__untypedProp___$TestAbstractProps = + 'TestAbstractProps.untypedProp'; + static const String _$key__customKeyProp___$TestAbstractProps = + 'TestAbstractProps.custom key!'; + static const String _$key__customNamespaceProp___$TestAbstractProps = + 'custom namespace~~customNamespaceProp'; + static const String _$key__customKeyAndNamespaceProp___$TestAbstractProps = + 'custom namespace~~custom key!'; + + static const List $props = const [ + _$prop__stringProp___$TestAbstractProps, + _$prop__dynamicProp___$TestAbstractProps, + _$prop__untypedProp___$TestAbstractProps, + _$prop__customKeyProp___$TestAbstractProps, + _$prop__customNamespaceProp___$TestAbstractProps, + _$prop__customKeyAndNamespaceProp___$TestAbstractProps + ]; + static const List $propKeys = const [ + _$key__stringProp___$TestAbstractProps, + _$key__dynamicProp___$TestAbstractProps, + _$key__untypedProp___$TestAbstractProps, + _$key__customKeyProp___$TestAbstractProps, + _$key__customNamespaceProp___$TestAbstractProps, + _$key__customKeyAndNamespaceProp___$TestAbstractProps + ]; +} + +const PropsMeta _$metaForTestAbstractProps = const PropsMeta( + fields: _$TestAbstractPropsAccessorsMixin.$props, + keys: _$TestAbstractPropsAccessorsMixin.$propKeys, +); + +abstract class TestAbstractProps extends _$TestAbstractProps + with _$TestAbstractPropsAccessorsMixin { + static const PropsMeta meta = _$metaForTestAbstractProps; +} + +abstract class _$TestCustomNamespaceAbstractPropsAccessorsMixin + implements _$TestCustomNamespaceAbstractProps { + @override + Map get props; + + /// Go to [_$TestCustomNamespaceAbstractProps.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$TestCustomNamespaceAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractProps.stringProp] to see the source code for this prop + @override + set stringProp(String value) => + props[_$key__stringProp___$TestCustomNamespaceAbstractProps] = value; + + /// Go to [_$TestCustomNamespaceAbstractProps.dynamicProp] to see the source code for this prop + @override + dynamic get dynamicProp => + props[_$key__dynamicProp___$TestCustomNamespaceAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractProps.dynamicProp] to see the source code for this prop + @override + set dynamicProp(dynamic value) => + props[_$key__dynamicProp___$TestCustomNamespaceAbstractProps] = value; + + /// Go to [_$TestCustomNamespaceAbstractProps.untypedProp] to see the source code for this prop + @override + get untypedProp => + props[_$key__untypedProp___$TestCustomNamespaceAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractProps.untypedProp] to see the source code for this prop + @override + set untypedProp(value) => + props[_$key__untypedProp___$TestCustomNamespaceAbstractProps] = value; + + /// Go to [_$TestCustomNamespaceAbstractProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyProp => + props[_$key__customKeyProp___$TestCustomNamespaceAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyProp(value) => + props[_$key__customKeyProp___$TestCustomNamespaceAbstractProps] = value; + + /// Go to [_$TestCustomNamespaceAbstractProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceProp => + props[_$key__customNamespaceProp___$TestCustomNamespaceAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceProp(value) => + props[_$key__customNamespaceProp___$TestCustomNamespaceAbstractProps] = + value; + + /// Go to [_$TestCustomNamespaceAbstractProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceProp => + props[ + _$key__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceProp(value) => props[ + _$key__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps] = + value; + /* GENERATED CONSTANTS */ + static const PropDescriptor + _$prop__stringProp___$TestCustomNamespaceAbstractProps = + const PropDescriptor( + _$key__stringProp___$TestCustomNamespaceAbstractProps); + static const PropDescriptor + _$prop__dynamicProp___$TestCustomNamespaceAbstractProps = + const PropDescriptor( + _$key__dynamicProp___$TestCustomNamespaceAbstractProps); + static const PropDescriptor + _$prop__untypedProp___$TestCustomNamespaceAbstractProps = + const PropDescriptor( + _$key__untypedProp___$TestCustomNamespaceAbstractProps); + static const PropDescriptor + _$prop__customKeyProp___$TestCustomNamespaceAbstractProps = + const PropDescriptor( + _$key__customKeyProp___$TestCustomNamespaceAbstractProps); + static const PropDescriptor + _$prop__customNamespaceProp___$TestCustomNamespaceAbstractProps = + const PropDescriptor( + _$key__customNamespaceProp___$TestCustomNamespaceAbstractProps); + static const PropDescriptor + _$prop__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps = + const PropDescriptor( + _$key__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps); + static const String _$key__stringProp___$TestCustomNamespaceAbstractProps = + 'custom mixin namespace**stringProp'; + static const String _$key__dynamicProp___$TestCustomNamespaceAbstractProps = + 'custom mixin namespace**dynamicProp'; + static const String _$key__untypedProp___$TestCustomNamespaceAbstractProps = + 'custom mixin namespace**untypedProp'; + static const String _$key__customKeyProp___$TestCustomNamespaceAbstractProps = + 'custom mixin namespace**custom key!'; + static const String + _$key__customNamespaceProp___$TestCustomNamespaceAbstractProps = + 'custom namespace~~customNamespaceProp'; + static const String + _$key__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps = + 'custom namespace~~custom key!'; + + static const List $props = const [ + _$prop__stringProp___$TestCustomNamespaceAbstractProps, + _$prop__dynamicProp___$TestCustomNamespaceAbstractProps, + _$prop__untypedProp___$TestCustomNamespaceAbstractProps, + _$prop__customKeyProp___$TestCustomNamespaceAbstractProps, + _$prop__customNamespaceProp___$TestCustomNamespaceAbstractProps, + _$prop__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps + ]; + static const List $propKeys = const [ + _$key__stringProp___$TestCustomNamespaceAbstractProps, + _$key__dynamicProp___$TestCustomNamespaceAbstractProps, + _$key__untypedProp___$TestCustomNamespaceAbstractProps, + _$key__customKeyProp___$TestCustomNamespaceAbstractProps, + _$key__customNamespaceProp___$TestCustomNamespaceAbstractProps, + _$key__customKeyAndNamespaceProp___$TestCustomNamespaceAbstractProps + ]; +} + +const PropsMeta _$metaForTestCustomNamespaceAbstractProps = const PropsMeta( + fields: _$TestCustomNamespaceAbstractPropsAccessorsMixin.$props, + keys: _$TestCustomNamespaceAbstractPropsAccessorsMixin.$propKeys, +); + +abstract class TestCustomNamespaceAbstractProps + extends _$TestCustomNamespaceAbstractProps + with _$TestCustomNamespaceAbstractPropsAccessorsMixin { + static const PropsMeta meta = _$metaForTestCustomNamespaceAbstractProps; +} + +abstract class _$TestAbstractStateAccessorsMixin + implements _$TestAbstractState { + @override + Map get state; + + /// Go to [_$TestAbstractState.stringState] to see the source code for this prop + @override + String get stringState => + state[_$key__stringState___$TestAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractState.stringState] to see the source code for this prop + @override + set stringState(String value) => + state[_$key__stringState___$TestAbstractState] = value; + + /// Go to [_$TestAbstractState.dynamicState] to see the source code for this prop + @override + dynamic get dynamicState => + state[_$key__dynamicState___$TestAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractState.dynamicState] to see the source code for this prop + @override + set dynamicState(dynamic value) => + state[_$key__dynamicState___$TestAbstractState] = value; + + /// Go to [_$TestAbstractState.untypedState] to see the source code for this prop + @override + get untypedState => + state[_$key__untypedState___$TestAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractState.untypedState] to see the source code for this prop + @override + set untypedState(value) => + state[_$key__untypedState___$TestAbstractState] = value; + + /// Go to [_$TestAbstractState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyState => + state[_$key__customKeyState___$TestAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyState(value) => + state[_$key__customKeyState___$TestAbstractState] = value; + + /// Go to [_$TestAbstractState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceState => + state[_$key__customNamespaceState___$TestAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceState(value) => + state[_$key__customNamespaceState___$TestAbstractState] = value; + + /// Go to [_$TestAbstractState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceState => + state[_$key__customKeyAndNamespaceState___$TestAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestAbstractState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceState(value) => + state[_$key__customKeyAndNamespaceState___$TestAbstractState] = value; + /* GENERATED CONSTANTS */ + static const StateDescriptor _$prop__stringState___$TestAbstractState = + const StateDescriptor(_$key__stringState___$TestAbstractState); + static const StateDescriptor _$prop__dynamicState___$TestAbstractState = + const StateDescriptor(_$key__dynamicState___$TestAbstractState); + static const StateDescriptor _$prop__untypedState___$TestAbstractState = + const StateDescriptor(_$key__untypedState___$TestAbstractState); + static const StateDescriptor _$prop__customKeyState___$TestAbstractState = + const StateDescriptor(_$key__customKeyState___$TestAbstractState); + static const StateDescriptor + _$prop__customNamespaceState___$TestAbstractState = + const StateDescriptor(_$key__customNamespaceState___$TestAbstractState); + static const StateDescriptor + _$prop__customKeyAndNamespaceState___$TestAbstractState = + const StateDescriptor( + _$key__customKeyAndNamespaceState___$TestAbstractState); + static const String _$key__stringState___$TestAbstractState = + 'TestAbstractState.stringState'; + static const String _$key__dynamicState___$TestAbstractState = + 'TestAbstractState.dynamicState'; + static const String _$key__untypedState___$TestAbstractState = + 'TestAbstractState.untypedState'; + static const String _$key__customKeyState___$TestAbstractState = + 'TestAbstractState.custom key!'; + static const String _$key__customNamespaceState___$TestAbstractState = + 'custom namespace~~customNamespaceState'; + static const String _$key__customKeyAndNamespaceState___$TestAbstractState = + 'custom namespace~~custom key!'; + + static const List $state = const [ + _$prop__stringState___$TestAbstractState, + _$prop__dynamicState___$TestAbstractState, + _$prop__untypedState___$TestAbstractState, + _$prop__customKeyState___$TestAbstractState, + _$prop__customNamespaceState___$TestAbstractState, + _$prop__customKeyAndNamespaceState___$TestAbstractState + ]; + static const List $stateKeys = const [ + _$key__stringState___$TestAbstractState, + _$key__dynamicState___$TestAbstractState, + _$key__untypedState___$TestAbstractState, + _$key__customKeyState___$TestAbstractState, + _$key__customNamespaceState___$TestAbstractState, + _$key__customKeyAndNamespaceState___$TestAbstractState + ]; +} + +const StateMeta _$metaForTestAbstractState = const StateMeta( + fields: _$TestAbstractStateAccessorsMixin.$state, + keys: _$TestAbstractStateAccessorsMixin.$stateKeys, +); + +abstract class TestAbstractState extends _$TestAbstractState + with _$TestAbstractStateAccessorsMixin { + static const StateMeta meta = _$metaForTestAbstractState; +} + +abstract class _$TestCustomNamespaceAbstractStateAccessorsMixin + implements _$TestCustomNamespaceAbstractState { + @override + Map get state; + + /// Go to [_$TestCustomNamespaceAbstractState.stringState] to see the source code for this prop + @override + String get stringState => + state[_$key__stringState___$TestCustomNamespaceAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractState.stringState] to see the source code for this prop + @override + set stringState(String value) => + state[_$key__stringState___$TestCustomNamespaceAbstractState] = value; + + /// Go to [_$TestCustomNamespaceAbstractState.dynamicState] to see the source code for this prop + @override + dynamic get dynamicState => + state[_$key__dynamicState___$TestCustomNamespaceAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractState.dynamicState] to see the source code for this prop + @override + set dynamicState(dynamic value) => + state[_$key__dynamicState___$TestCustomNamespaceAbstractState] = value; + + /// Go to [_$TestCustomNamespaceAbstractState.untypedState] to see the source code for this prop + @override + get untypedState => + state[_$key__untypedState___$TestCustomNamespaceAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractState.untypedState] to see the source code for this prop + @override + set untypedState(value) => + state[_$key__untypedState___$TestCustomNamespaceAbstractState] = value; + + /// Go to [_$TestCustomNamespaceAbstractState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyState => + state[_$key__customKeyState___$TestCustomNamespaceAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyState(value) => + state[_$key__customKeyState___$TestCustomNamespaceAbstractState] = value; + + /// Go to [_$TestCustomNamespaceAbstractState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceState => + state[_$key__customNamespaceState___$TestCustomNamespaceAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceState(value) => + state[_$key__customNamespaceState___$TestCustomNamespaceAbstractState] = + value; + + /// Go to [_$TestCustomNamespaceAbstractState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceState => + state[ + _$key__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceAbstractState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceState(value) => state[ + _$key__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState] = + value; + /* GENERATED CONSTANTS */ + static const StateDescriptor + _$prop__stringState___$TestCustomNamespaceAbstractState = + const StateDescriptor( + _$key__stringState___$TestCustomNamespaceAbstractState); + static const StateDescriptor + _$prop__dynamicState___$TestCustomNamespaceAbstractState = + const StateDescriptor( + _$key__dynamicState___$TestCustomNamespaceAbstractState); + static const StateDescriptor + _$prop__untypedState___$TestCustomNamespaceAbstractState = + const StateDescriptor( + _$key__untypedState___$TestCustomNamespaceAbstractState); + static const StateDescriptor + _$prop__customKeyState___$TestCustomNamespaceAbstractState = + const StateDescriptor( + _$key__customKeyState___$TestCustomNamespaceAbstractState); + static const StateDescriptor + _$prop__customNamespaceState___$TestCustomNamespaceAbstractState = + const StateDescriptor( + _$key__customNamespaceState___$TestCustomNamespaceAbstractState); + static const StateDescriptor + _$prop__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState = + const StateDescriptor( + _$key__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState); + static const String _$key__stringState___$TestCustomNamespaceAbstractState = + 'custom mixin namespace**stringState'; + static const String _$key__dynamicState___$TestCustomNamespaceAbstractState = + 'custom mixin namespace**dynamicState'; + static const String _$key__untypedState___$TestCustomNamespaceAbstractState = + 'custom mixin namespace**untypedState'; + static const String + _$key__customKeyState___$TestCustomNamespaceAbstractState = + 'custom mixin namespace**custom key!'; + static const String + _$key__customNamespaceState___$TestCustomNamespaceAbstractState = + 'custom namespace~~customNamespaceState'; + static const String + _$key__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState = + 'custom namespace~~custom key!'; + + static const List $state = const [ + _$prop__stringState___$TestCustomNamespaceAbstractState, + _$prop__dynamicState___$TestCustomNamespaceAbstractState, + _$prop__untypedState___$TestCustomNamespaceAbstractState, + _$prop__customKeyState___$TestCustomNamespaceAbstractState, + _$prop__customNamespaceState___$TestCustomNamespaceAbstractState, + _$prop__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState + ]; + static const List $stateKeys = const [ + _$key__stringState___$TestCustomNamespaceAbstractState, + _$key__dynamicState___$TestCustomNamespaceAbstractState, + _$key__untypedState___$TestCustomNamespaceAbstractState, + _$key__customKeyState___$TestCustomNamespaceAbstractState, + _$key__customNamespaceState___$TestCustomNamespaceAbstractState, + _$key__customKeyAndNamespaceState___$TestCustomNamespaceAbstractState + ]; +} + +const StateMeta _$metaForTestCustomNamespaceAbstractState = const StateMeta( + fields: _$TestCustomNamespaceAbstractStateAccessorsMixin.$state, + keys: _$TestCustomNamespaceAbstractStateAccessorsMixin.$stateKeys, +); + +abstract class TestCustomNamespaceAbstractState + extends _$TestCustomNamespaceAbstractState + with _$TestCustomNamespaceAbstractStateAccessorsMixin { + static const StateMeta meta = _$metaForTestCustomNamespaceAbstractState; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.dart new file mode 100644 index 000000000..0fdd4d7a9 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.dart @@ -0,0 +1,241 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +part 'accessor_mixin_integration_test.over_react.g.dart'; + +main() { + group('accessor for props/state mixin integration:', () { + group('@PropsMixin()', () { + group('generates prop getters/setters with', () { + test('the props class name as a namespace and the prop name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestPropsMixinSubclass()..stringProp = 'test'; + expect(mixinsTest.props, containsPair('TestPropsMixin.stringProp', 'test')); + + mixinsTest = new TestPropsMixinSubclass()..dynamicProp = 2; + expect(mixinsTest.props, containsPair('TestPropsMixin.dynamicProp', 2)); + + mixinsTest = new TestPropsMixinSubclass()..untypedProp = false; + expect(mixinsTest.props, containsPair('TestPropsMixin.untypedProp', false)); + }); + + test('custom prop keys', () { + var mixinsTest = new TestPropsMixinSubclass()..customKeyProp = 'test'; + expect(mixinsTest.props, containsPair('TestPropsMixin.custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + var mixinsTest = new TestPropsMixinSubclass()..customNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~customNamespaceProp', 'test')); + }); + + test('custom prop keys and namespaces', () { + var mixinsTest = new TestPropsMixinSubclass()..customKeyAndNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + + group('generates prop getters/setters, when there is a custom key namespace, with', () { + test('the custom namespace and the prop name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestCustomNamespacePropsMixinSubclass()..stringProp = 'test'; + expect(mixinsTest.props, containsPair('custom mixin namespace**stringProp', 'test')); + + mixinsTest = new TestCustomNamespacePropsMixinSubclass()..dynamicProp = 2; + expect(mixinsTest.props, containsPair('custom mixin namespace**dynamicProp', 2)); + + mixinsTest = new TestCustomNamespacePropsMixinSubclass()..untypedProp = false; + expect(mixinsTest.props, containsPair('custom mixin namespace**untypedProp', false)); + }); + + test('custom prop keys', () { + var mixinsTest = new TestCustomNamespacePropsMixinSubclass()..customKeyProp = 'test'; + expect(mixinsTest.props, containsPair('custom mixin namespace**custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + var mixinsTest = new TestCustomNamespacePropsMixinSubclass()..customNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~customNamespaceProp', 'test')); + }); + + test('custom prop keys and namespaces', () { + var mixinsTest = new TestCustomNamespacePropsMixinSubclass()..customKeyAndNamespaceProp = 'test'; + expect(mixinsTest.props, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + }); + + group('@StateMixin()', () { + group('generates state getters/setters with', () { + test('the state class name as a namespace and the state name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestStateMixinSubclass()..stringState = 'test'; + expect(mixinsTest.state, containsPair('TestStateMixin.stringState', 'test')); + + mixinsTest = new TestStateMixinSubclass()..dynamicState = 2; + expect(mixinsTest.state, containsPair('TestStateMixin.dynamicState', 2)); + + mixinsTest = new TestStateMixinSubclass()..untypedState = false; + expect(mixinsTest.state, containsPair('TestStateMixin.untypedState', false)); + }); + + test('custom state keys', () { + var mixinsTest = new TestStateMixinSubclass()..customKeyState = 'test'; + expect(mixinsTest.state, containsPair('TestStateMixin.custom key!', 'test')); + }); + + test('custom state key namespaces', () { + var mixinsTest = new TestStateMixinSubclass()..customNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~customNamespaceState', 'test')); + }); + + test('custom state keys and namespaces', () { + var mixinsTest = new TestStateMixinSubclass()..customKeyAndNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + + group('generates state getters/setters, when there is a custom key namespace, with', () { + test('the custom namespace and the state name as the key by default', () { + var mixinsTest; + + mixinsTest = new TestCustomNamespaceStateMixinSubclass()..stringState = 'test'; + expect(mixinsTest.state, containsPair('custom mixin namespace**stringState', 'test')); + + mixinsTest = new TestCustomNamespaceStateMixinSubclass()..dynamicState = 2; + expect(mixinsTest.state, containsPair('custom mixin namespace**dynamicState', 2)); + + mixinsTest = new TestCustomNamespaceStateMixinSubclass()..untypedState = false; + expect(mixinsTest.state, containsPair('custom mixin namespace**untypedState', false)); + }); + + test('custom state keys', () { + var mixinsTest = new TestCustomNamespaceStateMixinSubclass()..customKeyState = 'test'; + expect(mixinsTest.state, containsPair('custom mixin namespace**custom key!', 'test')); + }); + + test('custom state key namespaces', () { + var mixinsTest = new TestCustomNamespaceStateMixinSubclass()..customNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~customNamespaceState', 'test')); + }); + + test('custom state keys and namespaces', () { + var mixinsTest = new TestCustomNamespaceStateMixinSubclass()..customKeyAndNamespaceState = 'test'; + expect(mixinsTest.state, containsPair('custom namespace~~custom key!', 'test')); + }); + }); + }); + }); +} + + +@PropsMixin() +abstract class _$TestPropsMixin { + Map get props; + + String stringProp; + dynamic dynamicProp; + var untypedProp; + + @Accessor(key: 'custom key!') + var customKeyProp; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceProp; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceProp; +} + +class TestPropsMixinSubclass extends Object with + TestPropsMixin { + @override final Map props = {}; +} + + +@PropsMixin(keyNamespace: 'custom mixin namespace**') +abstract class _$TestCustomNamespacePropsMixin { + Map get props; + + String stringProp; + dynamic dynamicProp; + var untypedProp; + + @Accessor(key: 'custom key!') + var customKeyProp; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceProp; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceProp; +} + +class TestCustomNamespacePropsMixinSubclass extends Object with + TestCustomNamespacePropsMixin { + @override final Map props = {}; +} + + +@StateMixin() +abstract class _$TestStateMixin { + Map get state; + + String stringState; + dynamic dynamicState; + var untypedState; + + @Accessor(key: 'custom key!') + var customKeyState; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceState; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceState; +} + +class TestStateMixinSubclass extends Object with + TestStateMixin { + @override final Map state = {}; +} + + +@StateMixin(keyNamespace: 'custom mixin namespace**') +abstract class _$TestCustomNamespaceStateMixin { + Map get state; + + String stringState; + dynamic dynamicState; + var untypedState; + + @Accessor(key: 'custom key!') + var customKeyState; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceState; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceState; +} + +class TestCustomNamespaceStateMixinSubclass extends Object with + TestCustomNamespaceStateMixin { + @override final Map state = {}; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.over_react.g.dart new file mode 100644 index 000000000..260528aaa --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.over_react.g.dart @@ -0,0 +1,522 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'accessor_mixin_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +abstract class TestPropsMixin implements _$TestPropsMixin { + @override + Map get props; + + static const PropsMeta meta = _$metaForTestPropsMixin; + + /// Go to [_$TestPropsMixin.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$TestPropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestPropsMixin.stringProp] to see the source code for this prop + @override + set stringProp(String value) => + props[_$key__stringProp___$TestPropsMixin] = value; + + /// Go to [_$TestPropsMixin.dynamicProp] to see the source code for this prop + @override + dynamic get dynamicProp => + props[_$key__dynamicProp___$TestPropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestPropsMixin.dynamicProp] to see the source code for this prop + @override + set dynamicProp(dynamic value) => + props[_$key__dynamicProp___$TestPropsMixin] = value; + + /// Go to [_$TestPropsMixin.untypedProp] to see the source code for this prop + @override + get untypedProp => + props[_$key__untypedProp___$TestPropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestPropsMixin.untypedProp] to see the source code for this prop + @override + set untypedProp(value) => props[_$key__untypedProp___$TestPropsMixin] = value; + + /// Go to [_$TestPropsMixin.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyProp => + props[_$key__customKeyProp___$TestPropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestPropsMixin.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyProp(value) => + props[_$key__customKeyProp___$TestPropsMixin] = value; + + /// Go to [_$TestPropsMixin.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceProp => + props[_$key__customNamespaceProp___$TestPropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestPropsMixin.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceProp(value) => + props[_$key__customNamespaceProp___$TestPropsMixin] = value; + + /// Go to [_$TestPropsMixin.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceProp => + props[_$key__customKeyAndNamespaceProp___$TestPropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestPropsMixin.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceProp(value) => + props[_$key__customKeyAndNamespaceProp___$TestPropsMixin] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__stringProp___$TestPropsMixin = + const PropDescriptor(_$key__stringProp___$TestPropsMixin); + static const PropDescriptor _$prop__dynamicProp___$TestPropsMixin = + const PropDescriptor(_$key__dynamicProp___$TestPropsMixin); + static const PropDescriptor _$prop__untypedProp___$TestPropsMixin = + const PropDescriptor(_$key__untypedProp___$TestPropsMixin); + static const PropDescriptor _$prop__customKeyProp___$TestPropsMixin = + const PropDescriptor(_$key__customKeyProp___$TestPropsMixin); + static const PropDescriptor _$prop__customNamespaceProp___$TestPropsMixin = + const PropDescriptor(_$key__customNamespaceProp___$TestPropsMixin); + static const PropDescriptor + _$prop__customKeyAndNamespaceProp___$TestPropsMixin = + const PropDescriptor(_$key__customKeyAndNamespaceProp___$TestPropsMixin); + static const String _$key__stringProp___$TestPropsMixin = + 'TestPropsMixin.stringProp'; + static const String _$key__dynamicProp___$TestPropsMixin = + 'TestPropsMixin.dynamicProp'; + static const String _$key__untypedProp___$TestPropsMixin = + 'TestPropsMixin.untypedProp'; + static const String _$key__customKeyProp___$TestPropsMixin = + 'TestPropsMixin.custom key!'; + static const String _$key__customNamespaceProp___$TestPropsMixin = + 'custom namespace~~customNamespaceProp'; + static const String _$key__customKeyAndNamespaceProp___$TestPropsMixin = + 'custom namespace~~custom key!'; + + static const List $props = const [ + _$prop__stringProp___$TestPropsMixin, + _$prop__dynamicProp___$TestPropsMixin, + _$prop__untypedProp___$TestPropsMixin, + _$prop__customKeyProp___$TestPropsMixin, + _$prop__customNamespaceProp___$TestPropsMixin, + _$prop__customKeyAndNamespaceProp___$TestPropsMixin + ]; + static const List $propKeys = const [ + _$key__stringProp___$TestPropsMixin, + _$key__dynamicProp___$TestPropsMixin, + _$key__untypedProp___$TestPropsMixin, + _$key__customKeyProp___$TestPropsMixin, + _$key__customNamespaceProp___$TestPropsMixin, + _$key__customKeyAndNamespaceProp___$TestPropsMixin + ]; +} + +const PropsMeta _$metaForTestPropsMixin = const PropsMeta( + fields: TestPropsMixin.$props, + keys: TestPropsMixin.$propKeys, +); + +abstract class TestCustomNamespacePropsMixin + implements _$TestCustomNamespacePropsMixin { + @override + Map get props; + + static const PropsMeta meta = _$metaForTestCustomNamespacePropsMixin; + + /// Go to [_$TestCustomNamespacePropsMixin.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$TestCustomNamespacePropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespacePropsMixin.stringProp] to see the source code for this prop + @override + set stringProp(String value) => + props[_$key__stringProp___$TestCustomNamespacePropsMixin] = value; + + /// Go to [_$TestCustomNamespacePropsMixin.dynamicProp] to see the source code for this prop + @override + dynamic get dynamicProp => + props[_$key__dynamicProp___$TestCustomNamespacePropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespacePropsMixin.dynamicProp] to see the source code for this prop + @override + set dynamicProp(dynamic value) => + props[_$key__dynamicProp___$TestCustomNamespacePropsMixin] = value; + + /// Go to [_$TestCustomNamespacePropsMixin.untypedProp] to see the source code for this prop + @override + get untypedProp => + props[_$key__untypedProp___$TestCustomNamespacePropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespacePropsMixin.untypedProp] to see the source code for this prop + @override + set untypedProp(value) => + props[_$key__untypedProp___$TestCustomNamespacePropsMixin] = value; + + /// Go to [_$TestCustomNamespacePropsMixin.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyProp => + props[_$key__customKeyProp___$TestCustomNamespacePropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespacePropsMixin.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyProp(value) => + props[_$key__customKeyProp___$TestCustomNamespacePropsMixin] = value; + + /// Go to [_$TestCustomNamespacePropsMixin.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceProp => + props[_$key__customNamespaceProp___$TestCustomNamespacePropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespacePropsMixin.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceProp(value) => + props[_$key__customNamespaceProp___$TestCustomNamespacePropsMixin] = + value; + + /// Go to [_$TestCustomNamespacePropsMixin.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceProp => + props[ + _$key__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespacePropsMixin.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceProp(value) => + props[_$key__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin] = + value; + /* GENERATED CONSTANTS */ + static const PropDescriptor + _$prop__stringProp___$TestCustomNamespacePropsMixin = + const PropDescriptor(_$key__stringProp___$TestCustomNamespacePropsMixin); + static const PropDescriptor + _$prop__dynamicProp___$TestCustomNamespacePropsMixin = + const PropDescriptor(_$key__dynamicProp___$TestCustomNamespacePropsMixin); + static const PropDescriptor + _$prop__untypedProp___$TestCustomNamespacePropsMixin = + const PropDescriptor(_$key__untypedProp___$TestCustomNamespacePropsMixin); + static const PropDescriptor + _$prop__customKeyProp___$TestCustomNamespacePropsMixin = + const PropDescriptor( + _$key__customKeyProp___$TestCustomNamespacePropsMixin); + static const PropDescriptor + _$prop__customNamespaceProp___$TestCustomNamespacePropsMixin = + const PropDescriptor( + _$key__customNamespaceProp___$TestCustomNamespacePropsMixin); + static const PropDescriptor + _$prop__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin = + const PropDescriptor( + _$key__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin); + static const String _$key__stringProp___$TestCustomNamespacePropsMixin = + 'custom mixin namespace**stringProp'; + static const String _$key__dynamicProp___$TestCustomNamespacePropsMixin = + 'custom mixin namespace**dynamicProp'; + static const String _$key__untypedProp___$TestCustomNamespacePropsMixin = + 'custom mixin namespace**untypedProp'; + static const String _$key__customKeyProp___$TestCustomNamespacePropsMixin = + 'custom mixin namespace**custom key!'; + static const String + _$key__customNamespaceProp___$TestCustomNamespacePropsMixin = + 'custom namespace~~customNamespaceProp'; + static const String + _$key__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin = + 'custom namespace~~custom key!'; + + static const List $props = const [ + _$prop__stringProp___$TestCustomNamespacePropsMixin, + _$prop__dynamicProp___$TestCustomNamespacePropsMixin, + _$prop__untypedProp___$TestCustomNamespacePropsMixin, + _$prop__customKeyProp___$TestCustomNamespacePropsMixin, + _$prop__customNamespaceProp___$TestCustomNamespacePropsMixin, + _$prop__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin + ]; + static const List $propKeys = const [ + _$key__stringProp___$TestCustomNamespacePropsMixin, + _$key__dynamicProp___$TestCustomNamespacePropsMixin, + _$key__untypedProp___$TestCustomNamespacePropsMixin, + _$key__customKeyProp___$TestCustomNamespacePropsMixin, + _$key__customNamespaceProp___$TestCustomNamespacePropsMixin, + _$key__customKeyAndNamespaceProp___$TestCustomNamespacePropsMixin + ]; +} + +const PropsMeta _$metaForTestCustomNamespacePropsMixin = const PropsMeta( + fields: TestCustomNamespacePropsMixin.$props, + keys: TestCustomNamespacePropsMixin.$propKeys, +); + +abstract class TestStateMixin implements _$TestStateMixin { + @override + Map get state; + + static const StateMeta meta = _$metaForTestStateMixin; + + /// Go to [_$TestStateMixin.stringState] to see the source code for this prop + @override + String get stringState => + state[_$key__stringState___$TestStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestStateMixin.stringState] to see the source code for this prop + @override + set stringState(String value) => + state[_$key__stringState___$TestStateMixin] = value; + + /// Go to [_$TestStateMixin.dynamicState] to see the source code for this prop + @override + dynamic get dynamicState => + state[_$key__dynamicState___$TestStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestStateMixin.dynamicState] to see the source code for this prop + @override + set dynamicState(dynamic value) => + state[_$key__dynamicState___$TestStateMixin] = value; + + /// Go to [_$TestStateMixin.untypedState] to see the source code for this prop + @override + get untypedState => + state[_$key__untypedState___$TestStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestStateMixin.untypedState] to see the source code for this prop + @override + set untypedState(value) => + state[_$key__untypedState___$TestStateMixin] = value; + + /// Go to [_$TestStateMixin.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyState => + state[_$key__customKeyState___$TestStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestStateMixin.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyState(value) => + state[_$key__customKeyState___$TestStateMixin] = value; + + /// Go to [_$TestStateMixin.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceState => + state[_$key__customNamespaceState___$TestStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestStateMixin.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceState(value) => + state[_$key__customNamespaceState___$TestStateMixin] = value; + + /// Go to [_$TestStateMixin.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceState => + state[_$key__customKeyAndNamespaceState___$TestStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestStateMixin.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceState(value) => + state[_$key__customKeyAndNamespaceState___$TestStateMixin] = value; + /* GENERATED CONSTANTS */ + static const StateDescriptor _$prop__stringState___$TestStateMixin = + const StateDescriptor(_$key__stringState___$TestStateMixin); + static const StateDescriptor _$prop__dynamicState___$TestStateMixin = + const StateDescriptor(_$key__dynamicState___$TestStateMixin); + static const StateDescriptor _$prop__untypedState___$TestStateMixin = + const StateDescriptor(_$key__untypedState___$TestStateMixin); + static const StateDescriptor _$prop__customKeyState___$TestStateMixin = + const StateDescriptor(_$key__customKeyState___$TestStateMixin); + static const StateDescriptor _$prop__customNamespaceState___$TestStateMixin = + const StateDescriptor(_$key__customNamespaceState___$TestStateMixin); + static const StateDescriptor + _$prop__customKeyAndNamespaceState___$TestStateMixin = + const StateDescriptor( + _$key__customKeyAndNamespaceState___$TestStateMixin); + static const String _$key__stringState___$TestStateMixin = + 'TestStateMixin.stringState'; + static const String _$key__dynamicState___$TestStateMixin = + 'TestStateMixin.dynamicState'; + static const String _$key__untypedState___$TestStateMixin = + 'TestStateMixin.untypedState'; + static const String _$key__customKeyState___$TestStateMixin = + 'TestStateMixin.custom key!'; + static const String _$key__customNamespaceState___$TestStateMixin = + 'custom namespace~~customNamespaceState'; + static const String _$key__customKeyAndNamespaceState___$TestStateMixin = + 'custom namespace~~custom key!'; + + static const List $state = const [ + _$prop__stringState___$TestStateMixin, + _$prop__dynamicState___$TestStateMixin, + _$prop__untypedState___$TestStateMixin, + _$prop__customKeyState___$TestStateMixin, + _$prop__customNamespaceState___$TestStateMixin, + _$prop__customKeyAndNamespaceState___$TestStateMixin + ]; + static const List $stateKeys = const [ + _$key__stringState___$TestStateMixin, + _$key__dynamicState___$TestStateMixin, + _$key__untypedState___$TestStateMixin, + _$key__customKeyState___$TestStateMixin, + _$key__customNamespaceState___$TestStateMixin, + _$key__customKeyAndNamespaceState___$TestStateMixin + ]; +} + +const StateMeta _$metaForTestStateMixin = const StateMeta( + fields: TestStateMixin.$state, + keys: TestStateMixin.$stateKeys, +); + +abstract class TestCustomNamespaceStateMixin + implements _$TestCustomNamespaceStateMixin { + @override + Map get state; + + static const StateMeta meta = _$metaForTestCustomNamespaceStateMixin; + + /// Go to [_$TestCustomNamespaceStateMixin.stringState] to see the source code for this prop + @override + String get stringState => + state[_$key__stringState___$TestCustomNamespaceStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceStateMixin.stringState] to see the source code for this prop + @override + set stringState(String value) => + state[_$key__stringState___$TestCustomNamespaceStateMixin] = value; + + /// Go to [_$TestCustomNamespaceStateMixin.dynamicState] to see the source code for this prop + @override + dynamic get dynamicState => + state[_$key__dynamicState___$TestCustomNamespaceStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceStateMixin.dynamicState] to see the source code for this prop + @override + set dynamicState(dynamic value) => + state[_$key__dynamicState___$TestCustomNamespaceStateMixin] = value; + + /// Go to [_$TestCustomNamespaceStateMixin.untypedState] to see the source code for this prop + @override + get untypedState => + state[_$key__untypedState___$TestCustomNamespaceStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceStateMixin.untypedState] to see the source code for this prop + @override + set untypedState(value) => + state[_$key__untypedState___$TestCustomNamespaceStateMixin] = value; + + /// Go to [_$TestCustomNamespaceStateMixin.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyState => + state[_$key__customKeyState___$TestCustomNamespaceStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceStateMixin.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyState(value) => + state[_$key__customKeyState___$TestCustomNamespaceStateMixin] = value; + + /// Go to [_$TestCustomNamespaceStateMixin.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceState => + state[_$key__customNamespaceState___$TestCustomNamespaceStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceStateMixin.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceState(value) => + state[_$key__customNamespaceState___$TestCustomNamespaceStateMixin] = + value; + + /// Go to [_$TestCustomNamespaceStateMixin.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceState => + state[ + _$key__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TestCustomNamespaceStateMixin.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceState(value) => state[ + _$key__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin] = + value; + /* GENERATED CONSTANTS */ + static const StateDescriptor + _$prop__stringState___$TestCustomNamespaceStateMixin = + const StateDescriptor( + _$key__stringState___$TestCustomNamespaceStateMixin); + static const StateDescriptor + _$prop__dynamicState___$TestCustomNamespaceStateMixin = + const StateDescriptor( + _$key__dynamicState___$TestCustomNamespaceStateMixin); + static const StateDescriptor + _$prop__untypedState___$TestCustomNamespaceStateMixin = + const StateDescriptor( + _$key__untypedState___$TestCustomNamespaceStateMixin); + static const StateDescriptor + _$prop__customKeyState___$TestCustomNamespaceStateMixin = + const StateDescriptor( + _$key__customKeyState___$TestCustomNamespaceStateMixin); + static const StateDescriptor + _$prop__customNamespaceState___$TestCustomNamespaceStateMixin = + const StateDescriptor( + _$key__customNamespaceState___$TestCustomNamespaceStateMixin); + static const StateDescriptor + _$prop__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin = + const StateDescriptor( + _$key__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin); + static const String _$key__stringState___$TestCustomNamespaceStateMixin = + 'custom mixin namespace**stringState'; + static const String _$key__dynamicState___$TestCustomNamespaceStateMixin = + 'custom mixin namespace**dynamicState'; + static const String _$key__untypedState___$TestCustomNamespaceStateMixin = + 'custom mixin namespace**untypedState'; + static const String _$key__customKeyState___$TestCustomNamespaceStateMixin = + 'custom mixin namespace**custom key!'; + static const String + _$key__customNamespaceState___$TestCustomNamespaceStateMixin = + 'custom namespace~~customNamespaceState'; + static const String + _$key__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin = + 'custom namespace~~custom key!'; + + static const List $state = const [ + _$prop__stringState___$TestCustomNamespaceStateMixin, + _$prop__dynamicState___$TestCustomNamespaceStateMixin, + _$prop__untypedState___$TestCustomNamespaceStateMixin, + _$prop__customKeyState___$TestCustomNamespaceStateMixin, + _$prop__customNamespaceState___$TestCustomNamespaceStateMixin, + _$prop__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin + ]; + static const List $stateKeys = const [ + _$key__stringState___$TestCustomNamespaceStateMixin, + _$key__dynamicState___$TestCustomNamespaceStateMixin, + _$key__untypedState___$TestCustomNamespaceStateMixin, + _$key__customKeyState___$TestCustomNamespaceStateMixin, + _$key__customNamespaceState___$TestCustomNamespaceStateMixin, + _$key__customKeyAndNamespaceState___$TestCustomNamespaceStateMixin + ]; +} + +const StateMeta _$metaForTestCustomNamespaceStateMixin = const StateMeta( + fields: TestCustomNamespaceStateMixin.$state, + keys: TestCustomNamespaceStateMixin.$stateKeys, +); diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.dart new file mode 100644 index 000000000..e4eeecf98 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.dart @@ -0,0 +1,161 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +import './required_prop_integration_tests.dart' as r; +import '../../../../test_util/test_util.dart'; + +part 'component_integration_test.over_react.g.dart'; + +main() { + group('component integration:', () { + test('renders a component from end to end, successfully reading props via typed getters', () { + var instance = render((ComponentTest() + ..stringProp = '1' + ..dynamicProp = '2' + ..untypedProp = '3' + ..customKeyProp = '4' + ..customNamespaceProp = '5' + ..customKeyAndNamespaceProp = '6' + )()); + expect(instance, isNotNull); + + var node = findDomNode(instance); + expect(node.text, 'rendered content'); + expect(node.dataset, containsPair('prop-string-prop', '1')); + expect(node.dataset, containsPair('prop-dynamic-prop', '2')); + expect(node.dataset, containsPair('prop-untyped-prop', '3')); + expect(node.dataset, containsPair('prop-custom-key-prop', '4')); + expect(node.dataset, containsPair('prop-custom-namespace-prop', '5')); + expect(node.dataset, containsPair('prop-custom-key-and-namespace-prop', '6')); + }); + + group('initializes the factory variable with a function', () { + test('that returns a new props class implementation instance', () { + var instance = ComponentTest(); + expect(instance, const TypeMatcher()); + expect(instance, const TypeMatcher()); + }); + + test('that returns a new props class implementation instance backed by an existing map', () { + Map existingMap = {'ComponentTestProps.stringProp': 'test'}; + var props = ComponentTest(existingMap); + + expect(props.stringProp, equals('test')); + + props.stringProp = 'modified'; + expect(props.stringProp, equals('modified')); + expect(existingMap['ComponentTestProps.stringProp'], equals('modified')); + }); + }); + + group('generates prop getters/setters with', () { + test('the props class name as a namespace and the prop name as the key by default', () { + expect(ComponentTest()..stringProp = 'test', + containsPair('ComponentTestProps.stringProp', 'test')); + + expect(ComponentTest()..dynamicProp = 2, + containsPair('ComponentTestProps.dynamicProp', 2)); + + expect(ComponentTest()..untypedProp = false, + containsPair('ComponentTestProps.untypedProp', false)); + + }); + + test('custom prop keys', () { + expect(ComponentTest()..customKeyProp = 'test', + containsPair('ComponentTestProps.custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + expect(ComponentTest()..customNamespaceProp = 'test', + containsPair('custom namespace~~customNamespaceProp', 'test')); + }); + + test('custom prop keys and namespaces', () { + expect(ComponentTest()..customKeyAndNamespaceProp = 'test', + containsPair('custom namespace~~custom key!', 'test')); + }); + + test('default props', () { + expect(ComponentTest().componentDefaultProps, equals({'id':'testId'})); + }); + + test('empty map when no default props set', () { + expect(r.ComponentTest().componentDefaultProps, equals({})); + }); + + test('empty map when componentFactory is not ReactDartComponentFactoryProxy', () { + expect(Dom.div().componentDefaultProps, equals({})); + }); + }); + + test('omits props declared in the @Props() class when forwarding by default', () { + var shallowInstance = renderShallow((ComponentTest() + ..addProp('extraneous', true) + ..stringProp = 'test' + ..dynamicProp = 'test' + ..untypedProp = 'test' + ..customKeyProp = 'test' + ..customNamespaceProp = 'test' + ..customKeyAndNamespaceProp = 'test' + )()); + + var shallowProps = getProps(shallowInstance); + Iterable shallowPropKeys = shallowProps.keys.map((key) => key as String); // ignore: avoid_as + + expect(shallowPropKeys.where((String key) => !key.startsWith('data-prop-')), unorderedEquals(['id', 'extraneous', 'children'])); + }); + + r.requiredPropsIntegrationTest(); + }); +} + + +@Factory() +UiFactory ComponentTest = _$ComponentTest; + +@Props() +class _$ComponentTestProps extends UiProps { + String stringProp; + dynamic dynamicProp; + var untypedProp; + + @Accessor(key: 'custom key!') + var customKeyProp; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceProp; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceProp; +} + +@Component() +class ComponentTestComponent extends UiComponent2 { + @override + Map getDefaultProps() => newProps()..id = 'testId'; + + @override + render() => (Dom.div() + ..addProps(copyUnconsumedProps()) + ..addProp('data-prop-string-prop', props.stringProp) + ..addProp('data-prop-dynamic-prop', props.dynamicProp) + ..addProp('data-prop-untyped-prop', props.untypedProp) + ..addProp('data-prop-custom-key-prop', props.customKeyProp) + ..addProp('data-prop-custom-namespace-prop', props.customNamespaceProp) + ..addProp('data-prop-custom-key-and-namespace-prop', props.customKeyAndNamespaceProp) + )('rendered content'); +} 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 new file mode 100644 index 000000000..51d7726f2 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/component_integration_test.over_react.g.dart @@ -0,0 +1,246 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'component_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ComponentTestComponentFactory = registerComponent( + () => new _$ComponentTestComponent(), + builderFactory: ComponentTest, + componentClass: ComponentTestComponent, + isWrapper: false, + parentType: null, + displayName: 'ComponentTest'); + +abstract class _$ComponentTestPropsAccessorsMixin + implements _$ComponentTestProps { + @override + Map get props; + + /// Go to [_$ComponentTestProps.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.stringProp] to see the source code for this prop + @override + set stringProp(String value) => + props[_$key__stringProp___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.dynamicProp] to see the source code for this prop + @override + dynamic get dynamicProp => + props[_$key__dynamicProp___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.dynamicProp] to see the source code for this prop + @override + set dynamicProp(dynamic value) => + props[_$key__dynamicProp___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.untypedProp] to see the source code for this prop + @override + get untypedProp => + props[_$key__untypedProp___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.untypedProp] to see the source code for this prop + @override + set untypedProp(value) => + props[_$key__untypedProp___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyProp => + props[_$key__customKeyProp___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyProp(value) => + props[_$key__customKeyProp___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceProp => + props[_$key__customNamespaceProp___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceProp(value) => + props[_$key__customNamespaceProp___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceProp => + props[_$key__customKeyAndNamespaceProp___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceProp(value) => + props[_$key__customKeyAndNamespaceProp___$ComponentTestProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__stringProp___$ComponentTestProps = + const PropDescriptor(_$key__stringProp___$ComponentTestProps); + static const PropDescriptor _$prop__dynamicProp___$ComponentTestProps = + const PropDescriptor(_$key__dynamicProp___$ComponentTestProps); + static const PropDescriptor _$prop__untypedProp___$ComponentTestProps = + const PropDescriptor(_$key__untypedProp___$ComponentTestProps); + static const PropDescriptor _$prop__customKeyProp___$ComponentTestProps = + const PropDescriptor(_$key__customKeyProp___$ComponentTestProps); + static const PropDescriptor + _$prop__customNamespaceProp___$ComponentTestProps = + const PropDescriptor(_$key__customNamespaceProp___$ComponentTestProps); + static const PropDescriptor + _$prop__customKeyAndNamespaceProp___$ComponentTestProps = + const PropDescriptor( + _$key__customKeyAndNamespaceProp___$ComponentTestProps); + static const String _$key__stringProp___$ComponentTestProps = + 'ComponentTestProps.stringProp'; + static const String _$key__dynamicProp___$ComponentTestProps = + 'ComponentTestProps.dynamicProp'; + static const String _$key__untypedProp___$ComponentTestProps = + 'ComponentTestProps.untypedProp'; + static const String _$key__customKeyProp___$ComponentTestProps = + 'ComponentTestProps.custom key!'; + static const String _$key__customNamespaceProp___$ComponentTestProps = + 'custom namespace~~customNamespaceProp'; + static const String _$key__customKeyAndNamespaceProp___$ComponentTestProps = + 'custom namespace~~custom key!'; + + static const List $props = const [ + _$prop__stringProp___$ComponentTestProps, + _$prop__dynamicProp___$ComponentTestProps, + _$prop__untypedProp___$ComponentTestProps, + _$prop__customKeyProp___$ComponentTestProps, + _$prop__customNamespaceProp___$ComponentTestProps, + _$prop__customKeyAndNamespaceProp___$ComponentTestProps + ]; + static const List $propKeys = const [ + _$key__stringProp___$ComponentTestProps, + _$key__dynamicProp___$ComponentTestProps, + _$key__untypedProp___$ComponentTestProps, + _$key__customKeyProp___$ComponentTestProps, + _$key__customNamespaceProp___$ComponentTestProps, + _$key__customKeyAndNamespaceProp___$ComponentTestProps + ]; +} + +const PropsMeta _$metaForComponentTestProps = const PropsMeta( + fields: _$ComponentTestPropsAccessorsMixin.$props, + keys: _$ComponentTestPropsAccessorsMixin.$propKeys, +); + +class ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForComponentTestProps; +} + +_$$ComponentTestProps _$ComponentTest([Map backingProps]) => + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin + implements ComponentTestProps { + _$$ComponentTestProps._(); + + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$JsMap(backingMap); + } else { + return new _$$ComponentTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ComponentTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ComponentTestProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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; + + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); + + @override + _$$ComponentTestProps typedPropsFactory(Map backingMap) => + new _$$ComponentTestProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ComponentTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForComponentTestProps + ]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.dart new file mode 100644 index 000000000..2728c4708 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.dart @@ -0,0 +1,153 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'dart:html'; + +import 'package:over_react/over_react.dart'; +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'constant_required_accessor_integration_test.over_react.g.dart'; + +void main() { + group('properly identifies required props by', () { + group('throwing when a prop is required and not set', () { + test('on mount', () { + expect(() => render(ComponentTest()..nullable = true), + throwsPropError_Required('ComponentTestProps.required') + ); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest()..nullable = true)(), mountNode), + throwsPropError_Required('ComponentTestProps.required') + ); + }); + }); + + group('throwing when a prop is required and set to null', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..required = null + ..nullable = true + ), throwsPropError_Required('ComponentTestProps.required')); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect( + () => react_dom.render((ComponentTest() + ..required = null + ..nullable = true + )(), mountNode), + throwsPropError_Required('ComponentTestProps.required') + ); + }); + }); + + group('throwing when a prop is nullable and not set', () { + test('on mount', () { + expect(() => render(ComponentTest()..required = true), + throwsPropError_Required('ComponentTestProps.nullable')); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest()..required = true)(), mountNode), + throwsPropError_Required('ComponentTestProps.nullable') + ); + }); + }); + + group('not throwing when a prop is required and set', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..nullable = true + ..required = true + ), returnsNormally); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode), returnsNormally); + }); + }); + + group('not throwing when a prop is nullable and set to null', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..nullable = null + ..required = true + ), returnsNormally); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest() + ..required = true + ..nullable = null + )(), mountNode), returnsNormally); + }); + }); + }); +} + +@Factory() +UiFactory ComponentTest = _$ComponentTest; + +@Props() +class _$ComponentTestProps extends UiProps { + @requiredProp + var required; + + @nullableRequiredProp + var nullable; +} + +@Component() +class ComponentTestComponent extends UiComponent2 { + @override + render() => Dom.div()(); +} + 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 new file mode 100644 index 000000000..2fa33416b --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.over_react.g.dart @@ -0,0 +1,177 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'constant_required_accessor_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ComponentTestComponentFactory = registerComponent( + () => new _$ComponentTestComponent(), + builderFactory: ComponentTest, + componentClass: ComponentTestComponent, + isWrapper: false, + parentType: null, + displayName: 'ComponentTest'); + +abstract class _$ComponentTestPropsAccessorsMixin + implements _$ComponentTestProps { + @override + Map get props; + + /// Go to [_$ComponentTestProps.required] to see the source code for this prop + @override + @requiredProp + get required => + props[_$key__required___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.required] to see the source code for this prop + @override + @requiredProp + set required(value) => props[_$key__required___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.nullable] to see the source code for this prop + @override + @nullableRequiredProp + get nullable => + props[_$key__nullable___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.nullable] to see the source code for this prop + @override + @nullableRequiredProp + set nullable(value) => props[_$key__nullable___$ComponentTestProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__required___$ComponentTestProps = + const PropDescriptor(_$key__required___$ComponentTestProps, + isRequired: true); + static const PropDescriptor _$prop__nullable___$ComponentTestProps = + const PropDescriptor(_$key__nullable___$ComponentTestProps, + isRequired: true, isNullable: true); + static const String _$key__required___$ComponentTestProps = + 'ComponentTestProps.required'; + static const String _$key__nullable___$ComponentTestProps = + 'ComponentTestProps.nullable'; + + static const List $props = const [ + _$prop__required___$ComponentTestProps, + _$prop__nullable___$ComponentTestProps + ]; + static const List $propKeys = const [ + _$key__required___$ComponentTestProps, + _$key__nullable___$ComponentTestProps + ]; +} + +const PropsMeta _$metaForComponentTestProps = const PropsMeta( + fields: _$ComponentTestPropsAccessorsMixin.$props, + keys: _$ComponentTestPropsAccessorsMixin.$propKeys, +); + +class ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForComponentTestProps; +} + +_$$ComponentTestProps _$ComponentTest([Map backingProps]) => + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin + implements ComponentTestProps { + _$$ComponentTestProps._(); + + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$JsMap(backingMap); + } else { + return new _$$ComponentTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ComponentTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ComponentTestProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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; + + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); + + @override + _$$ComponentTestProps typedPropsFactory(Map backingMap) => + new _$$ComponentTestProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ComponentTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForComponentTestProps + ]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.dart new file mode 100644 index 000000000..2931f32ce --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.dart @@ -0,0 +1,121 @@ +// Copyright 2017 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'do_not_generate_accessor_integration_test.over_react.g.dart'; + +main() { + group('acessors with doNotGenerate integration', () { + group('generates prop getters/setters properly', () { + test('for prop fields listed before the field annotated with doNotGenerate', () { + expect((DoNotGenerateAccessorTest()..generated1Prop = 'test').values.single, 'test'); + }); + + test('for prop fields listed after the field annotated with doNotGenerate', () { + expect((DoNotGenerateAccessorTest()..generated2Prop = 'test').values.single, 'test'); + }); + + test('for prop fields annotated with `doNotGenerate: false`', () { + expect((DoNotGenerateAccessorTest()..explicitlyGeneratedProp = 'test').values.single, 'test'); + }); + + test('except for the field annotated with doNotGenerate', () { + var instance = DoNotGenerateAccessorTest()..notGeneratedProp = 'test'; + expect(instance.notGeneratedProp, 'test', reason: 'non-generated field should work as expected'); + expect(instance, isEmpty, reason: 'accessor should not be backed by a key-value pair'); + }); + + test('omitting the field annotated with doNotGenerate from the list of props', () { + expect(DoNotGenerateAccessorTestProps.meta.keys, [ + contains('generated1Prop'), + contains('generated2Prop'), + contains('explicitlyGeneratedProp'), + ], reason: 'should only include generated props'); + + expect(DoNotGenerateAccessorTestProps.meta.props.map((prop) => prop.key).toList(), [ + contains('generated1Prop'), + contains('generated2Prop'), + contains('explicitlyGeneratedProp'), + ], reason: 'should only include generated props'); + }); + }); + + group('generates state getters/setters properly', () { + DoNotGenerateAccessorTestComponent component; + + setUp(() { + component = renderAndGetComponent(DoNotGenerateAccessorTest()());; + }); + + test('for state fields listed before the field annotated with doNotGenerate', () { + expect((component.newState()..generated1State = 'test').values.single, 'test'); + }); + + test('for state fields listed after the field annotated with doNotGenerate', () { + expect((component.newState()..generated2State = 'test').values.single, 'test'); + }); + + test('for state fields annotated with `doNotGenerate: false`', () { + expect((component.newState()..explicitlyGeneratedState = 'test').values.single, 'test'); + }); + + test('except for the field annotated with doNotGenerate', () { + var instance = component.newState()..notGeneratedState = 'test'; + expect(instance.notGeneratedState, 'test', reason: 'non-generated field should work as expected'); + expect(instance, isEmpty, reason: 'accessor should not be backed by a key-value pair'); + }); + }); + }); +} + + +@Factory() +UiFactory DoNotGenerateAccessorTest = _$DoNotGenerateAccessorTest; + +@Props() +class _$DoNotGenerateAccessorTestProps extends UiProps { + var generated1Prop; + + @Accessor(doNotGenerate: true) + var notGeneratedProp; + + var generated2Prop; + + @Accessor(doNotGenerate: false) + var explicitlyGeneratedProp; +} + +@State() +class _$DoNotGenerateAccessorTestState extends UiState { + var generated1State; + + @Accessor(doNotGenerate: true) + var notGeneratedState; + + var generated2State; + + @Accessor(doNotGenerate: false) + var explicitlyGeneratedState; +} + +@Component() +class DoNotGenerateAccessorTestComponent extends UiStatefulComponent2 { + @override + render() => (Dom.div() + ..addProps(copyUnconsumedProps()) + )('rendered content'); +} 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 new file mode 100644 index 000000000..aeddbfa83 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.over_react.g.dart @@ -0,0 +1,359 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'do_not_generate_accessor_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $DoNotGenerateAccessorTestComponentFactory = registerComponent( + () => new _$DoNotGenerateAccessorTestComponent(), + builderFactory: DoNotGenerateAccessorTest, + componentClass: DoNotGenerateAccessorTestComponent, + isWrapper: false, + parentType: null, + displayName: 'DoNotGenerateAccessorTest'); + +abstract class _$DoNotGenerateAccessorTestPropsAccessorsMixin + implements _$DoNotGenerateAccessorTestProps { + @override + Map get props; + + /// Go to [_$DoNotGenerateAccessorTestProps.generated1Prop] to see the source code for this prop + @override + get generated1Prop => + props[_$key__generated1Prop___$DoNotGenerateAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$DoNotGenerateAccessorTestProps.generated1Prop] to see the source code for this prop + @override + set generated1Prop(value) => + props[_$key__generated1Prop___$DoNotGenerateAccessorTestProps] = value; + + /// Go to [_$DoNotGenerateAccessorTestProps.generated2Prop] to see the source code for this prop + @override + get generated2Prop => + props[_$key__generated2Prop___$DoNotGenerateAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$DoNotGenerateAccessorTestProps.generated2Prop] to see the source code for this prop + @override + set generated2Prop(value) => + props[_$key__generated2Prop___$DoNotGenerateAccessorTestProps] = value; + + /// Go to [_$DoNotGenerateAccessorTestProps.explicitlyGeneratedProp] to see the source code for this prop + @override + @Accessor(doNotGenerate: false) + get explicitlyGeneratedProp => + props[_$key__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$DoNotGenerateAccessorTestProps.explicitlyGeneratedProp] to see the source code for this prop + @override + @Accessor(doNotGenerate: false) + set explicitlyGeneratedProp(value) => + props[_$key__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps] = + value; + /* GENERATED CONSTANTS */ + static const PropDescriptor + _$prop__generated1Prop___$DoNotGenerateAccessorTestProps = + const PropDescriptor( + _$key__generated1Prop___$DoNotGenerateAccessorTestProps); + static const PropDescriptor + _$prop__generated2Prop___$DoNotGenerateAccessorTestProps = + const PropDescriptor( + _$key__generated2Prop___$DoNotGenerateAccessorTestProps); + static const PropDescriptor + _$prop__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps = + const PropDescriptor( + _$key__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps); + static const String _$key__generated1Prop___$DoNotGenerateAccessorTestProps = + 'DoNotGenerateAccessorTestProps.generated1Prop'; + static const String _$key__generated2Prop___$DoNotGenerateAccessorTestProps = + 'DoNotGenerateAccessorTestProps.generated2Prop'; + static const String + _$key__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps = + 'DoNotGenerateAccessorTestProps.explicitlyGeneratedProp'; + + static const List $props = const [ + _$prop__generated1Prop___$DoNotGenerateAccessorTestProps, + _$prop__generated2Prop___$DoNotGenerateAccessorTestProps, + _$prop__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps + ]; + static const List $propKeys = const [ + _$key__generated1Prop___$DoNotGenerateAccessorTestProps, + _$key__generated2Prop___$DoNotGenerateAccessorTestProps, + _$key__explicitlyGeneratedProp___$DoNotGenerateAccessorTestProps + ]; +} + +const PropsMeta _$metaForDoNotGenerateAccessorTestProps = const PropsMeta( + fields: _$DoNotGenerateAccessorTestPropsAccessorsMixin.$props, + keys: _$DoNotGenerateAccessorTestPropsAccessorsMixin.$propKeys, +); + +class DoNotGenerateAccessorTestProps extends _$DoNotGenerateAccessorTestProps + with _$DoNotGenerateAccessorTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForDoNotGenerateAccessorTestProps; +} + +_$$DoNotGenerateAccessorTestProps _$DoNotGenerateAccessorTest( + [Map backingProps]) => + backingProps == null + ? new _$$DoNotGenerateAccessorTestProps$JsMap(new JsBackedMap()) + : new _$$DoNotGenerateAccessorTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$DoNotGenerateAccessorTestProps + extends _$DoNotGenerateAccessorTestProps + with _$DoNotGenerateAccessorTestPropsAccessorsMixin + implements DoNotGenerateAccessorTestProps { + _$$DoNotGenerateAccessorTestProps._(); + + factory _$$DoNotGenerateAccessorTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); + } else { + return new _$$DoNotGenerateAccessorTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $DoNotGenerateAccessorTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'DoNotGenerateAccessorTestProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$DoNotGenerateAccessorTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$DoNotGenerateAccessorTestStateAccessorsMixin + implements _$DoNotGenerateAccessorTestState { + @override + Map get state; + + /// Go to [_$DoNotGenerateAccessorTestState.generated1State] to see the source code for this prop + @override + get generated1State => + state[_$key__generated1State___$DoNotGenerateAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$DoNotGenerateAccessorTestState.generated1State] to see the source code for this prop + @override + set generated1State(value) => + state[_$key__generated1State___$DoNotGenerateAccessorTestState] = value; + + /// Go to [_$DoNotGenerateAccessorTestState.generated2State] to see the source code for this prop + @override + get generated2State => + state[_$key__generated2State___$DoNotGenerateAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$DoNotGenerateAccessorTestState.generated2State] to see the source code for this prop + @override + set generated2State(value) => + state[_$key__generated2State___$DoNotGenerateAccessorTestState] = value; + + /// Go to [_$DoNotGenerateAccessorTestState.explicitlyGeneratedState] to see the source code for this prop + @override + @Accessor(doNotGenerate: false) + get explicitlyGeneratedState => + state[ + _$key__explicitlyGeneratedState___$DoNotGenerateAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$DoNotGenerateAccessorTestState.explicitlyGeneratedState] to see the source code for this prop + @override + @Accessor(doNotGenerate: false) + set explicitlyGeneratedState(value) => + state[_$key__explicitlyGeneratedState___$DoNotGenerateAccessorTestState] = + value; + /* GENERATED CONSTANTS */ + static const StateDescriptor + _$prop__generated1State___$DoNotGenerateAccessorTestState = + const StateDescriptor( + _$key__generated1State___$DoNotGenerateAccessorTestState); + static const StateDescriptor + _$prop__generated2State___$DoNotGenerateAccessorTestState = + const StateDescriptor( + _$key__generated2State___$DoNotGenerateAccessorTestState); + static const StateDescriptor + _$prop__explicitlyGeneratedState___$DoNotGenerateAccessorTestState = + const StateDescriptor( + _$key__explicitlyGeneratedState___$DoNotGenerateAccessorTestState); + static const String _$key__generated1State___$DoNotGenerateAccessorTestState = + 'DoNotGenerateAccessorTestState.generated1State'; + static const String _$key__generated2State___$DoNotGenerateAccessorTestState = + 'DoNotGenerateAccessorTestState.generated2State'; + static const String + _$key__explicitlyGeneratedState___$DoNotGenerateAccessorTestState = + 'DoNotGenerateAccessorTestState.explicitlyGeneratedState'; + + static const List $state = const [ + _$prop__generated1State___$DoNotGenerateAccessorTestState, + _$prop__generated2State___$DoNotGenerateAccessorTestState, + _$prop__explicitlyGeneratedState___$DoNotGenerateAccessorTestState + ]; + static const List $stateKeys = const [ + _$key__generated1State___$DoNotGenerateAccessorTestState, + _$key__generated2State___$DoNotGenerateAccessorTestState, + _$key__explicitlyGeneratedState___$DoNotGenerateAccessorTestState + ]; +} + +const StateMeta _$metaForDoNotGenerateAccessorTestState = const StateMeta( + fields: _$DoNotGenerateAccessorTestStateAccessorsMixin.$state, + keys: _$DoNotGenerateAccessorTestStateAccessorsMixin.$stateKeys, +); + +class DoNotGenerateAccessorTestState extends _$DoNotGenerateAccessorTestState + with _$DoNotGenerateAccessorTestStateAccessorsMixin { + static const StateMeta meta = _$metaForDoNotGenerateAccessorTestState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$DoNotGenerateAccessorTestState + extends _$DoNotGenerateAccessorTestState + with _$DoNotGenerateAccessorTestStateAccessorsMixin + implements DoNotGenerateAccessorTestState { + _$$DoNotGenerateAccessorTestState._(); + + factory _$$DoNotGenerateAccessorTestState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$DoNotGenerateAccessorTestState$JsMap(backingMap); + } else { + return new _$$DoNotGenerateAccessorTestState$PlainMap(backingMap); + } + } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$DoNotGenerateAccessorTestState$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// The backing state map proxied by this class. + @override + Map get state => _state; + Map _state; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$DoNotGenerateAccessorTestState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$DoNotGenerateAccessorTestComponent + extends DoNotGenerateAccessorTestComponent { + _$$DoNotGenerateAccessorTestProps$JsMap _cachedTypedProps; + + @override + _$$DoNotGenerateAccessorTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$DoNotGenerateAccessorTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$DoNotGenerateAccessorTestProps$JsMap(backingMap); + + @override + _$$DoNotGenerateAccessorTestProps typedPropsFactory(Map backingMap) => + new _$$DoNotGenerateAccessorTestProps(backingMap); + + _$$DoNotGenerateAccessorTestState$JsMap _cachedTypedState; + @override + _$$DoNotGenerateAccessorTestState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$DoNotGenerateAccessorTestState$JsMap typedStateFactoryJs( + JsBackedMap backingMap) => + new _$$DoNotGenerateAccessorTestState$JsMap(backingMap); + + @override + _$$DoNotGenerateAccessorTestState typedStateFactory(Map backingMap) => + new _$$DoNotGenerateAccessorTestState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$DoNotGenerateAccessorTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForDoNotGenerateAccessorTestProps + ]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.dart new file mode 100644 index 000000000..4251c8ae7 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.dart @@ -0,0 +1,147 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'namespaced_accessor_integration_test.over_react.g.dart'; + +main() { + group('custom namespaced props/state integration:', () { + group('generates prop getters/setters, when there is a custom key namespace, with', () { + test('the custom namespace and the prop name as the key by default', () { + expect(NamespacedAccessorTest()..stringProp = 'test', + containsPair('custom props class namespace**stringProp', 'test')); + + expect(NamespacedAccessorTest()..dynamicProp = 2, + containsPair('custom props class namespace**dynamicProp', 2)); + + expect(NamespacedAccessorTest()..untypedProp = false, + containsPair('custom props class namespace**untypedProp', false)); + }); + + test('custom prop keys', () { + expect(NamespacedAccessorTest()..customKeyProp = 'test', + containsPair('custom props class namespace**custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + expect(NamespacedAccessorTest()..customNamespaceProp = 'test', + containsPair('custom namespace~~customNamespaceProp', 'test')); + }); + + test('custom prop keys and namespaces', () { + expect(NamespacedAccessorTest()..customKeyAndNamespaceProp = 'test', + containsPair('custom namespace~~custom key!', 'test')); + }); + }); + + group('generates state getters/setters, when there is a custom key namespace, with', () { + NamespacedAccessorTestComponent component; + + setUp(() { + var renderedInstance = render(NamespacedAccessorTest()()); + component = getDartComponent(renderedInstance); + }); + + test('the custom namespace and the state name as the key by default', () { + expect(component.newState()..stringState = 'test', + containsPair('custom state class namespace**stringState', 'test')); + + expect(component.newState()..dynamicState = 2, + containsPair('custom state class namespace**dynamicState', 2)); + + expect(component.newState()..untypedState = false, + containsPair('custom state class namespace**untypedState', false)); + }); + + test('custom state keys', () { + expect(component.newState()..customKeyState = 'test', + containsPair('custom state class namespace**custom key!', 'test')); + }); + + test('custom state key namespaces', () { + expect(component.newState()..customNamespaceState = 'test', + containsPair('custom namespace~~customNamespaceState', 'test')); + }); + + test('custom state keys and namespaces', () { + expect(component.newState()..customKeyAndNamespaceState = 'test', + containsPair('custom namespace~~custom key!', 'test')); + }); + }); + + test('omits props declared in the @Props() class when forwarding by default', () { + var shallowInstance = renderShallow((NamespacedAccessorTest() + ..addProp('extraneous', true) + ..stringProp = 'test' + ..dynamicProp = 'test' + ..untypedProp = 'test' + ..customKeyProp = 'test' + ..customNamespaceProp = 'test' + ..customKeyAndNamespaceProp = 'test' + )()); + + var shallowProps = getProps(shallowInstance); + + expect(shallowProps.keys, unorderedEquals(['extraneous', 'children'])); + }); + }); +} + + +@Factory() +UiFactory NamespacedAccessorTest = _$NamespacedAccessorTest; + +@Props(keyNamespace: 'custom props class namespace**') +class _$NamespacedAccessorTestProps extends UiProps { + String stringProp; + dynamic dynamicProp; + var untypedProp; + + @Accessor(key: 'custom key!') + var customKeyProp; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceProp; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceProp; +} + +@State(keyNamespace: 'custom state class namespace**') +class _$NamespacedAccessorTestState extends UiState { + String stringState; + dynamic dynamicState; + var untypedState; + + @Accessor(key: 'custom key!') + var customKeyState; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceState; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceState; +} + +@Component() +class NamespacedAccessorTestComponent extends UiStatefulComponent2 { + @override + render() => (Dom.div() + ..addProps(copyUnconsumedProps()) + )('rendered content'); +} + 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 new file mode 100644 index 000000000..acebe8b44 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.over_react.g.dart @@ -0,0 +1,468 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'namespaced_accessor_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $NamespacedAccessorTestComponentFactory = registerComponent( + () => new _$NamespacedAccessorTestComponent(), + builderFactory: NamespacedAccessorTest, + componentClass: NamespacedAccessorTestComponent, + isWrapper: false, + parentType: null, + displayName: 'NamespacedAccessorTest'); + +abstract class _$NamespacedAccessorTestPropsAccessorsMixin + implements _$NamespacedAccessorTestProps { + @override + Map get props; + + /// Go to [_$NamespacedAccessorTestProps.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$NamespacedAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestProps.stringProp] to see the source code for this prop + @override + set stringProp(String value) => + props[_$key__stringProp___$NamespacedAccessorTestProps] = value; + + /// Go to [_$NamespacedAccessorTestProps.dynamicProp] to see the source code for this prop + @override + dynamic get dynamicProp => + props[_$key__dynamicProp___$NamespacedAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestProps.dynamicProp] to see the source code for this prop + @override + set dynamicProp(dynamic value) => + props[_$key__dynamicProp___$NamespacedAccessorTestProps] = value; + + /// Go to [_$NamespacedAccessorTestProps.untypedProp] to see the source code for this prop + @override + get untypedProp => + props[_$key__untypedProp___$NamespacedAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestProps.untypedProp] to see the source code for this prop + @override + set untypedProp(value) => + props[_$key__untypedProp___$NamespacedAccessorTestProps] = value; + + /// Go to [_$NamespacedAccessorTestProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyProp => + props[_$key__customKeyProp___$NamespacedAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestProps.customKeyProp] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyProp(value) => + props[_$key__customKeyProp___$NamespacedAccessorTestProps] = value; + + /// Go to [_$NamespacedAccessorTestProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceProp => + props[_$key__customNamespaceProp___$NamespacedAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestProps.customNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceProp(value) => + props[_$key__customNamespaceProp___$NamespacedAccessorTestProps] = value; + + /// Go to [_$NamespacedAccessorTestProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceProp => + props[_$key__customKeyAndNamespaceProp___$NamespacedAccessorTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestProps.customKeyAndNamespaceProp] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceProp(value) => + props[_$key__customKeyAndNamespaceProp___$NamespacedAccessorTestProps] = + value; + /* GENERATED CONSTANTS */ + static const PropDescriptor + _$prop__stringProp___$NamespacedAccessorTestProps = + const PropDescriptor(_$key__stringProp___$NamespacedAccessorTestProps); + static const PropDescriptor + _$prop__dynamicProp___$NamespacedAccessorTestProps = + const PropDescriptor(_$key__dynamicProp___$NamespacedAccessorTestProps); + static const PropDescriptor + _$prop__untypedProp___$NamespacedAccessorTestProps = + const PropDescriptor(_$key__untypedProp___$NamespacedAccessorTestProps); + static const PropDescriptor + _$prop__customKeyProp___$NamespacedAccessorTestProps = + const PropDescriptor(_$key__customKeyProp___$NamespacedAccessorTestProps); + static const PropDescriptor + _$prop__customNamespaceProp___$NamespacedAccessorTestProps = + const PropDescriptor( + _$key__customNamespaceProp___$NamespacedAccessorTestProps); + static const PropDescriptor + _$prop__customKeyAndNamespaceProp___$NamespacedAccessorTestProps = + const PropDescriptor( + _$key__customKeyAndNamespaceProp___$NamespacedAccessorTestProps); + static const String _$key__stringProp___$NamespacedAccessorTestProps = + 'custom props class namespace**stringProp'; + static const String _$key__dynamicProp___$NamespacedAccessorTestProps = + 'custom props class namespace**dynamicProp'; + static const String _$key__untypedProp___$NamespacedAccessorTestProps = + 'custom props class namespace**untypedProp'; + static const String _$key__customKeyProp___$NamespacedAccessorTestProps = + 'custom props class namespace**custom key!'; + static const String + _$key__customNamespaceProp___$NamespacedAccessorTestProps = + 'custom namespace~~customNamespaceProp'; + static const String + _$key__customKeyAndNamespaceProp___$NamespacedAccessorTestProps = + 'custom namespace~~custom key!'; + + static const List $props = const [ + _$prop__stringProp___$NamespacedAccessorTestProps, + _$prop__dynamicProp___$NamespacedAccessorTestProps, + _$prop__untypedProp___$NamespacedAccessorTestProps, + _$prop__customKeyProp___$NamespacedAccessorTestProps, + _$prop__customNamespaceProp___$NamespacedAccessorTestProps, + _$prop__customKeyAndNamespaceProp___$NamespacedAccessorTestProps + ]; + static const List $propKeys = const [ + _$key__stringProp___$NamespacedAccessorTestProps, + _$key__dynamicProp___$NamespacedAccessorTestProps, + _$key__untypedProp___$NamespacedAccessorTestProps, + _$key__customKeyProp___$NamespacedAccessorTestProps, + _$key__customNamespaceProp___$NamespacedAccessorTestProps, + _$key__customKeyAndNamespaceProp___$NamespacedAccessorTestProps + ]; +} + +const PropsMeta _$metaForNamespacedAccessorTestProps = const PropsMeta( + fields: _$NamespacedAccessorTestPropsAccessorsMixin.$props, + keys: _$NamespacedAccessorTestPropsAccessorsMixin.$propKeys, +); + +class NamespacedAccessorTestProps extends _$NamespacedAccessorTestProps + with _$NamespacedAccessorTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForNamespacedAccessorTestProps; +} + +_$$NamespacedAccessorTestProps _$NamespacedAccessorTest([Map backingProps]) => + backingProps == null + ? new _$$NamespacedAccessorTestProps$JsMap(new JsBackedMap()) + : new _$$NamespacedAccessorTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$NamespacedAccessorTestProps + extends _$NamespacedAccessorTestProps + with _$NamespacedAccessorTestPropsAccessorsMixin + implements NamespacedAccessorTestProps { + _$$NamespacedAccessorTestProps._(); + + factory _$$NamespacedAccessorTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$NamespacedAccessorTestProps$JsMap(backingMap); + } else { + return new _$$NamespacedAccessorTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $NamespacedAccessorTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'custom props class namespace**'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$NamespacedAccessorTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$NamespacedAccessorTestStateAccessorsMixin + implements _$NamespacedAccessorTestState { + @override + Map get state; + + /// Go to [_$NamespacedAccessorTestState.stringState] to see the source code for this prop + @override + String get stringState => + state[_$key__stringState___$NamespacedAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestState.stringState] to see the source code for this prop + @override + set stringState(String value) => + state[_$key__stringState___$NamespacedAccessorTestState] = value; + + /// Go to [_$NamespacedAccessorTestState.dynamicState] to see the source code for this prop + @override + dynamic get dynamicState => + state[_$key__dynamicState___$NamespacedAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestState.dynamicState] to see the source code for this prop + @override + set dynamicState(dynamic value) => + state[_$key__dynamicState___$NamespacedAccessorTestState] = value; + + /// Go to [_$NamespacedAccessorTestState.untypedState] to see the source code for this prop + @override + get untypedState => + state[_$key__untypedState___$NamespacedAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestState.untypedState] to see the source code for this prop + @override + set untypedState(value) => + state[_$key__untypedState___$NamespacedAccessorTestState] = value; + + /// Go to [_$NamespacedAccessorTestState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyState => + state[_$key__customKeyState___$NamespacedAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyState(value) => + state[_$key__customKeyState___$NamespacedAccessorTestState] = value; + + /// Go to [_$NamespacedAccessorTestState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceState => + state[_$key__customNamespaceState___$NamespacedAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceState(value) => + state[_$key__customNamespaceState___$NamespacedAccessorTestState] = value; + + /// Go to [_$NamespacedAccessorTestState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceState => + state[_$key__customKeyAndNamespaceState___$NamespacedAccessorTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$NamespacedAccessorTestState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceState(value) => + state[_$key__customKeyAndNamespaceState___$NamespacedAccessorTestState] = + value; + /* GENERATED CONSTANTS */ + static const StateDescriptor + _$prop__stringState___$NamespacedAccessorTestState = + const StateDescriptor(_$key__stringState___$NamespacedAccessorTestState); + static const StateDescriptor + _$prop__dynamicState___$NamespacedAccessorTestState = + const StateDescriptor(_$key__dynamicState___$NamespacedAccessorTestState); + static const StateDescriptor + _$prop__untypedState___$NamespacedAccessorTestState = + const StateDescriptor(_$key__untypedState___$NamespacedAccessorTestState); + static const StateDescriptor + _$prop__customKeyState___$NamespacedAccessorTestState = + const StateDescriptor( + _$key__customKeyState___$NamespacedAccessorTestState); + static const StateDescriptor + _$prop__customNamespaceState___$NamespacedAccessorTestState = + const StateDescriptor( + _$key__customNamespaceState___$NamespacedAccessorTestState); + static const StateDescriptor + _$prop__customKeyAndNamespaceState___$NamespacedAccessorTestState = + const StateDescriptor( + _$key__customKeyAndNamespaceState___$NamespacedAccessorTestState); + static const String _$key__stringState___$NamespacedAccessorTestState = + 'custom state class namespace**stringState'; + static const String _$key__dynamicState___$NamespacedAccessorTestState = + 'custom state class namespace**dynamicState'; + static const String _$key__untypedState___$NamespacedAccessorTestState = + 'custom state class namespace**untypedState'; + static const String _$key__customKeyState___$NamespacedAccessorTestState = + 'custom state class namespace**custom key!'; + static const String + _$key__customNamespaceState___$NamespacedAccessorTestState = + 'custom namespace~~customNamespaceState'; + static const String + _$key__customKeyAndNamespaceState___$NamespacedAccessorTestState = + 'custom namespace~~custom key!'; + + static const List $state = const [ + _$prop__stringState___$NamespacedAccessorTestState, + _$prop__dynamicState___$NamespacedAccessorTestState, + _$prop__untypedState___$NamespacedAccessorTestState, + _$prop__customKeyState___$NamespacedAccessorTestState, + _$prop__customNamespaceState___$NamespacedAccessorTestState, + _$prop__customKeyAndNamespaceState___$NamespacedAccessorTestState + ]; + static const List $stateKeys = const [ + _$key__stringState___$NamespacedAccessorTestState, + _$key__dynamicState___$NamespacedAccessorTestState, + _$key__untypedState___$NamespacedAccessorTestState, + _$key__customKeyState___$NamespacedAccessorTestState, + _$key__customNamespaceState___$NamespacedAccessorTestState, + _$key__customKeyAndNamespaceState___$NamespacedAccessorTestState + ]; +} + +const StateMeta _$metaForNamespacedAccessorTestState = const StateMeta( + fields: _$NamespacedAccessorTestStateAccessorsMixin.$state, + keys: _$NamespacedAccessorTestStateAccessorsMixin.$stateKeys, +); + +class NamespacedAccessorTestState extends _$NamespacedAccessorTestState + with _$NamespacedAccessorTestStateAccessorsMixin { + static const StateMeta meta = _$metaForNamespacedAccessorTestState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$NamespacedAccessorTestState + extends _$NamespacedAccessorTestState + with _$NamespacedAccessorTestStateAccessorsMixin + implements NamespacedAccessorTestState { + _$$NamespacedAccessorTestState._(); + + factory _$$NamespacedAccessorTestState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$NamespacedAccessorTestState$JsMap(backingMap); + } else { + return new _$$NamespacedAccessorTestState$PlainMap(backingMap); + } + } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$NamespacedAccessorTestState$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// The backing state map proxied by this class. + @override + Map get state => _state; + Map _state; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$NamespacedAccessorTestState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$NamespacedAccessorTestComponent + extends NamespacedAccessorTestComponent { + _$$NamespacedAccessorTestProps$JsMap _cachedTypedProps; + + @override + _$$NamespacedAccessorTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$NamespacedAccessorTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$NamespacedAccessorTestProps$JsMap(backingMap); + + @override + _$$NamespacedAccessorTestProps typedPropsFactory(Map backingMap) => + new _$$NamespacedAccessorTestProps(backingMap); + + _$$NamespacedAccessorTestState$JsMap _cachedTypedState; + @override + _$$NamespacedAccessorTestState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$NamespacedAccessorTestState$JsMap typedStateFactoryJs( + JsBackedMap backingMap) => + new _$$NamespacedAccessorTestState$JsMap(backingMap); + + @override + _$$NamespacedAccessorTestState typedStateFactory(Map backingMap) => + new _$$NamespacedAccessorTestState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$NamespacedAccessorTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForNamespacedAccessorTestProps + ]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.dart b/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.dart new file mode 100644 index 000000000..c2efcc647 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.dart @@ -0,0 +1,36 @@ +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'private_props_ddc_bug.over_react.g.dart'; + +main() { + test('sets private props correctly in `getDefaultProps`', () { + var instance = render((Foo())()); + + expect(instance, isNotNull); // sanity check + + var node = findDomNode(instance); + + expect(node.text, contains('some private value')); + }); +} + + +@Factory() +UiFactory Foo = _$Foo; + +@Props() +class _$FooProps extends UiProps { + String _privateProp; +} + +@Component() +class FooComponent extends UiComponent2 { + @override + Map getDefaultProps() => newProps().._privateProp = 'some private value'; + + @override + render() => (Dom.div())(props._privateProp); +} 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 new file mode 100644 index 000000000..13c68fe98 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.over_react.g.dart @@ -0,0 +1,146 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'private_props_ddc_bug.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $FooComponentFactory = registerComponent(() => new _$FooComponent(), + builderFactory: Foo, + componentClass: FooComponent, + isWrapper: false, + parentType: null, + displayName: 'Foo'); + +abstract class _$FooPropsAccessorsMixin implements _$FooProps { + @override + Map get props; + + /// Go to [_$FooProps._privateProp] to see the source code for this prop + @override + String get _privateProp => + props[_$key___privateProp___$FooProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$FooProps._privateProp] to see the source code for this prop + @override + set _privateProp(String value) => + props[_$key___privateProp___$FooProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop___privateProp___$FooProps = + const PropDescriptor(_$key___privateProp___$FooProps); + static const String _$key___privateProp___$FooProps = 'FooProps._privateProp'; + + static const List $props = const [ + _$prop___privateProp___$FooProps + ]; + static const List $propKeys = const [_$key___privateProp___$FooProps]; +} + +const PropsMeta _$metaForFooProps = const PropsMeta( + fields: _$FooPropsAccessorsMixin.$props, + keys: _$FooPropsAccessorsMixin.$propKeys, +); + +class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { + static const PropsMeta meta = _$metaForFooProps; +} + +_$$FooProps _$Foo([Map backingProps]) => backingProps == null + ? new _$$FooProps$JsMap(new JsBackedMap()) + : new _$$FooProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$FooProps extends _$FooProps + with _$FooPropsAccessorsMixin + implements FooProps { + _$$FooProps._(); + + factory _$$FooProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FooProps$JsMap(backingMap); + } else { + return new _$$FooProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'FooProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$FooProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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; + + @override + _$$FooProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FooProps$JsMap(backingMap); + + @override + _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$FooProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [_$metaForFooProps]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.dart new file mode 100644 index 000000000..2f05921c1 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.dart @@ -0,0 +1,153 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'dart:html'; + +import 'package:over_react/over_react.dart'; +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'required_accessor_integration_test.over_react.g.dart'; + +void main() { + group('properly identifies required props by', () { + group('throwing when a prop is required and not set', () { + test('on mount', () { + expect(() => render(ComponentTest()..nullable = true), + throwsPropError_Required('ComponentTestProps.required', 'This Prop is Required for testing purposes.') + ); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest()..nullable = true)(), mountNode), + throwsPropError_Required('ComponentTestProps.required', 'This Prop is Required for testing purposes.') + ); + }); + }); + + group('throwing when a prop is required and set to null', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..required = null + ..nullable = true + ), throwsPropError_Required('ComponentTestProps.required')); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect( + () => react_dom.render((ComponentTest() + ..required = null + ..nullable = true + )(), mountNode), + throwsPropError_Required('ComponentTestProps.required', 'This Prop is Required for testing purposes.') + ); + }); + }); + + group('throwing when a prop is nullable and not set', () { + test('on mount', () { + expect(() => render(ComponentTest()..required = true), + throwsPropError_Required('ComponentTestProps.nullable')); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest()..required = true)(), mountNode), + throwsPropError_Required('ComponentTestProps.nullable', 'This prop can be set to null!') + ); + }); + }); + + group('not throwing when a prop is required and set', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..nullable = true + ..required = true + ), returnsNormally); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode), returnsNormally); + }); + }); + + group('not throwing when a prop is nullable and set to null', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..nullable = null + ..required = true + ), returnsNormally); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest() + ..required = true + ..nullable = null + )(), mountNode), returnsNormally); + }); + }); + }); +} + +@Factory() +UiFactory ComponentTest = _$ComponentTest; + +@Props() +class _$ComponentTestProps extends UiProps { + @Accessor(isRequired: true, requiredErrorMessage: 'This Prop is Required for testing purposes.') + var required; + + @Accessor(isRequired: true, isNullable: true, requiredErrorMessage: 'This prop can be set to null!') + var nullable; +} + +@Component() +class ComponentTestComponent extends UiComponent2 { + @override + render() => Dom.div()(); +} + 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 new file mode 100644 index 000000000..88c8c089e --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.over_react.g.dart @@ -0,0 +1,190 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'required_accessor_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ComponentTestComponentFactory = registerComponent( + () => new _$ComponentTestComponent(), + builderFactory: ComponentTest, + componentClass: ComponentTestComponent, + isWrapper: false, + parentType: null, + displayName: 'ComponentTest'); + +abstract class _$ComponentTestPropsAccessorsMixin + implements _$ComponentTestProps { + @override + Map get props; + + /// Go to [_$ComponentTestProps.required] to see the source code for this prop + @override + @Accessor( + isRequired: true, + requiredErrorMessage: 'This Prop is Required for testing purposes.') + get required => + props[_$key__required___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.required] to see the source code for this prop + @override + @Accessor( + isRequired: true, + requiredErrorMessage: 'This Prop is Required for testing purposes.') + set required(value) => props[_$key__required___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.nullable] to see the source code for this prop + @override + @Accessor( + isRequired: true, + isNullable: true, + requiredErrorMessage: 'This prop can be set to null!') + get nullable => + props[_$key__nullable___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.nullable] to see the source code for this prop + @override + @Accessor( + isRequired: true, + isNullable: true, + requiredErrorMessage: 'This prop can be set to null!') + set nullable(value) => props[_$key__nullable___$ComponentTestProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__required___$ComponentTestProps = + const PropDescriptor(_$key__required___$ComponentTestProps, + isRequired: true, + errorMessage: 'This Prop is Required for testing purposes.'); + static const PropDescriptor _$prop__nullable___$ComponentTestProps = + const PropDescriptor(_$key__nullable___$ComponentTestProps, + isRequired: true, + isNullable: true, + errorMessage: 'This prop can be set to null!'); + static const String _$key__required___$ComponentTestProps = + 'ComponentTestProps.required'; + static const String _$key__nullable___$ComponentTestProps = + 'ComponentTestProps.nullable'; + + static const List $props = const [ + _$prop__required___$ComponentTestProps, + _$prop__nullable___$ComponentTestProps + ]; + static const List $propKeys = const [ + _$key__required___$ComponentTestProps, + _$key__nullable___$ComponentTestProps + ]; +} + +const PropsMeta _$metaForComponentTestProps = const PropsMeta( + fields: _$ComponentTestPropsAccessorsMixin.$props, + keys: _$ComponentTestPropsAccessorsMixin.$propKeys, +); + +class ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForComponentTestProps; +} + +_$$ComponentTestProps _$ComponentTest([Map backingProps]) => + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin + implements ComponentTestProps { + _$$ComponentTestProps._(); + + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$JsMap(backingMap); + } else { + return new _$$ComponentTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ComponentTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ComponentTestProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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; + + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); + + @override + _$$ComponentTestProps typedPropsFactory(Map backingMap) => + new _$$ComponentTestProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ComponentTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForComponentTestProps + ]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.dart b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.dart new file mode 100644 index 000000000..977f83068 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.dart @@ -0,0 +1,155 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'dart:html'; + +import 'package:over_react/over_react.dart'; +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'required_prop_integration_tests.over_react.g.dart'; + +void requiredPropsIntegrationTest() { + group('properly identifies required props by', () { + group('throwing when a prop is required and not set', () { + test('on mount', () { + expect(() => render(ComponentTest()..nullable = true), + throwsPropError_Required('ComponentTestProps.required', 'This Prop is Required for testing purposes.') + ); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest()..nullable = true)(), mountNode), + throwsPropError_Required('ComponentTestProps.required', 'This Prop is Required for testing purposes.') + ); + }); + }); + + group('throwing when a prop is required and set to null', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..required = null + ..nullable = true + ), throwsPropError_Required('ComponentTestProps.required')); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect( + () => react_dom.render((ComponentTest() + ..required = null + ..nullable = true + )(), mountNode), + throwsPropError_Required('ComponentTestProps.required', 'This Prop is Required for testing purposes.') + ); + }); + }); + + group('throwing when a prop is nullable and not set', () { + test('on mount', () { + expect(() => render(ComponentTest()..required = true), + throwsPropError_Required('ComponentTestProps.nullable')); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest()..required = true)(), mountNode), + throwsPropError_Required('ComponentTestProps.nullable', 'This prop can be set to null!') + ); + }); + }); + + group('not throwing when a prop is required and set', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..nullable = true + ..required = true + ), returnsNormally); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode), returnsNormally); + }); + }); + + group('not throwing when a prop is nullable and set to null', () { + test('on mount', () { + expect(() => render(ComponentTest() + ..nullable = null + ..required = true + ), returnsNormally); + }); + + test('on re-render', () { + var mountNode = new DivElement(); + react_dom.render((ComponentTest() + ..required = true + ..nullable = true + )(), mountNode); + + expect(() => react_dom.render((ComponentTest() + ..required = true + ..nullable = null + )(), mountNode), returnsNormally); + }); + }); + }); +} + +@Factory() +UiFactory ComponentTest = _$ComponentTest; + +@Props() +class _$ComponentTestProps extends UiProps { + // ignore: deprecated_member_use + @Required(message: 'This Prop is Required for testing purposes.') + var required; + + // ignore: deprecated_member_use + @Required(isNullable: true, message: 'This prop can be set to null!') + var nullable; +} + +@Component() +class ComponentTestComponent extends UiComponent2 { + @override + render() => Dom.div()(); +} + diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart new file mode 100644 index 000000000..16e14a020 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart @@ -0,0 +1,180 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'required_prop_integration_tests.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ComponentTestComponentFactory = registerComponent( + () => new _$ComponentTestComponent(), + builderFactory: ComponentTest, + componentClass: ComponentTestComponent, + isWrapper: false, + parentType: null, + displayName: 'ComponentTest'); + +abstract class _$ComponentTestPropsAccessorsMixin + implements _$ComponentTestProps { + @override + Map get props; + + /// Go to [_$ComponentTestProps.required] to see the source code for this prop + @override + @Required(message: 'This Prop is Required for testing purposes.') + get required => + props[_$key__required___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.required] to see the source code for this prop + @override + @Required(message: 'This Prop is Required for testing purposes.') + set required(value) => props[_$key__required___$ComponentTestProps] = value; + + /// Go to [_$ComponentTestProps.nullable] to see the source code for this prop + @override + @Required(isNullable: true, message: 'This prop can be set to null!') + get nullable => + props[_$key__nullable___$ComponentTestProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ComponentTestProps.nullable] to see the source code for this prop + @override + @Required(isNullable: true, message: 'This prop can be set to null!') + set nullable(value) => props[_$key__nullable___$ComponentTestProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__required___$ComponentTestProps = + const PropDescriptor(_$key__required___$ComponentTestProps, + isRequired: true, + errorMessage: 'This Prop is Required for testing purposes.'); + static const PropDescriptor _$prop__nullable___$ComponentTestProps = + const PropDescriptor(_$key__nullable___$ComponentTestProps, + isRequired: true, + isNullable: true, + errorMessage: 'This prop can be set to null!'); + static const String _$key__required___$ComponentTestProps = + 'ComponentTestProps.required'; + static const String _$key__nullable___$ComponentTestProps = + 'ComponentTestProps.nullable'; + + static const List $props = const [ + _$prop__required___$ComponentTestProps, + _$prop__nullable___$ComponentTestProps + ]; + static const List $propKeys = const [ + _$key__required___$ComponentTestProps, + _$key__nullable___$ComponentTestProps + ]; +} + +const PropsMeta _$metaForComponentTestProps = const PropsMeta( + fields: _$ComponentTestPropsAccessorsMixin.$props, + keys: _$ComponentTestPropsAccessorsMixin.$propKeys, +); + +class ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForComponentTestProps; +} + +_$$ComponentTestProps _$ComponentTest([Map backingProps]) => + backingProps == null + ? new _$$ComponentTestProps$JsMap(new JsBackedMap()) + : new _$$ComponentTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ComponentTestProps extends _$ComponentTestProps + with _$ComponentTestPropsAccessorsMixin + implements ComponentTestProps { + _$$ComponentTestProps._(); + + factory _$$ComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ComponentTestProps$JsMap(backingMap); + } else { + return new _$$ComponentTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ComponentTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ComponentTestProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$ComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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; + + @override + _$$ComponentTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ComponentTestProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ComponentTestProps$JsMap(backingMap); + + @override + _$$ComponentTestProps typedPropsFactory(Map backingMap) => + new _$$ComponentTestProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ComponentTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForComponentTestProps + ]; +} 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 new file mode 100644 index 000000000..5dd10ec14 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart @@ -0,0 +1,127 @@ +// Copyright 2016 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'stateful_component_integration_test.over_react.g.dart'; + +main() { + group('stateful component integration:', () { + test('state class cannot be instantiated directly', () { + expect(() { + new StatefulComponentTestState(); + }, throwsA(const TypeMatcher())); + }); + + test('renders a component from end to end, successfully reading state via typed getters', () { + var renderedInstance = render(StatefulComponentTest()()); + expect(renderedInstance, isNotNull); + + var node = findDomNode(renderedInstance); + expect(node.text, 'rendered content'); + expect(node.dataset, containsPair('state-string-state', '1')); + expect(node.dataset, containsPair('state-dynamic-state', '2')); + expect(node.dataset, containsPair('state-untyped-state', '3')); + expect(node.dataset, containsPair('state-custom-key-state', '4')); + expect(node.dataset, containsPair('state-custom-namespace-state', '5')); + expect(node.dataset, containsPair('state-custom-key-and-namespace-state', '6')); + }); + + group('generates state getters/setters with', () { + StatefulComponentTestComponent component; + + setUp(() { + var renderedInstance = render(StatefulComponentTest()()); + component = getDartComponent(renderedInstance); + }); + + test('prop keys using the props class name as a namespace and the prop name as the key by default', () { + expect(component.newState()..stringState = 'test', + containsPair('StatefulComponentTestState.stringState', 'test')); + + expect(component.newState()..dynamicState = 2, + containsPair('StatefulComponentTestState.dynamicState', 2)); + + expect(component.newState()..untypedState = false, + containsPair('StatefulComponentTestState.untypedState', false)); + }); + + test('custom prop keys', () { + expect(component.newState()..customKeyState = 'test', + containsPair('StatefulComponentTestState.custom key!', 'test')); + }); + + test('custom prop key namespaces', () { + expect(component.newState()..customNamespaceState = 'test', + containsPair('custom namespace~~customNamespaceState', 'test')); + }); + + test('custom prop keys and namespaces', () { + expect(component.newState()..customKeyAndNamespaceState = 'test', + containsPair('custom namespace~~custom key!', 'test')); + }); + }); + }); +} + + +@Factory() +UiFactory StatefulComponentTest = _$StatefulComponentTest; + +@Props() +class _$StatefulComponentTestProps extends UiProps {} + +@State() +class _$StatefulComponentTestState extends UiState { + String stringState; + dynamic dynamicState; + var untypedState; + + @Accessor(key: 'custom key!') + var customKeyState; + + @Accessor(keyNamespace: 'custom namespace~~') + var customNamespaceState; + + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + var customKeyAndNamespaceState; +} + +@Component() +class StatefulComponentTestComponent extends UiStatefulComponent2 { + @override + getInitialState() => (newState() + ..stringState = '1' + ..dynamicState = '2' + ..untypedState = '3' + ..customKeyState = '4' + ..customNamespaceState = '5' + ..customKeyAndNamespaceState = '6' + ); + + @override + render() => (Dom.div() + ..addProps(copyUnconsumedProps()) + ..addProp('data-who', state.stringState) + ..addProp('data-state-string-state', state.stringState) + ..addProp('data-state-dynamic-state', state.dynamicState) + ..addProp('data-state-untyped-state', state.untypedState) + ..addProp('data-state-custom-key-state', state.customKeyState) + ..addProp('data-state-custom-namespace-state', state.customNamespaceState) + ..addProp('data-state-custom-key-and-namespace-state', state.customKeyAndNamespaceState) + )('rendered content'); +} + 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 new file mode 100644 index 000000000..e67d2262b --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.over_react.g.dart @@ -0,0 +1,353 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'stateful_component_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $StatefulComponentTestComponentFactory = registerComponent( + () => new _$StatefulComponentTestComponent(), + builderFactory: StatefulComponentTest, + componentClass: StatefulComponentTestComponent, + isWrapper: false, + parentType: null, + displayName: 'StatefulComponentTest'); + +abstract class _$StatefulComponentTestPropsAccessorsMixin + implements _$StatefulComponentTestProps { + @override + Map get props; + + /* GENERATED CONSTANTS */ + + static const List $props = const []; + static const List $propKeys = const []; +} + +const PropsMeta _$metaForStatefulComponentTestProps = const PropsMeta( + fields: _$StatefulComponentTestPropsAccessorsMixin.$props, + keys: _$StatefulComponentTestPropsAccessorsMixin.$propKeys, +); + +class StatefulComponentTestProps extends _$StatefulComponentTestProps + with _$StatefulComponentTestPropsAccessorsMixin { + static const PropsMeta meta = _$metaForStatefulComponentTestProps; +} + +_$$StatefulComponentTestProps _$StatefulComponentTest([Map backingProps]) => + backingProps == null + ? new _$$StatefulComponentTestProps$JsMap(new JsBackedMap()) + : new _$$StatefulComponentTestProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$StatefulComponentTestProps + extends _$StatefulComponentTestProps + with _$StatefulComponentTestPropsAccessorsMixin + implements StatefulComponentTestProps { + _$$StatefulComponentTestProps._(); + + factory _$$StatefulComponentTestProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$StatefulComponentTestProps$JsMap(backingMap); + } else { + return new _$$StatefulComponentTestProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $StatefulComponentTestComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'StatefulComponentTestProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$StatefulComponentTestProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$StatefulComponentTestStateAccessorsMixin + implements _$StatefulComponentTestState { + @override + Map get state; + + /// Go to [_$StatefulComponentTestState.stringState] to see the source code for this prop + @override + String get stringState => + state[_$key__stringState___$StatefulComponentTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$StatefulComponentTestState.stringState] to see the source code for this prop + @override + set stringState(String value) => + state[_$key__stringState___$StatefulComponentTestState] = value; + + /// Go to [_$StatefulComponentTestState.dynamicState] to see the source code for this prop + @override + dynamic get dynamicState => + state[_$key__dynamicState___$StatefulComponentTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$StatefulComponentTestState.dynamicState] to see the source code for this prop + @override + set dynamicState(dynamic value) => + state[_$key__dynamicState___$StatefulComponentTestState] = value; + + /// Go to [_$StatefulComponentTestState.untypedState] to see the source code for this prop + @override + get untypedState => + state[_$key__untypedState___$StatefulComponentTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$StatefulComponentTestState.untypedState] to see the source code for this prop + @override + set untypedState(value) => + state[_$key__untypedState___$StatefulComponentTestState] = value; + + /// Go to [_$StatefulComponentTestState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + get customKeyState => + state[_$key__customKeyState___$StatefulComponentTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$StatefulComponentTestState.customKeyState] to see the source code for this prop + @override + @Accessor(key: 'custom key!') + set customKeyState(value) => + state[_$key__customKeyState___$StatefulComponentTestState] = value; + + /// Go to [_$StatefulComponentTestState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + get customNamespaceState => + state[_$key__customNamespaceState___$StatefulComponentTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$StatefulComponentTestState.customNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~') + set customNamespaceState(value) => + state[_$key__customNamespaceState___$StatefulComponentTestState] = value; + + /// Go to [_$StatefulComponentTestState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + get customKeyAndNamespaceState => + state[_$key__customKeyAndNamespaceState___$StatefulComponentTestState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$StatefulComponentTestState.customKeyAndNamespaceState] to see the source code for this prop + @override + @Accessor(keyNamespace: 'custom namespace~~', key: 'custom key!') + set customKeyAndNamespaceState(value) => + state[_$key__customKeyAndNamespaceState___$StatefulComponentTestState] = + value; + /* GENERATED CONSTANTS */ + static const StateDescriptor + _$prop__stringState___$StatefulComponentTestState = + const StateDescriptor(_$key__stringState___$StatefulComponentTestState); + static const StateDescriptor + _$prop__dynamicState___$StatefulComponentTestState = + const StateDescriptor(_$key__dynamicState___$StatefulComponentTestState); + static const StateDescriptor + _$prop__untypedState___$StatefulComponentTestState = + const StateDescriptor(_$key__untypedState___$StatefulComponentTestState); + static const StateDescriptor + _$prop__customKeyState___$StatefulComponentTestState = + const StateDescriptor( + _$key__customKeyState___$StatefulComponentTestState); + static const StateDescriptor + _$prop__customNamespaceState___$StatefulComponentTestState = + const StateDescriptor( + _$key__customNamespaceState___$StatefulComponentTestState); + static const StateDescriptor + _$prop__customKeyAndNamespaceState___$StatefulComponentTestState = + const StateDescriptor( + _$key__customKeyAndNamespaceState___$StatefulComponentTestState); + static const String _$key__stringState___$StatefulComponentTestState = + 'StatefulComponentTestState.stringState'; + static const String _$key__dynamicState___$StatefulComponentTestState = + 'StatefulComponentTestState.dynamicState'; + static const String _$key__untypedState___$StatefulComponentTestState = + 'StatefulComponentTestState.untypedState'; + static const String _$key__customKeyState___$StatefulComponentTestState = + 'StatefulComponentTestState.custom key!'; + static const String + _$key__customNamespaceState___$StatefulComponentTestState = + 'custom namespace~~customNamespaceState'; + static const String + _$key__customKeyAndNamespaceState___$StatefulComponentTestState = + 'custom namespace~~custom key!'; + + static const List $state = const [ + _$prop__stringState___$StatefulComponentTestState, + _$prop__dynamicState___$StatefulComponentTestState, + _$prop__untypedState___$StatefulComponentTestState, + _$prop__customKeyState___$StatefulComponentTestState, + _$prop__customNamespaceState___$StatefulComponentTestState, + _$prop__customKeyAndNamespaceState___$StatefulComponentTestState + ]; + static const List $stateKeys = const [ + _$key__stringState___$StatefulComponentTestState, + _$key__dynamicState___$StatefulComponentTestState, + _$key__untypedState___$StatefulComponentTestState, + _$key__customKeyState___$StatefulComponentTestState, + _$key__customNamespaceState___$StatefulComponentTestState, + _$key__customKeyAndNamespaceState___$StatefulComponentTestState + ]; +} + +const StateMeta _$metaForStatefulComponentTestState = const StateMeta( + fields: _$StatefulComponentTestStateAccessorsMixin.$state, + keys: _$StatefulComponentTestStateAccessorsMixin.$stateKeys, +); + +class StatefulComponentTestState extends _$StatefulComponentTestState + with _$StatefulComponentTestStateAccessorsMixin { + static const StateMeta meta = _$metaForStatefulComponentTestState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$StatefulComponentTestState + extends _$StatefulComponentTestState + with _$StatefulComponentTestStateAccessorsMixin + implements StatefulComponentTestState { + _$$StatefulComponentTestState._(); + + factory _$$StatefulComponentTestState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$StatefulComponentTestState$JsMap(backingMap); + } else { + return new _$$StatefulComponentTestState$PlainMap(backingMap); + } + } + + /// Let [UiState] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$StatefulComponentTestState$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// The backing state map proxied by this class. + @override + Map get state => _state; + Map _state; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$StatefulComponentTestState$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$StatefulComponentTestComponent extends StatefulComponentTestComponent { + _$$StatefulComponentTestProps$JsMap _cachedTypedProps; + + @override + _$$StatefulComponentTestProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$StatefulComponentTestProps$JsMap typedPropsFactoryJs( + JsBackedMap backingMap) => + new _$$StatefulComponentTestProps$JsMap(backingMap); + + @override + _$$StatefulComponentTestProps typedPropsFactory(Map backingMap) => + new _$$StatefulComponentTestProps(backingMap); + + _$$StatefulComponentTestState$JsMap _cachedTypedState; + @override + _$$StatefulComponentTestState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$StatefulComponentTestState$JsMap typedStateFactoryJs( + JsBackedMap backingMap) => + new _$$StatefulComponentTestState$JsMap(backingMap); + + @override + _$$StatefulComponentTestState typedStateFactory(Map backingMap) => + new _$$StatefulComponentTestState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$StatefulComponentTestProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForStatefulComponentTestProps + ]; +} diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.dart b/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.dart new file mode 100644 index 000000000..ef9daf59f --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.dart @@ -0,0 +1,42 @@ +import 'package:over_react/over_react.dart'; +import 'package:test/test.dart'; + +import '../../../../test_util/test_util.dart'; + +part 'unassigned_prop_integration_test.over_react.g.dart'; + +main() { + test('renders all children, even with unassigned props present', () { + var instance = render((Foo() + ..stringProp = 'some string value' + )()); + + expect(instance, isNotNull); // sanity check + + var node = findDomNode(instance); + + // This tests a workaround added to impl_generation.dart to add ` ?? null;` to the getters + // for props/state members. Details: + // without this workaround, this test would fail when compiled via DDC. + expect(node.text, contains('some string value')); + }); +} + + +@Factory() +UiFactory Foo = _$Foo; + +@Props() +class _$FooProps extends UiProps { + String stringProp; + String unassignedProp; +} + +@Component() +class FooComponent extends UiComponent2 { + @override + Map getDefaultProps() => newProps()..id = 'testId'; + + @override + render() => (Dom.div())(props.unassignedProp, props.stringProp); +} 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 new file mode 100644 index 000000000..2ee918475 --- /dev/null +++ b/test/over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.over_react.g.dart @@ -0,0 +1,163 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'unassigned_prop_integration_test.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $FooComponentFactory = registerComponent(() => new _$FooComponent(), + builderFactory: Foo, + componentClass: FooComponent, + isWrapper: false, + parentType: null, + displayName: 'Foo'); + +abstract class _$FooPropsAccessorsMixin implements _$FooProps { + @override + Map get props; + + /// Go to [_$FooProps.stringProp] to see the source code for this prop + @override + String get stringProp => + props[_$key__stringProp___$FooProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$FooProps.stringProp] to see the source code for this prop + @override + set stringProp(String value) => props[_$key__stringProp___$FooProps] = value; + + /// Go to [_$FooProps.unassignedProp] to see the source code for this prop + @override + String get unassignedProp => + props[_$key__unassignedProp___$FooProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$FooProps.unassignedProp] to see the source code for this prop + @override + set unassignedProp(String value) => + props[_$key__unassignedProp___$FooProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__stringProp___$FooProps = + const PropDescriptor(_$key__stringProp___$FooProps); + static const PropDescriptor _$prop__unassignedProp___$FooProps = + const PropDescriptor(_$key__unassignedProp___$FooProps); + static const String _$key__stringProp___$FooProps = 'FooProps.stringProp'; + static const String _$key__unassignedProp___$FooProps = + 'FooProps.unassignedProp'; + + static const List $props = const [ + _$prop__stringProp___$FooProps, + _$prop__unassignedProp___$FooProps + ]; + static const List $propKeys = const [ + _$key__stringProp___$FooProps, + _$key__unassignedProp___$FooProps + ]; +} + +const PropsMeta _$metaForFooProps = const PropsMeta( + fields: _$FooPropsAccessorsMixin.$props, + keys: _$FooPropsAccessorsMixin.$propKeys, +); + +class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { + static const PropsMeta meta = _$metaForFooProps; +} + +_$$FooProps _$Foo([Map backingProps]) => backingProps == null + ? new _$$FooProps$JsMap(new JsBackedMap()) + : new _$$FooProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$FooProps extends _$FooProps + with _$FooPropsAccessorsMixin + implements FooProps { + _$$FooProps._(); + + factory _$$FooProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$FooProps$JsMap(backingMap); + } else { + return new _$$FooProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $FooComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'FooProps.'; +} + +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 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; +} + +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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + _$$FooProps$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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; + + @override + _$$FooProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$FooProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$FooProps$JsMap(backingMap); + + @override + _$$FooProps typedPropsFactory(Map backingMap) => new _$$FooProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$FooProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [_$metaForFooProps]; +} diff --git a/test/over_react_component_declaration_test.dart b/test/over_react_component_declaration_test.dart index d6be011e0..a6e728fce 100644 --- a/test/over_react_component_declaration_test.dart +++ b/test/over_react_component_declaration_test.dart @@ -49,6 +49,16 @@ import 'over_react/component_declaration/builder_integration_tests/backwards_com import 'over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.dart' as backwards_compat_required_accessor_integration_test; import 'over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.dart' as backwards_compat_stateful_component_integration_test; import 'over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.dart' as backwards_compat_unassigned_prop_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/abstract_accessor_integration_test.dart' as component2_abstract_accessor_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/accessor_mixin_integration_test.dart' as component2_accessor_mixin_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/component_integration_test.dart' as component2_component_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.dart' as component2_constant_required_accessor_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/do_not_generate_accessor_integration_test.dart' as component2_do_not_generate_accessor_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/namespaced_accessor_integration_test.dart' as component2_namespaced_accessor_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/private_props_ddc_bug.dart' as component2_private_props_ddc_bug; +import 'over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.dart' as component2_required_accessor_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/stateful_component_integration_test.dart' as component2_stateful_component_integration_test; +import 'over_react/component_declaration/builder_integration_tests/component2/unassigned_prop_integration_test.dart' as component2_unassigned_prop_integration_test; main() { setClientConfiguration(); @@ -83,4 +93,15 @@ main() { backwards_compat_required_accessor_integration_test.main(); backwards_compat_stateful_component_integration_test.main(); backwards_compat_unassigned_prop_integration_test.main(); + + component2_abstract_accessor_integration_test.main(); + component2_accessor_mixin_integration_test.main(); + component2_do_not_generate_accessor_integration_test.main(); + component2_component_integration_test.main(); + component2_constant_required_accessor_integration_test.main(); + component2_private_props_ddc_bug.main(); + component2_namespaced_accessor_integration_test.main(); + component2_required_accessor_integration_test.main(); + component2_stateful_component_integration_test.main(); + component2_unassigned_prop_integration_test.main(); } From e4665a41c378904957342544a85313fb3e06b1d5 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 14 Mar 2019 14:31:35 -0700 Subject: [PATCH 22/39] Cleanup --- lib/over_react.dart | 1 + lib/src/builder/generation/declaration_parsing.dart | 6 +++++- lib/src/builder/generation/impl_generation.dart | 5 +++++ lib/src/component/dom_components.dart | 8 ++++++-- lib/src/component_declaration/builder_helpers.dart | 12 +++++++++++- lib/src/component_declaration/component_base.dart | 7 +++++++ 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lib/over_react.dart b/lib/over_react.dart index 89753eb0e..4fafab04a 100644 --- a/lib/over_react.dart +++ b/lib/over_react.dart @@ -27,6 +27,7 @@ export 'package:react/react.dart' show SyntheticUIEvent, SyntheticWheelEvent; +// FIXME use public entrypoint export 'package:react/src/react_client/js_backed_map.dart' show JsBackedMap; export 'package:react/react_client.dart' show setClientConfiguration, ReactElement, ReactComponentFactoryProxy; diff --git a/lib/src/builder/generation/declaration_parsing.dart b/lib/src/builder/generation/declaration_parsing.dart index dd6329cbe..71d69522e 100644 --- a/lib/src/builder/generation/declaration_parsing.dart +++ b/lib/src/builder/generation/declaration_parsing.dart @@ -485,6 +485,7 @@ class ParsedDeclarations { class ComponentNode extends NodeWithMeta { static const String _subtypeOfParamName = 'subtypeOf'; + /// Whether the component extends from Component2. final bool isComponent2; /// The value of the `subtypeOf` parameter passed in to this node's annotation. @@ -494,7 +495,10 @@ class ComponentNode extends NodeWithMeta type.name == 'Component2'), + // todo is there a better way to check against react's Component2? + : node.declaredElement.allSupertypes.any((type) { + return type.name == 'Component2'; + }), super(node) { // Perform special handling for the `subtypeOf` parameter of this node's annotation. // diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index cb5e000aa..e31fe71ba 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -754,6 +754,8 @@ class ImplGenerator { final classDeclaration = new StringBuffer(); if (isComponent2) { + // This class will only have a factory constructor that instantiates one + // of two subclasses. classDeclaration.write('abstract '); } classDeclaration.write('class $implName$typeParamsOnClass ' @@ -829,6 +831,7 @@ class ImplGenerator { final jsMapImplName = _jsMapAccessorImplClassNameFromImplClassName(implName); buffer ..writeln() + ..writeln('// Concrete $propsOrState implementation that can be backed by any [Map].') ..writeln('class $plainMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..writeln(' // This initializer of `_$propsOrState` to an empty map, as well as the reassignment') ..writeln(' // of `_$propsOrState` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217') @@ -843,6 +846,8 @@ class ImplGenerator { ..writeln(' Map _$propsOrState;') ..writeln('}') ..writeln() + ..writeln('// Concrete $propsOrState implementation that can only be backed by [JsMap],') + ..writeln('// allowing dart2js to compile more optimal code for key-value pair reads/writes.') ..writeln('class $jsMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..writeln(' // This initializer of `_$propsOrState` to an empty map, as well as the reassignment') ..writeln(' // of `_$propsOrState` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217') diff --git a/lib/src/component/dom_components.dart b/lib/src/component/dom_components.dart index 5cc23ade5..fe9a9ba30 100644 --- a/lib/src/component/dom_components.dart +++ b/lib/src/component/dom_components.dart @@ -45,7 +45,9 @@ class DomProps extends component_base.UiProps builder_helpers.GeneratedClass implements builder_helpers.UiProps { - // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 + // Initialize to a JsBackedMap so that copying can be optimized + // when converting props during ReactElement creation. + // todo generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2 DomProps(this.componentFactory, [Map props]) : this.props = props ?? new JsBackedMap(); @override @@ -67,7 +69,9 @@ class SvgProps extends component_base.UiProps builder_helpers.GeneratedClass implements DomProps { - // Wrap Map literal in parens to work around https://github.com/dart-lang/sdk/issues/24410 + // Initialize to a JsBackedMap so that copying can be optimized + // when converting props during ReactElement creation. + // todo generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2 SvgProps(this.componentFactory, [Map props]) : this.props = props ?? new JsBackedMap(); @override diff --git a/lib/src/component_declaration/builder_helpers.dart b/lib/src/component_declaration/builder_helpers.dart index 1066e3f39..9f547cf9c 100644 --- a/lib/src/component_declaration/builder_helpers.dart +++ b/lib/src/component_declaration/builder_helpers.dart @@ -15,10 +15,11 @@ library over_react.component_declaration.builder_helpers; import 'package:react/react_client.dart'; +// FIXME use public entrypoint +import 'package:react/src/react_client/js_backed_map.dart'; import './component_base.dart' as component_base; import './annotations.dart' as annotations; -import 'package:react/src/react_client/js_backed_map.dart'; export './annotations.dart'; export './component_base.dart' @@ -95,6 +96,15 @@ abstract class UiComponent2 extends component_base.UiCom @override @toBeGenerated TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); + + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + /// + /// This should be used where possible over [typedPropsFactory] to allow for + /// more efficient dart2js output. + @override + @toBeGenerated TProps typedPropsFactoryJs(JsBackedMap propsMap) => throw new UngeneratedError(member: #typedPropsFactoryJs); } diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 6cd0669b8..eb321806b 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -512,6 +512,13 @@ abstract class UiComponent2 extends react.Component2 imp /// /// Required to properly instantiate the generic [TProps] class. TProps typedPropsFactory(Map propsMap); + + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + /// + /// This should be used where possible over [typedPropsFactory] to allow for + /// more efficient dart2js output. TProps typedPropsFactoryJs(JsBackedMap propsMap); /// Returns a typed props object backed by a new Map. From bc5afbd6178435416f0e1a50ffd4e6e88ab2a816 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 14 Mar 2019 16:43:47 -0700 Subject: [PATCH 23/39] Use https dep override so Travis can pub get --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 303f8ff76..fa775f6e2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,6 @@ dev_dependencies: dependency_overrides: react: git: - url: git@github.com:cleandart/react-dart.git + url: https://github.com/cleandart/react-dart.git ref: c2eec28f0cf4189e15a61a49eef8863b77111924 # from 5.0.0-wip From 511963410573793fd3a7ac422466c74da2bb05f0 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Thu, 14 Mar 2019 16:44:35 -0700 Subject: [PATCH 24/39] Commit generated files --- .../component2/component_integration_test.over_react.g.dart | 3 +++ ...ant_required_accessor_integration_test.over_react.g.dart | 3 +++ ...not_generate_accessor_integration_test.over_react.g.dart | 6 ++++++ .../namespaced_accessor_integration_test.over_react.g.dart | 6 ++++++ .../component2/private_props_ddc_bug.over_react.g.dart | 3 +++ .../required_accessor_integration_test.over_react.g.dart | 3 +++ .../required_prop_integration_tests.over_react.g.dart | 3 +++ .../stateful_component_integration_test.over_react.g.dart | 6 ++++++ .../unassigned_prop_integration_test.over_react.g.dart | 3 +++ web/src/demo_components/button.over_react.g.dart | 6 ++++++ web/src/demo_components/button_group.over_react.g.dart | 6 ++++++ web/src/demo_components/list_group.over_react.g.dart | 3 +++ web/src/demo_components/list_group_item.over_react.g.dart | 3 +++ web/src/demo_components/progress.over_react.g.dart | 6 ++++++ web/src/demo_components/tag.over_react.g.dart | 3 +++ web/src/demo_components/toggle_button.over_react.g.dart | 6 ++++++ .../demo_components/toggle_button_group.over_react.g.dart | 6 ++++++ 17 files changed, 75 insertions(+) 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 51d7726f2..bdf0e7d6e 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,6 +179,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +// 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -194,6 +195,8 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 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 2fa33416b..de30204b2 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 @@ -110,6 +110,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +// 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -125,6 +126,8 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 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 aeddbfa83..e74807bbb 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 @@ -134,6 +134,7 @@ abstract class _$$DoNotGenerateAccessorTestProps String get propKeyNamespace => 'DoNotGenerateAccessorTestProps.'; } +// 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 @@ -150,6 +151,8 @@ class _$$DoNotGenerateAccessorTestProps$PlainMap 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 @@ -269,6 +272,7 @@ abstract class _$$DoNotGenerateAccessorTestState 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 @@ -285,6 +289,8 @@ class _$$DoNotGenerateAccessorTestState$PlainMap 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 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 acebe8b44..32f4ca83f 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 @@ -188,6 +188,7 @@ abstract class _$$NamespacedAccessorTestProps String get propKeyNamespace => 'custom props class namespace**'; } +// 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 @@ -204,6 +205,8 @@ class _$$NamespacedAccessorTestProps$PlainMap 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 @@ -378,6 +381,7 @@ abstract class _$$NamespacedAccessorTestState 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 @@ -394,6 +398,8 @@ class _$$NamespacedAccessorTestState$PlainMap 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 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 13c68fe98..73530793d 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 @@ -82,6 +82,7 @@ abstract class _$$FooProps extends _$FooProps String get propKeyNamespace => 'FooProps.'; } +// 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -97,6 +98,8 @@ class _$$FooProps$PlainMap extends _$$FooProps { 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 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 88c8c089e..d71bb265a 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 @@ -123,6 +123,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +// 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -138,6 +139,8 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart index 16e14a020..5dfb716b3 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart @@ -113,6 +113,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps String get propKeyNamespace => 'ComponentTestProps.'; } +// 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -128,6 +129,8 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 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 e67d2262b..1c44d07e1 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 @@ -74,6 +74,7 @@ abstract class _$$StatefulComponentTestProps String get propKeyNamespace => 'StatefulComponentTestProps.'; } +// 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 @@ -90,6 +91,8 @@ class _$$StatefulComponentTestProps$PlainMap 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 @@ -264,6 +267,7 @@ abstract class _$$StatefulComponentTestState 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 @@ -280,6 +284,8 @@ class _$$StatefulComponentTestState$PlainMap 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 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 2ee918475..3a1171bf7 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 @@ -99,6 +99,7 @@ abstract class _$$FooProps extends _$FooProps String get propKeyNamespace => 'FooProps.'; } +// 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -114,6 +115,8 @@ class _$$FooProps$PlainMap extends _$$FooProps { 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 4d7905c23..3c7fb684e 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -187,6 +187,7 @@ abstract class _$$ButtonProps extends _$ButtonProps String get propKeyNamespace => 'ButtonProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ButtonProps$PlainMap extends _$$ButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -202,6 +203,8 @@ class _$$ButtonProps$PlainMap extends _$$ButtonProps { 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 _$$ButtonProps$JsMap extends _$$ButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -257,6 +260,7 @@ abstract class _$$ButtonState extends _$ButtonState bool get $isClassGenerated => true; } +// Concrete state implementation that can be backed by any [Map]. class _$$ButtonState$PlainMap extends _$$ButtonState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -272,6 +276,8 @@ class _$$ButtonState$PlainMap extends _$$ButtonState { 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 _$$ButtonState$JsMap extends _$$ButtonState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index faafe0786..aa7f2e5f2 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -117,6 +117,7 @@ abstract class _$$ButtonGroupProps extends _$ButtonGroupProps String get propKeyNamespace => 'ButtonGroupProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -132,6 +133,8 @@ class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { 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 _$$ButtonGroupProps$JsMap extends _$$ButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -188,6 +191,7 @@ abstract class _$$ButtonGroupState extends _$ButtonGroupState bool get $isClassGenerated => true; } +// Concrete state implementation that can be backed by any [Map]. class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -203,6 +207,8 @@ class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { 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 _$$ButtonGroupState$JsMap extends _$$ButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index 19752ef00..ad6accba3 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -87,6 +87,7 @@ abstract class _$$ListGroupProps extends _$ListGroupProps String get propKeyNamespace => 'ListGroupProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -102,6 +103,8 @@ class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { 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 _$$ListGroupProps$JsMap extends _$$ListGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index f6307f89a..37dab3915 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -236,6 +236,7 @@ abstract class _$$ListGroupItemProps extends _$ListGroupItemProps String get propKeyNamespace => 'ListGroupItemProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -251,6 +252,8 @@ class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { 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 _$$ListGroupItemProps$JsMap extends _$$ListGroupItemProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index 55d15cf00..23e05e465 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -235,6 +235,7 @@ abstract class _$$ProgressProps extends _$ProgressProps String get propKeyNamespace => 'ProgressProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ProgressProps$PlainMap extends _$$ProgressProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -250,6 +251,8 @@ class _$$ProgressProps$PlainMap extends _$$ProgressProps { 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 _$$ProgressProps$JsMap extends _$$ProgressProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -318,6 +321,7 @@ abstract class _$$ProgressState extends _$ProgressState bool get $isClassGenerated => true; } +// Concrete state implementation that can be backed by any [Map]. class _$$ProgressState$PlainMap extends _$$ProgressState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -333,6 +337,8 @@ class _$$ProgressState$PlainMap extends _$$ProgressState { 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 _$$ProgressState$JsMap extends _$$ProgressState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index 08f466d66..da21a8a8a 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -97,6 +97,7 @@ abstract class _$$TagProps extends _$TagProps String get propKeyNamespace => 'TagProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$TagProps$PlainMap extends _$$TagProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -112,6 +113,8 @@ class _$$TagProps$PlainMap extends _$$TagProps { 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 _$$TagProps$JsMap extends _$$TagProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index 8b08db78e..139656abc 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -125,6 +125,7 @@ abstract class _$$ToggleButtonProps extends _$ToggleButtonProps String get propKeyNamespace => 'ToggleButtonProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -140,6 +141,8 @@ class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { 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 _$$ToggleButtonProps$JsMap extends _$$ToggleButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -230,6 +233,7 @@ abstract class _$$ToggleButtonState extends _$ToggleButtonState bool get $isClassGenerated => true; } +// Concrete state implementation that can be backed by any [Map]. class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -245,6 +249,8 @@ class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { 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 _$$ToggleButtonState$JsMap extends _$$ToggleButtonState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index acb926bc4..27d795f71 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -74,6 +74,7 @@ abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps String get propKeyNamespace => 'ToggleButtonGroupProps.'; } +// Concrete props implementation that can be backed by any [Map]. class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -89,6 +90,8 @@ class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { 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 _$$ToggleButtonGroupProps$JsMap extends _$$ToggleButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -146,6 +149,7 @@ abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState bool get $isClassGenerated => true; } +// Concrete state implementation that can be backed by any [Map]. class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 @@ -161,6 +165,8 @@ class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { 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 _$$ToggleButtonGroupState$JsMap extends _$$ToggleButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 From 147fcffd96b974edef3d197e50a126d3baf6b482 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Fri, 15 Mar 2019 09:34:14 -0700 Subject: [PATCH 25/39] Fix typo and commit generated files --- .../abstract_inheritance.over_react.g.dart | 4 +-- example/builder/basic.over_react.g.dart | 2 +- .../builder/basic_library.over_react.g.dart | 6 ++-- .../basic_with_state.over_react.g.dart | 4 +-- .../basic_with_type_params.over_react.g.dart | 2 +- .../generic_inheritance_sub.over_react.g.dart | 4 +-- ...eneric_inheritance_super.over_react.g.dart | 4 +-- .../private_component.over_react.g.dart | 4 +-- ...factory_public_component.over_react.g.dart | 2 +- .../builder/generation/impl_generation.dart | 6 ++-- .../component/resize_sensor.over_react.g.dart | 2 +- ...abstract_transition_test.over_react.g.dart | 4 +-- ...mponent_integration_test.over_react.g.dart | 2 +- ...ccessor_integration_test.over_react.g.dart | 2 +- ...ccessor_integration_test.over_react.g.dart | 4 +-- ...ccessor_integration_test.over_react.g.dart | 4 +-- .../private_props_ddc_bug.over_react.g.dart | 2 +- ...ccessor_integration_test.over_react.g.dart | 2 +- ...d_prop_integration_tests.over_react.g.dart | 2 +- ...mponent_integration_test.over_react.g.dart | 4 +-- ...ed_prop_integration_test.over_react.g.dart | 2 +- ...mponent_integration_test.over_react.g.dart | 4 +-- ...ccessor_integration_test.over_react.g.dart | 4 +-- ...ccessor_integration_test.over_react.g.dart | 8 ++--- ...ccessor_integration_test.over_react.g.dart | 8 ++--- .../private_props_ddc_bug.over_react.g.dart | 4 +-- ...ccessor_integration_test.over_react.g.dart | 4 +-- ...d_prop_integration_tests.over_react.g.dart | 4 +-- ...mponent_integration_test.over_react.g.dart | 8 ++--- ...ed_prop_integration_test.over_react.g.dart | 4 +-- ...mponent_integration_test.over_react.g.dart | 2 +- ...ccessor_integration_test.over_react.g.dart | 2 +- ...ccessor_integration_test.over_react.g.dart | 4 +-- ...ccessor_integration_test.over_react.g.dart | 4 +-- .../private_props_ddc_bug.over_react.g.dart | 2 +- ...ccessor_integration_test.over_react.g.dart | 2 +- ...d_prop_integration_tests.over_react.g.dart | 2 +- ...mponent_integration_test.over_react.g.dart | 4 +-- ...ed_prop_integration_test.over_react.g.dart | 2 +- .../test_a.over_react.g.dart | 2 +- .../test_b.over_react.g.dart | 2 +- .../extendedtype.over_react.g.dart | 2 +- .../type_inheritance/parent.over_react.g.dart | 2 +- .../subsubtype.over_react.g.dart | 2 +- .../subtype.over_react.g.dart | 2 +- .../flux_component_test.over_react.g.dart | 36 +++++++++---------- .../redux_component_test.over_react.g.dart | 6 ++-- ...ummy_composite_component.over_react.g.dart | 2 +- .../util/dom_util_test.over_react.g.dart | 2 +- ...prop_key_util_test_dart2.over_react.g.dart | 2 +- .../one_level_wrapper.over_react.g.dart | 2 +- .../two_level_wrapper.over_react.g.dart | 2 +- .../demo_components/button.over_react.g.dart | 8 ++--- .../button_group.over_react.g.dart | 8 ++--- .../list_group.over_react.g.dart | 4 +-- .../list_group_item.over_react.g.dart | 4 +-- .../progress.over_react.g.dart | 8 ++--- web/src/demo_components/tag.over_react.g.dart | 4 +-- .../toggle_button.over_react.g.dart | 8 ++--- .../toggle_button_group.over_react.g.dart | 8 ++--- 60 files changed, 128 insertions(+), 128 deletions(-) diff --git a/example/builder/abstract_inheritance.over_react.g.dart b/example/builder/abstract_inheritance.over_react.g.dart index f2f8d999c..8096b0d39 100644 --- a/example/builder/abstract_inheritance.over_react.g.dart +++ b/example/builder/abstract_inheritance.over_react.g.dart @@ -57,7 +57,7 @@ class _$$SubProps extends _$SubProps with _$SubPropsAccessorsMixin implements SubProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$SubProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -119,7 +119,7 @@ class _$$SubState extends _$SubState with _$SubStateAccessorsMixin implements SubState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$SubState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/basic.over_react.g.dart b/example/builder/basic.over_react.g.dart index 9b79de6d3..816767b00 100644 --- a/example/builder/basic.over_react.g.dart +++ b/example/builder/basic.over_react.g.dart @@ -133,7 +133,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/example/builder/basic_library.over_react.g.dart b/example/builder/basic_library.over_react.g.dart index 9fa777cdd..2e9a95a65 100644 --- a/example/builder/basic_library.over_react.g.dart +++ b/example/builder/basic_library.over_react.g.dart @@ -145,7 +145,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -214,7 +214,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -313,7 +313,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/example/builder/basic_with_state.over_react.g.dart b/example/builder/basic_with_state.over_react.g.dart index bbc0ed258..7370445fc 100644 --- a/example/builder/basic_with_state.over_react.g.dart +++ b/example/builder/basic_with_state.over_react.g.dart @@ -129,7 +129,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -194,7 +194,7 @@ class _$$BasicState extends _$BasicState with _$BasicStateAccessorsMixin implements BasicState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$BasicState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/basic_with_type_params.over_react.g.dart b/example/builder/basic_with_type_params.over_react.g.dart index e52074e1a..8019d49f9 100644 --- a/example/builder/basic_with_type_params.over_react.g.dart +++ b/example/builder/basic_with_type_params.over_react.g.dart @@ -79,7 +79,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/example/builder/generic_inheritance_sub.over_react.g.dart b/example/builder/generic_inheritance_sub.over_react.g.dart index 3055648b3..914b98d5b 100644 --- a/example/builder/generic_inheritance_sub.over_react.g.dart +++ b/example/builder/generic_inheritance_sub.over_react.g.dart @@ -63,7 +63,7 @@ class _$$GenericSubProps extends _$GenericSubProps with _$GenericSubPropsAccessorsMixin implements GenericSubProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSubProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -131,7 +131,7 @@ class _$$GenericSubState extends _$GenericSubState with _$GenericSubStateAccessorsMixin implements GenericSubState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSubState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/generic_inheritance_super.over_react.g.dart b/example/builder/generic_inheritance_super.over_react.g.dart index e256012d2..0f0663221 100644 --- a/example/builder/generic_inheritance_super.over_react.g.dart +++ b/example/builder/generic_inheritance_super.over_react.g.dart @@ -97,7 +97,7 @@ class _$$GenericSuperProps extends _$GenericSuperProps with _$GenericSuperPropsAccessorsMixin implements GenericSuperProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSuperProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -166,7 +166,7 @@ class _$$GenericSuperState extends _$GenericSuperState with _$GenericSuperStateAccessorsMixin implements GenericSuperState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$GenericSuperState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/private_component.over_react.g.dart b/example/builder/private_component.over_react.g.dart index 6e734995e..b44c4cbcb 100644 --- a/example/builder/private_component.over_react.g.dart +++ b/example/builder/private_component.over_react.g.dart @@ -59,7 +59,7 @@ class _$$_PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin implements _PrivateProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$_PrivateProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -121,7 +121,7 @@ class _$$_PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin implements _PrivateState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$_PrivateState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } diff --git a/example/builder/private_factory_public_component.over_react.g.dart b/example/builder/private_factory_public_component.over_react.g.dart index 31e0e7725..bbd5ec3d4 100644 --- a/example/builder/private_factory_public_component.over_react.g.dart +++ b/example/builder/private_factory_public_component.over_react.g.dart @@ -65,7 +65,7 @@ class _$$FormActionInputProps extends _$FormActionInputProps with _$FormActionInputPropsAccessorsMixin implements FormActionInputProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$FormActionInputProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } diff --git a/lib/src/builder/generation/impl_generation.dart b/lib/src/builder/generation/impl_generation.dart index e31fe71ba..8691c2948 100644 --- a/lib/src/builder/generation/impl_generation.dart +++ b/lib/src/builder/generation/impl_generation.dart @@ -789,7 +789,7 @@ class ImplGenerator { } 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217') + ..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(' $implName(Map backingMap) : this._$propsOrState = {} {') ..writeln(' this._$propsOrState = backingMap ?? {};') @@ -834,7 +834,7 @@ class ImplGenerator { ..writeln('// Concrete $propsOrState implementation that can be backed by any [Map].') ..writeln('class $plainMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..writeln(' // This initializer of `_$propsOrState` to an empty map, as well as the reassignment') - ..writeln(' // of `_$propsOrState` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217') + ..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(' $plainMapImplName(Map backingMap) : this._$propsOrState = {}, super._() {') ..writeln(' this._$propsOrState = backingMap ?? {};') @@ -850,7 +850,7 @@ class ImplGenerator { ..writeln('// allowing dart2js to compile more optimal code for key-value pair reads/writes.') ..writeln('class $jsMapImplName$typeParamsOnClass extends $implName$typeParamsOnSuper {') ..writeln(' // This initializer of `_$propsOrState` to an empty map, as well as the reassignment') - ..writeln(' // of `_$propsOrState` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217') + ..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(' $jsMapImplName(JsBackedMap backingMap) : this._$propsOrState = new JsBackedMap(), super._() {') ..writeln(' this._$propsOrState = backingMap ?? new JsBackedMap();') diff --git a/lib/src/component/resize_sensor.over_react.g.dart b/lib/src/component/resize_sensor.over_react.g.dart index 07831ee9c..4792517d5 100644 --- a/lib/src/component/resize_sensor.over_react.g.dart +++ b/lib/src/component/resize_sensor.over_react.g.dart @@ -48,7 +48,7 @@ class _$$ResizeSensorProps extends _$ResizeSensorProps with _$ResizeSensorPropsAccessorsMixin implements ResizeSensorProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ResizeSensorProps(Map backingMap) : this._props = {} { this._props = 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 0ec496aac..941b4b521 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 @@ -209,7 +209,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -261,7 +261,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart index fa8bf5dfa..66cd95fe1 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/component_integration_test.over_react.g.dart @@ -149,7 +149,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart index 3d1c90bbd..5fc3d413a 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/constant_required_accessor_integration_test.over_react.g.dart @@ -80,7 +80,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart index 53af450ae..ff5ab4b88 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/do_not_generate_accessor_integration_test.over_react.g.dart @@ -103,7 +103,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -210,7 +210,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart index ff7c64954..4ef397397 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/namespaced_accessor_integration_test.over_react.g.dart @@ -157,7 +157,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -319,7 +319,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart index ee7483c73..c0f1624e8 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/private_props_ddc_bug.over_react.g.dart @@ -54,7 +54,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart index 032adbc8f..85151117b 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_accessor_integration_test.over_react.g.dart @@ -93,7 +93,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart index 0d0b3d809..70789d967 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/required_prop_integration_tests.over_react.g.dart @@ -83,7 +83,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart index d8a9eda9a..8d165fb02 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/stateful_component_integration_test.over_react.g.dart @@ -43,7 +43,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -205,7 +205,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart index ef603740e..a007e8ed3 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/unassigned_prop_integration_test.over_react.g.dart @@ -71,7 +71,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 bdf0e7d6e..1634f2bcc 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 @@ -182,7 +182,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -199,7 +199,7 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 de30204b2..45373f1a4 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 @@ -113,7 +113,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -130,7 +130,7 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 e74807bbb..a48ad99ad 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 @@ -138,7 +138,7 @@ abstract class _$$DoNotGenerateAccessorTestProps 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -156,7 +156,7 @@ class _$$DoNotGenerateAccessorTestProps$PlainMap 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { @@ -276,7 +276,7 @@ abstract class _$$DoNotGenerateAccessorTestState 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -294,7 +294,7 @@ class _$$DoNotGenerateAccessorTestState$PlainMap 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 32f4ca83f..9b6f86093 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 @@ -192,7 +192,7 @@ abstract class _$$NamespacedAccessorTestProps 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -210,7 +210,7 @@ class _$$NamespacedAccessorTestProps$PlainMap 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { @@ -385,7 +385,7 @@ abstract class _$$NamespacedAccessorTestState 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -403,7 +403,7 @@ class _$$NamespacedAccessorTestState$PlainMap 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 73530793d..bb34ed074 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 @@ -85,7 +85,7 @@ abstract class _$$FooProps extends _$FooProps // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -102,7 +102,7 @@ class _$$FooProps$PlainMap extends _$$FooProps { // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 d71bb265a..62a310468 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 @@ -126,7 +126,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -143,7 +143,7 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { diff --git a/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart index 5dfb716b3..1f1b28cdc 100644 --- a/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/component2/required_prop_integration_tests.over_react.g.dart @@ -116,7 +116,7 @@ abstract class _$$ComponentTestProps extends _$ComponentTestProps // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -133,7 +133,7 @@ class _$$ComponentTestProps$PlainMap extends _$$ComponentTestProps { // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 1c44d07e1..87b40fdc9 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 @@ -78,7 +78,7 @@ abstract class _$$StatefulComponentTestProps 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -96,7 +96,7 @@ class _$$StatefulComponentTestProps$PlainMap 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { @@ -271,7 +271,7 @@ abstract class _$$StatefulComponentTestState 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -289,7 +289,7 @@ class _$$StatefulComponentTestState$PlainMap 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 3a1171bf7..7f9049a53 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 @@ -102,7 +102,7 @@ abstract class _$$FooProps extends _$FooProps // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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._() { @@ -119,7 +119,7 @@ class _$$FooProps$PlainMap extends _$$FooProps { // 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 = new JsBackedMap(), super._() { 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 a3e685d91..a11bff99c 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 @@ -154,7 +154,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 1294d2453..88b2aede3 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,7 +85,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 5a9b71b5c..5a72b4620 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 @@ -108,7 +108,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -220,7 +220,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 f465dbda6..798034f5b 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 @@ -162,7 +162,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -329,7 +329,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 58b95d1ae..8d74444f6 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 @@ -58,7 +58,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 32a950d28..cb4b2d23f 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 @@ -98,7 +98,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart index 518b42b41..687c2ef01 100644 --- a/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart +++ b/test/over_react/component_declaration/builder_integration_tests/required_prop_integration_tests.over_react.g.dart @@ -88,7 +88,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 63b3add97..4d2247aa9 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,7 +48,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -215,7 +215,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 a71d83c91..2954fbe8e 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 @@ -75,7 +75,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 353558f37..666204c4b 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 @@ -44,7 +44,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 56c39e9f3..15bf4b4fc 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 @@ -44,7 +44,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 e781c3596..18abe3063 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 @@ -49,7 +49,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 2c65b7a59..ee01fd6e9 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,7 +47,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 33da10f09..6f873f831 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 @@ -49,7 +49,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 f5ba8afdc..8fdbc7509 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,7 +48,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/flux_component_test.over_react.g.dart b/test/over_react/component_declaration/flux_component_test.over_react.g.dart index 5a0e31d3f..b61adcc88 100644 --- a/test/over_react/component_declaration/flux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/flux_component_test.over_react.g.dart @@ -47,7 +47,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -133,7 +133,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -220,7 +220,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -327,7 +327,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -414,7 +414,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -501,7 +501,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -588,7 +588,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -640,7 +640,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -725,7 +725,7 @@ class _$$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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -779,7 +779,7 @@ class _$$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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -865,7 +865,7 @@ class _$$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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -919,7 +919,7 @@ class _$$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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -1027,7 +1027,7 @@ class _$$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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -1080,7 +1080,7 @@ class _$$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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -1163,7 +1163,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -1215,7 +1215,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -1298,7 +1298,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } @@ -1350,7 +1350,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/test/over_react/component_declaration/redux_component_test.over_react.g.dart b/test/over_react/component_declaration/redux_component_test.over_react.g.dart index 325941663..9de9ee8b9 100644 --- a/test/over_react/component_declaration/redux_component_test.over_react.g.dart +++ b/test/over_react/component_declaration/redux_component_test.over_react.g.dart @@ -47,7 +47,7 @@ class _$$TestDefaultProps extends _$TestDefaultProps with _$TestDefaultPropsAccessorsMixin implements TestDefaultProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestDefaultProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -133,7 +133,7 @@ class _$$TestConnectProps extends _$TestConnectProps with _$TestConnectPropsAccessorsMixin implements TestConnectProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestConnectProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } @@ -218,7 +218,7 @@ class _$$TestPureProps extends _$TestPureProps with _$TestPurePropsAccessorsMixin implements TestPureProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TestPureProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 f8974c36d..5dbcc6ae8 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 @@ -107,7 +107,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 865443934..32c793026 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 @@ -46,7 +46,7 @@ class _$$DomTestProps extends _$DomTestProps with _$DomTestPropsAccessorsMixin implements DomTestProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$DomTestProps(Map backingMap) : this._props = {} { this._props = backingMap ?? {}; } 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 eb76cce40..e7f5adcd6 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 @@ -73,7 +73,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 4ceaaa248..c87127fe5 100644 --- a/test/test_util/one_level_wrapper.over_react.g.dart +++ b/test/test_util/one_level_wrapper.over_react.g.dart @@ -48,7 +48,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } 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 150c4f824..7488993e3 100644 --- a/test/test_util/two_level_wrapper.over_react.g.dart +++ b/test/test_util/two_level_wrapper.over_react.g.dart @@ -48,7 +48,7 @@ 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 work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // 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 ?? {}; } diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 3c7fb684e..1e0c17535 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -190,7 +190,7 @@ abstract class _$$ButtonProps extends _$ButtonProps // Concrete props implementation that can be backed by any [Map]. class _$$ButtonProps$PlainMap extends _$$ButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -207,7 +207,7 @@ class _$$ButtonProps$PlainMap extends _$$ButtonProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ButtonProps$JsMap extends _$$ButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -263,7 +263,7 @@ abstract class _$$ButtonState extends _$ButtonState // Concrete state implementation that can be backed by any [Map]. class _$$ButtonState$PlainMap extends _$$ButtonState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -280,7 +280,7 @@ class _$$ButtonState$PlainMap extends _$$ButtonState { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ButtonState$JsMap extends _$$ButtonState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index aa7f2e5f2..2c318983e 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -120,7 +120,7 @@ abstract class _$$ButtonGroupProps extends _$ButtonGroupProps // Concrete props implementation that can be backed by any [Map]. class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -137,7 +137,7 @@ class _$$ButtonGroupProps$PlainMap extends _$$ButtonGroupProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ButtonGroupProps$JsMap extends _$$ButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -194,7 +194,7 @@ abstract class _$$ButtonGroupState extends _$ButtonGroupState // Concrete state implementation that can be backed by any [Map]. class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -211,7 +211,7 @@ class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ButtonGroupState$JsMap extends _$$ButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ButtonGroupState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index ad6accba3..1d5c4dd4e 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -90,7 +90,7 @@ abstract class _$$ListGroupProps extends _$ListGroupProps // Concrete props implementation that can be backed by any [Map]. class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -107,7 +107,7 @@ class _$$ListGroupProps$PlainMap extends _$$ListGroupProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ListGroupProps$JsMap extends _$$ListGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index 37dab3915..59309cba1 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -239,7 +239,7 @@ abstract class _$$ListGroupItemProps extends _$ListGroupItemProps // Concrete props implementation that can be backed by any [Map]. class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupItemProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -256,7 +256,7 @@ class _$$ListGroupItemProps$PlainMap extends _$$ListGroupItemProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ListGroupItemProps$JsMap extends _$$ListGroupItemProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ListGroupItemProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index 23e05e465..e03db58e5 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -238,7 +238,7 @@ abstract class _$$ProgressProps extends _$ProgressProps // Concrete props implementation that can be backed by any [Map]. class _$$ProgressProps$PlainMap extends _$$ProgressProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -255,7 +255,7 @@ class _$$ProgressProps$PlainMap extends _$$ProgressProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ProgressProps$JsMap extends _$$ProgressProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -324,7 +324,7 @@ abstract class _$$ProgressState extends _$ProgressState // Concrete state implementation that can be backed by any [Map]. class _$$ProgressState$PlainMap extends _$$ProgressState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -341,7 +341,7 @@ class _$$ProgressState$PlainMap extends _$$ProgressState { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ProgressState$JsMap extends _$$ProgressState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ProgressState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index da21a8a8a..dd5f41d19 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -100,7 +100,7 @@ abstract class _$$TagProps extends _$TagProps // Concrete props implementation that can be backed by any [Map]. class _$$TagProps$PlainMap extends _$$TagProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TagProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -117,7 +117,7 @@ class _$$TagProps$PlainMap extends _$$TagProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$TagProps$JsMap extends _$$TagProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$TagProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index 139656abc..7201fa00c 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -128,7 +128,7 @@ abstract class _$$ToggleButtonProps extends _$ToggleButtonProps // Concrete props implementation that can be backed by any [Map]. class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -145,7 +145,7 @@ class _$$ToggleButtonProps$PlainMap extends _$$ToggleButtonProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ToggleButtonProps$JsMap extends _$$ToggleButtonProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -236,7 +236,7 @@ abstract class _$$ToggleButtonState extends _$ToggleButtonState // Concrete state implementation that can be backed by any [Map]. class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -253,7 +253,7 @@ class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ToggleButtonState$JsMap extends _$$ToggleButtonState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index 27d795f71..a5bb05ccf 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -77,7 +77,7 @@ abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps // Concrete props implementation that can be backed by any [Map]. class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupProps$PlainMap(Map backingMap) : this._props = {}, super._() { @@ -94,7 +94,7 @@ class _$$ToggleButtonGroupProps$PlainMap extends _$$ToggleButtonGroupProps { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ToggleButtonGroupProps$JsMap extends _$$ToggleButtonGroupProps { // This initializer of `_props` to an empty map, as well as the reassignment - // of `_props` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupProps$JsMap(JsBackedMap backingMap) : this._props = new JsBackedMap(), super._() { @@ -152,7 +152,7 @@ abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState // Concrete state implementation that can be backed by any [Map]. class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupState$PlainMap(Map backingMap) : this._state = {}, super._() { @@ -169,7 +169,7 @@ class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { // allowing dart2js to compile more optimal code for key-value pair reads/writes. class _$$ToggleButtonGroupState$JsMap extends _$$ToggleButtonGroupState { // This initializer of `_state` to an empty map, as well as the reassignment - // of `_state` in the constructor body is necessary work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 + // of `_state` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 _$$ToggleButtonGroupState$JsMap(JsBackedMap backingMap) : this._state = new JsBackedMap(), super._() { From f9c579297b76b67ccbaee07ae7aa318c4c870011 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Fri, 15 Mar 2019 14:53:47 -0700 Subject: [PATCH 26/39] DRY up DisposableManagerV7 impl, update deprecation warnings --- .../component_declaration/component_base.dart | 210 +----------------- .../disposable_manager_proxy.dart | 94 ++++++++ 2 files changed, 98 insertions(+), 206 deletions(-) create mode 100644 lib/src/component_declaration/disposable_manager_proxy.dart diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index eb321806b..f438dcdd1 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -31,6 +31,8 @@ import 'package:w_common/disposable.dart'; export 'package:over_react/src/component_declaration/component_type_checking.dart' show isComponentOfType, isValidElementOfType; +part 'disposable_manager_proxy.dart'; + /// Helper function that wraps react.registerComponent, and allows attachment of additional /// component factory metadata. /// @@ -127,9 +129,7 @@ typedef TProps BuilderOnlyUiFactory(); /// } /// /// > Related: [UiStatefulComponent] -abstract class UiComponent extends react.Component implements DisposableManagerV7 { - Disposable _disposableProxy; - +abstract class UiComponent extends react.Component with _DisposableManagerProxy { /// The props for the non-forwarding props defined in this component. Iterable get consumedProps => null; @@ -275,114 +275,12 @@ abstract class UiComponent extends react.Component imple // END Typed props helpers // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- - - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- - // BEGIN DisposableManagerV7 interface implementation - // - - @override - Future awaitBeforeDispose(Future future) => - _getDisposableProxy().awaitBeforeDispose(future); - - @override - Future getManagedDelayedFuture(Duration duration, T callback()) => - _getDisposableProxy().getManagedDelayedFuture(duration, callback); - - @override - ManagedDisposer getManagedDisposer(Disposer disposer) => _getDisposableProxy().getManagedDisposer(disposer); - - @override - Timer getManagedPeriodicTimer(Duration duration, void callback(Timer timer)) => - _getDisposableProxy().getManagedPeriodicTimer(duration, callback); - - @override - Timer getManagedTimer(Duration duration, void callback()) => - _getDisposableProxy().getManagedTimer(duration, callback); - - @override - StreamSubscription listenToStream( - Stream stream, void onData(T event), - {Function onError, void onDone(), bool cancelOnError}) => - _getDisposableProxy().listenToStream( - stream, onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); - - @override - Disposable manageAndReturnDisposable(Disposable disposable) => - _getDisposableProxy().manageAndReturnDisposable(disposable); - - @override - Completer manageCompleter(Completer completer) => - _getDisposableProxy().manageCompleter(completer); - - @override - void manageDisposable(Disposable disposable) => - _getDisposableProxy().manageDisposable(disposable); - - /// DEPRECATED. Use [getManagedDisposer] instead. - @Deprecated('2.0.0') - @override - void manageDisposer(Disposer disposer) => - _getDisposableProxy().manageDisposer(disposer); - - @override - void manageStreamController(StreamController controller) => - _getDisposableProxy().manageStreamController(controller); - - /// DEPRECATED. Use [listenToStream] instead. - @Deprecated('2.0.0') - @override - void manageStreamSubscription(StreamSubscription subscription) => - _getDisposableProxy().manageStreamSubscription(subscription); - - /// Instantiates a new [Disposable] instance on the first call to the - /// [DisposableManagerV7] method. - Disposable _getDisposableProxy() { - if (_disposableProxy == null) { - _disposableProxy = new Disposable(); - } - return _disposableProxy; - } - - /// Automatically dispose another object when this object is disposed. - /// - /// This method is an extension to `manageAndReturnDisposable` and returns the - /// passed in [Disposable] as its original type in addition to handling its - /// disposal. The method should be used when a variable is set and should - /// conditionally be managed for disposal. The most common case will be dealing - /// with optional parameters: - /// - /// class MyDisposable extends Disposable { - /// // This object also extends disposable - /// MyObject _internal; - /// - /// MyDisposable({MyObject optional}) { - /// // If optional is injected, we should not manage it. - /// // If we create our own internal reference we should manage it. - /// _internal = optional ?? - /// manageAndReturnTypedDisposable(new MyObject()); - /// } - /// - /// // ... - /// } - /// - /// The parameter may not be `null`. - @override - T manageAndReturnTypedDisposable(T disposable) => - _disposableProxy.manageAndReturnTypedDisposable(disposable); - - // - // END DisposableManagerV7 interface implementation - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- } -abstract class UiComponent2 extends react.Component2 implements DisposableManagerV7 { +abstract class UiComponent2 extends react.Component2 with _DisposableManagerProxy { @override Map getDefaultProps() => new JsBackedMap(); - Disposable _disposableProxy; - /// The props for the non-forwarding props defined in this component. Iterable get consumedProps => null; @@ -530,106 +428,6 @@ abstract class UiComponent2 extends react.Component2 imp // END Typed props helpers // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- - - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- - // BEGIN DisposableManagerV7 interface implementation - // - - @override - Future awaitBeforeDispose(Future future) => - _getDisposableProxy().awaitBeforeDispose(future); - - @override - Future getManagedDelayedFuture(Duration duration, T callback()) => - _getDisposableProxy().getManagedDelayedFuture(duration, callback); - - @override - ManagedDisposer getManagedDisposer(Disposer disposer) => _getDisposableProxy().getManagedDisposer(disposer); - - @override - Timer getManagedPeriodicTimer(Duration duration, void callback(Timer timer)) => - _getDisposableProxy().getManagedPeriodicTimer(duration, callback); - - @override - Timer getManagedTimer(Duration duration, void callback()) => - _getDisposableProxy().getManagedTimer(duration, callback); - - @override - StreamSubscription listenToStream( - Stream stream, void onData(T event), - {Function onError, void onDone(), bool cancelOnError}) => - _getDisposableProxy().listenToStream( - stream, onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); - - @override - Disposable manageAndReturnDisposable(Disposable disposable) => - _getDisposableProxy().manageAndReturnDisposable(disposable); - - @override - Completer manageCompleter(Completer completer) => - _getDisposableProxy().manageCompleter(completer); - - @override - void manageDisposable(Disposable disposable) => - _getDisposableProxy().manageDisposable(disposable); - - /// DEPRECATED. Use [getManagedDisposer] instead. - @Deprecated('2.0.0') - @override - void manageDisposer(Disposer disposer) => - _getDisposableProxy().manageDisposer(disposer); - - @override - void manageStreamController(StreamController controller) => - _getDisposableProxy().manageStreamController(controller); - - /// DEPRECATED. Use [listenToStream] instead. - @Deprecated('2.0.0') - @override - void manageStreamSubscription(StreamSubscription subscription) => - _getDisposableProxy().manageStreamSubscription(subscription); - - /// Instantiates a new [Disposable] instance on the first call to the - /// [DisposableManagerV7] method. - Disposable _getDisposableProxy() { - if (_disposableProxy == null) { - _disposableProxy = new Disposable(); - } - return _disposableProxy; - } - - /// Automatically dispose another object when this object is disposed. - /// - /// This method is an extension to `manageAndReturnDisposable` and returns the - /// passed in [Disposable] as its original type in addition to handling its - /// disposal. The method should be used when a variable is set and should - /// conditionally be managed for disposal. The most common case will be dealing - /// with optional parameters: - /// - /// class MyDisposable extends Disposable { - /// // This object also extends disposable - /// MyObject _internal; - /// - /// MyDisposable({MyObject optional}) { - /// // If optional is injected, we should not manage it. - /// // If we create our own internal reference we should manage it. - /// _internal = optional ?? - /// manageAndReturnTypedDisposable(new MyObject()); - /// } - /// - /// // ... - /// } - /// - /// The parameter may not be `null`. - @override - T manageAndReturnTypedDisposable(T disposable) => - _disposableProxy.manageAndReturnTypedDisposable(disposable); - - // - // END DisposableManagerV7 interface implementation - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- } /// The basis for a _stateful_ over_react component. diff --git a/lib/src/component_declaration/disposable_manager_proxy.dart b/lib/src/component_declaration/disposable_manager_proxy.dart new file mode 100644 index 000000000..8177d2dca --- /dev/null +++ b/lib/src/component_declaration/disposable_manager_proxy.dart @@ -0,0 +1,94 @@ +part of 'component_base.dart'; + +/// An implementation of [DisposableManagerV7] for use by +/// [UiComponent] and [UiComponent2]. +mixin _DisposableManagerProxy implements DisposableManagerV7 { + Disposable _disposableProxy; + + @override + Future awaitBeforeDispose(Future future) => + _getDisposableProxy().awaitBeforeDispose(future); + + @override + Future getManagedDelayedFuture(Duration duration, T callback()) => + _getDisposableProxy().getManagedDelayedFuture(duration, callback); + + @override + ManagedDisposer getManagedDisposer(Disposer disposer) => + _getDisposableProxy().getManagedDisposer(disposer); + + @override + Timer getManagedPeriodicTimer( + Duration duration, void callback(Timer timer)) => + _getDisposableProxy().getManagedPeriodicTimer(duration, callback); + + @override + Timer getManagedTimer(Duration duration, void callback()) => + _getDisposableProxy().getManagedTimer(duration, callback); + + @override + StreamSubscription listenToStream( + Stream stream, void onData(T event), + {Function onError, void onDone(), bool cancelOnError,}) => + _getDisposableProxy().listenToStream(stream, onData, + onError: onError, onDone: onDone, cancelOnError: cancelOnError); + + @override + Disposable manageAndReturnDisposable(Disposable disposable) => + _getDisposableProxy().manageAndReturnDisposable(disposable); + + @override + Completer manageCompleter(Completer completer) => + _getDisposableProxy().manageCompleter(completer); + + @override + void manageDisposable(Disposable disposable) => + _getDisposableProxy().manageDisposable(disposable); + + /// DEPRECATED. Use [getManagedDisposer] instead. + @Deprecated('w_common 2.0.0') + @override + void manageDisposer(Disposer disposer) => + _getDisposableProxy().manageDisposer(disposer); + + @override + void manageStreamController(StreamController controller) => + _getDisposableProxy().manageStreamController(controller); + + /// DEPRECATED. Use [listenToStream] instead. + @Deprecated('w_common 2.0.0') + @override + void manageStreamSubscription(StreamSubscription subscription) => + _getDisposableProxy().manageStreamSubscription(subscription); + + /// Instantiates a new [Disposable] instance on the first call to the + /// [DisposableManagerV7] method. + Disposable _getDisposableProxy() => _disposableProxy ??= new Disposable(); + + /// Automatically dispose another object when this object is disposed. + /// + /// This method is an extension to `manageAndReturnDisposable` and returns the + /// passed in [Disposable] as its original type in addition to handling its + /// disposal. The method should be used when a variable is set and should + /// conditionally be managed for disposal. The most common case will be dealing + /// with optional parameters: + /// + /// class MyDisposable extends Disposable { + /// // This object also extends disposable + /// MyObject _internal; + /// + /// MyDisposable({MyObject optional}) { + /// // If optional is injected, we should not manage it. + /// // If we create our own internal reference we should manage it. + /// _internal = optional ?? + /// manageAndReturnTypedDisposable(new MyObject()); + /// } + /// + /// // ... + /// } + /// + /// The parameter may not be `null`. + @override + T manageAndReturnTypedDisposable(T disposable) => + _disposableProxy.manageAndReturnTypedDisposable(disposable); +} From bd62327af257f5a16e8fd1d77e9d6f219be7ecd0 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Fri, 15 Mar 2019 15:28:30 -0700 Subject: [PATCH 27/39] Address compoennt_base feedback, organize better --- .../builder_helpers.dart | 147 +++++------- .../component_declaration/component_base.dart | 196 +--------------- .../component_base/component_base_2.dart | 222 ++++++++++++++++++ .../disposable_manager_proxy.dart | 16 +- 4 files changed, 299 insertions(+), 282 deletions(-) create mode 100644 lib/src/component_declaration/component_base/component_base_2.dart rename lib/src/component_declaration/{ => component_base}/disposable_manager_proxy.dart (84%) diff --git a/lib/src/component_declaration/builder_helpers.dart b/lib/src/component_declaration/builder_helpers.dart index 9f547cf9c..683782dbf 100644 --- a/lib/src/component_declaration/builder_helpers.dart +++ b/lib/src/component_declaration/builder_helpers.dart @@ -46,16 +46,8 @@ class GeneratedClass { } } - -/// See: [component_base.UiComponent] -/// -/// Use with the over_react builder via the `@Component()` ([annotations.Component]) annotation. -abstract class UiComponent extends component_base.UiComponent with GeneratedClass { - /// This class should not be instantiated directly, and throws an error to indicate this. - UiComponent() { - _throwIfNotGenerated(); - } - +mixin _GeneratedUiComponentStubs + on component_base.UiComponent, GeneratedClass { /// The default consumed props, taken from the keys generated in the associated @[annotations.Props] class. @toBeGenerated Iterable get $defaultConsumedProps => throw new UngeneratedError(member: #$defaultConsumedProps); @@ -74,116 +66,97 @@ abstract class UiComponent extends component_base.UiComp TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); } -abstract class UiComponent2 extends component_base.UiComponent2 with GeneratedClass { - /// This class should not be instantiated directly, and throws an error to indicate this. - UiComponent2() { - _throwIfNotGenerated(); - } - - /// The default consumed props, taken from the keys generated in the associated @[annotations.Props] class. - @toBeGenerated - Iterable get $defaultConsumedProps => throw new UngeneratedError(member: #$defaultConsumedProps); - - /// The keys for the non-forwarding props defined in this component. - /// - /// For generated components, this defaults to the keys generated in the associated @[annotations.Props] class - /// if this getter is not overridden. - @override - Iterable get consumedProps => $defaultConsumedProps; - - /// Returns a typed props object backed by the specified [propsMap]. - /// Required to properly instantiate the generic [TProps] class. - @override - @toBeGenerated - TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); - - /// Returns a typed props object backed by the specified [propsMap]. - /// - /// Required to properly instantiate the generic [TProps] class. +mixin _GeneratedUiStatefulComponentStubs + on component_base.UiStatefulComponent, GeneratedClass { + /// Returns a typed state object backed by the specified [stateMap]. /// - /// This should be used where possible over [typedPropsFactory] to allow for - /// more efficient dart2js output. + /// Required to properly instantiate the generic [TState] class. @override @toBeGenerated - TProps typedPropsFactoryJs(JsBackedMap propsMap) => throw new UngeneratedError(member: #typedPropsFactoryJs); + TState typedStateFactory(Map stateMap) => throw new UngeneratedError(member: #typedStateFactory, message: + '${#typedStateFactory}` should be implemented by code generation.\n\n' + 'This error may be due to your `UiState` class not being annotated with `@State()`,\n' + 'or because you are extending a stateful component without redeclaring your own `@State()`, like so:\n\n' + ' @State()\n' + ' class MyState extends SuperState {}\n' + ); } +/// See: [component_base.UiComponent] +/// +/// Use with the over_react builder via the `@Component()` ([annotations.Component]) annotation. +abstract class UiComponent + extends component_base.UiComponent + with + GeneratedClass, + _GeneratedUiComponentStubs { + /// This class should not be instantiated directly, and throws an error to indicate this. + UiComponent() { + _throwIfNotGenerated(); + } +} /// See: [component_base.UiStatefulComponent] /// /// Use with the over_react builder via the `@Component()` ([annotations.Component]) annotation. abstract class UiStatefulComponent - extends component_base.UiStatefulComponent with GeneratedClass { + extends component_base.UiStatefulComponent + with + GeneratedClass, + _GeneratedUiComponentStubs, + _GeneratedUiStatefulComponentStubs { /// This class should not be instantiated directly, and throws an error to indicate this. UiStatefulComponent() { _throwIfNotGenerated(); } +} - /// The default consumed prop keys, taken from the keys generated in the associated @[annotations.Props] class. - @toBeGenerated - Iterable get $defaultConsumedProps => throw new UngeneratedError(member: #$defaultConsumedProps); - - /// The keys for the non-forwarding props defined in this component. - /// - /// For generated components, this defaults to the keys generated in the associated @[annotations.Props] class - /// if this getter is not overridden. - @override - Iterable get consumedProps => $defaultConsumedProps; - +mixin _GeneratedUiComponent2Stubs + on component_base.UiComponent2, GeneratedClass { /// Returns a typed props object backed by the specified [propsMap]. /// /// Required to properly instantiate the generic [TProps] class. + /// + /// This should be used where possible over [typedPropsFactory] to allow for + /// more efficient dart2js output. @override @toBeGenerated - TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); + TProps typedPropsFactoryJs(JsBackedMap propsMap) => throw new UngeneratedError(member: #typedPropsFactoryJs); +} - /// Returns a typed state object backed by the specified [stateMap]. - /// - /// Required to properly instantiate the generic [TState] class. - @override @toBeGenerated TState typedStateFactory(Map stateMap) => throw new UngeneratedError(member: #typedStateFactory, message: - '${#typedStateFactory}` should be implemented by code generation.\n\n' - 'This error may be due to your `UiState` class not being annotated with `@State()`,\n' - 'or because you are extending a stateful component without redeclaring your own `@State()`, like so:\n\n' - ' @State()\n' - ' class MyState extends SuperState {}\n' - ); +abstract class UiComponent2 + extends component_base.UiComponent2 + with + GeneratedClass, + _GeneratedUiComponentStubs, + _GeneratedUiComponent2Stubs { + /// This class should not be instantiated directly, and throws an error to indicate this. + UiComponent2() { + _throwIfNotGenerated(); + } } abstract class UiStatefulComponent2 - extends component_base.UiStatefulComponent2 with GeneratedClass { + extends component_base.UiStatefulComponent2 + with + GeneratedClass, + _GeneratedUiComponentStubs, + _GeneratedUiComponent2Stubs, + _GeneratedUiStatefulComponentStubs { /// This class should not be instantiated directly, and throws an error to indicate this. UiStatefulComponent2() { _throwIfNotGenerated(); } - /// The default consumed prop keys, taken from the keys generated in the associated @[annotations.Props] class. - @toBeGenerated - Iterable get $defaultConsumedProps => throw new UngeneratedError(member: #$defaultConsumedProps); - - /// The keys for the non-forwarding props defined in this component. - /// - /// For generated components, this defaults to the keys generated in the associated @[annotations.Props] class - /// if this getter is not overridden. - @override - Iterable get consumedProps => $defaultConsumedProps; - - /// Returns a typed props object backed by the specified [propsMap]. + /// Returns a typed state object backed by the specified [stateMap]. /// - /// Required to properly instantiate the generic [TProps] class. - @override - @toBeGenerated - TProps typedPropsFactory(Map propsMap) => throw new UngeneratedError(member: #typedPropsFactory); - /// Returns a typed props object backed by the specified [propsMap]. + /// Required to properly instantiate the generic [TState] class. /// - /// Required to properly instantiate the generic [TProps] class. + /// This should be used where possible over [typedStateFactory] to allow for + /// more efficient dart2js output. @override @toBeGenerated - TProps typedPropsFactoryJs(JsBackedMap propsMap) => throw new UngeneratedError(member: #typedPropsFactoryJs); - - /// Returns a typed state object backed by the specified [stateMap]. - /// - /// Required to properly instantiate the generic [TState] class. - @override @toBeGenerated TState typedStateFactory(Map stateMap) => throw new UngeneratedError(member: #typedStateFactory, message: + TState typedStateFactoryJs(JsBackedMap stateMap) => throw new UngeneratedError(member: #typedStateFactory, message: '${#typedStateFactory}` should be implemented by code generation.\n\n' 'This error may be due to your `UiState` class not being annotated with `@State()`,\n' 'or because you are extending a stateful component without redeclaring your own `@State()`, like so:\n\n' diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index f438dcdd1..95a845970 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -31,7 +31,8 @@ import 'package:w_common/disposable.dart'; export 'package:over_react/src/component_declaration/component_type_checking.dart' show isComponentOfType, isValidElementOfType; -part 'disposable_manager_proxy.dart'; +part 'component_base/component_base_2.dart'; +part 'component_base/disposable_manager_proxy.dart'; /// Helper function that wraps react.registerComponent, and allows attachment of additional /// component factory metadata. @@ -277,159 +278,6 @@ abstract class UiComponent extends react.Component with // ---------------------------------------------------------------------- } -abstract class UiComponent2 extends react.Component2 with _DisposableManagerProxy { - @override - Map getDefaultProps() => new JsBackedMap(); - - /// The props for the non-forwarding props defined in this component. - Iterable get consumedProps => null; - - /// Returns a copy of this component's props with keys found in [consumedProps] omitted. - /// - /// > Should be used alongside [forwardingClassNameBuilder]. - /// - /// > Related [copyUnconsumedDomProps] - Map copyUnconsumedProps() { - var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; - - return copyProps(keySetsToOmit: consumedPropKeys); - } - - /// Returns a copy of this component's props with keys found in [consumedProps] and non-DOM props omitted. - /// - /// > Should be used alongside [forwardingClassNameBuilder]. - /// - /// > Related [copyUnconsumedProps] - Map copyUnconsumedDomProps() { - var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; - - return copyProps(onlyCopyDomProps: true, keySetsToOmit: consumedPropKeys); - } - - /// Returns a copy of this component's props with React props optionally omitted, and - /// with the specified [keysToOmit] and [keySetsToOmit] omitted. - Map copyProps({bool omitReservedReactProps: true, bool onlyCopyDomProps: false, Iterable keysToOmit, Iterable keySetsToOmit}) { - return getPropsToForward(this.props, - omitReactProps: omitReservedReactProps, - onlyCopyDomProps: onlyCopyDomProps, - keysToOmit: keysToOmit, - keySetsToOmit: keySetsToOmit - ); - } - - /// Throws a [PropError] if [appliedProps] are invalid. - /// - /// This is called automatically with the latest props available during [componentWillReceiveProps] and - /// [componentWillMount], and can also be called manually for custom validation. - /// - /// Override with a custom implementation to easily add validation (and don't forget to call super!) - /// - /// @mustCallSuper - /// void validateProps(Map appliedProps) { - /// super.validateProps(appliedProps); - /// - /// var tProps = typedPropsFactory(appliedProps); - /// if (tProps.items.length.isOdd) { - /// throw new PropError.value(tProps.items, 'items', 'must have an even number of items, because reasons'); - /// } - /// } - @mustCallSuper - void validateProps(Map appliedProps) { - validateRequiredProps(appliedProps); - } - - /// Validates that props with the `@requiredProp` annotation are present. - void validateRequiredProps(Map appliedProps) { - consumedProps?.forEach((ConsumedProps consumedProps) { - consumedProps.props.forEach((PropDescriptor prop) { - if (!prop.isRequired) return; - if (prop.isNullable && appliedProps.containsKey(prop.key)) return; - if (!prop.isNullable && appliedProps[prop.key] != null) return; - - throw new PropError.required(prop.key, prop.errorMessage); - }); - }); - } - - /// Returns a new ClassNameBuilder with className and blacklist values added from [CssClassPropsMixin.className] and - /// [CssClassPropsMixin.classNameBlacklist], if they are specified. - /// - /// This method should be used as the basis for the classNames of components receiving forwarded props. - /// - /// > Should be used alongside [copyUnconsumedProps] or [copyUnconsumedDomProps]. - ClassNameBuilder forwardingClassNameBuilder() { - return new ClassNameBuilder.fromProps(this.props); - } - - @override - @mustCallSuper - void componentWillReceiveProps(Map nextProps) { - if (inReactDevMode) { - validateProps(nextProps); - } - } - - @override - @mustCallSuper - void componentWillMount() { - if (inReactDevMode) { - validateProps(props); - } - } - - @override - @mustCallSuper - void componentWillUnmount() { - _disposableProxy?.dispose(); - } - - - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- - // BEGIN Typed props helpers - // - - /// A typed props object corresponding to the current untyped props Map ([unwrappedProps]). - /// - /// Created using [typedPropsFactory] and cached for each Map instance. - // FIXME explain that this needs to be concrete in Dart 2 for soundness; link to issue - @override - TProps get props { - throw new UngeneratedError(); - } - - /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. - @override - set props(Map value) => super.props = value; - - /// The props Map that will be used to create the typed [props] object. - Map get unwrappedProps => super.props; - set unwrappedProps(Map value) => super.props = value; - - /// Returns a typed props object backed by the specified [propsMap]. - /// - /// Required to properly instantiate the generic [TProps] class. - TProps typedPropsFactory(Map propsMap); - - /// Returns a typed props object backed by the specified [propsMap]. - /// - /// Required to properly instantiate the generic [TProps] class. - /// - /// This should be used where possible over [typedPropsFactory] to allow for - /// more efficient dart2js output. - TProps typedPropsFactoryJs(JsBackedMap propsMap); - - /// Returns a typed props object backed by a new Map. - /// - /// Convenient for use with [getDefaultProps]. - TProps newProps() => typedPropsFactoryJs(new JsBackedMap()); - - // - // END Typed props helpers - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- -} - /// The basis for a _stateful_ over_react component. /// /// Includes support for strongly-typed [UiState] in-addition-to the @@ -500,46 +348,6 @@ abstract class UiStatefulComponent extends UiComponent2 { - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- - // BEGIN Typed state helpers - // - - var _typedStateCache = new Expando(); - - /// A typed state object corresponding to the current untyped state Map ([unwrappedState]). - /// - /// Created using [typedStateFactory] and cached for each Map instance. - // FIXME explain that this needs to be concrete in Dart 2 for soundness; link to issue - @override - TState get state { - throw new UngeneratedError(); - } - /// Equivalent to setting [unwrappedState], but needed by react-dart to effect state changes. - @override - set state(Map value) => super.state = value; - - /// The state Map that will be used to create the typed [state] object. - Map get unwrappedState => super.state; - set unwrappedState(Map value) => super.state = value; - - /// Returns a typed state object backed by the specified [stateMap]. - /// - /// Required to properly instantiate the generic [TState] class. - TState typedStateFactory(Map stateMap); - - /// Returns a typed state object backed by a new Map. - /// - /// Convenient for use with [getInitialState] and [setState]. - TState newState() => typedStateFactory(new JsBackedMap()); - - // - // END Typed state helpers - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- -} - class _WarnOnModify extends MapView { //Used to customize warning based on whether the data is props or state bool isProps; diff --git a/lib/src/component_declaration/component_base/component_base_2.dart b/lib/src/component_declaration/component_base/component_base_2.dart new file mode 100644 index 000000000..89dddc774 --- /dev/null +++ b/lib/src/component_declaration/component_base/component_base_2.dart @@ -0,0 +1,222 @@ +// Copyright 2019 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +part of over_react.component_declaration.component_base; + +// FIXME 3.0.0-wip update doc comment +abstract class UiComponent2 extends react.Component2 + with _DisposableManagerProxy + implements UiComponent { + @override + Map getDefaultProps() => new JsBackedMap(); + + /// The props for the non-forwarding props defined in this component. + Iterable get consumedProps => null; + + /// Returns a copy of this component's props with keys found in [consumedProps] omitted. + /// + /// > Should be used alongside [forwardingClassNameBuilder]. + /// + /// > Related [copyUnconsumedDomProps] + Map copyUnconsumedProps() { + var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; + + return copyProps(keySetsToOmit: consumedPropKeys); + } + + /// Returns a copy of this component's props with keys found in [consumedProps] and non-DOM props omitted. + /// + /// > Should be used alongside [forwardingClassNameBuilder]. + /// + /// > Related [copyUnconsumedProps] + Map copyUnconsumedDomProps() { + var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; + + return copyProps(onlyCopyDomProps: true, keySetsToOmit: consumedPropKeys); + } + + /// Returns a copy of this component's props with React props optionally omitted, and + /// with the specified [keysToOmit] and [keySetsToOmit] omitted. + Map copyProps({bool omitReservedReactProps: true, bool onlyCopyDomProps: false, Iterable keysToOmit, Iterable keySetsToOmit}) { + return getPropsToForward(this.props, + omitReactProps: omitReservedReactProps, + onlyCopyDomProps: onlyCopyDomProps, + keysToOmit: keysToOmit, + keySetsToOmit: keySetsToOmit + ); + } + + /// Throws a [PropError] if [appliedProps] are invalid. + /// + /// This is called automatically with the latest props available during [componentWillReceiveProps] and + /// [componentWillMount], and can also be called manually for custom validation. + /// + /// Override with a custom implementation to easily add validation (and don't forget to call super!) + /// + /// @mustCallSuper + /// void validateProps(Map appliedProps) { + /// super.validateProps(appliedProps); + /// + /// var tProps = typedPropsFactory(appliedProps); + /// if (tProps.items.length.isOdd) { + /// throw new PropError.value(tProps.items, 'items', 'must have an even number of items, because reasons'); + /// } + /// } + @mustCallSuper + void validateProps(Map appliedProps) { + validateRequiredProps(appliedProps); + } + + /// Validates that props with the `@requiredProp` annotation are present. + void validateRequiredProps(Map appliedProps) { + consumedProps?.forEach((ConsumedProps consumedProps) { + consumedProps.props.forEach((PropDescriptor prop) { + if (!prop.isRequired) return; + if (prop.isNullable && appliedProps.containsKey(prop.key)) return; + if (!prop.isNullable && appliedProps[prop.key] != null) return; + + throw new PropError.required(prop.key, prop.errorMessage); + }); + }); + } + + /// Returns a new ClassNameBuilder with className and blacklist values added from [CssClassPropsMixin.className] and + /// [CssClassPropsMixin.classNameBlacklist], if they are specified. + /// + /// This method should be used as the basis for the classNames of components receiving forwarded props. + /// + /// > Should be used alongside [copyUnconsumedProps] or [copyUnconsumedDomProps]. + ClassNameBuilder forwardingClassNameBuilder() { + return new ClassNameBuilder.fromProps(this.props); + } + + @override + @mustCallSuper + void componentWillReceiveProps(Map nextProps) { + if (inReactDevMode) { + validateProps(nextProps); + } + } + + @override + @mustCallSuper + void componentWillMount() { + if (inReactDevMode) { + validateProps(props); + } + } + + @override + @mustCallSuper + void componentWillUnmount() { + _disposableProxy?.dispose(); + } + + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // BEGIN Typed props helpers + // + + /// A typed props object corresponding to the current untyped props Map ([unwrappedProps]). + /// + /// Created using [typedPropsFactory] and cached for each Map instance. + @override + TProps get props { + // This needs to be a concrete implementation in Dart 2 for soundness; + // without it, you get a confusing error. See: https://github.com/dart-lang/sdk/issues/36191 + throw new UngeneratedError(); + } + + /// Equivalent to setting [unwrappedProps], but needed by react-dart to effect props changes. + @override + set props(Map value) => super.props = value; + + /// The props Map that will be used to create the typed [props] object. + Map get unwrappedProps => super.props; + set unwrappedProps(Map value) => super.props = value; + + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + TProps typedPropsFactory(Map propsMap); + + /// Returns a typed props object backed by the specified [propsMap]. + /// + /// Required to properly instantiate the generic [TProps] class. + /// + /// This should be used where possible over [typedPropsFactory] to allow for + /// more efficient dart2js output. + TProps typedPropsFactoryJs(JsBackedMap propsMap); + + /// Returns a typed props object backed by a new Map. + /// + /// Convenient for use with [getDefaultProps]. + TProps newProps() => typedPropsFactoryJs(new JsBackedMap()); + + // + // END Typed props helpers + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- +} + +// FIXME 3.0.0-wip update doc comment +abstract class UiStatefulComponent2 + extends UiComponent2 + implements UiStatefulComponent { + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- + // BEGIN Typed state helpers + // + + /// A typed state object corresponding to the current untyped state Map ([unwrappedState]). + /// + /// Created using [typedStateFactory] and cached for each Map instance. + @override + TState get state { + // This needs to be a concrete implementation in Dart 2 for soundness; + // without it, you get a confusing error. See: https://github.com/dart-lang/sdk/issues/36191 + throw new UngeneratedError(); + } + + /// Equivalent to setting [unwrappedState], but needed by react-dart to effect state changes. + @override + set state(Map value) => super.state = value; + + /// The state Map that will be used to create the typed [state] object. + Map get unwrappedState => super.state; + set unwrappedState(Map value) => super.state = value; + + /// Returns a typed state object backed by the specified [stateMap]. + /// + /// Required to properly instantiate the generic [TState] class. + TState typedStateFactory(Map stateMap); + + /// Returns a typed state object backed by the specified [stateMap]. + /// + /// Required to properly instantiate the generic [TState] class. + /// + /// This should be used where possible over [typedStateFactory] to allow for + /// more efficient dart2js output. + TState typedStateFactoryJs(JsBackedMap stateMap); + + /// Returns a typed state object backed by a new Map. + /// + /// Convenient for use with [getInitialState] and [setState]. + TState newState() => typedStateFactoryJs(new JsBackedMap()); + + // + // END Typed state helpers + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- +} diff --git a/lib/src/component_declaration/disposable_manager_proxy.dart b/lib/src/component_declaration/component_base/disposable_manager_proxy.dart similarity index 84% rename from lib/src/component_declaration/disposable_manager_proxy.dart rename to lib/src/component_declaration/component_base/disposable_manager_proxy.dart index 8177d2dca..0ee11bac9 100644 --- a/lib/src/component_declaration/disposable_manager_proxy.dart +++ b/lib/src/component_declaration/component_base/disposable_manager_proxy.dart @@ -1,4 +1,18 @@ -part of 'component_base.dart'; +// Copyright 2019 Workiva Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +part of over_react.component_declaration.component_base; /// An implementation of [DisposableManagerV7] for use by /// [UiComponent] and [UiComponent2]. From 9c6ae034a51db8c525f29dde585c6f9bce6f7b05 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Fri, 15 Mar 2019 15:34:25 -0700 Subject: [PATCH 28/39] Address other feedback, mark TODOs/FIXMEs with "3.0.0-wip" --- lib/over_react.dart | 2 +- .../builder/generation/declaration_parsing.dart | 4 ++-- lib/src/builder/generation/impl_generation.dart | 17 ++++++++++++++--- lib/src/component/dom_components.dart | 4 ++-- .../component_declaration/builder_helpers.dart | 2 +- pubspec.yaml | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/over_react.dart b/lib/over_react.dart index 4fafab04a..325fdc5a4 100644 --- a/lib/over_react.dart +++ b/lib/over_react.dart @@ -27,7 +27,7 @@ export 'package:react/react.dart' show SyntheticUIEvent, SyntheticWheelEvent; -// FIXME use public entrypoint +// FIXME 3.0.0-wip use public entrypoint export 'package:react/src/react_client/js_backed_map.dart' show JsBackedMap; export 'package:react/react_client.dart' show setClientConfiguration, ReactElement, ReactComponentFactoryProxy; diff --git a/lib/src/builder/generation/declaration_parsing.dart b/lib/src/builder/generation/declaration_parsing.dart index 71d69522e..7ffdc2fe4 100644 --- a/lib/src/builder/generation/declaration_parsing.dart +++ b/lib/src/builder/generation/declaration_parsing.dart @@ -493,9 +493,9 @@ class ComponentNode extends NodeWithMeta new $jsMapImplName(backingMap);') ..writeln(); } @@ -553,10 +553,21 @@ class ImplGenerator { return className.replaceFirst(privateSourcePrefix, '$privateSourcePrefix\$'); } + /// Converts the abstract generated props/state implementation's classname + /// into the name of its subclass that can be backed by any Map. + /// + /// Example: + /// Input: '_$$FooProps' + /// Output: '_$$FooProps$PlainMap' static String _plainMapAccessorsImplClassNameFromImplClassName(String implName) { return '$implName\$PlainMap'; } - + /// Converts the abstract generated props/state implementation's classname + /// into the name of its subclass that can be backed by only JsMaps. + /// + /// Example: + /// Input: '_$$FooProps' + /// Output: '_$$FooProps$JsMap' static String _jsMapAccessorImplClassNameFromImplClassName(String implName) { return '$implName\$JsMap'; } diff --git a/lib/src/component/dom_components.dart b/lib/src/component/dom_components.dart index fe9a9ba30..c6ed763d6 100644 --- a/lib/src/component/dom_components.dart +++ b/lib/src/component/dom_components.dart @@ -47,7 +47,7 @@ class DomProps extends component_base.UiProps builder_helpers.UiProps { // Initialize to a JsBackedMap so that copying can be optimized // when converting props during ReactElement creation. - // todo generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2 + // TODO 3.0.0-wip generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2 DomProps(this.componentFactory, [Map props]) : this.props = props ?? new JsBackedMap(); @override @@ -71,7 +71,7 @@ class SvgProps extends component_base.UiProps DomProps { // Initialize to a JsBackedMap so that copying can be optimized // when converting props during ReactElement creation. - // todo generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2 + // TODO 3.0.0-wip generate JsBackedMap-based implementation used when no backing map is provided, like we do for Component2 SvgProps(this.componentFactory, [Map props]) : this.props = props ?? new JsBackedMap(); @override diff --git a/lib/src/component_declaration/builder_helpers.dart b/lib/src/component_declaration/builder_helpers.dart index 683782dbf..564b7bf66 100644 --- a/lib/src/component_declaration/builder_helpers.dart +++ b/lib/src/component_declaration/builder_helpers.dart @@ -15,7 +15,7 @@ library over_react.component_declaration.builder_helpers; import 'package:react/react_client.dart'; -// FIXME use public entrypoint +// FIXME 3.0.0-wip use public entrypoint import 'package:react/src/react_client/js_backed_map.dart'; import './component_base.dart' as component_base; diff --git a/pubspec.yaml b/pubspec.yaml index fa775f6e2..a27ab5a1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,5 +45,5 @@ dependency_overrides: react: git: url: https://github.com/cleandart/react-dart.git - ref: c2eec28f0cf4189e15a61a49eef8863b77111924 # from 5.0.0-wip + ref: 5.0.0-wip From 96ed5a70bd02fc6e01184f475405c7d398991381 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Fri, 15 Mar 2019 15:39:37 -0700 Subject: [PATCH 29/39] Update CONTRIBUTING and PR_TEMPLATE, remove CODEOWNERS --- .github/CONTRIBUTING.md | 227 ------------------------------- .github/PULL_REQUEST_TEMPLATE.md | 41 +++++- CODEOWNERS | 1 - CONTRIBUTING.md | 195 ++++++++++++++++---------- 4 files changed, 157 insertions(+), 307 deletions(-) delete mode 100644 .github/CONTRIBUTING.md delete mode 100644 CODEOWNERS diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index a922f6ea6..000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,227 +0,0 @@ -# Contributing to OverReact - -Looking to contribute something to the over_react library? __Here's how you can help.__ - -+ __[Coding Standards](#coding-standards)__ - + [General Formatting Guidelines](#general-formatting-guidelines) -+ __[Using the Issue Tracker](#using-the-issue-tracker)__ - + [Reporting Bugs](#bug-reports) - + [Feature Requests](#feature-requests) - + [Submitting Pull Requests](#pull-requests) -+ __[Commit Message Standards](#git-commit-message-standards)__ -+ __[Developer Workflow](#developer-workflow)__ - - - - -## Coding standards - -A lot can be gained by writing code in a consistent way. Moreover, always remember that code is written and -maintained by _people_. Ensure your code is descriptive, well commented, and approachable by others. - -__ALWAYS__ adhere to the [Dart Style Guide]. _Please take the time to read it if you have never done so._ - -  - - -### General formatting guidelines - -+ __AVOID__ lines longer than 120 characters. -+ __AVOID__ using `dartfmt` as an excuse to ignore good judgement about - whether your code is readable and approachable by others. - -  -  - - - -## Using the issue tracker - -The issue tracker is the preferred channel for [bug reports](#bug-reports) and [feature requests](#feature-requests), -but __please follow the guidelines:__ - - + __Fill out the template we've provided.__ - - + __Be Professional__ - + Please __do not__ derail or troll issues. Keep the discussion on topic and respect the opinions of others. - - + __Not that Professional__ - + Feel free to include _relevant_ animated gifs to drive home your message / request. - -  - - -### Bug reports - -A bug is a _demonstrable problem_ that is caused by the code in the repository. - -_Good bug reports are extremely helpful - thank you!__ - -__Guidelines for bug reports:__ - -1. __Search for existing issues.__ Duplicate issues can become cumbersome, and you'd help us out a lot by first - checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a - fix available. - -2. __Record a screencast of yourself reproducing the issue__. - 1. Be sure the problem exists in over_react's code by building a - reduced test case that one of the reviewers can pull locally - and test out. - -3. __Share as much information as possible.__ Include operating system and version, browser and version, version of - `over_react`, etc. where appropriate. - -Always include steps to reproduce the bug. - -__Example Bug Report:__ - -> Short and descriptive example bug report title -> -> A summary of the issue and the browser/OS environment in which it occurs. If -> suitable, include the steps required to reproduce the bug. -> -> 1. This is the first step -> 2. This is the second step -> 3. Further steps, etc. -> -> `` - a link to branch with the reduced test case -> -> Any other information you want to share that is relevant to the issue being -> reported. This might include the lines of code that you have identified as -> causing the bug, and potential solutions (and your opinions on their -> merits). - -  - - -### Feature requests - -Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the -project. It's up to *you* to make a strong case to convince the `over_react` team of the merits of this feature. -Please provide as much detail and context as possible. - -  - - -### Pull requests - -Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope -and avoid containing unrelated commits. - -__Please ask first__ before embarking on any significant pull request (e.g. implementing features, refactoring code, -porting to a different language), otherwise you risk spending a lot of time working on something that the project's -lead developers might not want to merge into the project. - -Please adhere to the [Dart Style Guide] for all changes contained in your pull requests. - -Adhering to the following process is the best way to get your work included in the project: - -1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, - and configure the remotes: - - ```bash - # Navigate to the directory where you store repos locally - cd ~/your-local-git-repo-spot - # Clone your fork of the repo into the current directory - git clone git@github.com:/over_react - # Navigate to the newly cloned directory - cd ~/your-local-git-repo-spot/over_react - # Assign the repo you forked from to a remote called "upstream" - git remote add upstream git@github.com:Workiva/over_react - ``` - -2. If you cloned a while ago, get the latest changes from upstream: - - ```bash - git checkout master - git pull upstream master - ``` - -3. Create a new topic branch that will contain your feature, change, or fix: - - ```bash - git checkout -b - ``` - -4. Commit your changes in logical chunks. Please adhere to these - [git commit message guidelines](#git-commit-message-standards) or your code is unlikely be merged into the master - branch. Optionally, you can use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) - feature to tidy up your commits before making them public. - -5. Write tests for your changes. - 1. There are no exceptions. - 2. If you're having trouble, reach out in your PR about how to best go about testing your changes. - -6. If you have merge conflicts, locally merge the upstream master branch into your topic branch: - - ```bash - git pull upstream master - ``` - -7. Push your topic branch up to your fork: - - ```bash - git push origin - ``` - -8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) - with a clear title and description - following all the [issue guidelines](#using-the-issue-tracker) listed above. - -  -  - - - -## Git Commit Message Standards - -Below you will find an example commit message that follows the guidelines we would like all over_react contributors -to follow. - -``` -Capitalized, short (50 chars or less) summary - -More detailed explanatory text, if necessary. Wrap it to about 72 -characters or so. In some contexts, the first line is treated as the -subject of an email and the rest of the text as the body. The blank -line separating the summary from the body is critical (unless you omit -the body entirely); tools like rebase can get confused if you run the -two together. - -+ Bullet points are okay, too - -+ Typically a hyphen, asterisk or plus-symbol is used for the bullet, -followed by a single space, with blank lines in between, but -conventions vary here -``` - -Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up -with commit messages generated by commands like git merge and git revert. - -Further paragraphs come after blank lines. - -> [Read this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for more information on why a -> standardized commit message format is important. - -  -  - - - -## Developer Workflow - -The `over_react` developer workflow couldn't be any more simple! - -To serve the demos within `web/`, or start the transformer, run: - -```bash -pub serve -``` - -When you're ready to run the tests... run: - -```bash -pub run dart_dev test -``` - - -[Dart Style Guide]: https://www.dartlang.org/guides/language/effective-dart/style diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b27658a74..c1074fa24 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,45 @@ -## Ultimate problem: +## Motivation + +## Changes + -## How it was fixed: +#### Release Notes + +## Review +_[See CONTRIBUTING.md][contributing-review-types] for more details on review types (+1 / QA +1 / +10) and code review process._ -## Testing suggestions: + -> __FYA:__ @greglittlefield-wf @aaronlademann-wf @kealjones-wk @evanweible-wf @maxwellpeterson-wf +Please review: + +### QA Checklist +- [ ] Tests were updated and provide good coverage of the changeset and other affected code +- [ ] Manual testing was performed if needed + - [ ] Steps from PR author: + + - [ ] Anything falling under manual testing criteria [outlined in CONTRIBUTING.md][contributing-manual-testing] + +## Merge Checklist +While we perform many automated checks before auto-merging, some manual checks are needed: +- [ ] A Client Platform member has reviewed these changes +- [ ] There are no unaddressed comments _- this check can be automated if reviewers use the "Request Changes" feature_ +- [ ] _For release PRs -_ Version metadata in Rosie comment is correct + + +[contributing-review-types]: https://github.com/Workiva/over_react/blob/master/CONTRIBUTING.md#review-types +[contributing-manual-testing]: https://github.com/Workiva/over_react/blob/master/CONTRIBUTING.md#manual-testing-criteria diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 17a93a716..000000000 --- a/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @Workiva/app-frameworks diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9cd91172a..6fa46dc9f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,75 +1,124 @@ -# Contributing +# Contributing to over_react -> We are working on a more thorough version of these contributing guidlines. For -> the time being, we've documented our temporary dual-release setup that is -> necessary for supporting Dart 1 and Dart 2 concurrently. +- [__Support, Opening Issues__](#support-opening-issues) +- [__Contributing Changes__](#contributing-changes) + - [Coding Standards](#coding-standards) + - [Git Commit Message Standards](#git-commit-message-standards) +- [__Code Review Process and Merging Requirements__](#code-review-process-and-merging-requirements) + - [Minimum Required Review](#minimum-required-review) + - [Review Types](#review-types) + - [Manual Testing Criteria](#manual-testing-criteria) -## Dart 1 & Dart 2 Dual-Releases - -Long story short, we are unable to maintain a single codebase of over_react that -is compatible with both Dart 1 and Dart 2. Transformers only work on Dart 1 and -builders only work on Dart 2, and we can't maintain the transformer and builder -together due to dependency conflicts. - -> For more information on our Dart 2 migration, [see this guide](/doc/dart2_migration.md). - -Fortunately, this problem can be shouldered entirely by the maintainers via a -dual-release strategy (credit to the [dart2_constant](https://pub.dartlang.org/packages/dart2_constant) -for the idea). The result is that consumers will depend on a version range of -this library like they normally do and everything will _just work_. - -For every _version_ we want to release, we will actually release two releases - -a Dart 1 (transformer) version and a Dart 2 (builder) version. These two -releases will have the same semantic version, but will have unique build -suffixes. The `pub` client will then decide which one to install based on their -`environment.sdk` constraints and the active Dart SDK version. - -### Branches - -- `master` - - Dart2-only - - Provides a builder - - Environment constraint: `>=2.1.0 <3.0.0` - -- `master_dart1` - - Dart1-only - - Provides a transformer - - Environment constraint: `>=1.24.3 <2.0.0` - -### Release Process - -> Note that these steps are intended to be followed by Workiva employees, and as -> such have some references to internal tooling. - -For every release, do the following: - -1. Ensure the next release versions exist in MARV: - - Name | Branch - ---- | ------ - over_react 2.x.x+dart1 | master_dart1 - over_react 2.x.x+dart2 | master - -1. Trigger the `over_react 2.x.x+dart1` release first and review the PR: - - - Ensure the updated `pubspec.yaml` version is correct, including the - `+dart1` suffix. - - - Ensure the build passes. - - - Merge the Dart 1 release and publish it to pub. - -1. Trigger the `over_react 2.x.x+dart2` release second and review the PR: - - - Ensure the updated `pubspec.yaml` version is correct. - - - Ensure the build passes. - - - **Add any necessary changelog updates to the Dart 2 version.** - - - Merge the Dart 2 release and publish it to pub. - -1. Re-recreate the Dart 1 release in MARV (it does not get recreated - automatically like the default release does). - -1. Add the `+dart2` suffix to the automatically created release. +--- + +## Support, Opening Issues +Have a bug to report or an improvement/feature to request? Please +[open an issue](https://github.com/Workiva/over_react/issues/new) and fill out +the issue template with as much detail as necessary. + +###### Workiva Employees +> __Contact us on Slack:__ [\#support-ui-platform](https://workiva.slack.com/app_redirect?channel=support-ui-platform) + +Have a bug to report or an improvement/feature to request? +Please contact us on Slack or [create a JIRA ticket](https://jira.atl.workiva.net/secure/CreateIssue!default.jspa?pid=CPLAT&component=over_react) +and fill out the description with as much detail as necessary. + +## Contributing Changes +If you're contributing a change to over_react, please follow this process: (and +thank you!) + +1. Before you start working on a larger contribution (e.g. implementing features, + refactoring code, etc.), you should get in touch with us first so that + we can help out and possibly guide you. + + Coordinating up front makes it much easier to avoid frustration later on. + +1. Commit your changes in logical chunks. Please adhere to these + [coding standards](#coding-standards) and + [Git commit message guidelines](#git-commit-message-standards). + +1. Write tests for your changes. + - There are very few exceptions. + - If you're having trouble, please reach out for testing advice. We'll be + happy to help! +1. Open a PR against the `master` branch and fill out the template with as much + detail as necessary. +1. See instructions in PR template for getting review on your changes. + + +### Coding Standards +A lot can be gained by writing code in a consistent way. Moreover, always +remember that code is written and maintained by _people_. Ensure your code is +descriptive, well commented, and approachable by others. + +- Dart + - Adhere to the official [Dart Style Guide][dart-style-guide]. _Please take the time to read it if you have never done so._ + - Format your code using `pub run dart_dev format` (this is enforced by a CI check) + + +### Git Commit Message Standards + +Read [this short post][git-commit-messages] for commit message guidelines (and more information on why standardized commit message format is important). + +[dart-style-guide]: https://www.dartlang.org/articles/style-guide/ +[git-commit-messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html + +## Code Review Process and Merging Requirements +For a PR to merge, it must: +1. Receive the minimum required review + - High-risk PRs (e.g., large number of lines changed, touching areas at high risk of regression, complex changes) + - __Two__ +1s + - QA +1 by someone other than the commit author + - All other PRs (including trivial changes) + - +1 + - QA +1 by someone other than the commit author + + ___NOTE: It does not matter whether the "+1" and "QA +1" come from the same reviewer (e.g., via a "+10").___ +2. Pass the merge checklist outlined in the PR template + + +### Review Types + +- __+1__ + - Reviewing code for correctness, robustness, maintainability, performance, etc. + - Reviewing tests for coverage, thoroughness, and clarity + - _This responsibility is shared with QA reviewers_ +- __QA +1__ + - Verifying that adequate tests have been has been added, and reviewing them + for coverage, thoroughness, and clarity + - _This responsibility is shared with code reviewers_ + - Verifying automated tests pass in CI (this is often done automatically by Rosie). + - Performing manual testing instructions, if they exist. (see criteria in the next section) + - __Must be done by someone other than the commit author.__ +- __+10__ + - Exactly equivalent to performing both a "+1" and a "QA +1", just combined into one step. + +## Manual Testing Criteria +Manual testing instructions (done as part of a "QA +1") should be included for the following scenarios. + +__If none of these apply, then manual testing instructions may be omitted.__ + +- When manual testing can help uncover areas of missed test coverage (in terms of certain scenarios and states, not just lines covered). + + _Examples:_ + - Running CLIs on several different projects to help catch edge-cases. + - Hammering on UI elements to ensure they react gracefully to different sequences of user input. + +- When tests run in CI do not fully exercise the desired behavior. + + _Examples:_ + - Changes were made in areas of the code that shouldn't be tested, like examples. + - Changes were made in areas of the code that are very difficult to fully test, and are more efficient to test manually. + - Changes need to be consumed in a certain library, harness, or deploy to be fully tested. + +- When CI tests do not fully protect against regressions to existing behavior. + + _Examples:_ + - Test coverage around code impacted by changes is sparse. + - Changes need to be integrated with another library to ensure nothing broke. + +- When changes are made to CI itself, and need to be manually verified. + + _Examples:_ + - Test runner was updated. + - New test suites were added. From 2240989c748f4d3a3bc7106e10ddc191f6488440 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Mon, 18 Mar 2019 13:10:20 -0700 Subject: [PATCH 30/39] Silence deprecations introduced by 5.0.0-wip, misc cleanup --- analysis_options.yaml | 1 - example/index.dart | 1 - lib/src/component/dummy_component.dart | 1 + .../built_redux_component.dart | 1 + lib/src/component_declaration/component_base.dart | 8 ++++++-- .../component_type_checking.dart | 5 +++++ lib/src/util/react_wrappers.dart | 15 ++++++++++++--- lib/src/util/validation_util.dart | 1 + .../component_base_test.dart | 7 ++++--- .../component_type_checking_test.dart | 2 ++ test/over_react/util/react_wrappers_test.dart | 5 +++++ web/src/demo_components/list_group.dart | 1 - 12 files changed, 37 insertions(+), 11 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 1b9e04758..53b338ea8 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,7 +5,6 @@ analyzer: linter: rules: - annotate_overrides - - avoid_as - avoid_empty_else - avoid_init_to_null - avoid_return_types_on_setters diff --git a/example/index.dart b/example/index.dart index fe2954cff..1f27d5392 100644 --- a/example/index.dart +++ b/example/index.dart @@ -1,7 +1,6 @@ import 'dart:html'; import 'package:over_react/over_react.dart'; -import 'package:react/react_client.dart' show ReactDartComponentFactoryProxy; import 'package:react/react_dom.dart' as react_dom; import './builder/abstract_inheritance.dart'; diff --git a/lib/src/component/dummy_component.dart b/lib/src/component/dummy_component.dart index f73b83ba2..dbce5076a 100644 --- a/lib/src/component/dummy_component.dart +++ b/lib/src/component/dummy_component.dart @@ -19,6 +19,7 @@ import 'package:react/react.dart' as react; /// Dummy component useful for: /// /// - Allowing sub-typing of components. +// ignore: deprecated_member_use class DummyComponent extends react.Component { @override render() => false; diff --git a/lib/src/component_declaration/built_redux_component.dart b/lib/src/component_declaration/built_redux_component.dart index 92f0ee7d5..226a7052b 100644 --- a/lib/src/component_declaration/built_redux_component.dart +++ b/lib/src/component_declaration/built_redux_component.dart @@ -99,6 +99,7 @@ abstract class BuiltReduxUiComponent< void redraw([callback()]) { _isDirty = true; + // ignore: deprecated_member_use super.redraw(() { _isDirty = false; diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 95a845970..4f344a53f 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -16,7 +16,6 @@ library over_react.component_declaration.component_base; import 'dart:async'; import 'dart:collection'; -import 'dart:html'; import 'package:meta/meta.dart'; import 'package:over_react/over_react.dart'; @@ -44,13 +43,16 @@ part 'component_base/disposable_manager_proxy.dart'; /// used as types for [isComponentOfType]/[getComponentFactory]. /// /// * [displayName]: the name of the component for use when debugging. +// ignore: deprecated_member_use ReactDartComponentFactoryProxy registerComponent(react.Component dartComponentFactory(), { bool isWrapper: false, + // ignore: deprecated_member_use ReactDartComponentFactoryProxy parentType, UiFactory builderFactory, Type componentClass, String displayName }) { + // ignore: deprecated_member_use ReactDartComponentFactoryProxy reactComponentFactory = react.registerComponent(dartComponentFactory); if (displayName != null) { @@ -71,6 +73,7 @@ ReactDartComponentFactoryProxy registerComponent(react.Component dartComponentFa /// __The result must be stored in a variable that is named very specifically:__ /// /// var $`AbstractComponentClassName`Factory = registerAbstractComponent(`AbstractComponentClassName`); +// ignore: deprecated_member_use ReactDartComponentFactoryProxy registerAbstractComponent(Type abstractComponentClass, {ReactDartComponentFactoryProxy parentType}) => registerComponent(() => new DummyComponent(), componentClass: abstractComponentClass, parentType: parentType); @@ -580,8 +583,9 @@ abstract class UiProps extends MapBase /// An unmodifiable map view of the default props for this component brought /// in from the [componentFactory]. + // ignore: deprecated_member_use Map get componentDefaultProps => componentFactory is ReactDartComponentFactoryProxy - // ignore: avoid_as + // ignore: avoid_as, deprecated_member_use ? (componentFactory as ReactDartComponentFactoryProxy).defaultProps : const {}; } diff --git a/lib/src/component_declaration/component_type_checking.dart b/lib/src/component_declaration/component_type_checking.dart index 7794149ba..16ebf8648 100644 --- a/lib/src/component_declaration/component_type_checking.dart +++ b/lib/src/component_declaration/component_type_checking.dart @@ -27,10 +27,12 @@ import 'package:react/react_client/react_interop.dart'; // ---------------------------------------------------------------------- +// ignore: deprecated_member_use Expando _typeAliasToFactory = new Expando(); /// Registers a type alias for the specified factory, so that [getComponentTypeFromAlias] can be /// called with [typeAlias] to retrieve [factory]'s [ReactClass] type. +// ignore: deprecated_member_use void registerComponentTypeAlias(ReactDartComponentFactoryProxy factory, dynamic typeAlias) { if (typeAlias != null) { _typeAliasToFactory[typeAlias] = factory; @@ -45,8 +47,10 @@ const String _componentTypeMetaKey = '_componentTypeMeta'; /// the component type of the specified [factory]. /// /// This meta is retrievable via [getComponentTypeMeta]. +// ignore: deprecated_member_use void setComponentTypeMeta(ReactDartComponentFactoryProxy factory, { bool isWrapper, + // ignore: deprecated_member_use ReactDartComponentFactoryProxy parentType }) { setProperty(factory.type, _componentTypeMetaKey, new ComponentTypeMeta(isWrapper, parentType)); @@ -109,6 +113,7 @@ class ComponentTypeMeta { /// isComponentOfType(Bar()(), Foo); // true (due to parent type-checking) /// /// > See: `subtypeOf` (within [annotations.Component]) + // ignore: deprecated_member_use final ReactDartComponentFactoryProxy parentType; ComponentTypeMeta(this.isWrapper, this.parentType); diff --git a/lib/src/util/react_wrappers.dart b/lib/src/util/react_wrappers.dart index fcbb1ae01..4c428e004 100644 --- a/lib/src/util/react_wrappers.dart +++ b/lib/src/util/react_wrappers.dart @@ -46,7 +46,8 @@ import 'package:react/react_dom.dart' as react_dom; /// Returns internal data structure used by react-dart to maintain the native Dart component /// for a given react-dart [ReactElement] or [ReactComponent] [instance]. ReactDartComponentInternal _getInternal(/* ReactElement|ReactComponent */ instance) => - (instance.props as InteropProps).internal; // ignore: avoid_as + // ignore: deprecated_member_use + (instance.props as InteropProps).internal; /// Returns the internal representation of a Dart component's props as maintained by react-dart. /// @@ -154,6 +155,7 @@ Map getProps(/* ReactElement|ReactComponent */ instance, {bool traverseWrappers: } /// Returns the DOM node associated with a mounted React component [instance], +// ignore: deprecated_member_use /// which can be a [ReactComponent]/[Element] or [react.Component]. /// /// This method simply wraps react.findDOMNode with strong typing for the return value @@ -186,8 +188,11 @@ bool _isCompositeComponent(dynamic object) { /// /// Handles both Dart and JS React components, returning the appropriate props structure for each type: /// -/// * For Dart components, existing props are read from [InteropProps.internal], which are then merged with +// ignore: deprecated_member_use +/// * For non-[react.Component2] Dart components, existing props are read from [InteropProps.internal], which are then merged with /// the new [newProps] and saved in a new [InteropProps] with the expected [ReactDartComponentInternal] structure. +/// * For [react.Component2] Dart components, [newProps] is passed through [ReactDartComponentFactoryProxy2.generateExtendedJsProps] +/// and then passed to React JS, which will merge the props normally. /// * Children are likewise copied and potentially overwritten with [newChildren] as expected. /// * For JS components, a copy of [newProps] is returned, since React will merge the props without any special handling. dynamic preparePropsChangeset(ReactElement element, Map newProps, [Iterable newChildren]) { @@ -216,7 +221,7 @@ dynamic preparePropsChangeset(ReactElement element, Map newProps, [Iterable newC } } } else { - // react-dart component + // react-dart Component (not Component2) Map oldExtendedProps = internal.props; Map extendedProps = new Map.from(oldExtendedProps); @@ -224,6 +229,7 @@ dynamic preparePropsChangeset(ReactElement element, Map newProps, [Iterable newC extendedProps.addAll(newProps); } + // ignore: deprecated_member_use propsChangeset = ReactDartComponentFactoryProxy.generateExtendedJsProps(extendedProps, newChildren ?? extendedProps['children']); } @@ -255,6 +261,7 @@ ReactElement cloneElement(ReactElement element, [Map props, Iterable children]) /// Returns the native Dart component associated with a mounted component [instance]. /// /// Returns `null` if the [instance] is not Dart-based _(an [Element] or a JS composite component)_. +// ignore: deprecated_member_use T getDartComponent(/* ReactElement|ReactComponent|Element */ instance) { if (instance is Element) { return null; @@ -307,6 +314,7 @@ T getDartComponent(/* ReactElement|ReactComponent|Ele /// /// The component instance will be of the type: /// +// ignore: deprecated_member_use /// * [react.Component] for Dart components /// * [ReactComponent] for JS composite components /// * [Element] for DOM components @@ -356,6 +364,7 @@ CallbackRef chainRef(ReactElement element, CallbackRef newCallbackRef) { // callback ref and converts the JS instance to the Dart component. // // So, we need to undo the wrapping around this chained ref and pass in the JS instance. + // ignore: deprecated_member_use existingRef(ref is react.Component ? ref.jsThis : ref); if (newCallbackRef != null) newCallbackRef(ref); diff --git a/lib/src/util/validation_util.dart b/lib/src/util/validation_util.dart index b1f82e5bc..43aad8da1 100644 --- a/lib/src/util/validation_util.dart +++ b/lib/src/util/validation_util.dart @@ -86,6 +86,7 @@ class ValidationUtil { if (isValidElement(data)) { window.console.log('props: ${prettyPrintMap(getProps(data))}'); + // ignore: deprecated_member_use } else if (data is react.Component) { window.console.log('props: ${data.props}'); } diff --git a/test/over_react/component_declaration/component_base_test.dart b/test/over_react/component_declaration/component_base_test.dart index 5f8923a9d..3ab97d5f9 100644 --- a/test/over_react/component_declaration/component_base_test.dart +++ b/test/over_react/component_declaration/component_base_test.dart @@ -478,6 +478,7 @@ main() { var renderedInstance = render(TestComponent()()); TestComponentComponent component = getDartComponent(renderedInstance); + // ignore: deprecated_member_use expect(component.ref('foo'), isNotNull); }); }); @@ -676,7 +677,7 @@ main() { component.awaitBeforeDispose(completer.future); // Add events to stream - component.manageDisposer(() async => streamController.add('disposalFuture')); // ignore: deprecated_member_use + component.manageDisposer(() async => streamController.add('disposalFuture')); // ignore: deprecated_member_use_from_same_package completer.future.then(streamController.add); // Perform events out of order @@ -772,7 +773,7 @@ main() { test('should call managed disposers', () async { var disposerCalled = false; - component.manageDisposer(() async => disposerCalled = true); // ignore: deprecated_member_use + component.manageDisposer(() async => disposerCalled = true); // ignore: deprecated_member_use_from_same_package expect(disposerCalled, isFalse); await unmountAndDisposal(); expect(disposerCalled, isTrue); @@ -795,7 +796,7 @@ main() { count: 0, reason: 'Did not expect event after cancelling subscription')); - component.manageStreamSubscription(streamSubscription); // ignore: deprecated_member_use + component.manageStreamSubscription(streamSubscription); // ignore: deprecated_member_use_from_same_package await unmountAndDisposal(); streamController diff --git a/test/over_react/component_declaration/component_type_checking_test.dart b/test/over_react/component_declaration/component_type_checking_test.dart index b5529451f..58b9c47ea 100644 --- a/test/over_react/component_declaration/component_type_checking_test.dart +++ b/test/over_react/component_declaration/component_type_checking_test.dart @@ -47,6 +47,7 @@ main() { test('returns the ReactClass type for a ReactDartComponentFactoryProxy', () { var reactClass = createTestReactClass(); + // ignore: deprecated_member_use var factory = new ReactDartComponentFactoryProxy(reactClass); expect(getComponentTypeFromAlias(factory), same(reactClass)); }); @@ -58,6 +59,7 @@ main() { test('returns the ReactClass type for an aliased ReactDartComponentFactoryProxy', () { var reactClass = createTestReactClass(); + // ignore: deprecated_member_use var factory = new ReactDartComponentFactoryProxy(reactClass); var typeAlias = new Object(); diff --git a/test/over_react/util/react_wrappers_test.dart b/test/over_react/util/react_wrappers_test.dart index 4c4385bf9..54e5eb121 100644 --- a/test/over_react/util/react_wrappers_test.dart +++ b/test/over_react/util/react_wrappers_test.dart @@ -1018,6 +1018,7 @@ main() { cloneElement(instanceWithRef, {'ref': chainedRef}) ); var component = getDartComponent(renderedInstance); + // ignore: deprecated_member_use expect(component, const TypeMatcher(), reason: 'test setup sanity check'); expect(calls, equals([ @@ -1083,6 +1084,7 @@ main() { cloneElement(instanceWithoutRef, {'ref': chainedRef}) ); var component = getDartComponent(renderedInstance); + // ignore: deprecated_member_use expect(component, const TypeMatcher(), reason: 'test setup sanity check'); expect(calls, equals([ @@ -1103,6 +1105,7 @@ main() { cloneElement(instanceWithRef, {'ref': chainedRef}) ); var component = getDartComponent(renderedInstance); + // ignore: deprecated_member_use expect(component, const TypeMatcher(), reason: 'test setup sanity check'); expect(calls, equals([ @@ -1136,6 +1139,7 @@ main() { /// Helper component for testing a Dart (react-dart) React component with cloneElement. final TestComponentFactory = react.registerComponent(() => new TestComponent()); +// ignore: deprecated_member_use class TestComponent extends react.Component { @override render() => Dom.div()(); @@ -1156,6 +1160,7 @@ class PlainObjectStyleMap { /// Helper component that renders whatever you tell it to. Necessary for rendering components with the 'ref' prop. final RenderingContainerComponentFactory = react.registerComponent(() => new RenderingContainerComponent()); +// ignore: deprecated_member_use class RenderingContainerComponent extends react.Component { @override render() => props['renderer'](); diff --git a/web/src/demo_components/list_group.dart b/web/src/demo_components/list_group.dart index ec3e735c3..ed8a40ab1 100644 --- a/web/src/demo_components/list_group.dart +++ b/web/src/demo_components/list_group.dart @@ -1,7 +1,6 @@ import 'package:over_react/over_react.dart'; import '../demo_components.dart'; -import 'package:react/react.dart' as react; part 'list_group.over_react.g.dart'; /// Bootstrap's `ListGroup` component is flexible and powerful for From da6591d731e9cc7b177476498098fbf6b9911d76 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Mon, 18 Mar 2019 13:10:58 -0700 Subject: [PATCH 31/39] Add overrides to Component-implemented methods, remove lifecycle-based validation --- .../component_base/component_base_2.dart | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/src/component_declaration/component_base/component_base_2.dart b/lib/src/component_declaration/component_base/component_base_2.dart index 89dddc774..a152020a9 100644 --- a/lib/src/component_declaration/component_base/component_base_2.dart +++ b/lib/src/component_declaration/component_base/component_base_2.dart @@ -22,6 +22,7 @@ abstract class UiComponent2 extends react.Component2 Map getDefaultProps() => new JsBackedMap(); /// The props for the non-forwarding props defined in this component. + @override Iterable get consumedProps => null; /// Returns a copy of this component's props with keys found in [consumedProps] omitted. @@ -29,6 +30,7 @@ abstract class UiComponent2 extends react.Component2 /// > Should be used alongside [forwardingClassNameBuilder]. /// /// > Related [copyUnconsumedDomProps] + @override Map copyUnconsumedProps() { var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; @@ -40,6 +42,7 @@ abstract class UiComponent2 extends react.Component2 /// > Should be used alongside [forwardingClassNameBuilder]. /// /// > Related [copyUnconsumedProps] + @override Map copyUnconsumedDomProps() { var consumedPropKeys = consumedProps?.map((ConsumedProps consumedProps) => consumedProps.keys) ?? const []; @@ -48,6 +51,7 @@ abstract class UiComponent2 extends react.Component2 /// Returns a copy of this component's props with React props optionally omitted, and /// with the specified [keysToOmit] and [keySetsToOmit] omitted. + @override Map copyProps({bool omitReservedReactProps: true, bool onlyCopyDomProps: false, Iterable keysToOmit, Iterable keySetsToOmit}) { return getPropsToForward(this.props, omitReactProps: omitReservedReactProps, @@ -74,11 +78,13 @@ abstract class UiComponent2 extends react.Component2 /// } /// } @mustCallSuper + @override void validateProps(Map appliedProps) { validateRequiredProps(appliedProps); } /// Validates that props with the `@requiredProp` annotation are present. + @override void validateRequiredProps(Map appliedProps) { consumedProps?.forEach((ConsumedProps consumedProps) { consumedProps.props.forEach((PropDescriptor prop) { @@ -97,26 +103,11 @@ abstract class UiComponent2 extends react.Component2 /// This method should be used as the basis for the classNames of components receiving forwarded props. /// /// > Should be used alongside [copyUnconsumedProps] or [copyUnconsumedDomProps]. + @override ClassNameBuilder forwardingClassNameBuilder() { return new ClassNameBuilder.fromProps(this.props); } - @override - @mustCallSuper - void componentWillReceiveProps(Map nextProps) { - if (inReactDevMode) { - validateProps(nextProps); - } - } - - @override - @mustCallSuper - void componentWillMount() { - if (inReactDevMode) { - validateProps(props); - } - } - @override @mustCallSuper void componentWillUnmount() { @@ -143,12 +134,15 @@ abstract class UiComponent2 extends react.Component2 set props(Map value) => super.props = value; /// The props Map that will be used to create the typed [props] object. + @override Map get unwrappedProps => super.props; + @override set unwrappedProps(Map value) => super.props = value; /// Returns a typed props object backed by the specified [propsMap]. /// /// Required to properly instantiate the generic [TProps] class. + @override TProps typedPropsFactory(Map propsMap); /// Returns a typed props object backed by the specified [propsMap]. @@ -162,6 +156,7 @@ abstract class UiComponent2 extends react.Component2 /// Returns a typed props object backed by a new Map. /// /// Convenient for use with [getDefaultProps]. + @override TProps newProps() => typedPropsFactoryJs(new JsBackedMap()); // @@ -194,12 +189,15 @@ abstract class UiStatefulComponent2 super.state = value; /// The state Map that will be used to create the typed [state] object. + @override Map get unwrappedState => super.state; + @override set unwrappedState(Map value) => super.state = value; /// Returns a typed state object backed by the specified [stateMap]. /// /// Required to properly instantiate the generic [TState] class. + @override TState typedStateFactory(Map stateMap); /// Returns a typed state object backed by the specified [stateMap]. @@ -213,6 +211,7 @@ abstract class UiStatefulComponent2 typedStateFactoryJs(new JsBackedMap()); // From 17fc4d1fd8be4ab099ab9786f7c6fa6aeeba46a0 Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Mon, 18 Mar 2019 13:43:08 -0700 Subject: [PATCH 32/39] Change examples back to UiComponent --- web/src/demo_components/button.dart | 2 +- .../demo_components/button.over_react.g.dart | 125 +++-------------- web/src/demo_components/button_group.dart | 4 +- .../button_group.over_react.g.dart | 126 +++--------------- web/src/demo_components/list_group.dart | 2 +- .../list_group.over_react.g.dart | 72 ++-------- web/src/demo_components/list_group_item.dart | 2 +- .../list_group_item.over_react.g.dart | 71 ++-------- web/src/demo_components/progress.dart | 2 +- .../progress.over_react.g.dart | 126 +++--------------- web/src/demo_components/tag.dart | 2 +- web/src/demo_components/tag.over_react.g.dart | 71 ++-------- .../toggle_button.over_react.g.dart | 126 +++--------------- .../toggle_button_group.over_react.g.dart | 125 +++-------------- 14 files changed, 119 insertions(+), 737 deletions(-) diff --git a/web/src/demo_components/button.dart b/web/src/demo_components/button.dart index 7a917eabe..3da1a4b69 100644 --- a/web/src/demo_components/button.dart +++ b/web/src/demo_components/button.dart @@ -78,7 +78,7 @@ class _$ButtonProps extends UiProps { class _$ButtonState extends UiState {} @Component() -class ButtonComponent extends UiStatefulComponent2 { +class ButtonComponent extends UiStatefulComponent { @override Map getDefaultProps() => (newProps() ..skin = ButtonSkin.PRIMARY diff --git a/web/src/demo_components/button.over_react.g.dart b/web/src/demo_components/button.over_react.g.dart index 1e0c17535..96719c488 100644 --- a/web/src/demo_components/button.over_react.g.dart +++ b/web/src/demo_components/button.over_react.g.dart @@ -154,26 +154,25 @@ class ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin { static const PropsMeta meta = _$metaForButtonProps; } -_$$ButtonProps _$Button([Map backingProps]) => backingProps == null - ? new _$$ButtonProps$JsMap(new JsBackedMap()) - : new _$$ButtonProps(backingProps); +_$$ButtonProps _$Button([Map backingProps]) => new _$$ButtonProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ButtonProps extends _$ButtonProps +class _$$ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin implements ButtonProps { - _$$ButtonProps._(); - - factory _$$ButtonProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonProps$JsMap(backingMap); - } else { - return new _$$ButtonProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -187,39 +186,6 @@ abstract class _$$ButtonProps extends _$ButtonProps String get propKeyNamespace => 'ButtonProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ButtonProps$PlainMap extends _$$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$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 _$$ButtonProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$ButtonStateAccessorsMixin implements _$ButtonState { @override Map get state; @@ -242,31 +208,12 @@ class ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin { // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ButtonState extends _$ButtonState +class _$$ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin implements ButtonState { - _$$ButtonState._(); - - factory _$$ButtonState(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonState$JsMap(backingMap); - } else { - return new _$$ButtonState$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 _$$ButtonState$PlainMap extends _$$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$PlainMap(Map backingMap) - : this._state = {}, - super._() { + _$$ButtonState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -274,23 +221,10 @@ class _$$ButtonState$PlainMap extends _$$ButtonState { @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 _$$ButtonState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._state = new JsBackedMap(), - super._() { - this._state = backingMap ?? new 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. @@ -298,39 +232,10 @@ class _$$ButtonState$JsMap extends _$$ButtonState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ButtonComponent extends ButtonComponent { - _$$ButtonProps$JsMap _cachedTypedProps; - - @override - _$$ButtonProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ButtonProps$JsMap(backingMap); - @override _$$ButtonProps typedPropsFactory(Map backingMap) => new _$$ButtonProps(backingMap); - _$$ButtonState$JsMap _cachedTypedState; - @override - _$$ButtonState$JsMap get state => _cachedTypedState; - - @override - set state(Map value) { - super.state = value; - _cachedTypedState = typedStateFactoryJs(value); - } - - @override - _$$ButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - new _$$ButtonState$JsMap(backingMap); - @override _$$ButtonState typedStateFactory(Map backingMap) => new _$$ButtonState(backingMap); diff --git a/web/src/demo_components/button_group.dart b/web/src/demo_components/button_group.dart index dabb7c387..20ad6bb58 100644 --- a/web/src/demo_components/button_group.dart +++ b/web/src/demo_components/button_group.dart @@ -34,7 +34,7 @@ class _$ButtonGroupState extends UiState {} @Component() class ButtonGroupComponent - extends UiStatefulComponent2 { + extends UiStatefulComponent { @override Map getDefaultProps() => (newProps() ..size = ButtonGroupSize.DEFAULT @@ -149,7 +149,7 @@ class ButtonGroupSize extends ClassNameConstant { /// } /// /// @Component() -/// class MyComponent extends UiComponent2 { +/// class MyComponent extends UiComponent { /// ButtonGroupSize matchingButtonGroupSize = buttonToButtonGroupSize[props.size]; /// } final Map buttonToButtonGroupSize = const { diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/src/demo_components/button_group.over_react.g.dart index 2c318983e..31ca54e89 100644 --- a/web/src/demo_components/button_group.over_react.g.dart +++ b/web/src/demo_components/button_group.over_react.g.dart @@ -83,26 +83,26 @@ class ButtonGroupProps extends _$ButtonGroupProps static const PropsMeta meta = _$metaForButtonGroupProps; } -_$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => backingProps == null - ? new _$$ButtonGroupProps$JsMap(new JsBackedMap()) - : new _$$ButtonGroupProps(backingProps); +_$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => + new _$$ButtonGroupProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ButtonGroupProps extends _$ButtonGroupProps +class _$$ButtonGroupProps extends _$ButtonGroupProps with _$ButtonGroupPropsAccessorsMixin implements ButtonGroupProps { - _$$ButtonGroupProps._(); - - factory _$$ButtonGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonGroupProps$JsMap(backingMap); - } else { - return new _$$ButtonGroupProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -117,39 +117,6 @@ abstract class _$$ButtonGroupProps extends _$ButtonGroupProps String get propKeyNamespace => 'ButtonGroupProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ButtonGroupProps$PlainMap extends _$$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$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 _$$ButtonGroupProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$ButtonGroupStateAccessorsMixin implements _$ButtonGroupState { @override Map get state; @@ -173,31 +140,12 @@ class ButtonGroupState extends _$ButtonGroupState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ButtonGroupState extends _$ButtonGroupState +class _$$ButtonGroupState extends _$ButtonGroupState with _$ButtonGroupStateAccessorsMixin implements ButtonGroupState { - _$$ButtonGroupState._(); - - factory _$$ButtonGroupState(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ButtonGroupState$JsMap(backingMap); - } else { - return new _$$ButtonGroupState$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 _$$ButtonGroupState$PlainMap extends _$$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$PlainMap(Map backingMap) - : this._state = {}, - super._() { + _$$ButtonGroupState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -205,23 +153,10 @@ class _$$ButtonGroupState$PlainMap extends _$$ButtonGroupState { @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 _$$ButtonGroupState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._state = new JsBackedMap(), - super._() { - this._state = backingMap ?? new 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. @@ -229,39 +164,10 @@ class _$$ButtonGroupState$JsMap extends _$$ButtonGroupState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ButtonGroupComponent extends ButtonGroupComponent { - _$$ButtonGroupProps$JsMap _cachedTypedProps; - - @override - _$$ButtonGroupProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ButtonGroupProps$JsMap(backingMap); - @override _$$ButtonGroupProps typedPropsFactory(Map backingMap) => new _$$ButtonGroupProps(backingMap); - _$$ButtonGroupState$JsMap _cachedTypedState; - @override - _$$ButtonGroupState$JsMap get state => _cachedTypedState; - - @override - set state(Map value) { - super.state = value; - _cachedTypedState = typedStateFactoryJs(value); - } - - @override - _$$ButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - new _$$ButtonGroupState$JsMap(backingMap); - @override _$$ButtonGroupState typedStateFactory(Map backingMap) => new _$$ButtonGroupState(backingMap); diff --git a/web/src/demo_components/list_group.dart b/web/src/demo_components/list_group.dart index ed8a40ab1..e0027703e 100644 --- a/web/src/demo_components/list_group.dart +++ b/web/src/demo_components/list_group.dart @@ -20,7 +20,7 @@ class _$ListGroupProps extends UiProps { } @Component() -class ListGroupComponent extends UiComponent2 { +class ListGroupComponent extends UiComponent { @override Map getDefaultProps() => (newProps() ..elementType = ListGroupElementType.DIV diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/src/demo_components/list_group.over_react.g.dart index 1d5c4dd4e..4f37b7650 100644 --- a/web/src/demo_components/list_group.over_react.g.dart +++ b/web/src/demo_components/list_group.over_react.g.dart @@ -54,26 +54,26 @@ class ListGroupProps extends _$ListGroupProps static const PropsMeta meta = _$metaForListGroupProps; } -_$$ListGroupProps _$ListGroup([Map backingProps]) => backingProps == null - ? new _$$ListGroupProps$JsMap(new JsBackedMap()) - : new _$$ListGroupProps(backingProps); +_$$ListGroupProps _$ListGroup([Map backingProps]) => + new _$$ListGroupProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ListGroupProps extends _$ListGroupProps +class _$$ListGroupProps extends _$ListGroupProps with _$ListGroupPropsAccessorsMixin implements ListGroupProps { - _$$ListGroupProps._(); - - factory _$$ListGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ListGroupProps$JsMap(backingMap); - } else { - return new _$$ListGroupProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -87,59 +87,11 @@ abstract class _$$ListGroupProps extends _$ListGroupProps String get propKeyNamespace => 'ListGroupProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ListGroupProps$PlainMap extends _$$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$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 _$$ListGroupProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 _$ListGroupComponent extends ListGroupComponent { - _$$ListGroupProps$JsMap _cachedTypedProps; - - @override - _$$ListGroupProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ListGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ListGroupProps$JsMap(backingMap); - @override _$$ListGroupProps typedPropsFactory(Map backingMap) => new _$$ListGroupProps(backingMap); diff --git a/web/src/demo_components/list_group_item.dart b/web/src/demo_components/list_group_item.dart index 3a93b7031..cf00101b7 100644 --- a/web/src/demo_components/list_group_item.dart +++ b/web/src/demo_components/list_group_item.dart @@ -84,7 +84,7 @@ class _$ListGroupItemProps extends UiProps { } @Component() -class ListGroupItemComponent extends UiComponent2 { +class ListGroupItemComponent extends UiComponent { @override Map getDefaultProps() => (newProps() ..elementType = ListGroupItemElementType.SPAN diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/src/demo_components/list_group_item.over_react.g.dart index 59309cba1..355d1df4d 100644 --- a/web/src/demo_components/list_group_item.over_react.g.dart +++ b/web/src/demo_components/list_group_item.over_react.g.dart @@ -202,26 +202,25 @@ class ListGroupItemProps extends _$ListGroupItemProps } _$$ListGroupItemProps _$ListGroupItem([Map backingProps]) => - backingProps == null - ? new _$$ListGroupItemProps$JsMap(new JsBackedMap()) - : new _$$ListGroupItemProps(backingProps); + new _$$ListGroupItemProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ListGroupItemProps extends _$ListGroupItemProps +class _$$ListGroupItemProps extends _$ListGroupItemProps with _$ListGroupItemPropsAccessorsMixin implements ListGroupItemProps { - _$$ListGroupItemProps._(); - - factory _$$ListGroupItemProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ListGroupItemProps$JsMap(backingMap); - } else { - return new _$$ListGroupItemProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -236,59 +235,11 @@ abstract class _$$ListGroupItemProps extends _$ListGroupItemProps String get propKeyNamespace => 'ListGroupItemProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ListGroupItemProps$PlainMap extends _$$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$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 _$$ListGroupItemProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 _$ListGroupItemComponent extends ListGroupItemComponent { - _$$ListGroupItemProps$JsMap _cachedTypedProps; - - @override - _$$ListGroupItemProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ListGroupItemProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ListGroupItemProps$JsMap(backingMap); - @override _$$ListGroupItemProps typedPropsFactory(Map backingMap) => new _$$ListGroupItemProps(backingMap); diff --git a/web/src/demo_components/progress.dart b/web/src/demo_components/progress.dart index b708d1df8..4077140de 100644 --- a/web/src/demo_components/progress.dart +++ b/web/src/demo_components/progress.dart @@ -83,7 +83,7 @@ class _$ProgressState extends UiState { } @Component() -class ProgressComponent extends UiStatefulComponent2 { +class ProgressComponent extends UiStatefulComponent { @override Map getDefaultProps() => (newProps() ..value = 0.0 diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/src/demo_components/progress.over_react.g.dart index e03db58e5..1cb0c7ad6 100644 --- a/web/src/demo_components/progress.over_react.g.dart +++ b/web/src/demo_components/progress.over_react.g.dart @@ -202,26 +202,26 @@ class ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin { static const PropsMeta meta = _$metaForProgressProps; } -_$$ProgressProps _$Progress([Map backingProps]) => backingProps == null - ? new _$$ProgressProps$JsMap(new JsBackedMap()) - : new _$$ProgressProps(backingProps); +_$$ProgressProps _$Progress([Map backingProps]) => + new _$$ProgressProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ProgressProps extends _$ProgressProps +class _$$ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin implements ProgressProps { - _$$ProgressProps._(); - - factory _$$ProgressProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ProgressProps$JsMap(backingMap); - } else { - return new _$$ProgressProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -235,39 +235,6 @@ abstract class _$$ProgressProps extends _$ProgressProps String get propKeyNamespace => 'ProgressProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ProgressProps$PlainMap extends _$$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$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 _$$ProgressProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$ProgressStateAccessorsMixin implements _$ProgressState { @override Map get state; @@ -303,31 +270,12 @@ class ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin { // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ProgressState extends _$ProgressState +class _$$ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin implements ProgressState { - _$$ProgressState._(); - - factory _$$ProgressState(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ProgressState$JsMap(backingMap); - } else { - return new _$$ProgressState$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 _$$ProgressState$PlainMap extends _$$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$PlainMap(Map backingMap) - : this._state = {}, - super._() { + _$$ProgressState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -335,23 +283,10 @@ class _$$ProgressState$PlainMap extends _$$ProgressState { @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 _$$ProgressState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._state = new JsBackedMap(), - super._() { - this._state = backingMap ?? new 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. @@ -359,39 +294,10 @@ class _$$ProgressState$JsMap extends _$$ProgressState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ProgressComponent extends ProgressComponent { - _$$ProgressProps$JsMap _cachedTypedProps; - - @override - _$$ProgressProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ProgressProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ProgressProps$JsMap(backingMap); - @override _$$ProgressProps typedPropsFactory(Map backingMap) => new _$$ProgressProps(backingMap); - _$$ProgressState$JsMap _cachedTypedState; - @override - _$$ProgressState$JsMap get state => _cachedTypedState; - - @override - set state(Map value) { - super.state = value; - _cachedTypedState = typedStateFactoryJs(value); - } - - @override - _$$ProgressState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - new _$$ProgressState$JsMap(backingMap); - @override _$$ProgressState typedStateFactory(Map backingMap) => new _$$ProgressState(backingMap); diff --git a/web/src/demo_components/tag.dart b/web/src/demo_components/tag.dart index 5b6d5cb18..927e5a4a9 100644 --- a/web/src/demo_components/tag.dart +++ b/web/src/demo_components/tag.dart @@ -27,7 +27,7 @@ class _$TagProps extends UiProps { } @Component() -class TagComponent extends UiComponent2 { +class TagComponent extends UiComponent { @override Map getDefaultProps() => (newProps() ..skin = TagSkin.DEFAULT diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/src/demo_components/tag.over_react.g.dart index dd5f41d19..3200bfd1b 100644 --- a/web/src/demo_components/tag.over_react.g.dart +++ b/web/src/demo_components/tag.over_react.g.dart @@ -64,26 +64,25 @@ class TagProps extends _$TagProps with _$TagPropsAccessorsMixin { static const PropsMeta meta = _$metaForTagProps; } -_$$TagProps _$Tag([Map backingProps]) => backingProps == null - ? new _$$TagProps$JsMap(new JsBackedMap()) - : new _$$TagProps(backingProps); +_$$TagProps _$Tag([Map backingProps]) => new _$$TagProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$TagProps extends _$TagProps +class _$$TagProps extends _$TagProps with _$TagPropsAccessorsMixin implements TagProps { - _$$TagProps._(); - - factory _$$TagProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$TagProps$JsMap(backingMap); - } else { - return new _$$TagProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -97,59 +96,11 @@ abstract class _$$TagProps extends _$TagProps String get propKeyNamespace => 'TagProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$TagProps$PlainMap extends _$$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$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 _$$TagProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new 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 _$TagComponent extends TagComponent { - _$$TagProps$JsMap _cachedTypedProps; - - @override - _$$TagProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$TagProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$TagProps$JsMap(backingMap); - @override _$$TagProps typedPropsFactory(Map backingMap) => new _$$TagProps(backingMap); diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/src/demo_components/toggle_button.over_react.g.dart index 7201fa00c..2918fd4c0 100644 --- a/web/src/demo_components/toggle_button.over_react.g.dart +++ b/web/src/demo_components/toggle_button.over_react.g.dart @@ -91,26 +91,26 @@ class ToggleButtonProps extends _$ToggleButtonProps static const PropsMeta meta = _$metaForToggleButtonProps; } -_$$ToggleButtonProps _$ToggleButton([Map backingProps]) => backingProps == null - ? new _$$ToggleButtonProps$JsMap(new JsBackedMap()) - : new _$$ToggleButtonProps(backingProps); +_$$ToggleButtonProps _$ToggleButton([Map backingProps]) => + new _$$ToggleButtonProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ToggleButtonProps extends _$ToggleButtonProps +class _$$ToggleButtonProps extends _$ToggleButtonProps with _$ToggleButtonPropsAccessorsMixin implements ToggleButtonProps { - _$$ToggleButtonProps._(); - - factory _$$ToggleButtonProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonProps$JsMap(backingMap); - } else { - return new _$$ToggleButtonProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -125,39 +125,6 @@ abstract class _$$ToggleButtonProps extends _$ToggleButtonProps String get propKeyNamespace => 'ToggleButtonProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ToggleButtonProps$PlainMap extends _$$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$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 _$$ToggleButtonProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$ToggleButtonStateAccessorsMixin implements _$ToggleButtonState { @override @@ -215,31 +182,12 @@ class ToggleButtonState extends _$ToggleButtonState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ToggleButtonState extends _$ToggleButtonState +class _$$ToggleButtonState extends _$ToggleButtonState with _$ToggleButtonStateAccessorsMixin implements ToggleButtonState { - _$$ToggleButtonState._(); - - factory _$$ToggleButtonState(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonState$JsMap(backingMap); - } else { - return new _$$ToggleButtonState$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 _$$ToggleButtonState$PlainMap extends _$$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$PlainMap(Map backingMap) - : this._state = {}, - super._() { + _$$ToggleButtonState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -247,23 +195,10 @@ class _$$ToggleButtonState$PlainMap extends _$$ToggleButtonState { @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 _$$ToggleButtonState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._state = new JsBackedMap(), - super._() { - this._state = backingMap ?? new 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. @@ -271,39 +206,10 @@ class _$$ToggleButtonState$JsMap extends _$$ToggleButtonState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ToggleButtonComponent extends ToggleButtonComponent { - _$$ToggleButtonProps$JsMap _cachedTypedProps; - - @override - _$$ToggleButtonProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ToggleButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ToggleButtonProps$JsMap(backingMap); - @override _$$ToggleButtonProps typedPropsFactory(Map backingMap) => new _$$ToggleButtonProps(backingMap); - _$$ToggleButtonState$JsMap _cachedTypedState; - @override - _$$ToggleButtonState$JsMap get state => _cachedTypedState; - - @override - set state(Map value) { - super.state = value; - _cachedTypedState = typedStateFactoryJs(value); - } - - @override - _$$ToggleButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - new _$$ToggleButtonState$JsMap(backingMap); - @override _$$ToggleButtonState typedStateFactory(Map backingMap) => new _$$ToggleButtonState(backingMap); diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/src/demo_components/toggle_button_group.over_react.g.dart index a5bb05ccf..1f515c96e 100644 --- a/web/src/demo_components/toggle_button_group.over_react.g.dart +++ b/web/src/demo_components/toggle_button_group.over_react.g.dart @@ -40,26 +40,25 @@ class ToggleButtonGroupProps extends _$ToggleButtonGroupProps } _$$ToggleButtonGroupProps _$ToggleButtonGroup([Map backingProps]) => - backingProps == null - ? new _$$ToggleButtonGroupProps$JsMap(new JsBackedMap()) - : new _$$ToggleButtonGroupProps(backingProps); + new _$$ToggleButtonGroupProps(backingProps); // Concrete props implementation. // // Implements constructor and backing map, and links up to generated component factory. -abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps +class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps with _$ToggleButtonGroupPropsAccessorsMixin implements ToggleButtonGroupProps { - _$$ToggleButtonGroupProps._(); - - factory _$$ToggleButtonGroupProps(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonGroupProps$JsMap(backingMap); - } else { - return new _$$ToggleButtonGroupProps$PlainMap(backingMap); - } + // This initializer of `_props` to an empty map, as well as 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 ?? {}; } + /// The backing props map proxied by this class. + @override + Map get props => _props; + Map _props; + /// Let [UiProps] internals know that this class has been generated. @override bool get $isClassGenerated => true; @@ -74,39 +73,6 @@ abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps String get propKeyNamespace => 'ToggleButtonGroupProps.'; } -// Concrete props implementation that can be backed by any [Map]. -class _$$ToggleButtonGroupProps$PlainMap extends _$$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$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 _$$ToggleButtonGroupProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._props = new JsBackedMap(), - super._() { - this._props = backingMap ?? new JsBackedMap(); - } - - /// The backing props map proxied by this class. - @override - JsBackedMap get props => _props; - JsBackedMap _props; -} - abstract class _$ToggleButtonGroupStateAccessorsMixin implements _$ToggleButtonGroupState { @override @@ -131,31 +97,12 @@ class ToggleButtonGroupState extends _$ToggleButtonGroupState // Concrete state implementation. // // Implements constructor and backing map. -abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState +class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState with _$ToggleButtonGroupStateAccessorsMixin implements ToggleButtonGroupState { - _$$ToggleButtonGroupState._(); - - factory _$$ToggleButtonGroupState(Map backingMap) { - if (backingMap is JsBackedMap) { - return new _$$ToggleButtonGroupState$JsMap(backingMap); - } else { - return new _$$ToggleButtonGroupState$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 _$$ToggleButtonGroupState$PlainMap extends _$$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$PlainMap(Map backingMap) - : this._state = {}, - super._() { + _$$ToggleButtonGroupState(Map backingMap) : this._state = {} { this._state = backingMap ?? {}; } @@ -163,23 +110,10 @@ class _$$ToggleButtonGroupState$PlainMap extends _$$ToggleButtonGroupState { @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 _$$ToggleButtonGroupState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) - : this._state = new JsBackedMap(), - super._() { - this._state = backingMap ?? new 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. @@ -187,39 +121,10 @@ class _$$ToggleButtonGroupState$JsMap extends _$$ToggleButtonGroupState { // Implements typed props/state factories, defaults `consumedPropKeys` to the keys // generated for the associated props class. class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { - _$$ToggleButtonGroupProps$JsMap _cachedTypedProps; - - @override - _$$ToggleButtonGroupProps$JsMap get props => _cachedTypedProps; - - @override - set props(Map value) { - super.props = value; - _cachedTypedProps = typedPropsFactoryJs(value); - } - - @override - _$$ToggleButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => - new _$$ToggleButtonGroupProps$JsMap(backingMap); - @override _$$ToggleButtonGroupProps typedPropsFactory(Map backingMap) => new _$$ToggleButtonGroupProps(backingMap); - _$$ToggleButtonGroupState$JsMap _cachedTypedState; - @override - _$$ToggleButtonGroupState$JsMap get state => _cachedTypedState; - - @override - set state(Map value) { - super.state = value; - _cachedTypedState = typedStateFactoryJs(value); - } - - @override - _$$ToggleButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => - new _$$ToggleButtonGroupState$JsMap(backingMap); - @override _$$ToggleButtonGroupState typedStateFactory(Map backingMap) => new _$$ToggleButtonGroupState(backingMap); From 78de0fbf9b9265826fd5e21d89c4cf719ef98a1d Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Mon, 18 Mar 2019 13:45:42 -0700 Subject: [PATCH 33/39] Use both UiComponent and UiComponent2 in web example --- build.yaml | 2 +- web/{ => component1}/index.dart | 0 web/component1/index.html | 67 +++ web/{ => component1}/src/demo_components.dart | 0 .../src/demo_components/button.dart | 0 .../demo_components/button.over_react.g.dart | 0 .../src/demo_components/button_group.dart | 0 .../button_group.over_react.g.dart | 0 .../src/demo_components/list_group.dart | 0 .../list_group.over_react.g.dart | 0 .../src/demo_components/list_group_item.dart | 0 .../list_group_item.over_react.g.dart | 0 .../src/demo_components/progress.dart | 0 .../progress.over_react.g.dart | 0 .../src/demo_components/tag.dart | 0 .../src/demo_components/tag.over_react.g.dart | 0 .../src/demo_components/toggle_button.dart | 0 .../toggle_button.over_react.g.dart | 0 .../demo_components/toggle_button_group.dart | 0 .../toggle_button_group.over_react.g.dart | 0 web/{ => component1}/src/demos.dart | 0 .../src/demos/button/button-active.dart | 0 .../src/demos/button/button-block.dart | 0 .../src/demos/button/button-disabled.dart | 0 .../src/demos/button/button-examples.dart | 0 .../src/demos/button/button-outline.dart | 0 .../src/demos/button/button-sizes.dart | 0 .../src/demos/button/button-types.dart | 0 .../src/demos/button/index.dart | 0 .../src/demos/list-group/index.dart | 0 .../list-group-anchors-and-buttons.dart | 0 .../demos/list-group/list-group-basic.dart | 0 .../list-group/list-group-contextual.dart | 0 .../demos/list-group/list-group-header.dart | 0 .../src/demos/list-group/list-group-tags.dart | 0 .../src/demos/progress/index.dart | 0 .../progress/progress-animated-stripes.dart | 0 .../src/demos/progress/progress-basic.dart | 0 .../demos/progress/progress-contextual.dart | 0 .../src/demos/progress/progress-striped.dart | 0 web/{ => component1}/src/demos/tag/index.dart | 0 .../src/demos/tag/tag-basic.dart | 0 .../src/demos/tag/tag-contextual.dart | 0 .../src/demos/tag/tag-pills.dart | 0 .../toggle-button/toggle-button-checkbox.dart | 0 .../toggle-button/toggle-button-radio.dart | 0 .../src/shared/constants.dart | 0 .../src/shared/constants.over_react.g.dart | 0 web/component2/index.dart | 28 ++ web/component2/index.html | 67 +++ web/component2/src/demo_components.dart | 10 + .../src/demo_components/button.dart | 207 +++++++++ .../demo_components/button.over_react.g.dart | 348 +++++++++++++++ .../src/demo_components/button_group.dart | 160 +++++++ .../button_group.over_react.g.dart | 279 ++++++++++++ .../src/demo_components/list_group.dart | 53 +++ .../list_group.over_react.g.dart | 157 +++++++ .../src/demo_components/list_group_item.dart | 247 +++++++++++ .../list_group_item.over_react.g.dart | 306 +++++++++++++ .../src/demo_components/progress.dart | 192 ++++++++ .../progress.over_react.g.dart | 409 ++++++++++++++++++ web/component2/src/demo_components/tag.dart | 79 ++++ .../src/demo_components/tag.over_react.g.dart | 164 +++++++ .../src/demo_components/toggle_button.dart | 217 ++++++++++ .../toggle_button.over_react.g.dart | 321 ++++++++++++++ .../demo_components/toggle_button_group.dart | 98 +++++ .../toggle_button_group.over_react.g.dart | 237 ++++++++++ web/component2/src/demos.dart | 27 ++ .../src/demos/button/button-active.dart | 14 + .../src/demos/button/button-block.dart | 13 + .../src/demos/button/button-disabled.dart | 15 + .../src/demos/button/button-examples.dart | 17 + .../src/demos/button/button-outline.dart | 13 + .../src/demos/button/button-sizes.dart | 10 + .../src/demos/button/button-types.dart | 11 + web/component2/src/demos/button/index.dart | 31 ++ .../src/demos/list-group/index.dart | 25 ++ .../list-group-anchors-and-buttons.dart | 24 + .../demos/list-group/list-group-basic.dart | 11 + .../list-group/list-group-contextual.dart | 23 + .../demos/list-group/list-group-header.dart | 31 ++ .../src/demos/list-group/list-group-tags.dart | 28 ++ web/component2/src/demos/progress/index.dart | 22 + .../progress/progress-animated-stripes.dart | 10 + .../src/demos/progress/progress-basic.dart | 35 ++ .../demos/progress/progress-contextual.dart | 22 + .../src/demos/progress/progress-striped.dart | 30 ++ web/component2/src/demos/tag/index.dart | 16 + web/component2/src/demos/tag/tag-basic.dart | 12 + .../src/demos/tag/tag-contextual.dart | 12 + web/component2/src/demos/tag/tag-pills.dart | 30 ++ .../toggle-button/toggle-button-checkbox.dart | 19 + .../toggle-button/toggle-button-radio.dart | 19 + web/component2/src/shared/constants.dart | 98 +++++ .../src/shared/constants.over_react.g.dart | 125 ++++++ web/index.html | 52 +-- 96 files changed, 4394 insertions(+), 49 deletions(-) rename web/{ => component1}/index.dart (100%) create mode 100644 web/component1/index.html rename web/{ => component1}/src/demo_components.dart (100%) rename web/{ => component1}/src/demo_components/button.dart (100%) rename web/{ => component1}/src/demo_components/button.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/button_group.dart (100%) rename web/{ => component1}/src/demo_components/button_group.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/list_group.dart (100%) rename web/{ => component1}/src/demo_components/list_group.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/list_group_item.dart (100%) rename web/{ => component1}/src/demo_components/list_group_item.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/progress.dart (100%) rename web/{ => component1}/src/demo_components/progress.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/tag.dart (100%) rename web/{ => component1}/src/demo_components/tag.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/toggle_button.dart (100%) rename web/{ => component1}/src/demo_components/toggle_button.over_react.g.dart (100%) rename web/{ => component1}/src/demo_components/toggle_button_group.dart (100%) rename web/{ => component1}/src/demo_components/toggle_button_group.over_react.g.dart (100%) rename web/{ => component1}/src/demos.dart (100%) rename web/{ => component1}/src/demos/button/button-active.dart (100%) rename web/{ => component1}/src/demos/button/button-block.dart (100%) rename web/{ => component1}/src/demos/button/button-disabled.dart (100%) rename web/{ => component1}/src/demos/button/button-examples.dart (100%) rename web/{ => component1}/src/demos/button/button-outline.dart (100%) rename web/{ => component1}/src/demos/button/button-sizes.dart (100%) rename web/{ => component1}/src/demos/button/button-types.dart (100%) rename web/{ => component1}/src/demos/button/index.dart (100%) rename web/{ => component1}/src/demos/list-group/index.dart (100%) rename web/{ => component1}/src/demos/list-group/list-group-anchors-and-buttons.dart (100%) rename web/{ => component1}/src/demos/list-group/list-group-basic.dart (100%) rename web/{ => component1}/src/demos/list-group/list-group-contextual.dart (100%) rename web/{ => component1}/src/demos/list-group/list-group-header.dart (100%) rename web/{ => component1}/src/demos/list-group/list-group-tags.dart (100%) rename web/{ => component1}/src/demos/progress/index.dart (100%) rename web/{ => component1}/src/demos/progress/progress-animated-stripes.dart (100%) rename web/{ => component1}/src/demos/progress/progress-basic.dart (100%) rename web/{ => component1}/src/demos/progress/progress-contextual.dart (100%) rename web/{ => component1}/src/demos/progress/progress-striped.dart (100%) rename web/{ => component1}/src/demos/tag/index.dart (100%) rename web/{ => component1}/src/demos/tag/tag-basic.dart (100%) rename web/{ => component1}/src/demos/tag/tag-contextual.dart (100%) rename web/{ => component1}/src/demos/tag/tag-pills.dart (100%) rename web/{ => component1}/src/demos/toggle-button/toggle-button-checkbox.dart (100%) rename web/{ => component1}/src/demos/toggle-button/toggle-button-radio.dart (100%) rename web/{ => component1}/src/shared/constants.dart (100%) rename web/{ => component1}/src/shared/constants.over_react.g.dart (100%) create mode 100644 web/component2/index.dart create mode 100644 web/component2/index.html create mode 100644 web/component2/src/demo_components.dart create mode 100644 web/component2/src/demo_components/button.dart create mode 100644 web/component2/src/demo_components/button.over_react.g.dart create mode 100644 web/component2/src/demo_components/button_group.dart create mode 100644 web/component2/src/demo_components/button_group.over_react.g.dart create mode 100644 web/component2/src/demo_components/list_group.dart create mode 100644 web/component2/src/demo_components/list_group.over_react.g.dart create mode 100644 web/component2/src/demo_components/list_group_item.dart create mode 100644 web/component2/src/demo_components/list_group_item.over_react.g.dart create mode 100644 web/component2/src/demo_components/progress.dart create mode 100644 web/component2/src/demo_components/progress.over_react.g.dart create mode 100644 web/component2/src/demo_components/tag.dart create mode 100644 web/component2/src/demo_components/tag.over_react.g.dart create mode 100644 web/component2/src/demo_components/toggle_button.dart create mode 100644 web/component2/src/demo_components/toggle_button.over_react.g.dart create mode 100644 web/component2/src/demo_components/toggle_button_group.dart create mode 100644 web/component2/src/demo_components/toggle_button_group.over_react.g.dart create mode 100644 web/component2/src/demos.dart create mode 100644 web/component2/src/demos/button/button-active.dart create mode 100644 web/component2/src/demos/button/button-block.dart create mode 100644 web/component2/src/demos/button/button-disabled.dart create mode 100644 web/component2/src/demos/button/button-examples.dart create mode 100644 web/component2/src/demos/button/button-outline.dart create mode 100644 web/component2/src/demos/button/button-sizes.dart create mode 100644 web/component2/src/demos/button/button-types.dart create mode 100644 web/component2/src/demos/button/index.dart create mode 100644 web/component2/src/demos/list-group/index.dart create mode 100644 web/component2/src/demos/list-group/list-group-anchors-and-buttons.dart create mode 100644 web/component2/src/demos/list-group/list-group-basic.dart create mode 100644 web/component2/src/demos/list-group/list-group-contextual.dart create mode 100644 web/component2/src/demos/list-group/list-group-header.dart create mode 100644 web/component2/src/demos/list-group/list-group-tags.dart create mode 100644 web/component2/src/demos/progress/index.dart create mode 100644 web/component2/src/demos/progress/progress-animated-stripes.dart create mode 100644 web/component2/src/demos/progress/progress-basic.dart create mode 100644 web/component2/src/demos/progress/progress-contextual.dart create mode 100644 web/component2/src/demos/progress/progress-striped.dart create mode 100644 web/component2/src/demos/tag/index.dart create mode 100644 web/component2/src/demos/tag/tag-basic.dart create mode 100644 web/component2/src/demos/tag/tag-contextual.dart create mode 100644 web/component2/src/demos/tag/tag-pills.dart create mode 100644 web/component2/src/demos/toggle-button/toggle-button-checkbox.dart create mode 100644 web/component2/src/demos/toggle-button/toggle-button-radio.dart create mode 100644 web/component2/src/shared/constants.dart create mode 100644 web/component2/src/shared/constants.over_react.g.dart diff --git a/build.yaml b/build.yaml index da687494d..3bb2b1c4d 100644 --- a/build.yaml +++ b/build.yaml @@ -43,7 +43,7 @@ targets: - "example/**" - "lib/*.dart" - "test/*.dart" - - "web/*.dart" + - "web/**/index.dart" exclude: - "lib/src/builder/**" diff --git a/web/index.dart b/web/component1/index.dart similarity index 100% rename from web/index.dart rename to web/component1/index.dart diff --git a/web/component1/index.html b/web/component1/index.html new file mode 100644 index 000000000..a5a8fa153 --- /dev/null +++ b/web/component1/index.html @@ -0,0 +1,67 @@ + + + + + + over_react demo components + + + + + + + + +
+

OverReact Component Demos - UiComponent1(deprecated)

+
+
+

Button

+

Modify the source of /web/demos/button/button-examples.dart to play + around with the component rendered below.

+
+
+
+

ListGroup / ListGroupItem

+

Modify the source of /web/demos/list-group/list-group-basic.dart to play + around with the component rendered below.

+
+
+
+

Progress

+

Modify the source of /web/demos/progress/progress-basic.dart to play + around with the component rendered below.

+
+
+
+

Tag

+

Modify the source of /web/demos/tag/tag-basic.dart to play + around with the component rendered below.

+
+
+
+

ToggleButton (Checkbox)

+

Modify the source of /web/demos/toggle-button/toggle-button-checkbox.dart to play + around with the component rendered below.

+
+
+
+

ToggleButton (Radio)

+

Modify the source of /web/demos/toggle-button/toggle-button-radio.dart to play + around with the component rendered below.

+
+
+
+
+ + + + + + + + + + + + diff --git a/web/src/demo_components.dart b/web/component1/src/demo_components.dart similarity index 100% rename from web/src/demo_components.dart rename to web/component1/src/demo_components.dart diff --git a/web/src/demo_components/button.dart b/web/component1/src/demo_components/button.dart similarity index 100% rename from web/src/demo_components/button.dart rename to web/component1/src/demo_components/button.dart diff --git a/web/src/demo_components/button.over_react.g.dart b/web/component1/src/demo_components/button.over_react.g.dart similarity index 100% rename from web/src/demo_components/button.over_react.g.dart rename to web/component1/src/demo_components/button.over_react.g.dart diff --git a/web/src/demo_components/button_group.dart b/web/component1/src/demo_components/button_group.dart similarity index 100% rename from web/src/demo_components/button_group.dart rename to web/component1/src/demo_components/button_group.dart diff --git a/web/src/demo_components/button_group.over_react.g.dart b/web/component1/src/demo_components/button_group.over_react.g.dart similarity index 100% rename from web/src/demo_components/button_group.over_react.g.dart rename to web/component1/src/demo_components/button_group.over_react.g.dart diff --git a/web/src/demo_components/list_group.dart b/web/component1/src/demo_components/list_group.dart similarity index 100% rename from web/src/demo_components/list_group.dart rename to web/component1/src/demo_components/list_group.dart diff --git a/web/src/demo_components/list_group.over_react.g.dart b/web/component1/src/demo_components/list_group.over_react.g.dart similarity index 100% rename from web/src/demo_components/list_group.over_react.g.dart rename to web/component1/src/demo_components/list_group.over_react.g.dart diff --git a/web/src/demo_components/list_group_item.dart b/web/component1/src/demo_components/list_group_item.dart similarity index 100% rename from web/src/demo_components/list_group_item.dart rename to web/component1/src/demo_components/list_group_item.dart diff --git a/web/src/demo_components/list_group_item.over_react.g.dart b/web/component1/src/demo_components/list_group_item.over_react.g.dart similarity index 100% rename from web/src/demo_components/list_group_item.over_react.g.dart rename to web/component1/src/demo_components/list_group_item.over_react.g.dart diff --git a/web/src/demo_components/progress.dart b/web/component1/src/demo_components/progress.dart similarity index 100% rename from web/src/demo_components/progress.dart rename to web/component1/src/demo_components/progress.dart diff --git a/web/src/demo_components/progress.over_react.g.dart b/web/component1/src/demo_components/progress.over_react.g.dart similarity index 100% rename from web/src/demo_components/progress.over_react.g.dart rename to web/component1/src/demo_components/progress.over_react.g.dart diff --git a/web/src/demo_components/tag.dart b/web/component1/src/demo_components/tag.dart similarity index 100% rename from web/src/demo_components/tag.dart rename to web/component1/src/demo_components/tag.dart diff --git a/web/src/demo_components/tag.over_react.g.dart b/web/component1/src/demo_components/tag.over_react.g.dart similarity index 100% rename from web/src/demo_components/tag.over_react.g.dart rename to web/component1/src/demo_components/tag.over_react.g.dart diff --git a/web/src/demo_components/toggle_button.dart b/web/component1/src/demo_components/toggle_button.dart similarity index 100% rename from web/src/demo_components/toggle_button.dart rename to web/component1/src/demo_components/toggle_button.dart diff --git a/web/src/demo_components/toggle_button.over_react.g.dart b/web/component1/src/demo_components/toggle_button.over_react.g.dart similarity index 100% rename from web/src/demo_components/toggle_button.over_react.g.dart rename to web/component1/src/demo_components/toggle_button.over_react.g.dart diff --git a/web/src/demo_components/toggle_button_group.dart b/web/component1/src/demo_components/toggle_button_group.dart similarity index 100% rename from web/src/demo_components/toggle_button_group.dart rename to web/component1/src/demo_components/toggle_button_group.dart diff --git a/web/src/demo_components/toggle_button_group.over_react.g.dart b/web/component1/src/demo_components/toggle_button_group.over_react.g.dart similarity index 100% rename from web/src/demo_components/toggle_button_group.over_react.g.dart rename to web/component1/src/demo_components/toggle_button_group.over_react.g.dart diff --git a/web/src/demos.dart b/web/component1/src/demos.dart similarity index 100% rename from web/src/demos.dart rename to web/component1/src/demos.dart diff --git a/web/src/demos/button/button-active.dart b/web/component1/src/demos/button/button-active.dart similarity index 100% rename from web/src/demos/button/button-active.dart rename to web/component1/src/demos/button/button-active.dart diff --git a/web/src/demos/button/button-block.dart b/web/component1/src/demos/button/button-block.dart similarity index 100% rename from web/src/demos/button/button-block.dart rename to web/component1/src/demos/button/button-block.dart diff --git a/web/src/demos/button/button-disabled.dart b/web/component1/src/demos/button/button-disabled.dart similarity index 100% rename from web/src/demos/button/button-disabled.dart rename to web/component1/src/demos/button/button-disabled.dart diff --git a/web/src/demos/button/button-examples.dart b/web/component1/src/demos/button/button-examples.dart similarity index 100% rename from web/src/demos/button/button-examples.dart rename to web/component1/src/demos/button/button-examples.dart diff --git a/web/src/demos/button/button-outline.dart b/web/component1/src/demos/button/button-outline.dart similarity index 100% rename from web/src/demos/button/button-outline.dart rename to web/component1/src/demos/button/button-outline.dart diff --git a/web/src/demos/button/button-sizes.dart b/web/component1/src/demos/button/button-sizes.dart similarity index 100% rename from web/src/demos/button/button-sizes.dart rename to web/component1/src/demos/button/button-sizes.dart diff --git a/web/src/demos/button/button-types.dart b/web/component1/src/demos/button/button-types.dart similarity index 100% rename from web/src/demos/button/button-types.dart rename to web/component1/src/demos/button/button-types.dart diff --git a/web/src/demos/button/index.dart b/web/component1/src/demos/button/index.dart similarity index 100% rename from web/src/demos/button/index.dart rename to web/component1/src/demos/button/index.dart diff --git a/web/src/demos/list-group/index.dart b/web/component1/src/demos/list-group/index.dart similarity index 100% rename from web/src/demos/list-group/index.dart rename to web/component1/src/demos/list-group/index.dart diff --git a/web/src/demos/list-group/list-group-anchors-and-buttons.dart b/web/component1/src/demos/list-group/list-group-anchors-and-buttons.dart similarity index 100% rename from web/src/demos/list-group/list-group-anchors-and-buttons.dart rename to web/component1/src/demos/list-group/list-group-anchors-and-buttons.dart diff --git a/web/src/demos/list-group/list-group-basic.dart b/web/component1/src/demos/list-group/list-group-basic.dart similarity index 100% rename from web/src/demos/list-group/list-group-basic.dart rename to web/component1/src/demos/list-group/list-group-basic.dart diff --git a/web/src/demos/list-group/list-group-contextual.dart b/web/component1/src/demos/list-group/list-group-contextual.dart similarity index 100% rename from web/src/demos/list-group/list-group-contextual.dart rename to web/component1/src/demos/list-group/list-group-contextual.dart diff --git a/web/src/demos/list-group/list-group-header.dart b/web/component1/src/demos/list-group/list-group-header.dart similarity index 100% rename from web/src/demos/list-group/list-group-header.dart rename to web/component1/src/demos/list-group/list-group-header.dart diff --git a/web/src/demos/list-group/list-group-tags.dart b/web/component1/src/demos/list-group/list-group-tags.dart similarity index 100% rename from web/src/demos/list-group/list-group-tags.dart rename to web/component1/src/demos/list-group/list-group-tags.dart diff --git a/web/src/demos/progress/index.dart b/web/component1/src/demos/progress/index.dart similarity index 100% rename from web/src/demos/progress/index.dart rename to web/component1/src/demos/progress/index.dart diff --git a/web/src/demos/progress/progress-animated-stripes.dart b/web/component1/src/demos/progress/progress-animated-stripes.dart similarity index 100% rename from web/src/demos/progress/progress-animated-stripes.dart rename to web/component1/src/demos/progress/progress-animated-stripes.dart diff --git a/web/src/demos/progress/progress-basic.dart b/web/component1/src/demos/progress/progress-basic.dart similarity index 100% rename from web/src/demos/progress/progress-basic.dart rename to web/component1/src/demos/progress/progress-basic.dart diff --git a/web/src/demos/progress/progress-contextual.dart b/web/component1/src/demos/progress/progress-contextual.dart similarity index 100% rename from web/src/demos/progress/progress-contextual.dart rename to web/component1/src/demos/progress/progress-contextual.dart diff --git a/web/src/demos/progress/progress-striped.dart b/web/component1/src/demos/progress/progress-striped.dart similarity index 100% rename from web/src/demos/progress/progress-striped.dart rename to web/component1/src/demos/progress/progress-striped.dart diff --git a/web/src/demos/tag/index.dart b/web/component1/src/demos/tag/index.dart similarity index 100% rename from web/src/demos/tag/index.dart rename to web/component1/src/demos/tag/index.dart diff --git a/web/src/demos/tag/tag-basic.dart b/web/component1/src/demos/tag/tag-basic.dart similarity index 100% rename from web/src/demos/tag/tag-basic.dart rename to web/component1/src/demos/tag/tag-basic.dart diff --git a/web/src/demos/tag/tag-contextual.dart b/web/component1/src/demos/tag/tag-contextual.dart similarity index 100% rename from web/src/demos/tag/tag-contextual.dart rename to web/component1/src/demos/tag/tag-contextual.dart diff --git a/web/src/demos/tag/tag-pills.dart b/web/component1/src/demos/tag/tag-pills.dart similarity index 100% rename from web/src/demos/tag/tag-pills.dart rename to web/component1/src/demos/tag/tag-pills.dart diff --git a/web/src/demos/toggle-button/toggle-button-checkbox.dart b/web/component1/src/demos/toggle-button/toggle-button-checkbox.dart similarity index 100% rename from web/src/demos/toggle-button/toggle-button-checkbox.dart rename to web/component1/src/demos/toggle-button/toggle-button-checkbox.dart diff --git a/web/src/demos/toggle-button/toggle-button-radio.dart b/web/component1/src/demos/toggle-button/toggle-button-radio.dart similarity index 100% rename from web/src/demos/toggle-button/toggle-button-radio.dart rename to web/component1/src/demos/toggle-button/toggle-button-radio.dart diff --git a/web/src/shared/constants.dart b/web/component1/src/shared/constants.dart similarity index 100% rename from web/src/shared/constants.dart rename to web/component1/src/shared/constants.dart diff --git a/web/src/shared/constants.over_react.g.dart b/web/component1/src/shared/constants.over_react.g.dart similarity index 100% rename from web/src/shared/constants.over_react.g.dart rename to web/component1/src/shared/constants.over_react.g.dart diff --git a/web/component2/index.dart b/web/component2/index.dart new file mode 100644 index 000000000..71dc30091 --- /dev/null +++ b/web/component2/index.dart @@ -0,0 +1,28 @@ +import 'dart:html'; + +import 'package:over_react/over_react.dart'; +import 'package:over_react/react_dom.dart' as react_dom; + +import 'src/demos.dart'; + +void main() { + setClientConfiguration(); + + react_dom.render( + buttonExamplesDemo(), querySelector('$demoMountNodeSelectorPrefix--button')); + + react_dom.render( + listGroupBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--list-group')); + + react_dom.render( + progressBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--progress')); + + react_dom.render( + tagBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--tag')); + + react_dom.render( + checkboxToggleButtonDemo(), querySelector('$demoMountNodeSelectorPrefix--checkbox-toggle')); + + react_dom.render( + radioToggleButtonDemo(), querySelector('$demoMountNodeSelectorPrefix--radio-toggle')); +} diff --git a/web/component2/index.html b/web/component2/index.html new file mode 100644 index 000000000..7a67af318 --- /dev/null +++ b/web/component2/index.html @@ -0,0 +1,67 @@ + + + + + + over_react demo components + + + + + + + + +
+

OverReact Component Demos - UiComponent2

+
+
+

Button

+

Modify the source of /web/demos/button/button-examples.dart to play + around with the component rendered below.

+
+
+
+

ListGroup / ListGroupItem

+

Modify the source of /web/demos/list-group/list-group-basic.dart to play + around with the component rendered below.

+
+
+
+

Progress

+

Modify the source of /web/demos/progress/progress-basic.dart to play + around with the component rendered below.

+
+
+
+

Tag

+

Modify the source of /web/demos/tag/tag-basic.dart to play + around with the component rendered below.

+
+
+
+

ToggleButton (Checkbox)

+

Modify the source of /web/demos/toggle-button/toggle-button-checkbox.dart to play + around with the component rendered below.

+
+
+
+

ToggleButton (Radio)

+

Modify the source of /web/demos/toggle-button/toggle-button-radio.dart to play + around with the component rendered below.

+
+
+
+
+ + + + + + + + + + + + diff --git a/web/component2/src/demo_components.dart b/web/component2/src/demo_components.dart new file mode 100644 index 000000000..26d2dbec9 --- /dev/null +++ b/web/component2/src/demo_components.dart @@ -0,0 +1,10 @@ +export 'shared/constants.dart'; + +export 'demo_components/button.dart'; +export 'demo_components/button_group.dart'; +export 'demo_components/list_group.dart'; +export 'demo_components/list_group_item.dart'; +export 'demo_components/progress.dart'; +export 'demo_components/tag.dart'; +export 'demo_components/toggle_button_group.dart'; +export 'demo_components/toggle_button.dart'; diff --git a/web/component2/src/demo_components/button.dart b/web/component2/src/demo_components/button.dart new file mode 100644 index 000000000..7a917eabe --- /dev/null +++ b/web/component2/src/demo_components/button.dart @@ -0,0 +1,207 @@ +import 'package:over_react/over_react.dart'; + +import '../demo_components.dart'; +part 'button.over_react.g.dart'; + +/// Nest one or more `Button` components within a [ListGroup] +/// to render individual items within a list. +/// +/// See: +@Factory() +UiFactory Button = _$Button; + +@Props() +class _$ButtonProps extends UiProps { + /// The skin / "context" for the [Button]. + /// + /// See: . + /// + /// Default: [ButtonSkin.PRIMARY] + ButtonSkin skin; + + /// The size of the [Button]. + /// + /// See: . + /// + /// Default: [ButtonSize.DEFAULT] + ButtonSize size; + + /// Whether the [Button] should appear "active". + /// + /// See: + /// + /// Default: false + bool isActive; + + /// Whether the [Button] is disabled. + /// + /// See: + /// + /// Default: false + @Accessor(key: 'disabled', keyNamespace: '') + bool isDisabled; + + /// Whether the [Button] is a block level button -- that which spans the full + /// width of its parent. + /// + /// Default: false + bool isBlock; + + /// The HTML `href` attribute value for the [Button]. + /// + /// If set, the item will render via [Dom.a]. + /// + /// _Proxies [DomProps.href]_ + @Accessor(keyNamespace: '') + String href; + + /// The HTML `target` attribute value for the [Button]. + /// + /// If set, the item will render via [Dom.a]. + /// + /// _Proxies [DomProps.target]_ + @Accessor(keyNamespace: '') + String target; + + /// The HTML `type` attribute value for the [Button] when + /// rendered via [Dom.button]. + /// + /// This will only be applied if [href] is not set. + /// + /// _Proxies [DomProps.type]_ + /// + /// Default: [ButtonType.BUTTON] + ButtonType type; +} + +@State() +class _$ButtonState extends UiState {} + +@Component() +class ButtonComponent extends UiStatefulComponent2 { + @override + Map getDefaultProps() => (newProps() + ..skin = ButtonSkin.PRIMARY + ..size = ButtonSize.DEFAULT + ..isActive = false + ..isDisabled = false + ..isBlock = false + ..type = ButtonType.BUTTON + ); + +// T get props; +// + @override + render() { + return renderButton(props.children); + } + + ReactElement renderButton(dynamic children) { + BuilderOnlyUiFactory factory = buttonDomNodeFactory; + + return (factory() + ..addProps(copyUnconsumedDomProps()) + ..className = getButtonClasses().toClassName() + ..href = props.href + ..target = props.target + ..type = type + ..disabled = isAnchorLink ? null : props.isDisabled + ..addProps(ariaProps() + ..disabled = isAnchorLink ? props.isDisabled : null + ) + )(children); + } + + ClassNameBuilder getButtonClasses() { + return forwardingClassNameBuilder() + ..add('btn') + ..add('btn-block', props.isBlock) + ..add('active', isActive) + ..add('disabled', props.isDisabled) + ..add(props.skin.className) + ..add(props.size.className); + } + + BuilderOnlyUiFactory get buttonDomNodeFactory => isAnchorLink ? Dom.a : Dom.button; + + bool get isAnchorLink => props.href != null; + + bool get isActive => props.isActive; + + String get type => isAnchorLink ? null : props.type.typeName; +} + +/// Contextual skin options for a [Button] component. +class ButtonSkin extends ClassNameConstant { + const ButtonSkin._(String name, String className) : super(name, className); + + /// [className] value: 'btn-primary' + static const ButtonSkin PRIMARY = + const ButtonSkin._('PRIMARY', 'btn-primary'); + + /// [className] value: 'btn-secondary' + static const ButtonSkin SECONDARY = + const ButtonSkin._('SECONDARY', 'btn-secondary'); + + /// [className] value: 'btn-danger' + static const ButtonSkin DANGER = + const ButtonSkin._('DANGER', 'btn-danger'); + + /// [className] value: 'btn-success' + static const ButtonSkin SUCCESS = + const ButtonSkin._('SUCCESS', 'btn-success'); + + /// [className] value: 'btn-warning' + static const ButtonSkin WARNING = + const ButtonSkin._('WARNING', 'btn-warning'); + + /// [className] value: 'btn-info' + static const ButtonSkin INFO = + const ButtonSkin._('INFO', 'btn-info'); + + /// [className] value: 'btn-link' + static const ButtonSkin LINK = + const ButtonSkin._('LINK', 'btn-link'); + + /// [className] value: 'btn-outline-primary' + static const ButtonSkin PRIMARY_OUTLINE = + const ButtonSkin._('PRIMARY_OUTLINE', 'btn-outline-primary'); + + /// [className] value: 'btn-outline-secondary' + static const ButtonSkin SECONDARY_OUTLINE = + const ButtonSkin._('SECONDARY_OUTLINE', 'btn-outline-secondary'); + + /// [className] value: 'btn-outline-danger' + static const ButtonSkin DANGER_OUTLINE = + const ButtonSkin._('DANGER_OUTLINE', 'btn-outline-danger'); + + /// [className] value: 'btn-outline-success' + static const ButtonSkin SUCCESS_OUTLINE = + const ButtonSkin._('SUCCESS_OUTLINE', 'btn-outline-success'); + + /// [className] value: 'btn-outline-warning' + static const ButtonSkin WARNING_OUTLINE = + const ButtonSkin._('WARNING_OUTLINE', 'btn-outline-warning'); + + /// [className] value: 'btn-outline-info' + static const ButtonSkin INFO_OUTLINE = + const ButtonSkin._('INFO_OUTLINE', 'btn-outline-info'); +} + +/// Size options for a [Button] component. +class ButtonSize extends ClassNameConstant { + const ButtonSize._(String name, String className) : super(name, className); + + /// [className] value: '' + static const ButtonSize DEFAULT = + const ButtonSize._('DEFAULT', ''); + + /// [className] value: 'btn-lg' + static const ButtonSize LARGE = + const ButtonSize._('LARGE', 'btn-lg'); + + /// [className] value: 'btn-sm' + static const ButtonSize SMALL = + const ButtonSize._('SMALL', 'btn-sm'); +} + diff --git a/web/component2/src/demo_components/button.over_react.g.dart b/web/component2/src/demo_components/button.over_react.g.dart new file mode 100644 index 000000000..1e0c17535 --- /dev/null +++ b/web/component2/src/demo_components/button.over_react.g.dart @@ -0,0 +1,348 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'button.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ButtonComponentFactory = registerComponent(() => new _$ButtonComponent(), + builderFactory: Button, + componentClass: ButtonComponent, + isWrapper: false, + parentType: null, + displayName: 'Button'); + +abstract class _$ButtonPropsAccessorsMixin implements _$ButtonProps { + @override + Map get props; + + /// Go to [_$ButtonProps.skin] to see the source code for this prop + @override + ButtonSkin get skin => + props[_$key__skin___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.skin] to see the source code for this prop + @override + set skin(ButtonSkin value) => props[_$key__skin___$ButtonProps] = value; + + /// Go to [_$ButtonProps.size] to see the source code for this prop + @override + ButtonSize get size => + props[_$key__size___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.size] to see the source code for this prop + @override + set size(ButtonSize value) => props[_$key__size___$ButtonProps] = value; + + /// Go to [_$ButtonProps.isActive] to see the source code for this prop + @override + bool get isActive => + props[_$key__isActive___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.isActive] to see the source code for this prop + @override + set isActive(bool value) => props[_$key__isActive___$ButtonProps] = value; + + /// Go to [_$ButtonProps.isDisabled] to see the source code for this prop + @override + @Accessor(key: 'disabled', keyNamespace: '') + bool get isDisabled => + props[_$key__isDisabled___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.isDisabled] to see the source code for this prop + @override + @Accessor(key: 'disabled', keyNamespace: '') + set isDisabled(bool value) => props[_$key__isDisabled___$ButtonProps] = value; + + /// Go to [_$ButtonProps.isBlock] to see the source code for this prop + @override + bool get isBlock => + props[_$key__isBlock___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.isBlock] to see the source code for this prop + @override + set isBlock(bool value) => props[_$key__isBlock___$ButtonProps] = value; + + /// Go to [_$ButtonProps.href] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + String get href => + props[_$key__href___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.href] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set href(String value) => props[_$key__href___$ButtonProps] = value; + + /// Go to [_$ButtonProps.target] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + String get target => + props[_$key__target___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.target] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set target(String value) => props[_$key__target___$ButtonProps] = value; + + /// Go to [_$ButtonProps.type] to see the source code for this prop + @override + ButtonType get type => + props[_$key__type___$ButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonProps.type] to see the source code for this prop + @override + set type(ButtonType value) => props[_$key__type___$ButtonProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__skin___$ButtonProps = + const PropDescriptor(_$key__skin___$ButtonProps); + static const PropDescriptor _$prop__size___$ButtonProps = + const PropDescriptor(_$key__size___$ButtonProps); + static const PropDescriptor _$prop__isActive___$ButtonProps = + const PropDescriptor(_$key__isActive___$ButtonProps); + static const PropDescriptor _$prop__isDisabled___$ButtonProps = + const PropDescriptor(_$key__isDisabled___$ButtonProps); + static const PropDescriptor _$prop__isBlock___$ButtonProps = + const PropDescriptor(_$key__isBlock___$ButtonProps); + static const PropDescriptor _$prop__href___$ButtonProps = + const PropDescriptor(_$key__href___$ButtonProps); + static const PropDescriptor _$prop__target___$ButtonProps = + const PropDescriptor(_$key__target___$ButtonProps); + static const PropDescriptor _$prop__type___$ButtonProps = + const PropDescriptor(_$key__type___$ButtonProps); + static const String _$key__skin___$ButtonProps = 'ButtonProps.skin'; + static const String _$key__size___$ButtonProps = 'ButtonProps.size'; + static const String _$key__isActive___$ButtonProps = 'ButtonProps.isActive'; + static const String _$key__isDisabled___$ButtonProps = 'disabled'; + static const String _$key__isBlock___$ButtonProps = 'ButtonProps.isBlock'; + static const String _$key__href___$ButtonProps = 'href'; + static const String _$key__target___$ButtonProps = 'target'; + static const String _$key__type___$ButtonProps = 'ButtonProps.type'; + + static const List $props = const [ + _$prop__skin___$ButtonProps, + _$prop__size___$ButtonProps, + _$prop__isActive___$ButtonProps, + _$prop__isDisabled___$ButtonProps, + _$prop__isBlock___$ButtonProps, + _$prop__href___$ButtonProps, + _$prop__target___$ButtonProps, + _$prop__type___$ButtonProps + ]; + static const List $propKeys = const [ + _$key__skin___$ButtonProps, + _$key__size___$ButtonProps, + _$key__isActive___$ButtonProps, + _$key__isDisabled___$ButtonProps, + _$key__isBlock___$ButtonProps, + _$key__href___$ButtonProps, + _$key__target___$ButtonProps, + _$key__type___$ButtonProps + ]; +} + +const PropsMeta _$metaForButtonProps = const PropsMeta( + fields: _$ButtonPropsAccessorsMixin.$props, + keys: _$ButtonPropsAccessorsMixin.$propKeys, +); + +class ButtonProps extends _$ButtonProps with _$ButtonPropsAccessorsMixin { + static const PropsMeta meta = _$metaForButtonProps; +} + +_$$ButtonProps _$Button([Map backingProps]) => backingProps == null + ? new _$$ButtonProps$JsMap(new JsBackedMap()) + : new _$$ButtonProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ButtonProps extends _$ButtonProps + with _$ButtonPropsAccessorsMixin + implements ButtonProps { + _$$ButtonProps._(); + + factory _$$ButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonProps$JsMap(backingMap); + } else { + return new _$$ButtonProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $ButtonComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ButtonProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ButtonProps$PlainMap extends _$$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$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 _$$ButtonProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$ButtonStateAccessorsMixin implements _$ButtonState { + @override + Map get state; + + /* GENERATED CONSTANTS */ + + static const List $state = const []; + static const List $stateKeys = const []; +} + +const StateMeta _$metaForButtonState = const StateMeta( + fields: _$ButtonStateAccessorsMixin.$state, + keys: _$ButtonStateAccessorsMixin.$stateKeys, +); + +class ButtonState extends _$ButtonState with _$ButtonStateAccessorsMixin { + static const StateMeta meta = _$metaForButtonState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$ButtonState extends _$ButtonState + with _$ButtonStateAccessorsMixin + implements ButtonState { + _$$ButtonState._(); + + factory _$$ButtonState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonState$JsMap(backingMap); + } else { + return new _$$ButtonState$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 _$$ButtonState$PlainMap extends _$$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$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// 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 _$$ButtonState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$ButtonComponent extends ButtonComponent { + _$$ButtonProps$JsMap _cachedTypedProps; + + @override + _$$ButtonProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ButtonProps$JsMap(backingMap); + + @override + _$$ButtonProps typedPropsFactory(Map backingMap) => + new _$$ButtonProps(backingMap); + + _$$ButtonState$JsMap _cachedTypedState; + @override + _$$ButtonState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ButtonState$JsMap(backingMap); + + @override + _$$ButtonState typedStateFactory(Map backingMap) => + new _$$ButtonState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ButtonProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForButtonProps + ]; +} diff --git a/web/component2/src/demo_components/button_group.dart b/web/component2/src/demo_components/button_group.dart new file mode 100644 index 000000000..dabb7c387 --- /dev/null +++ b/web/component2/src/demo_components/button_group.dart @@ -0,0 +1,160 @@ +import 'package:over_react/over_react.dart'; + +import '../demo_components.dart'; +part 'button_group.over_react.g.dart'; + +/// Groups a series of [Button]s together on a single line. +/// +/// See: . +@Factory() +UiFactory ButtonGroup = _$ButtonGroup; + +@Props() +class _$ButtonGroupProps extends UiProps { + /// Apply a button size variation universally to every [Button] within the [ButtonGroup]. + /// + /// See: . + /// + /// Default: [ButtonGroupSize.DEFAULT] + ButtonGroupSize size; + + /// The [ButtonSkin] variation applied to every [Button] within the [ButtonGroup]. + ButtonSkin skin; + + /// Make the [Button]s within a [ButtonGroup] stack vertically. + /// + /// See: . + /// + /// Default: false + bool isVertical; +} + +@State() +class _$ButtonGroupState extends UiState {} + +@Component() +class ButtonGroupComponent + extends UiStatefulComponent2 { + @override + Map getDefaultProps() => (newProps() + ..size = ButtonGroupSize.DEFAULT + ..isVertical = false + ); + + @override + render() { + return renderButtonGroup(renderButtons()); + } + + ReactElement renderButtonGroup(dynamic children) { + var componentBuilder = Dom.div(); + + if (children.length > 1) { + componentBuilder.role = Role.group; + } + + return (componentBuilder + ..addProps(copyUnconsumedDomProps()) + ..className = getButtonGroupClasses().toClassName())(children); + } + + ClassNameBuilder getButtonGroupClasses() { + return forwardingClassNameBuilder() + ..add('btn-group', !props.isVertical) + ..add('btn-group-vertical', props.isVertical) + ..add(props.size.className); + } + + /// Renders a list of [Button]s using [renderButton]. + List renderButtons() { + List buttons = []; + + for (int index = 0; index < props.children.length; index++) { + buttons.add(renderButton(props.children[index], index)); + } + + return buttons; + } + + /// Clones the provided [child] with the props specified in [buttonPropsToAdd]. + ReactElement renderButton(dynamic child, int index) { + if (isValidButtonChild(child)) { + return cloneElement(child, buttonPropsToAdd(child, index)); + } + + print('invalid child'); + return child; + } + + /// The props that should be added when we clone the given [child] using + /// [cloneElement] via [renderButton]. + ButtonProps buttonPropsToAdd(dynamic child, int index) { + var childProps = childFactory(getProps(child)); + var childKey = getInstanceKey(child); + + return childFactory() + ..skin = props.skin ?? childProps.skin + ..key = childKey ?? index; + } + + /// Returns whether the provided [child] can be cloned using [cloneElement]. + bool isValidButtonChild(dynamic child) { + var isCloneable = false; + if (isValidElement(child)) { + if (!isComponentOfType(child, childFactory)) { + assert(ValidationUtil.warn( + 'An unexpected child type was found within this component.', + this + )); + } + + isCloneable = true; + } else if (child != null) { + assert(ValidationUtil.warn( + 'You are not using a valid ReactElement.', + this + )); + } + + return isCloneable; + } + + /// The factory expected for each child of [ButtonGroup]. + /// + /// _The factory accept [ButtonProps] as its generic parameter._ + UiFactory get childFactory => Button; +} + +/// Size options for a [ButtonGroup]s, with corresponding [className] values. +class ButtonGroupSize extends ClassNameConstant { + const ButtonGroupSize._(String name, String className) : super(name, className); + + /// [className] value: 'btn-group-sm' + static const ButtonGroupSize SMALL = const ButtonGroupSize._('SMALL', 'btn-group-sm'); + + /// [className] value: '' + static const ButtonGroupSize DEFAULT = const ButtonGroupSize._('DEFAULT', ''); + + /// [className] value: 'btn-group-lg' + static const ButtonGroupSize LARGE = const ButtonGroupSize._('LARGE', 'btn-group-lg'); +} + +/// Mapping from [ButtonSize] values to their analogous [ButtonGroupSize] values. +/// +/// __Example:__ +/// +/// @Props() +/// class MyProps extends UiProps { +/// ButtonSize size; +/// } +/// +/// @Component() +/// class MyComponent extends UiComponent2 { +/// ButtonGroupSize matchingButtonGroupSize = buttonToButtonGroupSize[props.size]; +/// } +final Map buttonToButtonGroupSize = const { + ButtonSize.SMALL: ButtonGroupSize.SMALL, + ButtonSize.DEFAULT: ButtonGroupSize.DEFAULT, + ButtonSize.LARGE: ButtonGroupSize.LARGE, +}; + diff --git a/web/component2/src/demo_components/button_group.over_react.g.dart b/web/component2/src/demo_components/button_group.over_react.g.dart new file mode 100644 index 000000000..2c318983e --- /dev/null +++ b/web/component2/src/demo_components/button_group.over_react.g.dart @@ -0,0 +1,279 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'button_group.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ButtonGroupComponentFactory = registerComponent( + () => new _$ButtonGroupComponent(), + builderFactory: ButtonGroup, + componentClass: ButtonGroupComponent, + isWrapper: false, + parentType: null, + displayName: 'ButtonGroup'); + +abstract class _$ButtonGroupPropsAccessorsMixin implements _$ButtonGroupProps { + @override + Map get props; + + /// Go to [_$ButtonGroupProps.size] to see the source code for this prop + @override + ButtonGroupSize get size => + props[_$key__size___$ButtonGroupProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonGroupProps.size] to see the source code for this prop + @override + set size(ButtonGroupSize value) => + props[_$key__size___$ButtonGroupProps] = value; + + /// Go to [_$ButtonGroupProps.skin] to see the source code for this prop + @override + ButtonSkin get skin => + props[_$key__skin___$ButtonGroupProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonGroupProps.skin] to see the source code for this prop + @override + set skin(ButtonSkin value) => props[_$key__skin___$ButtonGroupProps] = value; + + /// Go to [_$ButtonGroupProps.isVertical] to see the source code for this prop + @override + bool get isVertical => + props[_$key__isVertical___$ButtonGroupProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ButtonGroupProps.isVertical] to see the source code for this prop + @override + set isVertical(bool value) => + props[_$key__isVertical___$ButtonGroupProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__size___$ButtonGroupProps = + const PropDescriptor(_$key__size___$ButtonGroupProps); + static const PropDescriptor _$prop__skin___$ButtonGroupProps = + const PropDescriptor(_$key__skin___$ButtonGroupProps); + static const PropDescriptor _$prop__isVertical___$ButtonGroupProps = + const PropDescriptor(_$key__isVertical___$ButtonGroupProps); + static const String _$key__size___$ButtonGroupProps = 'ButtonGroupProps.size'; + static const String _$key__skin___$ButtonGroupProps = 'ButtonGroupProps.skin'; + static const String _$key__isVertical___$ButtonGroupProps = + 'ButtonGroupProps.isVertical'; + + static const List $props = const [ + _$prop__size___$ButtonGroupProps, + _$prop__skin___$ButtonGroupProps, + _$prop__isVertical___$ButtonGroupProps + ]; + static const List $propKeys = const [ + _$key__size___$ButtonGroupProps, + _$key__skin___$ButtonGroupProps, + _$key__isVertical___$ButtonGroupProps + ]; +} + +const PropsMeta _$metaForButtonGroupProps = const PropsMeta( + fields: _$ButtonGroupPropsAccessorsMixin.$props, + keys: _$ButtonGroupPropsAccessorsMixin.$propKeys, +); + +class ButtonGroupProps extends _$ButtonGroupProps + with _$ButtonGroupPropsAccessorsMixin { + static const PropsMeta meta = _$metaForButtonGroupProps; +} + +_$$ButtonGroupProps _$ButtonGroup([Map backingProps]) => backingProps == null + ? new _$$ButtonGroupProps$JsMap(new JsBackedMap()) + : new _$$ButtonGroupProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ButtonGroupProps extends _$ButtonGroupProps + with _$ButtonGroupPropsAccessorsMixin + implements ButtonGroupProps { + _$$ButtonGroupProps._(); + + factory _$$ButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonGroupProps$JsMap(backingMap); + } else { + return new _$$ButtonGroupProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ButtonGroupComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ButtonGroupProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ButtonGroupProps$PlainMap extends _$$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$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 _$$ButtonGroupProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$ButtonGroupStateAccessorsMixin implements _$ButtonGroupState { + @override + Map get state; + + /* GENERATED CONSTANTS */ + + static const List $state = const []; + static const List $stateKeys = const []; +} + +const StateMeta _$metaForButtonGroupState = const StateMeta( + fields: _$ButtonGroupStateAccessorsMixin.$state, + keys: _$ButtonGroupStateAccessorsMixin.$stateKeys, +); + +class ButtonGroupState extends _$ButtonGroupState + with _$ButtonGroupStateAccessorsMixin { + static const StateMeta meta = _$metaForButtonGroupState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$ButtonGroupState extends _$ButtonGroupState + with _$ButtonGroupStateAccessorsMixin + implements ButtonGroupState { + _$$ButtonGroupState._(); + + factory _$$ButtonGroupState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ButtonGroupState$JsMap(backingMap); + } else { + return new _$$ButtonGroupState$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 _$$ButtonGroupState$PlainMap extends _$$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$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// 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 _$$ButtonGroupState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$ButtonGroupComponent extends ButtonGroupComponent { + _$$ButtonGroupProps$JsMap _cachedTypedProps; + + @override + _$$ButtonGroupProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ButtonGroupProps$JsMap(backingMap); + + @override + _$$ButtonGroupProps typedPropsFactory(Map backingMap) => + new _$$ButtonGroupProps(backingMap); + + _$$ButtonGroupState$JsMap _cachedTypedState; + @override + _$$ButtonGroupState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ButtonGroupState$JsMap(backingMap); + + @override + _$$ButtonGroupState typedStateFactory(Map backingMap) => + new _$$ButtonGroupState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ButtonGroupProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForButtonGroupProps + ]; +} diff --git a/web/component2/src/demo_components/list_group.dart b/web/component2/src/demo_components/list_group.dart new file mode 100644 index 000000000..ed8a40ab1 --- /dev/null +++ b/web/component2/src/demo_components/list_group.dart @@ -0,0 +1,53 @@ +import 'package:over_react/over_react.dart'; + +import '../demo_components.dart'; +part 'list_group.over_react.g.dart'; + +/// Bootstrap's `ListGroup` component is flexible and powerful for +/// displaying lists of [ListGroupItem] components. +/// +/// See: +@Factory() +UiFactory ListGroup = _$ListGroup; + +@Props() +class _$ListGroupProps extends UiProps { + /// The HTML element type for the [ListGroup], specifying its + /// DOM representation when rendered. + /// + /// Default: [ListGroupElementType.DIV] + ListGroupElementType elementType; +} + +@Component() +class ListGroupComponent extends UiComponent2 { + @override + Map getDefaultProps() => (newProps() + ..elementType = ListGroupElementType.DIV + ); + + @override + render() { + var classes = forwardingClassNameBuilder() + ..add('list-group'); + + return (props.elementType.componentBuilderFactory() + ..addProps(copyUnconsumedDomProps()) + ..className = classes.toClassName() + )(props.children); + } +} + +/// Options for the [Element] that will be used when +/// rendering a [ListGroup] component. +class ListGroupElementType { + final BuilderOnlyUiFactory componentBuilderFactory; + ListGroupElementType._internal(this.componentBuilderFactory); + + /// A [Dom.ul] (HTML `
    ` element) + static final ListGroupElementType UL = new ListGroupElementType._internal(Dom.ul); + + /// A [Dom.div] (HTML `
    ` element) + static final ListGroupElementType DIV = new ListGroupElementType._internal(Dom.div); +} + diff --git a/web/component2/src/demo_components/list_group.over_react.g.dart b/web/component2/src/demo_components/list_group.over_react.g.dart new file mode 100644 index 000000000..1d5c4dd4e --- /dev/null +++ b/web/component2/src/demo_components/list_group.over_react.g.dart @@ -0,0 +1,157 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_group.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ListGroupComponentFactory = registerComponent( + () => new _$ListGroupComponent(), + builderFactory: ListGroup, + componentClass: ListGroupComponent, + isWrapper: false, + parentType: null, + displayName: 'ListGroup'); + +abstract class _$ListGroupPropsAccessorsMixin implements _$ListGroupProps { + @override + Map get props; + + /// Go to [_$ListGroupProps.elementType] to see the source code for this prop + @override + ListGroupElementType get elementType => + props[_$key__elementType___$ListGroupProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupProps.elementType] to see the source code for this prop + @override + set elementType(ListGroupElementType value) => + props[_$key__elementType___$ListGroupProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__elementType___$ListGroupProps = + const PropDescriptor(_$key__elementType___$ListGroupProps); + static const String _$key__elementType___$ListGroupProps = + 'ListGroupProps.elementType'; + + static const List $props = const [ + _$prop__elementType___$ListGroupProps + ]; + static const List $propKeys = const [ + _$key__elementType___$ListGroupProps + ]; +} + +const PropsMeta _$metaForListGroupProps = const PropsMeta( + fields: _$ListGroupPropsAccessorsMixin.$props, + keys: _$ListGroupPropsAccessorsMixin.$propKeys, +); + +class ListGroupProps extends _$ListGroupProps + with _$ListGroupPropsAccessorsMixin { + static const PropsMeta meta = _$metaForListGroupProps; +} + +_$$ListGroupProps _$ListGroup([Map backingProps]) => backingProps == null + ? new _$$ListGroupProps$JsMap(new JsBackedMap()) + : new _$$ListGroupProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ListGroupProps extends _$ListGroupProps + with _$ListGroupPropsAccessorsMixin + implements ListGroupProps { + _$$ListGroupProps._(); + + factory _$$ListGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupProps$JsMap(backingMap); + } else { + return new _$$ListGroupProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $ListGroupComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ListGroupProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ListGroupProps$PlainMap extends _$$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$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 _$$ListGroupProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 _$ListGroupComponent extends ListGroupComponent { + _$$ListGroupProps$JsMap _cachedTypedProps; + + @override + _$$ListGroupProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ListGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ListGroupProps$JsMap(backingMap); + + @override + _$$ListGroupProps typedPropsFactory(Map backingMap) => + new _$$ListGroupProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ListGroupProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForListGroupProps + ]; +} diff --git a/web/component2/src/demo_components/list_group_item.dart b/web/component2/src/demo_components/list_group_item.dart new file mode 100644 index 000000000..3a93b7031 --- /dev/null +++ b/web/component2/src/demo_components/list_group_item.dart @@ -0,0 +1,247 @@ +import 'package:over_react/over_react.dart'; + +import '../demo_components.dart'; +part 'list_group_item.over_react.g.dart'; + +/// Nest one or more `ListGroupItem` components within a [ListGroup] +/// to render individual items within a list. +/// +/// See: +@Factory() +UiFactory ListGroupItem = _$ListGroupItem; + +@Props() +class _$ListGroupItemProps extends UiProps { + /// The HTML element type for the [ListGroupItem], specifying its DOM + /// representation when rendered. + /// + /// Will only be used if [href] and [onClick] are both `null`. + /// + /// Default: [ListGroupItemElementType.SPAN] + ListGroupItemElementType elementType; + + /// Optional header text to display within the [ListGroupItem] above + /// the value of [children]. + /// + /// See: . + dynamic header; + + /// The size of the [header] text you desire. + /// + /// Default: [ListGroupItemHeaderElementSize.H5] + ListGroupItemHeaderElementSize headerSize; + + /// Additional props to be added to the [header] element _(if specified)_. + Map headerProps; + + /// The skin / "context" for the [ListGroupItem]. + /// + /// See: . + /// + /// Default: [ListGroupItemSkin.DEFAULT] + ListGroupItemSkin skin; + + /// Whether the [ListGroupItem] should appear "active". + /// + /// See: + /// + /// Default: false + bool isActive; + + /// Whether the [ListGroupItem] is disabled. + /// + /// See: + /// + /// Default: false + @Accessor(key: 'disabled', keyNamespace: '') + bool isDisabled; + + /// The HTML `href` attribute value for the [ListGroupItem]. + /// + /// If set, the item will render via [Dom.a]. + /// + /// _Proxies [DomProps.href]_ + @Accessor(keyNamespace: '') + String href; + + /// The HTML `target` attribute value for the [ListGroupItem]. + /// + /// If set, the item will render via [Dom.a]. + /// + /// _Proxies [DomProps.target]_ + @Accessor(keyNamespace: '') + String target; + + /// The HTML `type` attribute value for the [ListGroupItem] when + /// rendered via [Dom.button]. + /// + /// This will only be applied if [onClick] is also set. + /// + /// _Proxies [DomProps.type]_ + /// + /// Default: [ButtonType.BUTTON] + ButtonType type; +} + +@Component() +class ListGroupItemComponent extends UiComponent2 { + @override + Map getDefaultProps() => (newProps() + ..elementType = ListGroupItemElementType.SPAN + ..skin = ListGroupItemSkin.DEFAULT + ..isActive = false + ..isDisabled = false + ..type = ButtonType.BUTTON + ..headerSize = ListGroupItemHeaderElementSize.H5 + ); + + @override + render() { + var children = props.children; + + if (props.header != null) { + children = [ + renderItemHeader(), + (Dom.p() + ..className = 'list-group-item-text' + ..key = 'item-text' + )(props.children) + ]; + } + + BuilderOnlyUiFactory factory = _getItemDomNodeFactory(); + + return (factory() + ..addProps(copyUnconsumedDomProps()) + ..className = _getItemClasses().toClassName() + ..href = props.href + ..target = props.target + ..type = _isActionItem && !_isAnchorLink ? props.type.typeName : null + ..disabled = _useDisabledAttr ? props.isDisabled : null + ..addProps(ariaProps() + ..disabled = !_useDisabledAttr ? props.isDisabled : null + ) + )(children); + } + + ReactElement renderItemHeader() { + if (props.header == null) return null; + + var headerClasses = new ClassNameBuilder.fromProps(props.headerProps) + ..add('list-group-item-heading'); + + return (props.headerSize.componentBuilderFactory() + ..addProps(props.headerProps) + ..className = headerClasses.toClassName() + ..key = 'item-header' + )(props.header); + } + + BuilderOnlyUiFactory _getItemDomNodeFactory() { + BuilderOnlyUiFactory factory; + + if (props.href != null) { + factory = Dom.a; + } else if (props.onClick != null) { + factory = Dom.button; + } else { + factory = props.elementType.componentBuilderFactory; + } + + return factory; + } + + ClassNameBuilder _getItemClasses() { + return forwardingClassNameBuilder() + ..add('list-group-item') + ..add('list-group-item-action', _isActionItem) + ..add('active', props.isActive) + ..add('disabled', props.isDisabled) + ..add(props.skin.className); + } + + bool get _useDisabledAttr => _getItemDomNodeFactory() == Dom.button; + + bool get _isActionItem => (props.href ?? props.onClick) != null; + + bool get _isAnchorLink => props.href != null; +} + +/// Contextual skin options for a [ListGroupItem] component. +class ListGroupItemSkin extends ClassNameConstant { + const ListGroupItemSkin._(String name, String className) : super(name, className); + + /// [className] value: null + static const ListGroupItemSkin DEFAULT = + const ListGroupItemSkin._('DEFAULT', null); + + /// [className] value: 'list-group-item-danger' + static const ListGroupItemSkin DANGER = + const ListGroupItemSkin._('DANGER', 'list-group-item-danger'); + + /// [className] value: 'list-group-item-success' + static const ListGroupItemSkin SUCCESS = + const ListGroupItemSkin._('SUCCESS', 'list-group-item-success'); + + /// [className] value: 'list-group-item-warning' + static const ListGroupItemSkin WARNING = + const ListGroupItemSkin._('WARNING', 'list-group-item-warning'); + + /// [className] value: 'list-group-item-info' + static const ListGroupItemSkin INFO = + const ListGroupItemSkin._('INFO', 'list-group-item-info'); +} + +/// Options for the [Element] that will be used when rendering a [ListGroupItem] component. +class ListGroupItemElementType { + final BuilderOnlyUiFactory componentBuilderFactory; + ListGroupItemElementType._internal(this.componentBuilderFactory); + + /// A [Dom.li] (HTML `
  • ` element) + /// + /// Will only be used if [ListGroupItemProps.href] and + /// [ListGroupItemProps.onClick] are both `null`. + /// + /// Only use this when the parent [ListGroup] has + /// [ListGroupProps.elementType] set to [ListGroupElementType.UL]. + static final ListGroupItemElementType LI = + new ListGroupItemElementType._internal(Dom.li); + + /// A [Dom.span] (HTML `` element) + /// + /// Will only be used if [ListGroupItemProps.href] and + /// [ListGroupItemProps.onClick] are both `null`. + static final ListGroupItemElementType SPAN = + new ListGroupItemElementType._internal(Dom.span); +} + +/// Options for the [Element] that will be used when rendering a [ListGroupItemProps.header]. +class ListGroupItemHeaderElementSize { + final BuilderOnlyUiFactory componentBuilderFactory; + ListGroupItemHeaderElementSize._internal(this.componentBuilderFactory); + + /// A [Dom.h1] (HTML `

    ` element) + static final ListGroupItemHeaderElementSize H1 = + new ListGroupItemHeaderElementSize._internal(Dom.h1); + + /// A [Dom.h2] (HTML `

    ` element) + static final ListGroupItemHeaderElementSize H2 = + new ListGroupItemHeaderElementSize._internal(Dom.h2); + + /// A [Dom.h3] (HTML `

    ` element) + static final ListGroupItemHeaderElementSize H3 = + new ListGroupItemHeaderElementSize._internal(Dom.h3); + + /// A [Dom.h4] (HTML `

    ` element) + static final ListGroupItemHeaderElementSize H4 = + new ListGroupItemHeaderElementSize._internal(Dom.h4); + + /// A [Dom.h5] (HTML `

    ` element) + static final ListGroupItemHeaderElementSize H5 = + new ListGroupItemHeaderElementSize._internal(Dom.h5); + + /// A [Dom.h6] (HTML `
    ` element) + static final ListGroupItemHeaderElementSize H6 = + new ListGroupItemHeaderElementSize._internal(Dom.h6); +} + diff --git a/web/component2/src/demo_components/list_group_item.over_react.g.dart b/web/component2/src/demo_components/list_group_item.over_react.g.dart new file mode 100644 index 000000000..59309cba1 --- /dev/null +++ b/web/component2/src/demo_components/list_group_item.over_react.g.dart @@ -0,0 +1,306 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_group_item.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ListGroupItemComponentFactory = registerComponent( + () => new _$ListGroupItemComponent(), + builderFactory: ListGroupItem, + componentClass: ListGroupItemComponent, + isWrapper: false, + parentType: null, + displayName: 'ListGroupItem'); + +abstract class _$ListGroupItemPropsAccessorsMixin + implements _$ListGroupItemProps { + @override + Map get props; + + /// Go to [_$ListGroupItemProps.elementType] to see the source code for this prop + @override + ListGroupItemElementType get elementType => + props[_$key__elementType___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.elementType] to see the source code for this prop + @override + set elementType(ListGroupItemElementType value) => + props[_$key__elementType___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.header] to see the source code for this prop + @override + dynamic get header => + props[_$key__header___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.header] to see the source code for this prop + @override + set header(dynamic value) => + props[_$key__header___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.headerSize] to see the source code for this prop + @override + ListGroupItemHeaderElementSize get headerSize => + props[_$key__headerSize___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.headerSize] to see the source code for this prop + @override + set headerSize(ListGroupItemHeaderElementSize value) => + props[_$key__headerSize___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.headerProps] to see the source code for this prop + @override + Map get headerProps => + props[_$key__headerProps___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.headerProps] to see the source code for this prop + @override + set headerProps(Map value) => + props[_$key__headerProps___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.skin] to see the source code for this prop + @override + ListGroupItemSkin get skin => + props[_$key__skin___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.skin] to see the source code for this prop + @override + set skin(ListGroupItemSkin value) => + props[_$key__skin___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.isActive] to see the source code for this prop + @override + bool get isActive => + props[_$key__isActive___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.isActive] to see the source code for this prop + @override + set isActive(bool value) => + props[_$key__isActive___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.isDisabled] to see the source code for this prop + @override + @Accessor(key: 'disabled', keyNamespace: '') + bool get isDisabled => + props[_$key__isDisabled___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.isDisabled] to see the source code for this prop + @override + @Accessor(key: 'disabled', keyNamespace: '') + set isDisabled(bool value) => + props[_$key__isDisabled___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.href] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + String get href => + props[_$key__href___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.href] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set href(String value) => props[_$key__href___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.target] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + String get target => + props[_$key__target___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.target] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set target(String value) => + props[_$key__target___$ListGroupItemProps] = value; + + /// Go to [_$ListGroupItemProps.type] to see the source code for this prop + @override + ButtonType get type => + props[_$key__type___$ListGroupItemProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ListGroupItemProps.type] to see the source code for this prop + @override + set type(ButtonType value) => + props[_$key__type___$ListGroupItemProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__elementType___$ListGroupItemProps = + const PropDescriptor(_$key__elementType___$ListGroupItemProps); + static const PropDescriptor _$prop__header___$ListGroupItemProps = + const PropDescriptor(_$key__header___$ListGroupItemProps); + static const PropDescriptor _$prop__headerSize___$ListGroupItemProps = + const PropDescriptor(_$key__headerSize___$ListGroupItemProps); + static const PropDescriptor _$prop__headerProps___$ListGroupItemProps = + const PropDescriptor(_$key__headerProps___$ListGroupItemProps); + static const PropDescriptor _$prop__skin___$ListGroupItemProps = + const PropDescriptor(_$key__skin___$ListGroupItemProps); + static const PropDescriptor _$prop__isActive___$ListGroupItemProps = + const PropDescriptor(_$key__isActive___$ListGroupItemProps); + static const PropDescriptor _$prop__isDisabled___$ListGroupItemProps = + const PropDescriptor(_$key__isDisabled___$ListGroupItemProps); + static const PropDescriptor _$prop__href___$ListGroupItemProps = + const PropDescriptor(_$key__href___$ListGroupItemProps); + static const PropDescriptor _$prop__target___$ListGroupItemProps = + const PropDescriptor(_$key__target___$ListGroupItemProps); + static const PropDescriptor _$prop__type___$ListGroupItemProps = + const PropDescriptor(_$key__type___$ListGroupItemProps); + static const String _$key__elementType___$ListGroupItemProps = + 'ListGroupItemProps.elementType'; + static const String _$key__header___$ListGroupItemProps = + 'ListGroupItemProps.header'; + static const String _$key__headerSize___$ListGroupItemProps = + 'ListGroupItemProps.headerSize'; + static const String _$key__headerProps___$ListGroupItemProps = + 'ListGroupItemProps.headerProps'; + static const String _$key__skin___$ListGroupItemProps = + 'ListGroupItemProps.skin'; + static const String _$key__isActive___$ListGroupItemProps = + 'ListGroupItemProps.isActive'; + static const String _$key__isDisabled___$ListGroupItemProps = 'disabled'; + static const String _$key__href___$ListGroupItemProps = 'href'; + static const String _$key__target___$ListGroupItemProps = 'target'; + static const String _$key__type___$ListGroupItemProps = + 'ListGroupItemProps.type'; + + static const List $props = const [ + _$prop__elementType___$ListGroupItemProps, + _$prop__header___$ListGroupItemProps, + _$prop__headerSize___$ListGroupItemProps, + _$prop__headerProps___$ListGroupItemProps, + _$prop__skin___$ListGroupItemProps, + _$prop__isActive___$ListGroupItemProps, + _$prop__isDisabled___$ListGroupItemProps, + _$prop__href___$ListGroupItemProps, + _$prop__target___$ListGroupItemProps, + _$prop__type___$ListGroupItemProps + ]; + static const List $propKeys = const [ + _$key__elementType___$ListGroupItemProps, + _$key__header___$ListGroupItemProps, + _$key__headerSize___$ListGroupItemProps, + _$key__headerProps___$ListGroupItemProps, + _$key__skin___$ListGroupItemProps, + _$key__isActive___$ListGroupItemProps, + _$key__isDisabled___$ListGroupItemProps, + _$key__href___$ListGroupItemProps, + _$key__target___$ListGroupItemProps, + _$key__type___$ListGroupItemProps + ]; +} + +const PropsMeta _$metaForListGroupItemProps = const PropsMeta( + fields: _$ListGroupItemPropsAccessorsMixin.$props, + keys: _$ListGroupItemPropsAccessorsMixin.$propKeys, +); + +class ListGroupItemProps extends _$ListGroupItemProps + with _$ListGroupItemPropsAccessorsMixin { + static const PropsMeta meta = _$metaForListGroupItemProps; +} + +_$$ListGroupItemProps _$ListGroupItem([Map backingProps]) => + backingProps == null + ? new _$$ListGroupItemProps$JsMap(new JsBackedMap()) + : new _$$ListGroupItemProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ListGroupItemProps extends _$ListGroupItemProps + with _$ListGroupItemPropsAccessorsMixin + implements ListGroupItemProps { + _$$ListGroupItemProps._(); + + factory _$$ListGroupItemProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ListGroupItemProps$JsMap(backingMap); + } else { + return new _$$ListGroupItemProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ListGroupItemComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ListGroupItemProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ListGroupItemProps$PlainMap extends _$$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$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 _$$ListGroupItemProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 _$ListGroupItemComponent extends ListGroupItemComponent { + _$$ListGroupItemProps$JsMap _cachedTypedProps; + + @override + _$$ListGroupItemProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ListGroupItemProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ListGroupItemProps$JsMap(backingMap); + + @override + _$$ListGroupItemProps typedPropsFactory(Map backingMap) => + new _$$ListGroupItemProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ListGroupItemProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForListGroupItemProps + ]; +} diff --git a/web/component2/src/demo_components/progress.dart b/web/component2/src/demo_components/progress.dart new file mode 100644 index 000000000..b708d1df8 --- /dev/null +++ b/web/component2/src/demo_components/progress.dart @@ -0,0 +1,192 @@ +import 'dart:math'; + +import 'package:over_react/over_react.dart'; +part 'progress.over_react.g.dart'; + +/// Bootstrap's `Progress` component stylizes the HTML5 `` element with a +/// few extra CSS classes and some crafty browser-specific CSS. +/// +/// See: +@Factory() +UiFactory Progress = _$Progress; + +@Props() +class _$ProgressProps extends UiProps { + /// The current value of the [Progress] component. + /// + /// This value should be between the [min] and [max] values. + /// + /// Default: `0.0` + double value; + + /// The min value of the [Progress] component. + /// + /// Default: `0.0` + double min; + + /// The max value of the [Progress] component. + /// + /// Default: `100.0` + double max; + + /// The skin / "context" for the [Progress] component. + /// + /// See: . + /// + /// Default: [ProgressSkin.DEFAULT] + ProgressSkin skin; + + /// Whether to render a "Barber Pole" gradient stripe effect in the [Progress] component. + /// + /// Default: false + bool isStriped; + + /// Whether to animate the "Barber Pole" gradient stripe effect in the [Progress] component. + /// + /// __Note:__ Has no effect if [isStriped] is `false`. + /// + /// Default: false + bool isAnimated; + + /// Optionally add a caption that describes the context of the [Progress] component. + /// + /// See: . + /// + /// Default: [ProgressComponent._getPercentComplete]% + String caption; + + /// Additional props to be added to the [caption] element _(if specified)_. + Map captionProps; + + /// Whether the [caption] should be visible. + /// + /// Default: false + bool showCaption; + + /// Whether the [caption] should be appended with the value of [value]. + /// + /// Default: true + bool showPercentComplete; + + /// Additional props to be added to the [Dom.div] that wraps around the [caption] element and `` element. + Map rootNodeProps; +} + +@State() +class _$ProgressState extends UiState { + /// An autogenerated GUID, used as a fallback when [ProgressProps.id] is unspecified, and + /// saved on the state so it will persist across remounts. + /// + /// HTML id attributes are needed on `` elements for proper accessibility support, + /// so this state value ensures there's always a valid ID value to use. + String id; +} + +@Component() +class ProgressComponent extends UiStatefulComponent2 { + @override + Map getDefaultProps() => (newProps() + ..value = 0.0 + ..min = 0.0 + ..max = 100.0 + ..skin = ProgressSkin.DEFAULT + ..isStriped = false + ..isAnimated = false + ..showCaption = false + ..showPercentComplete = true + ); + + @override + Map getInitialState() => (newState() + ..id = 'progress_' + generateGuid(4) + ); + + @override + render() { + return (Dom.div()..addProps(props.rootNodeProps))( + renderCaptionNode(), + renderProgressNode(), + props.children + ); + } + + ReactElement renderProgressNode() { + return (Dom.progress() + ..addProps(copyUnconsumedDomProps()) + ..addProps(ariaProps() + ..labelledby = captionId + ) + ..className = _getProgressNodeClasses().toClassName() + ..id = id + ..value = currentValue + ..max = props.max + )(); + } + + ReactElement renderCaptionNode() { + var captionClasses = new ClassNameBuilder.fromProps(props.captionProps) + ..add('sr-only', !props.showCaption); + + var captionText = props.caption ?? ''; + + if (props.showPercentComplete) { + captionText += ' ${_getPercentComplete()}%'; + } + + return (Dom.div() + ..addProps(props.captionProps) + ..id = captionId + ..className = captionClasses.toClassName() + )(captionText); + } + + ClassNameBuilder _getProgressNodeClasses() { + return new ClassNameBuilder() + ..add('progress') + ..add('progress-striped', props.isStriped) + ..add('progress-animated', props.isAnimated) + ..add(props.skin.className); + } + + /// Get the percentage complete based on [ProgressProps.min], [ProgressProps.max] and [ProgressProps.value]. + double _getPercentComplete() { + return (props.value - props.min) / (props.max - props.min) * 100; + } + + /// Returns the value that determines the width of the progress bar + /// within the rendered [Progress] component via [DomPropsMixin.value]. + /// + /// Note that the value of the HTML `` element's value + /// attribute will never be less than the value of [ProgressProps.min]. + double get currentValue => max(props.min, props.value); + + String get id => props.id ?? state.id; + + String get captionId => '${id}_caption'; +} + +/// Contextual skin options for a [Progress] component. +class ProgressSkin extends ClassNameConstant { + const ProgressSkin._(String name, String className) : super(name, className); + + /// [className] value: '' + static const ProgressSkin DEFAULT = + const ProgressSkin._('DEFAULT', ''); + + /// [className] value: 'progress-danger' + static const ProgressSkin DANGER = + const ProgressSkin._('DANGER', 'progress-danger'); + + /// [className] value: 'progress-success' + static const ProgressSkin SUCCESS = + const ProgressSkin._('SUCCESS', 'progress-success'); + + /// [className] value: 'progress-warning' + static const ProgressSkin WARNING = + const ProgressSkin._('WARNING', 'progress-warning'); + + /// [className] value: 'progress-info' + static const ProgressSkin INFO = + const ProgressSkin._('INFO', 'progress-info'); +} + diff --git a/web/component2/src/demo_components/progress.over_react.g.dart b/web/component2/src/demo_components/progress.over_react.g.dart new file mode 100644 index 000000000..e03db58e5 --- /dev/null +++ b/web/component2/src/demo_components/progress.over_react.g.dart @@ -0,0 +1,409 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'progress.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ProgressComponentFactory = registerComponent( + () => new _$ProgressComponent(), + builderFactory: Progress, + componentClass: ProgressComponent, + isWrapper: false, + parentType: null, + displayName: 'Progress'); + +abstract class _$ProgressPropsAccessorsMixin implements _$ProgressProps { + @override + Map get props; + + /// Go to [_$ProgressProps.value] to see the source code for this prop + @override + double get value => + props[_$key__value___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.value] to see the source code for this prop + @override + set value(double value) => props[_$key__value___$ProgressProps] = value; + + /// Go to [_$ProgressProps.min] to see the source code for this prop + @override + double get min => + props[_$key__min___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.min] to see the source code for this prop + @override + set min(double value) => props[_$key__min___$ProgressProps] = value; + + /// Go to [_$ProgressProps.max] to see the source code for this prop + @override + double get max => + props[_$key__max___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.max] to see the source code for this prop + @override + set max(double value) => props[_$key__max___$ProgressProps] = value; + + /// Go to [_$ProgressProps.skin] to see the source code for this prop + @override + ProgressSkin get skin => + props[_$key__skin___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.skin] to see the source code for this prop + @override + set skin(ProgressSkin value) => props[_$key__skin___$ProgressProps] = value; + + /// Go to [_$ProgressProps.isStriped] to see the source code for this prop + @override + bool get isStriped => + props[_$key__isStriped___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.isStriped] to see the source code for this prop + @override + set isStriped(bool value) => props[_$key__isStriped___$ProgressProps] = value; + + /// Go to [_$ProgressProps.isAnimated] to see the source code for this prop + @override + bool get isAnimated => + props[_$key__isAnimated___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.isAnimated] to see the source code for this prop + @override + set isAnimated(bool value) => + props[_$key__isAnimated___$ProgressProps] = value; + + /// Go to [_$ProgressProps.caption] to see the source code for this prop + @override + String get caption => + props[_$key__caption___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.caption] to see the source code for this prop + @override + set caption(String value) => props[_$key__caption___$ProgressProps] = value; + + /// Go to [_$ProgressProps.captionProps] to see the source code for this prop + @override + Map get captionProps => + props[_$key__captionProps___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.captionProps] to see the source code for this prop + @override + set captionProps(Map value) => + props[_$key__captionProps___$ProgressProps] = value; + + /// Go to [_$ProgressProps.showCaption] to see the source code for this prop + @override + bool get showCaption => + props[_$key__showCaption___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.showCaption] to see the source code for this prop + @override + set showCaption(bool value) => + props[_$key__showCaption___$ProgressProps] = value; + + /// Go to [_$ProgressProps.showPercentComplete] to see the source code for this prop + @override + bool get showPercentComplete => + props[_$key__showPercentComplete___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.showPercentComplete] to see the source code for this prop + @override + set showPercentComplete(bool value) => + props[_$key__showPercentComplete___$ProgressProps] = value; + + /// Go to [_$ProgressProps.rootNodeProps] to see the source code for this prop + @override + Map get rootNodeProps => + props[_$key__rootNodeProps___$ProgressProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressProps.rootNodeProps] to see the source code for this prop + @override + set rootNodeProps(Map value) => + props[_$key__rootNodeProps___$ProgressProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__value___$ProgressProps = + const PropDescriptor(_$key__value___$ProgressProps); + static const PropDescriptor _$prop__min___$ProgressProps = + const PropDescriptor(_$key__min___$ProgressProps); + static const PropDescriptor _$prop__max___$ProgressProps = + const PropDescriptor(_$key__max___$ProgressProps); + static const PropDescriptor _$prop__skin___$ProgressProps = + const PropDescriptor(_$key__skin___$ProgressProps); + static const PropDescriptor _$prop__isStriped___$ProgressProps = + const PropDescriptor(_$key__isStriped___$ProgressProps); + static const PropDescriptor _$prop__isAnimated___$ProgressProps = + const PropDescriptor(_$key__isAnimated___$ProgressProps); + static const PropDescriptor _$prop__caption___$ProgressProps = + const PropDescriptor(_$key__caption___$ProgressProps); + static const PropDescriptor _$prop__captionProps___$ProgressProps = + const PropDescriptor(_$key__captionProps___$ProgressProps); + static const PropDescriptor _$prop__showCaption___$ProgressProps = + const PropDescriptor(_$key__showCaption___$ProgressProps); + static const PropDescriptor _$prop__showPercentComplete___$ProgressProps = + const PropDescriptor(_$key__showPercentComplete___$ProgressProps); + static const PropDescriptor _$prop__rootNodeProps___$ProgressProps = + const PropDescriptor(_$key__rootNodeProps___$ProgressProps); + static const String _$key__value___$ProgressProps = 'ProgressProps.value'; + static const String _$key__min___$ProgressProps = 'ProgressProps.min'; + static const String _$key__max___$ProgressProps = 'ProgressProps.max'; + static const String _$key__skin___$ProgressProps = 'ProgressProps.skin'; + static const String _$key__isStriped___$ProgressProps = + 'ProgressProps.isStriped'; + static const String _$key__isAnimated___$ProgressProps = + 'ProgressProps.isAnimated'; + static const String _$key__caption___$ProgressProps = 'ProgressProps.caption'; + static const String _$key__captionProps___$ProgressProps = + 'ProgressProps.captionProps'; + static const String _$key__showCaption___$ProgressProps = + 'ProgressProps.showCaption'; + static const String _$key__showPercentComplete___$ProgressProps = + 'ProgressProps.showPercentComplete'; + static const String _$key__rootNodeProps___$ProgressProps = + 'ProgressProps.rootNodeProps'; + + static const List $props = const [ + _$prop__value___$ProgressProps, + _$prop__min___$ProgressProps, + _$prop__max___$ProgressProps, + _$prop__skin___$ProgressProps, + _$prop__isStriped___$ProgressProps, + _$prop__isAnimated___$ProgressProps, + _$prop__caption___$ProgressProps, + _$prop__captionProps___$ProgressProps, + _$prop__showCaption___$ProgressProps, + _$prop__showPercentComplete___$ProgressProps, + _$prop__rootNodeProps___$ProgressProps + ]; + static const List $propKeys = const [ + _$key__value___$ProgressProps, + _$key__min___$ProgressProps, + _$key__max___$ProgressProps, + _$key__skin___$ProgressProps, + _$key__isStriped___$ProgressProps, + _$key__isAnimated___$ProgressProps, + _$key__caption___$ProgressProps, + _$key__captionProps___$ProgressProps, + _$key__showCaption___$ProgressProps, + _$key__showPercentComplete___$ProgressProps, + _$key__rootNodeProps___$ProgressProps + ]; +} + +const PropsMeta _$metaForProgressProps = const PropsMeta( + fields: _$ProgressPropsAccessorsMixin.$props, + keys: _$ProgressPropsAccessorsMixin.$propKeys, +); + +class ProgressProps extends _$ProgressProps with _$ProgressPropsAccessorsMixin { + static const PropsMeta meta = _$metaForProgressProps; +} + +_$$ProgressProps _$Progress([Map backingProps]) => backingProps == null + ? new _$$ProgressProps$JsMap(new JsBackedMap()) + : new _$$ProgressProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ProgressProps extends _$ProgressProps + with _$ProgressPropsAccessorsMixin + implements ProgressProps { + _$$ProgressProps._(); + + factory _$$ProgressProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ProgressProps$JsMap(backingMap); + } else { + return new _$$ProgressProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $ProgressComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ProgressProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ProgressProps$PlainMap extends _$$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$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 _$$ProgressProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$ProgressStateAccessorsMixin implements _$ProgressState { + @override + Map get state; + + /// Go to [_$ProgressState.id] to see the source code for this prop + @override + String get id => + state[_$key__id___$ProgressState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ProgressState.id] to see the source code for this prop + @override + set id(String value) => state[_$key__id___$ProgressState] = value; + /* GENERATED CONSTANTS */ + static const StateDescriptor _$prop__id___$ProgressState = + const StateDescriptor(_$key__id___$ProgressState); + static const String _$key__id___$ProgressState = 'ProgressState.id'; + + static const List $state = const [ + _$prop__id___$ProgressState + ]; + static const List $stateKeys = const [_$key__id___$ProgressState]; +} + +const StateMeta _$metaForProgressState = const StateMeta( + fields: _$ProgressStateAccessorsMixin.$state, + keys: _$ProgressStateAccessorsMixin.$stateKeys, +); + +class ProgressState extends _$ProgressState with _$ProgressStateAccessorsMixin { + static const StateMeta meta = _$metaForProgressState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$ProgressState extends _$ProgressState + with _$ProgressStateAccessorsMixin + implements ProgressState { + _$$ProgressState._(); + + factory _$$ProgressState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ProgressState$JsMap(backingMap); + } else { + return new _$$ProgressState$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 _$$ProgressState$PlainMap extends _$$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$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// 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 _$$ProgressState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$ProgressComponent extends ProgressComponent { + _$$ProgressProps$JsMap _cachedTypedProps; + + @override + _$$ProgressProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ProgressProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ProgressProps$JsMap(backingMap); + + @override + _$$ProgressProps typedPropsFactory(Map backingMap) => + new _$$ProgressProps(backingMap); + + _$$ProgressState$JsMap _cachedTypedState; + @override + _$$ProgressState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ProgressState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ProgressState$JsMap(backingMap); + + @override + _$$ProgressState typedStateFactory(Map backingMap) => + new _$$ProgressState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ProgressProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForProgressProps + ]; +} diff --git a/web/component2/src/demo_components/tag.dart b/web/component2/src/demo_components/tag.dart new file mode 100644 index 000000000..5b6d5cb18 --- /dev/null +++ b/web/component2/src/demo_components/tag.dart @@ -0,0 +1,79 @@ +import 'package:over_react/over_react.dart'; +part 'tag.over_react.g.dart'; + +/// Bootstrap's `Tag` component renders a small and adaptive tag +/// for adding context to just about any content. +/// +/// See: +@Factory() +UiFactory Tag = _$Tag; + +@Props() +class _$TagProps extends UiProps { + /// The skin / "context" for the [Tag]. + /// + /// See: . + /// + /// Default: [TagSkin.DEFAULT] + TagSkin skin; + + /// Whether to render the [Tag] with rounded corners that make it look + /// more like a "pill" (a.k.a Bootstrap v3 "badge") + /// + /// See: . + /// + /// Default: false + bool isPill; +} + +@Component() +class TagComponent extends UiComponent2 { + @override + Map getDefaultProps() => (newProps() + ..skin = TagSkin.DEFAULT + ..isPill = false + ); + + @override + render() { + var classes = forwardingClassNameBuilder() + ..add('tag') + ..add('tag-pill', props.isPill) + ..add(props.skin.className); + + return (Dom.span() + ..addProps(copyUnconsumedDomProps()) + ..className = classes.toClassName() + )(props.children); + } +} + +/// Contextual skin options for a [Tag] component. +class TagSkin extends ClassNameConstant { + const TagSkin._(String name, String className) : super(name, className); + + /// [className] value: 'tag-default' + static const TagSkin DEFAULT = + const TagSkin._('DEFAULT', 'tag-default'); + + /// [className] value: 'tag-primary' + static const TagSkin PRIMARY = + const TagSkin._('PRIMARY', 'tag-primary'); + + /// [className] value: 'tag-danger' + static const TagSkin DANGER = + const TagSkin._('DANGER', 'tag-danger'); + + /// [className] value: 'tag-success' + static const TagSkin SUCCESS = + const TagSkin._('SUCCESS', 'tag-success'); + + /// [className] value: 'tag-warning' + static const TagSkin WARNING = + const TagSkin._('WARNING', 'tag-warning'); + + /// [className] value: 'tag-info' + static const TagSkin INFO = + const TagSkin._('INFO', 'tag-info'); +} + diff --git a/web/component2/src/demo_components/tag.over_react.g.dart b/web/component2/src/demo_components/tag.over_react.g.dart new file mode 100644 index 000000000..dd5f41d19 --- /dev/null +++ b/web/component2/src/demo_components/tag.over_react.g.dart @@ -0,0 +1,164 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tag.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $TagComponentFactory = registerComponent(() => new _$TagComponent(), + builderFactory: Tag, + componentClass: TagComponent, + isWrapper: false, + parentType: null, + displayName: 'Tag'); + +abstract class _$TagPropsAccessorsMixin implements _$TagProps { + @override + Map get props; + + /// Go to [_$TagProps.skin] to see the source code for this prop + @override + TagSkin get skin => + props[_$key__skin___$TagProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TagProps.skin] to see the source code for this prop + @override + set skin(TagSkin value) => props[_$key__skin___$TagProps] = value; + + /// Go to [_$TagProps.isPill] to see the source code for this prop + @override + bool get isPill => + props[_$key__isPill___$TagProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$TagProps.isPill] to see the source code for this prop + @override + set isPill(bool value) => props[_$key__isPill___$TagProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__skin___$TagProps = + const PropDescriptor(_$key__skin___$TagProps); + static const PropDescriptor _$prop__isPill___$TagProps = + const PropDescriptor(_$key__isPill___$TagProps); + static const String _$key__skin___$TagProps = 'TagProps.skin'; + static const String _$key__isPill___$TagProps = 'TagProps.isPill'; + + static const List $props = const [ + _$prop__skin___$TagProps, + _$prop__isPill___$TagProps + ]; + static const List $propKeys = const [ + _$key__skin___$TagProps, + _$key__isPill___$TagProps + ]; +} + +const PropsMeta _$metaForTagProps = const PropsMeta( + fields: _$TagPropsAccessorsMixin.$props, + keys: _$TagPropsAccessorsMixin.$propKeys, +); + +class TagProps extends _$TagProps with _$TagPropsAccessorsMixin { + static const PropsMeta meta = _$metaForTagProps; +} + +_$$TagProps _$Tag([Map backingProps]) => backingProps == null + ? new _$$TagProps$JsMap(new JsBackedMap()) + : new _$$TagProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$TagProps extends _$TagProps + with _$TagPropsAccessorsMixin + implements TagProps { + _$$TagProps._(); + + factory _$$TagProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$TagProps$JsMap(backingMap); + } else { + return new _$$TagProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => $TagComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'TagProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$TagProps$PlainMap extends _$$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$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 _$$TagProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new 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 _$TagComponent extends TagComponent { + _$$TagProps$JsMap _cachedTypedProps; + + @override + _$$TagProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$TagProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$TagProps$JsMap(backingMap); + + @override + _$$TagProps typedPropsFactory(Map backingMap) => new _$$TagProps(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$TagProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [_$metaForTagProps]; +} diff --git a/web/component2/src/demo_components/toggle_button.dart b/web/component2/src/demo_components/toggle_button.dart new file mode 100644 index 000000000..2113252fa --- /dev/null +++ b/web/component2/src/demo_components/toggle_button.dart @@ -0,0 +1,217 @@ +import 'dart:html'; + +import 'package:over_react/over_react.dart'; + +import '../demo_components.dart'; +part 'toggle_button.over_react.g.dart'; + +/// Use [ToggleButton]s in order to render functional `` +/// or `` elements that look like a [Button]. +/// +/// See: +@Factory() +UiFactory ToggleButton = _$ToggleButton; + +@Props() +class _$ToggleButtonProps extends ButtonProps with + AbstractInputPropsMixin { + /// Whether the `` rendered by the [ToggleButton] should have focus upon mounting. + /// + /// _Proxies [DomProps.autoFocus]._ + /// + /// Default: `false` + @Accessor(keyNamespace: '') + bool autoFocus; + + /// Whether the [ToggleButton] is checked by default. + /// + /// Setting this without the setting the [checked] prop to will make the + /// [ToggleButton] _uncontrolled_; it will initially render checked or unchecked + /// depending on the value of this prop, and then update itself automatically + /// in response to user input, like a normal HTML input. + /// + /// Related: [checked] + /// + /// _Proxies [DomProps.defaultChecked]._ + /// + /// See: . + @Accessor(keyNamespace: '') + bool defaultChecked; + + /// Whether the [ToggleButton] is checked. + /// + /// Setting this will make the [ToggleButton] _controlled_; it will not update + /// automatically in response to user input, but instead will always render + /// checked or unchecked depending on the value of this prop. + /// + /// Related: [defaultChecked] + /// + /// _Proxies [DomProps.checked]._ + /// + /// See: . + @Accessor(keyNamespace: '') + bool checked; +} + +@State() +class _$ToggleButtonState extends ButtonState with + AbstractInputStateMixin { + /// Tracks if the [ToggleButton] is focused. Determines whether to render with the `js-focus` CSS + /// class. + /// + /// Initial: [ToggleButtonProps.autoFocus] + bool isFocused; + + /// Tracks if the [ToggleButton] input is `checked`. Determines whether to render with the `active` CSS class. + /// + /// Initial: [ToggleButtonProps.checked] `??` [ToggleButtonProps.defaultChecked] `?? false` + bool isChecked; +} + +@Component(subtypeOf: ButtonComponent) +class ToggleButtonComponent extends ButtonComponent { + // Refs + + /// A reference to the [Dom.input] rendered via [renderInput] within the [ToggleButton]. + InputElement inputRef; + + @override + Map getDefaultProps() => (newProps() + ..addProps(super.getDefaultProps()) + ..toggleType = ToggleBehaviorType.CHECKBOX + ); + + @override + Map getInitialState() => (newState() + ..id = 'toggle_button_' + generateGuid() + ..isFocused = props.autoFocus + ..isChecked = props.checked ?? props.defaultChecked ?? false + ); + + @override + get consumedProps => const [ + ToggleButtonProps.meta, + ButtonProps.meta, + AbstractInputPropsMixin.meta, + ]; + + @override + void componentWillMount() { + super.componentWillMount(); + + _validateProps(props); + } + + @override + void componentWillReceiveProps(Map newProps) { + super.componentWillReceiveProps(newProps); + var tNewProps = typedPropsFactory(newProps); + + _validateProps(tNewProps); + + if (tNewProps.checked != null && props.checked != tNewProps.checked) { + setState(newState()..isChecked = tNewProps.checked); + } + } + + @override + render() { + return renderButton( + [ + renderInput(), + props.children + ] + ); + } + + ReactElement renderInput() { + var builder = Dom.input() + ..type = props.toggleType.typeName + ..id = id + ..name = props.name + ..tabIndex = props.tabIndex + ..disabled = props.isDisabled + ..autoFocus = props.autoFocus + ..onChange = props.onChange + ..onClick = props.onClick + ..style = makeInputNodeInvisible + ..ref = (ref) { inputRef = ref; } + ..key = 'input'; + + // ******************************************************** + // + // React JS 15.0 Workarounds + // + // [1] Starting from React 15.0, the checked/defaultChecked + // props should not be set with a cascading setter + // because it will recognize the null as a "clear input" + // rather than a request to make the input controlled + // vs uncontrolled. + // + // [2] React 15.0 introduced a bug that warns when setting + // value to null on an input even if that input is of + // type radio or checkbox. This comes from treating + // setting value as a controlled input even when it + // should not. + // + // See: https://github.com/facebook/react/issues/6779 + // + // ******************************************************** + + if (props.defaultChecked != null) builder.defaultChecked = state.isChecked; // [1] + if (props.checked != null) builder.checked = state.isChecked; // [1] + if (props.value != null) builder.value = props.value; // [2] + + return builder(); + } + + /// Returns a map of inline CSS styles to be applied to the HTML `` node. + /// + /// These styles are a workaround to hide the input in an a11y-friendly manner since + /// the bootstrap styles we are using for the demo components uses an HTML attribute + /// CSS selector that we do not want to use since we're demoing how to build a stateful + /// toggle button with OverReact, not with Bootstrap's jQuery plugin data-api hook. + /// + /// In an actual implementation, you would want to add a unique class to the root of this + /// component, and add these styles in your app / component library stylesheet. + Map get makeInputNodeInvisible => { + 'position': 'absolute', + 'clip': 'rect(0,0,0,0)', + 'pointerEvents': 'none' + }; + + /// Checks the `` element to ensure that [ToggleButtonState.isChecked] + /// matches the value of the [InputElement.checked] attribute. + /// + /// Does not refresh the state if [ToggleButtonProps.checked] is not null + /// (the component is a "controlled" component). + void refreshState() { + if (!_isControlled) setState(newState()..isChecked = inputRef.checked); + } + + void _validateProps(ToggleButtonProps props) { + assert( + (props.toggleType == ToggleBehaviorType.RADIO && props.name != null) || + props.toggleType == ToggleBehaviorType.CHECKBOX + ); + } + + /// Used to check if the `input` element is controlled or not. + bool get _isControlled => props.checked != null; + + @override + bool get isActive => state.isChecked; + + @override + String get type => null; + + @override + BuilderOnlyUiFactory get buttonDomNodeFactory => Dom.label; + + /// The id to use for a [ToggleButton]. + /// + /// Attempts to use [AbstractInputPropsMixin.id] _(specified by the consumer)_, falling back to + /// [AbstractInputStateMixin.id] _(auto-generated)_. + String get id => props.id ?? state.id; +} + diff --git a/web/component2/src/demo_components/toggle_button.over_react.g.dart b/web/component2/src/demo_components/toggle_button.over_react.g.dart new file mode 100644 index 000000000..7201fa00c --- /dev/null +++ b/web/component2/src/demo_components/toggle_button.over_react.g.dart @@ -0,0 +1,321 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'toggle_button.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ToggleButtonComponentFactory = + registerComponent(() => new _$ToggleButtonComponent(), + builderFactory: ToggleButton, + componentClass: ToggleButtonComponent, + isWrapper: false, + parentType: $ButtonComponentFactory, + /* from `subtypeOf: ButtonComponent` */ + displayName: 'ToggleButton'); + +abstract class _$ToggleButtonPropsAccessorsMixin + implements _$ToggleButtonProps { + @override + Map get props; + + /// Go to [_$ToggleButtonProps.autoFocus] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + bool get autoFocus => + props[_$key__autoFocus___$ToggleButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ToggleButtonProps.autoFocus] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set autoFocus(bool value) => + props[_$key__autoFocus___$ToggleButtonProps] = value; + + /// Go to [_$ToggleButtonProps.defaultChecked] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + bool get defaultChecked => + props[_$key__defaultChecked___$ToggleButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ToggleButtonProps.defaultChecked] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set defaultChecked(bool value) => + props[_$key__defaultChecked___$ToggleButtonProps] = value; + + /// Go to [_$ToggleButtonProps.checked] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + bool get checked => + props[_$key__checked___$ToggleButtonProps] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ToggleButtonProps.checked] to see the source code for this prop + @override + @Accessor(keyNamespace: '') + set checked(bool value) => props[_$key__checked___$ToggleButtonProps] = value; + /* GENERATED CONSTANTS */ + static const PropDescriptor _$prop__autoFocus___$ToggleButtonProps = + const PropDescriptor(_$key__autoFocus___$ToggleButtonProps); + static const PropDescriptor _$prop__defaultChecked___$ToggleButtonProps = + const PropDescriptor(_$key__defaultChecked___$ToggleButtonProps); + static const PropDescriptor _$prop__checked___$ToggleButtonProps = + const PropDescriptor(_$key__checked___$ToggleButtonProps); + static const String _$key__autoFocus___$ToggleButtonProps = 'autoFocus'; + static const String _$key__defaultChecked___$ToggleButtonProps = + 'defaultChecked'; + static const String _$key__checked___$ToggleButtonProps = 'checked'; + + static const List $props = const [ + _$prop__autoFocus___$ToggleButtonProps, + _$prop__defaultChecked___$ToggleButtonProps, + _$prop__checked___$ToggleButtonProps + ]; + static const List $propKeys = const [ + _$key__autoFocus___$ToggleButtonProps, + _$key__defaultChecked___$ToggleButtonProps, + _$key__checked___$ToggleButtonProps + ]; +} + +const PropsMeta _$metaForToggleButtonProps = const PropsMeta( + fields: _$ToggleButtonPropsAccessorsMixin.$props, + keys: _$ToggleButtonPropsAccessorsMixin.$propKeys, +); + +class ToggleButtonProps extends _$ToggleButtonProps + with _$ToggleButtonPropsAccessorsMixin { + static const PropsMeta meta = _$metaForToggleButtonProps; +} + +_$$ToggleButtonProps _$ToggleButton([Map backingProps]) => backingProps == null + ? new _$$ToggleButtonProps$JsMap(new JsBackedMap()) + : new _$$ToggleButtonProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ToggleButtonProps extends _$ToggleButtonProps + with _$ToggleButtonPropsAccessorsMixin + implements ToggleButtonProps { + _$$ToggleButtonProps._(); + + factory _$$ToggleButtonProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonProps$JsMap(backingMap); + } else { + return new _$$ToggleButtonProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ToggleButtonComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ToggleButtonProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ToggleButtonProps$PlainMap extends _$$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$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 _$$ToggleButtonProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$ToggleButtonStateAccessorsMixin + implements _$ToggleButtonState { + @override + Map get state; + + /// Go to [_$ToggleButtonState.isFocused] to see the source code for this prop + @override + bool get isFocused => + state[_$key__isFocused___$ToggleButtonState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ToggleButtonState.isFocused] to see the source code for this prop + @override + set isFocused(bool value) => + state[_$key__isFocused___$ToggleButtonState] = value; + + /// Go to [_$ToggleButtonState.isChecked] to see the source code for this prop + @override + bool get isChecked => + state[_$key__isChecked___$ToggleButtonState] ?? + null; // Add ` ?? null` to workaround DDC bug: ; + /// Go to [_$ToggleButtonState.isChecked] to see the source code for this prop + @override + set isChecked(bool value) => + state[_$key__isChecked___$ToggleButtonState] = value; + /* GENERATED CONSTANTS */ + static const StateDescriptor _$prop__isFocused___$ToggleButtonState = + const StateDescriptor(_$key__isFocused___$ToggleButtonState); + static const StateDescriptor _$prop__isChecked___$ToggleButtonState = + const StateDescriptor(_$key__isChecked___$ToggleButtonState); + static const String _$key__isFocused___$ToggleButtonState = + 'ToggleButtonState.isFocused'; + static const String _$key__isChecked___$ToggleButtonState = + 'ToggleButtonState.isChecked'; + + static const List $state = const [ + _$prop__isFocused___$ToggleButtonState, + _$prop__isChecked___$ToggleButtonState + ]; + static const List $stateKeys = const [ + _$key__isFocused___$ToggleButtonState, + _$key__isChecked___$ToggleButtonState + ]; +} + +const StateMeta _$metaForToggleButtonState = const StateMeta( + fields: _$ToggleButtonStateAccessorsMixin.$state, + keys: _$ToggleButtonStateAccessorsMixin.$stateKeys, +); + +class ToggleButtonState extends _$ToggleButtonState + with _$ToggleButtonStateAccessorsMixin { + static const StateMeta meta = _$metaForToggleButtonState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$ToggleButtonState extends _$ToggleButtonState + with _$ToggleButtonStateAccessorsMixin + implements ToggleButtonState { + _$$ToggleButtonState._(); + + factory _$$ToggleButtonState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonState$JsMap(backingMap); + } else { + return new _$$ToggleButtonState$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 _$$ToggleButtonState$PlainMap extends _$$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$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// 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 _$$ToggleButtonState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$ToggleButtonComponent extends ToggleButtonComponent { + _$$ToggleButtonProps$JsMap _cachedTypedProps; + + @override + _$$ToggleButtonProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ToggleButtonProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonProps$JsMap(backingMap); + + @override + _$$ToggleButtonProps typedPropsFactory(Map backingMap) => + new _$$ToggleButtonProps(backingMap); + + _$$ToggleButtonState$JsMap _cachedTypedState; + @override + _$$ToggleButtonState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ToggleButtonState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonState$JsMap(backingMap); + + @override + _$$ToggleButtonState typedStateFactory(Map backingMap) => + new _$$ToggleButtonState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ToggleButtonProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForToggleButtonProps + ]; +} diff --git a/web/component2/src/demo_components/toggle_button_group.dart b/web/component2/src/demo_components/toggle_button_group.dart new file mode 100644 index 000000000..91d6b9afe --- /dev/null +++ b/web/component2/src/demo_components/toggle_button_group.dart @@ -0,0 +1,98 @@ +import 'package:over_react/over_react.dart'; + +import '../demo_components.dart'; +part 'toggle_button_group.over_react.g.dart'; + +/// A specialized [ButtonGroup] component that will surround one or more child +/// [ToggleButton] components so that a single shared [ToggleButtonGroupProps.name] +/// value can be applied to the aforementioned children via [cloneElement]. +/// +/// __Renders HTML Markup:__ +/// +///
    +/// +///
    +///
    +/// {props.children} +///
    +///
    +///
    +/// +/// See: +@Factory() +UiFactory ToggleButtonGroup = _$ToggleButtonGroup; + +@Props() +class _$ToggleButtonGroupProps extends ButtonGroupProps with + AbstractInputPropsMixin {} + +@State() +class _$ToggleButtonGroupState extends ButtonGroupState with + AbstractInputStateMixin {} + +@Component(subtypeOf: ButtonGroupComponent) +class ToggleButtonGroupComponent extends ButtonGroupComponent { + // Refs + + Map _toggleButtonRefs = {}; + + /// The name to use for all children of a [ToggleButtonGroup]. + /// + /// Attempts to use [ToggleButtonGroupProps.name] _(specified by the consumer)_, falling back to + /// [ToggleButtonGroupState.name] _(auto-generated)_. + String get name => props.name ?? state.name; + + @override + Map getDefaultProps() => (newProps() + ..addProps(super.getDefaultProps()) + ..toggleType = ToggleBehaviorType.CHECKBOX + ); + + @override + Map getInitialState() => (newState() + ..addAll(super.getInitialState()) + ..name = 'toggle_button_group_' + generateGuid() + ); + + @override + get consumedProps => const [ + ToggleButtonGroupProps.meta, + ]; + + /// The props that should be added when we clone the given [child] using + /// [cloneElement] via [renderButton]. + @override + ToggleButtonProps buttonPropsToAdd(dynamic child, int index) { + var childProps = childFactory(getProps(child)); + + ButtonProps superPropsToAdd = super.buttonPropsToAdd(child, index); + + return childFactory() + ..addProps(superPropsToAdd) + ..name = name + ..toggleType = props.toggleType + ..onChange = formEventCallbacks.chain(props.onChange, _handleOnChange) + ..value = childProps.value ?? index + ..ref = chainRef(child, (ref) { _toggleButtonRefs[index] = ref; }); + } + + @override + ClassNameBuilder getButtonGroupClasses() { + return super.getButtonGroupClasses() + ..add('btn-toggle-group'); + } + + /// The handler for when one of the children of the [ToggleButtonGroup] is changed or unchecked + void _handleOnChange(SyntheticFormEvent event) { + _toggleButtonRefs.values.forEach((childComponent) { + if (childComponent is ToggleButtonComponent) childComponent.refreshState(); + }); + } + + /// The factory expected for each child of [ToggleButtonGroup]. + @override + UiFactory get childFactory => ToggleButton; +} + diff --git a/web/component2/src/demo_components/toggle_button_group.over_react.g.dart b/web/component2/src/demo_components/toggle_button_group.over_react.g.dart new file mode 100644 index 000000000..a5bb05ccf --- /dev/null +++ b/web/component2/src/demo_components/toggle_button_group.over_react.g.dart @@ -0,0 +1,237 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'toggle_button_group.dart'; + +// ************************************************************************** +// OverReactGenerator +// ************************************************************************** + +// React component factory implementation. +// +// Registers component implementation and links type meta to builder factory. +final $ToggleButtonGroupComponentFactory = + registerComponent(() => new _$ToggleButtonGroupComponent(), + builderFactory: ToggleButtonGroup, + componentClass: ToggleButtonGroupComponent, + isWrapper: false, + parentType: $ButtonGroupComponentFactory, + /* from `subtypeOf: ButtonGroupComponent` */ + displayName: 'ToggleButtonGroup'); + +abstract class _$ToggleButtonGroupPropsAccessorsMixin + implements _$ToggleButtonGroupProps { + @override + Map get props; + + /* GENERATED CONSTANTS */ + + static const List $props = const []; + static const List $propKeys = const []; +} + +const PropsMeta _$metaForToggleButtonGroupProps = const PropsMeta( + fields: _$ToggleButtonGroupPropsAccessorsMixin.$props, + keys: _$ToggleButtonGroupPropsAccessorsMixin.$propKeys, +); + +class ToggleButtonGroupProps extends _$ToggleButtonGroupProps + with _$ToggleButtonGroupPropsAccessorsMixin { + static const PropsMeta meta = _$metaForToggleButtonGroupProps; +} + +_$$ToggleButtonGroupProps _$ToggleButtonGroup([Map backingProps]) => + backingProps == null + ? new _$$ToggleButtonGroupProps$JsMap(new JsBackedMap()) + : new _$$ToggleButtonGroupProps(backingProps); + +// Concrete props implementation. +// +// Implements constructor and backing map, and links up to generated component factory. +abstract class _$$ToggleButtonGroupProps extends _$ToggleButtonGroupProps + with _$ToggleButtonGroupPropsAccessorsMixin + implements ToggleButtonGroupProps { + _$$ToggleButtonGroupProps._(); + + factory _$$ToggleButtonGroupProps(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonGroupProps$JsMap(backingMap); + } else { + return new _$$ToggleButtonGroupProps$PlainMap(backingMap); + } + } + + /// Let [UiProps] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The [ReactComponentFactory] associated with the component built by this class. + @override + ReactComponentFactoryProxy get componentFactory => + $ToggleButtonGroupComponentFactory; + + /// The default namespace for the prop getters/setters generated for this class. + @override + String get propKeyNamespace => 'ToggleButtonGroupProps.'; +} + +// Concrete props implementation that can be backed by any [Map]. +class _$$ToggleButtonGroupProps$PlainMap extends _$$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$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 _$$ToggleButtonGroupProps$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._props = new JsBackedMap(), + super._() { + this._props = backingMap ?? new JsBackedMap(); + } + + /// The backing props map proxied by this class. + @override + JsBackedMap get props => _props; + JsBackedMap _props; +} + +abstract class _$ToggleButtonGroupStateAccessorsMixin + implements _$ToggleButtonGroupState { + @override + Map get state; + + /* GENERATED CONSTANTS */ + + static const List $state = const []; + static const List $stateKeys = const []; +} + +const StateMeta _$metaForToggleButtonGroupState = const StateMeta( + fields: _$ToggleButtonGroupStateAccessorsMixin.$state, + keys: _$ToggleButtonGroupStateAccessorsMixin.$stateKeys, +); + +class ToggleButtonGroupState extends _$ToggleButtonGroupState + with _$ToggleButtonGroupStateAccessorsMixin { + static const StateMeta meta = _$metaForToggleButtonGroupState; +} + +// Concrete state implementation. +// +// Implements constructor and backing map. +abstract class _$$ToggleButtonGroupState extends _$ToggleButtonGroupState + with _$ToggleButtonGroupStateAccessorsMixin + implements ToggleButtonGroupState { + _$$ToggleButtonGroupState._(); + + factory _$$ToggleButtonGroupState(Map backingMap) { + if (backingMap is JsBackedMap) { + return new _$$ToggleButtonGroupState$JsMap(backingMap); + } else { + return new _$$ToggleButtonGroupState$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 _$$ToggleButtonGroupState$PlainMap extends _$$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$PlainMap(Map backingMap) + : this._state = {}, + super._() { + this._state = backingMap ?? {}; + } + + /// 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 _$$ToggleButtonGroupState$JsMap extends _$$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$JsMap(JsBackedMap backingMap) + : this._state = new JsBackedMap(), + super._() { + this._state = backingMap ?? new JsBackedMap(); + } + + /// The backing state map proxied by this class. + @override + JsBackedMap get state => _state; + JsBackedMap _state; +} + +// Concrete component implementation mixin. +// +// Implements typed props/state factories, defaults `consumedPropKeys` to the keys +// generated for the associated props class. +class _$ToggleButtonGroupComponent extends ToggleButtonGroupComponent { + _$$ToggleButtonGroupProps$JsMap _cachedTypedProps; + + @override + _$$ToggleButtonGroupProps$JsMap get props => _cachedTypedProps; + + @override + set props(Map value) { + super.props = value; + _cachedTypedProps = typedPropsFactoryJs(value); + } + + @override + _$$ToggleButtonGroupProps$JsMap typedPropsFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonGroupProps$JsMap(backingMap); + + @override + _$$ToggleButtonGroupProps typedPropsFactory(Map backingMap) => + new _$$ToggleButtonGroupProps(backingMap); + + _$$ToggleButtonGroupState$JsMap _cachedTypedState; + @override + _$$ToggleButtonGroupState$JsMap get state => _cachedTypedState; + + @override + set state(Map value) { + super.state = value; + _cachedTypedState = typedStateFactoryJs(value); + } + + @override + _$$ToggleButtonGroupState$JsMap typedStateFactoryJs(JsBackedMap backingMap) => + new _$$ToggleButtonGroupState$JsMap(backingMap); + + @override + _$$ToggleButtonGroupState typedStateFactory(Map backingMap) => + new _$$ToggleButtonGroupState(backingMap); + + /// Let [UiComponent] internals know that this class has been generated. + @override + bool get $isClassGenerated => true; + + /// The default consumed props, taken from _$ToggleButtonGroupProps. + /// Used in [UiProps.consumedProps] if [consumedProps] is not overridden. + @override + final List $defaultConsumedProps = const [ + _$metaForToggleButtonGroupProps + ]; +} diff --git a/web/component2/src/demos.dart b/web/component2/src/demos.dart new file mode 100644 index 000000000..f244fe08a --- /dev/null +++ b/web/component2/src/demos.dart @@ -0,0 +1,27 @@ +export 'shared/constants.dart'; + +export 'demos/button/button-examples.dart'; +export 'demos/button/button-types.dart'; +export 'demos/button/button-outline.dart'; +export 'demos/button/button-sizes.dart'; +export 'demos/button/button-block.dart'; +export 'demos/button/button-active.dart'; +export 'demos/button/button-disabled.dart'; + +export 'demos/list-group/list-group-basic.dart'; +export 'demos/list-group/list-group-tags.dart'; +export 'demos/list-group/list-group-anchors-and-buttons.dart'; +export 'demos/list-group/list-group-contextual.dart'; +export 'demos/list-group/list-group-header.dart'; + +export 'demos/progress/progress-basic.dart'; +export 'demos/progress/progress-contextual.dart'; +export 'demos/progress/progress-striped.dart'; +export 'demos/progress/progress-animated-stripes.dart'; + +export 'demos/tag/tag-basic.dart'; +export 'demos/tag/tag-contextual.dart'; +export 'demos/tag/tag-pills.dart'; + +export 'demos/toggle-button/toggle-button-checkbox.dart'; +export 'demos/toggle-button/toggle-button-radio.dart'; diff --git a/web/component2/src/demos/button/button-active.dart b/web/component2/src/demos/button/button-active.dart new file mode 100644 index 000000000..5b58aa30f --- /dev/null +++ b/web/component2/src/demos/button/button-active.dart @@ -0,0 +1,14 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonActiveDemo() => + (Dom.div()..className = 'btn-toolbar')( + (Button() + ..isActive = true + )('Primary button'), + (Button() + ..isActive = true + ..skin = ButtonSkin.SECONDARY + )('Button') + ); diff --git a/web/component2/src/demos/button/button-block.dart b/web/component2/src/demos/button/button-block.dart new file mode 100644 index 000000000..88f10131c --- /dev/null +++ b/web/component2/src/demos/button/button-block.dart @@ -0,0 +1,13 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonBlockDemo() => Dom.div()( + (Button() + ..isBlock = true + )('Block level button'), + (Button() + ..isBlock = true + ..skin = ButtonSkin.SECONDARY + )('Block level button') +); diff --git a/web/component2/src/demos/button/button-disabled.dart b/web/component2/src/demos/button/button-disabled.dart new file mode 100644 index 000000000..52dc3375b --- /dev/null +++ b/web/component2/src/demos/button/button-disabled.dart @@ -0,0 +1,15 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonDisabledDemo() => + (Dom.div()..className = 'btn-toolbar')( + (Button() + ..isDisabled = true + )('Primary button'), + (Button() + ..href = '#' + ..isDisabled = true + ..skin = ButtonSkin.SECONDARY + )('Link') + ); diff --git a/web/component2/src/demos/button/button-examples.dart b/web/component2/src/demos/button/button-examples.dart new file mode 100644 index 000000000..68e8f12ff --- /dev/null +++ b/web/component2/src/demos/button/button-examples.dart @@ -0,0 +1,17 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonExamplesDemo() => + (Dom.div()..className = 'btn-toolbar')( + Button()('Primary'), + (Button()..skin = ButtonSkin.SECONDARY)('Secondary'), + (Button()..skin = ButtonSkin.SUCCESS)('Success'), + (Button()..skin = ButtonSkin.INFO)('Info'), + (Button()..skin = ButtonSkin.WARNING)('Warning'), + (Button()..skin = ButtonSkin.DANGER)('Danger'), + (Button() + ..href = '#' + ..skin = ButtonSkin.LINK + )('Link') + ); diff --git a/web/component2/src/demos/button/button-outline.dart b/web/component2/src/demos/button/button-outline.dart new file mode 100644 index 000000000..d66bc6a47 --- /dev/null +++ b/web/component2/src/demos/button/button-outline.dart @@ -0,0 +1,13 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonOutlineDemo() => + (Dom.div()..className = 'btn-toolbar')( + (Button()..skin = ButtonSkin.PRIMARY_OUTLINE)('Primary'), + (Button()..skin = ButtonSkin.SECONDARY_OUTLINE)('Secondary'), + (Button()..skin = ButtonSkin.SUCCESS_OUTLINE)('Success'), + (Button()..skin = ButtonSkin.INFO_OUTLINE)('Info'), + (Button()..skin = ButtonSkin.WARNING_OUTLINE)('Warning'), + (Button()..skin = ButtonSkin.DANGER_OUTLINE)('Danger') + ); diff --git a/web/component2/src/demos/button/button-sizes.dart b/web/component2/src/demos/button/button-sizes.dart new file mode 100644 index 000000000..3804d6fc1 --- /dev/null +++ b/web/component2/src/demos/button/button-sizes.dart @@ -0,0 +1,10 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonSizesDemo() => + (Dom.div()..className = 'btn-toolbar')( + (Button()..size = ButtonSize.SMALL)('Small'), + Button()('Default'), + (Button()..size = ButtonSize.LARGE)('Large') + ); diff --git a/web/component2/src/demos/button/button-types.dart b/web/component2/src/demos/button/button-types.dart new file mode 100644 index 000000000..8e8d7393f --- /dev/null +++ b/web/component2/src/demos/button/button-types.dart @@ -0,0 +1,11 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement buttonTypesDemo() => + (Dom.div()..className = 'btn-toolbar')( + Button()('Button'), + (Button()..href = '#')('Link'), + (Button()..type = ButtonType.SUBMIT)('Submit'), + (Button()..type = ButtonType.RESET)('Reset') + ); diff --git a/web/component2/src/demos/button/index.dart b/web/component2/src/demos/button/index.dart new file mode 100644 index 000000000..d58f4f208 --- /dev/null +++ b/web/component2/src/demos/button/index.dart @@ -0,0 +1,31 @@ +import 'dart:html'; + +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:over_react/over_react.dart'; + +import '../../demos.dart'; + +main() { + setClientConfiguration(); + + react_dom.render(buttonExamplesDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-examples')); + + react_dom.render(buttonTypesDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-types')); + + react_dom.render(buttonOutlineDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-outline')); + + react_dom.render(buttonSizesDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-sizes')); + + react_dom.render(buttonBlockDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-block')); + + react_dom.render(buttonActiveDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-active')); + + react_dom.render(buttonDisabledDemo(), + querySelector('$demoMountNodeSelectorPrefix--button-disabled')); +} diff --git a/web/component2/src/demos/list-group/index.dart b/web/component2/src/demos/list-group/index.dart new file mode 100644 index 000000000..4eb0436d8 --- /dev/null +++ b/web/component2/src/demos/list-group/index.dart @@ -0,0 +1,25 @@ +import 'dart:html'; + +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:over_react/over_react.dart'; + +import '../../demos.dart'; + +main() { + setClientConfiguration(); + + react_dom.render(listGroupBasicDemo(), + querySelector('$demoMountNodeSelectorPrefix--list-group-basic')); + + react_dom.render(listGroupTagsDemo(), + querySelector('$demoMountNodeSelectorPrefix--list-group-tags')); + + react_dom.render(listGroupAnchorsAndButtonsDemo(), + querySelector('$demoMountNodeSelectorPrefix--list-group-anchors-and-buttons')); + + react_dom.render(listGroupContextualSkinDemo(), + querySelector('$demoMountNodeSelectorPrefix--list-group-contextual')); + + react_dom.render(listGroupHeaderDemo(), + querySelector('$demoMountNodeSelectorPrefix--list-group-header')); +} diff --git a/web/component2/src/demos/list-group/list-group-anchors-and-buttons.dart b/web/component2/src/demos/list-group/list-group-anchors-and-buttons.dart new file mode 100644 index 000000000..41fd1dd58 --- /dev/null +++ b/web/component2/src/demos/list-group/list-group-anchors-and-buttons.dart @@ -0,0 +1,24 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement listGroupAnchorsAndButtonsDemo() => + ListGroup()( + (ListGroupItem() + ..isActive = true + ..href = '#' + )('Cras justo odio'), + (ListGroupItem() + ..onClick = (_) {} + )('Dapibus ac facilisis in'), + (ListGroupItem() + ..onClick = (_) {} + )('Morbi leo risus'), + (ListGroupItem() + ..onClick = (_) {} + )('Porta ac consectetur ac'), + (ListGroupItem() + ..isDisabled = true + ..onClick = (_) {} + )('Vestibulum at eros') + ); diff --git a/web/component2/src/demos/list-group/list-group-basic.dart b/web/component2/src/demos/list-group/list-group-basic.dart new file mode 100644 index 000000000..8f954354d --- /dev/null +++ b/web/component2/src/demos/list-group/list-group-basic.dart @@ -0,0 +1,11 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement listGroupBasicDemo() => + ListGroup()( + ListGroupItem()('Dapibus ac facilisis in'), + ListGroupItem()('Cras sit amet nibh libero'), + ListGroupItem()('Porta ac consectetur ac'), + ListGroupItem()('Vestibulum at eros') + ); diff --git a/web/component2/src/demos/list-group/list-group-contextual.dart b/web/component2/src/demos/list-group/list-group-contextual.dart new file mode 100644 index 000000000..523aac994 --- /dev/null +++ b/web/component2/src/demos/list-group/list-group-contextual.dart @@ -0,0 +1,23 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement listGroupContextualSkinDemo() => + ListGroup()( + (ListGroupItem() + ..onClick = (_) {} + ..skin = ListGroupItemSkin.SUCCESS + )('Dapibus ac facilisis in'), + (ListGroupItem() + ..onClick = (_) {} + ..skin = ListGroupItemSkin.INFO + )('Cras sit amet nibh libero'), + (ListGroupItem() + ..onClick = (_) {} + ..skin = ListGroupItemSkin.WARNING + )('Porta ac consectetur ac'), + (ListGroupItem() + ..onClick = (_) {} + ..skin = ListGroupItemSkin.DANGER + )('Vestibulum at eros') + ); diff --git a/web/component2/src/demos/list-group/list-group-header.dart b/web/component2/src/demos/list-group/list-group-header.dart new file mode 100644 index 000000000..de131adc2 --- /dev/null +++ b/web/component2/src/demos/list-group/list-group-header.dart @@ -0,0 +1,31 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement listGroupHeaderDemo() => + ListGroup()( + (ListGroupItem() + ..header = 'List group item heading' + ..onClick = (_) {} + ..isActive = true + )( + 'Donec id elit non mi porta gravida at eget metus. ' + 'Maecenas sed diam eget risus varius blandit.' + ), + (ListGroupItem() + ..header = 'List group item heading' + ..headerSize = ListGroupItemHeaderElementSize.H4 + ..onClick = (_) {} + )( + 'Donec id elit non mi porta gravida at eget metus. ' + 'Maecenas sed diam eget risus varius blandit.' + ), + (ListGroupItem() + ..header = 'List group item heading' + ..headerSize = ListGroupItemHeaderElementSize.H3 + ..onClick = (_) {} + )( + 'Donec id elit non mi porta gravida at eget metus. ' + 'Maecenas sed diam eget risus varius blandit.' + ) + ); diff --git a/web/component2/src/demos/list-group/list-group-tags.dart b/web/component2/src/demos/list-group/list-group-tags.dart new file mode 100644 index 000000000..08f0c1c6d --- /dev/null +++ b/web/component2/src/demos/list-group/list-group-tags.dart @@ -0,0 +1,28 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement listGroupTagsDemo() => + ListGroup()( + ListGroupItem()( + (Tag() + ..className = 'float-xs-right' + ..isPill = true + )(14), + 'Cras justo odio' + ), + ListGroupItem()( + (Tag() + ..className = 'float-xs-right' + ..isPill = true + )(2), + 'Dapibus ac facilisis in' + ), + ListGroupItem()( + (Tag() + ..className = 'float-xs-right' + ..isPill = true + )(1), + 'Morbi leo risus' + ) + ); diff --git a/web/component2/src/demos/progress/index.dart b/web/component2/src/demos/progress/index.dart new file mode 100644 index 000000000..f24cae739 --- /dev/null +++ b/web/component2/src/demos/progress/index.dart @@ -0,0 +1,22 @@ +import 'dart:html'; + +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:over_react/over_react.dart'; + +import '../../demos.dart'; + +main() { + setClientConfiguration(); + + react_dom.render(progressBasicDemo(), + querySelector('$demoMountNodeSelectorPrefix--progress-basic')); + + react_dom.render(progressContextualDemo(), + querySelector('$demoMountNodeSelectorPrefix--progress-contextual')); + + react_dom.render(progressStripedDemo(), + querySelector('$demoMountNodeSelectorPrefix--progress-striped')); + + react_dom.render(progressAnimatedStripesDemo(), + querySelector('$demoMountNodeSelectorPrefix--progress-animated-stripes')); +} diff --git a/web/component2/src/demos/progress/progress-animated-stripes.dart b/web/component2/src/demos/progress/progress-animated-stripes.dart new file mode 100644 index 000000000..661e5dc9c --- /dev/null +++ b/web/component2/src/demos/progress/progress-animated-stripes.dart @@ -0,0 +1,10 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement progressAnimatedStripesDemo() => + (Progress() + ..value = 25.0 + ..isStriped = true + ..isAnimated = true + )(); diff --git a/web/component2/src/demos/progress/progress-basic.dart b/web/component2/src/demos/progress/progress-basic.dart new file mode 100644 index 000000000..62d4d81d1 --- /dev/null +++ b/web/component2/src/demos/progress/progress-basic.dart @@ -0,0 +1,35 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement progressBasicDemo() => Dom.div()( + (Progress() + ..showCaption = true + ..captionProps = (domProps()..className = 'text-xs-center') + ..caption = 'Reticulating splines...' + )(), + (Progress() + ..value = 25.0 + ..showCaption = true + ..captionProps = (domProps()..className = 'text-xs-center') + ..caption = 'Reticulating splines...' + )(), + (Progress() + ..value = 50.0 + ..showCaption = true + ..captionProps = (domProps()..className = 'text-xs-center') + ..caption = 'Reticulating splines...' + )(), + (Progress() + ..value = 75.0 + ..showCaption = true + ..captionProps = (domProps()..className = 'text-xs-center') + ..caption = 'Reticulating splines...' + )(), + (Progress() + ..value = 100.0 + ..showCaption = true + ..captionProps = (domProps()..className = 'text-xs-center') + ..caption = 'Reticulating splines...' + )() +); diff --git a/web/component2/src/demos/progress/progress-contextual.dart b/web/component2/src/demos/progress/progress-contextual.dart new file mode 100644 index 000000000..7c485d28b --- /dev/null +++ b/web/component2/src/demos/progress/progress-contextual.dart @@ -0,0 +1,22 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement progressContextualDemo() => Dom.div()( + (Progress() + ..value = 25.0 + ..skin = ProgressSkin.SUCCESS + )(), + (Progress() + ..value = 50.0 + ..skin = ProgressSkin.INFO + )(), + (Progress() + ..value = 75.0 + ..skin = ProgressSkin.WARNING + )(), + (Progress() + ..value = 100.0 + ..skin = ProgressSkin.DANGER + )() +); diff --git a/web/component2/src/demos/progress/progress-striped.dart b/web/component2/src/demos/progress/progress-striped.dart new file mode 100644 index 000000000..d028bcb1f --- /dev/null +++ b/web/component2/src/demos/progress/progress-striped.dart @@ -0,0 +1,30 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement progressStripedDemo() => Dom.div()( + (Progress() + ..value = 10.0 + ..isStriped = true + )(), + (Progress() + ..value = 25.0 + ..skin = ProgressSkin.SUCCESS + ..isStriped = true + )(), + (Progress() + ..value = 50.0 + ..skin = ProgressSkin.INFO + ..isStriped = true + )(), + (Progress() + ..value = 75.0 + ..skin = ProgressSkin.WARNING + ..isStriped = true + )(), + (Progress() + ..value = 100.0 + ..skin = ProgressSkin.DANGER + ..isStriped = true + )() +); diff --git a/web/component2/src/demos/tag/index.dart b/web/component2/src/demos/tag/index.dart new file mode 100644 index 000000000..66f8c921f --- /dev/null +++ b/web/component2/src/demos/tag/index.dart @@ -0,0 +1,16 @@ +import 'dart:html'; + +import 'package:over_react/react_dom.dart' as react_dom; +import 'package:over_react/over_react.dart'; + +import '../../demos.dart'; + +main() { + setClientConfiguration(); + + react_dom.render(tagBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--tag-basic')); + + react_dom.render(tagContextualDemo(), querySelector('$demoMountNodeSelectorPrefix--tag-contextual')); + + react_dom.render(tagPillsDemo(), querySelector('$demoMountNodeSelectorPrefix--tag-pills')); +} diff --git a/web/component2/src/demos/tag/tag-basic.dart b/web/component2/src/demos/tag/tag-basic.dart new file mode 100644 index 000000000..f39e8986a --- /dev/null +++ b/web/component2/src/demos/tag/tag-basic.dart @@ -0,0 +1,12 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement tagBasicDemo() => Dom.div()( + Dom.h1()('Example heading ', Tag()('New')), + Dom.h2()('Example heading ', Tag()('New')), + Dom.h3()('Example heading ', Tag()('New')), + Dom.h4()('Example heading ', Tag()('New')), + Dom.h5()('Example heading ', Tag()('New')), + Dom.h6()('Example heading ', Tag()('New')) +); diff --git a/web/component2/src/demos/tag/tag-contextual.dart b/web/component2/src/demos/tag/tag-contextual.dart new file mode 100644 index 000000000..168b8df72 --- /dev/null +++ b/web/component2/src/demos/tag/tag-contextual.dart @@ -0,0 +1,12 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement tagContextualDemo() => Dom.div()( + (Tag()..skin = TagSkin.DEFAULT)('Default'), + (Tag()..skin = TagSkin.PRIMARY)('Primary'), + (Tag()..skin = TagSkin.SUCCESS)('Success'), + (Tag()..skin = TagSkin.INFO)('Info'), + (Tag()..skin = TagSkin.WARNING)('Warning'), + (Tag()..skin = TagSkin.DANGER)('Danger') +); diff --git a/web/component2/src/demos/tag/tag-pills.dart b/web/component2/src/demos/tag/tag-pills.dart new file mode 100644 index 000000000..56af9d90e --- /dev/null +++ b/web/component2/src/demos/tag/tag-pills.dart @@ -0,0 +1,30 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement tagPillsDemo() => Dom.div()( + (Tag() + ..isPill = true + ..skin = TagSkin.DEFAULT + )('Default'), + (Tag() + ..isPill = true + ..skin = TagSkin.PRIMARY + )('Primary'), + (Tag() + ..isPill = true + ..skin = TagSkin.SUCCESS + )('Success'), + (Tag() + ..isPill = true + ..skin = TagSkin.INFO + )('Info'), + (Tag() + ..isPill = true + ..skin = TagSkin.WARNING + )('Warning'), + (Tag() + ..isPill = true + ..skin = TagSkin.DANGER + )('Danger') +); diff --git a/web/component2/src/demos/toggle-button/toggle-button-checkbox.dart b/web/component2/src/demos/toggle-button/toggle-button-checkbox.dart new file mode 100644 index 000000000..ccf9c98ac --- /dev/null +++ b/web/component2/src/demos/toggle-button/toggle-button-checkbox.dart @@ -0,0 +1,19 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement checkboxToggleButtonDemo() => + (ToggleButtonGroup() + ..toggleType = ToggleBehaviorType.CHECKBOX + )( + (ToggleButton() + ..value = '1' + )('Checkbox 1'), + (ToggleButton() + ..value = '2' + ..defaultChecked = true + )('Checkbox 2'), + (ToggleButton() + ..value = '3' + )('Checkbox 3') + ); diff --git a/web/component2/src/demos/toggle-button/toggle-button-radio.dart b/web/component2/src/demos/toggle-button/toggle-button-radio.dart new file mode 100644 index 000000000..633f6b2fd --- /dev/null +++ b/web/component2/src/demos/toggle-button/toggle-button-radio.dart @@ -0,0 +1,19 @@ +import 'package:over_react/over_react.dart'; + +import '../../demo_components.dart'; + +ReactElement radioToggleButtonDemo() => + (ToggleButtonGroup() + ..toggleType = ToggleBehaviorType.RADIO + )( + (ToggleButton() + ..value = '1' + )('Radio 1'), + (ToggleButton() + ..value = '2' + ..defaultChecked = true + )('Radio 2'), + (ToggleButton() + ..value = '3' + )('Radio 3') + ); diff --git a/web/component2/src/shared/constants.dart b/web/component2/src/shared/constants.dart new file mode 100644 index 000000000..e448aabbc --- /dev/null +++ b/web/component2/src/shared/constants.dart @@ -0,0 +1,98 @@ +import 'package:over_react/over_react.dart'; +part 'constants.over_react.g.dart'; + +const String demoMountNodeSelectorPrefix = '.component-demo__mount'; + +/// A class of possible HTML `type` attribute values to be placed on a [Dom.button]. +class ButtonType extends DebugFriendlyConstant { + /// The DOM `