-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
+ 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
RavenNumber of Findings: 0 |
Codecov Report
@@ 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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not (shrug)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed?
There was a problem hiding this comment.
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
.
+1 |
QA +10
Merging. |
+ Looks like some changes had been made in parallel in the lib where these originated - and those changes never made it into #11
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