Skip to content

Batch initial hydration#354

Merged
mountiny merged 4 commits intoExpensify:mainfrom
janicduplessis:@janic/init-batch
Sep 25, 2023
Merged

Batch initial hydration#354
mountiny merged 4 commits intoExpensify:mainfrom
janicduplessis:@janic/init-batch

Conversation

@janicduplessis
Copy link
Contributor

Details

Batch the initial hydration with the same mechanism introduced in #315. This is useful to make rendering of all connected components happen in the same batch. In this cases this reduces renders when opening a new chat in Expensify from ~100 to ~30.

Related Issues

N/A

Automated Tests

This doesn't really add new functionality, I just made sure the existing still pass.

Linked PRs

N/A

@janicduplessis janicduplessis requested a review from a team as a code owner September 20, 2023 11:34
@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@melvin-bot melvin-bot bot requested review from jasperhuangg and removed request for a team September 20, 2023 11:34
@janicduplessis
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copy link
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.

The changes LGTM overall. Great stuff @janicduplessis

Just one small request to aid in understanding the case where we do not batch

tgolen
tgolen previously approved these changes Sep 21, 2023
Copy link
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.

Looks pretty straight forward

@jasperhuangg
Copy link
Contributor

It seems like you're in pretty good hands here so I'm going to unassign myself since I don't have the best context on these changes.

@jasperhuangg jasperhuangg removed their request for review September 21, 2023 04:16
@janicduplessis
Copy link
Contributor Author

@mountiny @marcaaron @tgolen Thanks for the review! I addressed your feedback.

return batchUpdatesPromise;
}

function batchUpdates(updates) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function batchUpdates(updates) {
function queueUpdates(updates) {

I think this is a clearer name for this function?

Copy link
Contributor

Choose a reason for hiding this comment

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

but also it is not only queueing, it's queueing and maybe processing. Not sure. Maybe batchUpdates is explicative enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code was actually just moved and I didn't change it so maybe it would be better to keep it as is?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I didn't review the previous PR so I think it's NAB

mountiny
mountiny previously approved these changes Sep 22, 2023
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

marcaaron
marcaaron previously approved these changes Sep 22, 2023
@mountiny
Copy link
Contributor

@janicduplessis seems like tests are not happy

@janicduplessis janicduplessis dismissed stale reviews from marcaaron and mountiny via 847a314 September 22, 2023 08:21
@janicduplessis
Copy link
Contributor Author

@mountiny Strange, the tests are passing locally. I added a potential fix, can you run them again?

@mountiny
Copy link
Contributor

Running

@janicduplessis
Copy link
Contributor Author

@mountiny Looks like it passed 🎉

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

I see the App is already on 1.0.87 so I think we can go ahead and merge this

@mountiny mountiny merged commit e0d343b into Expensify:main Sep 25, 2023
@janicduplessis janicduplessis deleted the @janic/init-batch branch September 26, 2023 00:11
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.

6 participants