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

AF-392: Add workaround to NSM for Dart 2 #207

Merged
merged 5 commits into from
Jan 25, 2019

Conversation

corwinsheahan-wf
Copy link
Contributor

@corwinsheahan-wf corwinsheahan-wf commented Dec 7, 2018

Ultimate problem:

In Dart 2, calls to noSuchMethod include the default values for positional parameters, and it is no longer possible to tell how many arguments have been specified: https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#200-dev560

This breaks our variadic children implementation, which uses noSuchMethod and the positional parameter length to know how many children were passed in.

This is a blocker for Dart 2.

How it was fixed:

Testing suggestions:

  • Smoke test on dart 1 in web_skin_dart (tests pass, examples work, etc.)

Potential areas of regression:

  • React components

FYA: @greglittlefield-wf @aaronlademann-wf @evanweible-wf @sebastianmalysa-wf

@corwinsheahan-wf corwinsheahan-wf requested a review from a team as a code owner December 7, 2018 23:00
@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@corwinsheahan-wf corwinsheahan-wf changed the title AF-392: Add workaround for NSM for Dart 2 WIP: AF-392: Add workaround for NSM for Dart 2 Dec 7, 2018
@@ -54,7 +54,7 @@ class DomProps extends component_base.UiProps
String get propKeyNamespace => '';

@override
ReactElement 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]);
ReactElement call([c1, 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]);
Copy link
Contributor

Choose a reason for hiding this comment

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

These can actually just get removed now, since they were put in as a workaround to not having NSM! a5c1820#diff-f41fd818c60cfc37d947e71aa885a019
🎉

lib/src/component_declaration/component_base.dart Outdated Show resolved Hide resolved
test/vm_tests/transformer/impl_generation_test.dart Outdated Show resolved Hide resolved
* Naming adjustment
* actually test paths for call() on UiProps
* Remove unneeded call() instances
if (factory is ReactComponentFactoryProxy) {
// Use `build` instead of using emulated function behavior to work around DDC issue
// https://github.com/dart-lang/sdk/issues/29904
// Should have the benefit of better performance; TODO optimize type check?
Copy link
Contributor Author

@corwinsheahan-wf corwinsheahan-wf Dec 13, 2018

Choose a reason for hiding this comment

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

This TODO was already in the noSuchMethod implementation. Not sure if it should stay 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, looking at this again, this type-check should be quite cheap, so I say we can remove this TODO

@codecov-io
Copy link

codecov-io commented Dec 13, 2018

Codecov Report

Merging #207 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage    90.3%   90.31%   +0.02%     
==========================================
  Files          35       35              
  Lines        1772     1775       +3     
==========================================
+ Hits         1600     1603       +3     
  Misses        172      172

@corwinsheahan-wf corwinsheahan-wf changed the title WIP: AF-392: Add workaround for NSM for Dart 2 AF-392: Add workaround for NSM for Dart 2 Dec 18, 2018
@corwinsheahan-wf corwinsheahan-wf changed the title AF-392: Add workaround for NSM for Dart 2 AF-392: Add workaround to NSM for Dart 2 Dec 18, 2018
@aaronlademann-wf aaronlademann-wf added the dart2 PRs targeting our effort to get to Dart SDK 2.0 compatibility label Dec 20, 2018
@evanweible-wf evanweible-wf added this to the Dart 2 Compat milestone Dec 21, 2018
@corwinsheahan-wf
Copy link
Contributor Author

This is blocked until https://github.com/Workiva/graph_ui/pull/399 is merged.

@sebastianmalysa-wf
Copy link
Contributor

sebastianmalysa-wf commented Jan 11, 2019

Consumed this in the following repos with no issues:

  • audit
  • datatables
  • graph_ui
  • home
  • text_doc_client
  • w_virtual_components
  • web_skin_dart

There were two errors found with this consumed in graph_app. The following PR fixes these errors and will need to be merged/released before this can move forward: https://github.com/Workiva/graph_app/pull/6723

@sebastianmalysa-wf
Copy link
Contributor

@corwinsheahan-wf @evanweible-wf web_skin_dart Skynet run is failing, but I don't think it's related to the consumption of this work. I think we're ready to move forward with this.

@evanweible-wf
Copy link
Contributor

QA +1

  • CI passes
  • Consumer tests pass

@Workiva/release-management-p

@rmconsole7-wk rmconsole7-wk merged commit cc52209 into master Jan 25, 2019
@rmconsole7-wk rmconsole7-wk deleted the AF-392_variadic_children_dart2_workaround branch January 25, 2019 16:57
@evanweible-wf evanweible-wf modified the milestones: Dart 2 Compat, 2.0.0 (Dart 1 & 2 compatibility) Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart2 PRs targeting our effort to get to Dart SDK 2.0 compatibility Merge Requirements Met RM Ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants