Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIP-2410: Basic DDC support #82

Merged
merged 15 commits into from
Jun 21, 2017

Conversation

greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Jun 20, 2017

Ultimate problem:

Running OverReact-based code in the DDC resulted in several runtime errors.

Also, the patterns of declaring abstract prop getters was problematic.

How it was fixed:

  • Fix DDC issues within internal code
    • Major fixes:
    • Minor fixes:
      • Disable caching (for now) in getProps since Expandos not working on certain JS objects
      • Fix mixing in the same props class twice
      • Work around MapViewMixin and Props/StateMapViewMixin errors in DDC
  • Fix DDC issues likely to be experienced by consumers
  • Add tests for:
    • emulated function name bug workaround
      • Some DDC-specific have been added but are disabled for now, until we set up test to run in the DDC
    • abstract accessor transformer workaround

Testing suggestions:

Potential areas of regression:

  • UiProps + fluent interface
  • transformer

FYA: @greglittlefield-wf @aaronlademann-wf @jacehensley-wf @clairesarsam-wf @joelleibow-wf

@aviary2-wf
Copy link

Raven

Number of Findings: 0

@@ -35,7 +35,7 @@ DomProps domProps([Map backingMap]) => new DomProps(null, backingMap);

typedef DomProps DomPropsFactory();

class DomProps extends component_base.UiProps with DomPropsMixin, ReactPropsMixin {
class DomProps extends component_base.UiProps with DomPropsMixin {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of "Fix mixing in the same props class twice"; ReactPropsMixin is already mixed in by component_base.UiProps

@@ -45,7 +45,7 @@ class DomProps extends component_base.UiProps with DomPropsMixin, ReactPropsMixi
final Map props;
}

class SvgProps extends component_base.UiProps with DomPropsMixin, ReactPropsMixin, SvgPropsMixin implements DomProps {
class SvgProps extends component_base.UiProps with DomPropsMixin, SvgPropsMixin implements DomProps {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of "Fix mixing in the same props class twice"; ReactPropsMixin is already mixed in by component_base.UiProps

var parameters = []
..add(props)
..addAll(invocation.positionalArguments);
return Function.apply(factory, parameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need test coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; though 99% of cases will use a ReactComponentFactoryProxy, it's in here for backwards compatibility.

I'll add some tests around this.

Copy link
Contributor Author

@greglittlefield-wf greglittlefield-wf Jun 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage added in 88bce6c

(member.isGetter || member.isSetter) &&
!member.isSynthetic &&
!member.isStatic &&
member.metadata.any((meta) => meta.name.name == 'override')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the consumer isn't annotating overrides?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then they need to start annotating overrides if they want to get this opt-in fix 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine, seeing as the @override restriction is documented. I put that restriction in place to avoid patching accessors that might not need it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let Trent know that we should require the annotate overrides lint then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's necessary. The issue that this fixes is quite apparent when building in the DDC, so it's easy to identify which getters are problematic. And then there's also the tool that @georgelesica-wf, which should also identify problematic getters.

Plus, I'm not sure that anyone else outside of our team even uses this pattern. .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better safe than sorry

@codecov-io
Copy link

codecov-io commented Jun 20, 2017

Codecov Report

Merging #82 into master will decrease coverage by 2.77%.
The diff coverage is 93.19%.

@@            Coverage Diff             @@
##           master      #82      +/-   ##
==========================================
- Coverage   97.58%   94.81%   -2.76%     
==========================================
  Files          29       31       +2     
  Lines        1402     1522     +120     
==========================================
+ Hits         1368     1443      +75     
- Misses         34       79      +45

Copy link
Contributor

@clairesarsam-wf clairesarsam-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not seeing any issues in the current state of this code - waiting on further test coverage to +1.

@aaronlademann-wf
Copy link
Contributor

@clairesarsam-wf ready for dev +1

@clairesarsam-wf
Copy link
Contributor

+1

@aaronlademann-wf
Copy link
Contributor

QA +10

  • Testing instruction
    • Tests pass on content-shell running Dart 1.23.0
    • Tests pass on chrome running Dart 1.23.0
  • Dev +1's
  • Dev/QA +10
  • Unit tests created/updated
  • All unit tests pass
  • Rosie ran/Rosie comment displays expected info
  • Dependency Scan Clean

Merging.

@aaronlademann-wf aaronlademann-wf merged commit 86082d4 into Workiva:master Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants