-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Replace defaultValue
with ??
#11674
Comments
Overall, the more we can automate things with eslint rules, the better. If we do chose to replace it all at once, we should have any eslint configurations in one commit, and the actual replacement in its own commit to make merging as easy as possible.
I agree we'd want to take stock of the usage before removing it. If we do chose to remove it, we'd go through a deprecation period where we transition users off.
Yes. This creates a new object every time, whereas |
@ggetz Not sure whether this is still needed, but I can do this. I'm going to drop the other one I volunteered for. |
We should replace this with another global value, maybe an export called We may want to do it with the empty array as well but I don't know if we use that as often as the empty object. Start with just the object and make note of how many I know it'll probably just be a very large tedious PR but feel free to do it in pieces and open it whenever you're ready. If you want to do it in chunks and open a draft PR i'm happy to take a look early just to confirm you're on the right track or anything. |
@jjspace Thanks for the feedback. Let me do a PR right now. And it looks like there are two references to |
@jjspace Sorry for not creating the pull request. The tests are failing. I'm trying to figure out how to run individual tests in the debugger so that I can trace the issue, but am having troubling figuring out how to get it set it. Here's the type of error I'm getting: |
You can run single tests or suites by putting "f" in front of the In the specific test you showed it looks like a value that was previously guaranteed to be an array (or something else) using |
@jjspace Thanks for the testing guide. I fixed it. (I accidentally deleted a |
@jjspace Just realized there are 2500 of these references. I think I'll break this in half and submit two halves. Will probably be a little more digestible this way. |
@dave-b-b 😅 that's why I said it would probably be a very large and tedious but simple PR. I think it'd be best if we have 1 final commit that we can merge and then possibly tag before and after to make it easy to merge into other PRs like I'll have to do for my If you still want to split it up we can use the first PR as a sort of "staging" branch and you can create one or more smaller PRs into that one to review smaller chunks, like this: gitGraph
commit
commit
branch first-half
checkout first-half
commit
branch second-half
commit
checkout first-half
merge second-half
checkout main
merge first-half
commit
|
The builtin JS Nullish coalescing operator
??
behaves exactly the same as thedefaultValue
functionTransition options
??
for all new codedefaultValue
to match existing code??
?Considerations
defaultValue
), how many people use it downstream?defaultValue.EMPTY_OBJECT
? (Related defaultValue.EMPTY_OBJECT missing from documentation and Typescript #11326){}
everywhere?The text was updated successfully, but these errors were encountered: