CPLAT-3968 CPLAT-3969 Add unconvertJsProps() util to react_client.dart#153
Merged
greglittlefield-wf merged 6 commits intoWorkiva:masterfrom Feb 8, 2019
Merged
Conversation
607e1fc to
dbe7d70
Compare
Collaborator
|
+1 |
Collaborator
Author
|
@greglittlefield-wf I went ahead and added a |
Collaborator
|
+1 |
test/react_client_test.dart
Outdated
| for (final key in eventPropKeyToEventFactory.keys) { | ||
| expect(jsProps[key], isNotNull, | ||
| reason: 'JS event handler prop should not be null'); | ||
| expect(identical(jsProps[key], originalHandlers[key]), isTrue, |
Collaborator
There was a problem hiding this comment.
FYI there's a same matcher you can use
Collaborator
Author
There was a problem hiding this comment.
Can't believe I didn't know that
Collaborator
|
+1 |
Collaborator
Author
|
Consumer tests:
|
This was referenced Feb 7, 2019
maxwellpeterson-wf
approved these changes
Feb 8, 2019
Collaborator
|
+1, merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
getJsProps()method in over_react makes more sense in this library, as it is intended to be used only with JS components and not Dart components. over_react has its owngetProps()that should be sufficient (and usesgetJsProps()internally).To avoid naming conflicts and ambiguous imports in over_react, I've added the same functionality under a different name:
unconvertJsProps(). This should also help clarify its intended usage in the future when some additional JS map work is taken on.Additionally, logic was added to handle the unconverting of the JS event handlers (they are converted to their synthetic counterparts when added), which is necessary for Dart 2 compatibility.
Testing
Code Review
@greglittlefield-wf @aaronlademann-wf @kealjones-wk @corwinsheahan-wf