Skip to content

Replaced defaultValue with ?? #12507

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

Merged
merged 4 commits into from
Mar 13, 2025
Merged

Replaced defaultValue with ?? #12507

merged 4 commits into from
Mar 13, 2025

Conversation

jfayot
Copy link
Contributor

@jfayot jfayot commented Mar 3, 2025

Description

  • Deprecated defaultValue function, replaced by nullish coalescing operator.
  • Deprecated defaultValue.EMPTY_OBJECT, replaced by Frozen.EMPTY_OBJECT.
  • Added Frozen namespace with EMPTY_ARRAY and EMPTY_OBJECT frozen values and associated documentation.
  • Replaced [] by DefaultValues.EMPTY_ARRAY only where appropriate.
  • Updated coding guide.

Issue number and link

Fixes #11674

Testing plan

  • All specs still pass.
  • Functionally, everything should be the same, so primarily review the files themselves.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

github-actions bot commented Mar 3, 2025

Thank you for the pull request, @jfayot!

✅ We can confirm we have a CLA on file for you.

@jfayot jfayot changed the title fix: replaced defaultValue with ?? Replaced defaultValue with ?? Mar 3, 2025
Copy link
Contributor

@jjspace jjspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @jfayot! Overall the code changes all seem good to me, just a couple minor comments.

Would you also be able to post a comment with the steps/process you took to do this? I suspect that anyone that was using these functions (like some of our other internal libraries) is using them everywhere and need a large PR like this. It would greatly benefit them if you already found a process that works well

@jfayot
Copy link
Contributor Author

jfayot commented Mar 5, 2025

@jjspace, I think it is ready for another review.

I've created a repo in which you will find the migration scripts. It has some limitations, but still could be useful and be adapted for specific use cases. Off course it can be shared with the community.

@jfayot
Copy link
Contributor Author

jfayot commented Mar 11, 2025

Hi @jjspace ! Will you have some time to dedicate on reviewing final changes for this PR ?

Copy link
Contributor

@jjspace jjspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes and comments @jfayot. This is very close, just some last organizational comments

@jfayot
Copy link
Contributor Author

jfayot commented Mar 11, 2025

@jjspace this should be ready for another review!

The migration scripts have been updated accordingly...

Copy link
Contributor

@jjspace jjspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, really happy to get this in! Thanks for all the work on this @jfayot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace defaultValue with ??
2 participants