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.
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.
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.
Maybe not (shrug)
There was a problem hiding this comment.
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.
Why was this lint disabled? Seems like it'd be valuable to keep enabled.
There was a problem hiding this comment.
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.
#nit This is a little confiusing. What about:
A factory for a JS composite component, for use in testing.
jacehensley-wf
left a comment
There was a problem hiding this comment.
Two small comments
|
|
||
| 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.
Why was this changed?
There was a problem hiding this comment.
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.
No it doesn't matter, was just curious 😄
| import 'package:react/react.dart' as react show div; | ||
| 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.
Why was this changed?
There was a problem hiding this comment.
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_reactthat 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