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-2512 Add more utils from over_react #11

Merged
merged 14 commits into from
Jul 24, 2017

Conversation

aaronlademann-wf
Copy link
Contributor

@aaronlademann-wf aaronlademann-wf commented Jul 13, 2017

Ultimate problem:

There were some test utilities within over_react that were not exposed / available for consumers.

How it was fixed:

Move them here, and expose them!

Testing suggestions:

Passing CI

Areas of regression

None expected


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

+ Unless we’re prepared to address them, I’d prefer that we turn them off.
+ We don’t have nearly enough tests in this lib to need to run them all syncronously.
+ For things like prop forwarding
@aviary2-wf
Copy link

aviary2-wf commented Jul 13, 2017

Raven

Number of Findings: 0

@codecov-io
Copy link

codecov-io commented Jul 13, 2017

Codecov Report

Merging #11 into master will decrease coverage by 43.4%.
The diff coverage is 4.79%.

@@             Coverage Diff             @@
##           master      #11       +/-   ##
===========================================
- Coverage   97.62%   54.23%   -43.39%     
===========================================
  Files           5        9        +4     
  Lines         210      402      +192     
===========================================
+ Hits          205      218       +13     
- Misses          5      184      +179


group('startRecordingValidationWarnings()', () {
test('begins recording validation warnings, appending them to `_validationWarnings` as expected', () {
react_dom.render(TestValidationWarnings()(), mountNode);
Copy link
Contributor

Choose a reason for hiding this comment

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

Using a component to test this seems really unnecessary. Why not just call ValidationUtil.warn directly in this test?

// limitations under the License.

/// Utility function to convert a `SCREAMING_SNAKE` [str] into a `spinal-case` equivalent.
String screamingSnakeToSpinal(String str) {
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 one-liner really worth including?

String screamingSnakeToSpinal(String str) => str.replaceAll('_', '-').toLowerCase();

I'm not opposed to leaving it in, but it seems extraneous.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe not (shrug)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I purposefully omitted this when moving stuff over

# - prefer_final_fields
# - prefer_final_locals
- prefer_function_declarations_over_variables
# - prefer_function_declarations_over_variables
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf Jul 13, 2017

Choose a reason for hiding this comment

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

Why was this lint disabled? Seems like it'd be valuable to keep enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To get rid of noisy lints that we have no intention of addressing.

If someone wants to address them, thats cool - but the analyzer view within the IDE is most useful when it is empty when you start your work.

import 'package:react/react_client/js_interop_helpers.dart';

/// A factory for a JS composite component.
/// A factory for testing a JS composite component.
Copy link
Contributor

Choose a reason for hiding this comment

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

#nit This is a little confiusing. What about:

A factory for a JS composite component, for use in testing.

Copy link
Contributor

@jacehensley-wf jacehensley-wf left a comment

Choose a reason for hiding this comment

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

Two small comments

@@ -13,12 +13,12 @@
// limitations under the License.

import 'package:js/js.dart';
import 'package:react/react.dart' as react;
import 'package:react/react.dart' as react show div;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure tbh @jacehensley-wf - is it a problem? I may have just done it to make it easier to grok what specifically is needed from react.dart in this file since in general - we want to minimize direct dependencies on react, and prefer depending on the exports provided in over_react.

Copy link
Contributor

Choose a reason for hiding this comment

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

No it doesn't matter, was just curious 😄

import 'package:react/react_client.dart';
import 'package:react/react_client/react_interop.dart';
import 'package:react/react_client/react_interop.dart' show React, ReactClassConfig;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure tbh @jacehensley-wf - is it a problem? I may have just done it to make it easier to grok what specifically is needed from react.dart in this file since in general - we want to minimize direct dependencies on react, and prefer depending on the exports provided in over_react.

@aaronlademann-wf aaronlademann-wf changed the title Add more utils from over_react UIP-2512 Add more utils from over_react Jul 18, 2017
@jacehensley-wf
Copy link
Contributor

+1

@leviwith-wf
Copy link
Contributor

QA +10

  • build passes
  • tests also pass locally

  • Testing instruction
  • Dev +1's
  • Dev/QA +10
  • All unit tests pass
  • Rosie ran/Rosie comment displays expected info
  • Dependency Scan Clean

Merging.

aaronlademann-wf added a commit that referenced this pull request Jul 26, 2017
+ Looks like some changes had been made in parallel in the lib where these originated - and those changes never made it into #11
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