-
Notifications
You must be signed in to change notification settings - Fork 67
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
FED-1728 Migrate to null safety #373
Conversation
It can't really be made null safe, and we always intended on removing it in the next major.
Simulated synthetic events will be missing some properties if they're not included in eventData, meaning the non-nullable typings on them are incorrect. As opposed to making everything nullable to account for that, we'll treat those simulated events the same way Mockito treats mock objects, and just require that any properties being accessed get stubbed in using the eventData argument.
versioning it useRef without an argument is more common than with one, and this approach improves that experience by: 1. not requiring consumers explicitly provide `null` and provide a nullable type argument 2. not involving a new, versioned API that must be migrated to
Importantly, this fixes some callback ref typing issues after fixing unnecessary_lambdas lints
2d3e1e3
to
dbcf43a
Compare
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.
Didn't make it very far... will pick this back up tomorrow.
e4f4faf
to
7ab1084
Compare
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.
This is great work!!!
test/nullable_callback_detection/nullable_callback_detection_sound_test.dart
Outdated
Show resolved
Hide resolved
expect(array is List, isTrue); | ||
array as List; |
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.
Whoa - is this new? Cast once and be done for the remaining scope?
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.
Yup! There's a bunch of tiny little type promotion improvements like this added alongside null safety; it's so nice!
componentWillUpdateWithContext/shouldComponentUpdateWithContext
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.
+1
+10 |
@Workiva/release-management-p |
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.
+1 from RM
Motivation
This package needs to be upgraded to null safety in order for it to be used in other null-safe packages, and is a prerequisite for being consumed in Dart 3.
This PR contains the bulk of the changes that will make up the react-dart 7.0.0 major release.
A separate PR will be made into the v7_wip branch to perform other planned deprecated API removals. We can do a more complete audit of public API changes either at that point, or in the PR to merge the
v7_wip
branch.Changes
null
key handling in JsBackedMap, required due to null-safe typing of getProperty/setProperty when implicit-casts are disabled, add testsassert
s that callback ref args aren’t non-nullable, add testsReactComponentFactoryProxy.call
return type fromdynamic
toReactElement
dynamic
toReactDomComponentFactoryProxy
forwardRef
,memo
,main
.fromJs
Testing