Skip to content

Remove null values in nested objects#353

Merged
marcaaron merged 40 commits intoExpensify:mainfrom
margelo:@chrispader/remove-nested-nullish-object-keys
Sep 28, 2023
Merged

Remove null values in nested objects#353
marcaaron merged 40 commits intoExpensify:mainfrom
margelo:@chrispader/remove-nested-nullish-object-keys

Conversation

@chrispader
Copy link
Copy Markdown
Contributor

@chrispader chrispader commented Sep 19, 2023

@tgolen @blazejkustra @marcaaron @thienlnam

Details

At the moment, we only remove nullish values (undefined and null) for top-level keys in objects when merging.

In this Slack thread we agreed to also remove nullish values from nested objects.

Related Issues

#301

Automated Tests

Linked PRs

tgolen
tgolen previously approved these changes Sep 20, 2023
Copy link
Copy Markdown
Collaborator

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

I approve this PR. Let's merge as-is.

@marcaaron
Copy link
Copy Markdown
Contributor

I think it needs some more work, no?

@chrispader
Copy link
Copy Markdown
Contributor Author

chrispader commented Sep 20, 2023

I approve this PR. Let's merge as-is.

LMAO! 😂 still not sure if it's a joke though.

I think it needs some more work, no?

Yes, it needs more work, just added the TODO comment so far...

@tgolen
Copy link
Copy Markdown
Collaborator

tgolen commented Sep 21, 2023

All tests are passing and there are no performance regressions. I think we're good here 👍

@chrispader chrispader changed the title Remove nullish values in nested objects Remove null values in nested objects Sep 21, 2023
@chrispader chrispader changed the title Remove null values in nested objects [HOLD on #359] Remove null values in nested objects Sep 21, 2023
@chrispader chrispader marked this pull request as ready for review September 21, 2023 12:45
@chrispader chrispader requested a review from a team as a code owner September 21, 2023 12:45
@melvin-bot melvin-bot bot requested review from Gonals and removed request for a team September 21, 2023 12:45
@neil-marcellini neil-marcellini self-requested a review September 22, 2023 04:51
Comment thread lib/utils.js Outdated
Comment thread lib/utils.js Outdated
Copy link
Copy Markdown
Contributor

@Szymon20000 Szymon20000 left a comment

Choose a reason for hiding this comment

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

Looks good!
I would remove lodash from the fast merge function. That kills Hermes optimisations and we merge quite frequently.

@chrispader
Copy link
Copy Markdown
Contributor Author

chrispader commented Sep 27, 2023

Looks good!
I would remove lodash from the fast merge function. That kills Hermes optimisations and we merge quite frequently.

@marcaaron @tgolen i'll let you guys decide if we want to omit underscore here. Looks like the better approach to remove underscore

@blazejkustra
Copy link
Copy Markdown
Contributor

This PR is blocking some of the TS migration issues (example). Any idea when we can expect this PR to be merged? @chrispader

@chrispader
Copy link
Copy Markdown
Contributor Author

@marcaaron @tgolen feel free to merge this whenever you think it's ready 👍

Just removed the underscore where possbile, so this should be good to go

@marcaaron
Copy link
Copy Markdown
Contributor

decide if we want to omit underscore here

Sounds good to me 👍

Copy link
Copy Markdown
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

noticed a small typo otherwise LGTM 👍

Comment thread lib/Onyx.js Outdated
Co-authored-by: Marc Glasser <marc.aaron.glasser@gmail.com>
@chrispader
Copy link
Copy Markdown
Contributor Author

noticed a small typo otherwise LGTM 👍

fixed! @marcaaron

@marcaaron marcaaron merged commit 8671b9c into Expensify:main Sep 28, 2023
@ospfranco
Copy link
Copy Markdown
Contributor

Just tried to merge 1.0.96 which includes this changes and the main app is failing.

Oscar Franco Screen 000021

It also causes an issue on app start:

Screenshot_1695972930
Simulator Screenshot - iPhone SE (3rd generation) - 2023-09-29 at 09 02 10

ospfranco added a commit to margelo/react-native-onyx that referenced this pull request Sep 29, 2023
…ove-nested-nullish-object-keys"

This reverts commit 8671b9c, reversing
changes made to ce35c4e.
marcaaron added a commit that referenced this pull request Sep 29, 2023
…-object-keys

Revert pull request #353 remove-nested-nullish-object-keys
@marcaaron
Copy link
Copy Markdown
Contributor

Sounds good. I merged the revert.

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.

10 participants