Skip to content

Conversation

@just-boris
Copy link
Member

Issue #, if available:

Description of changes:

Optimization for React, if there will be multiple state changes inside onObserve, they will be batched into a single re-render

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.22%. Comparing base (c8a5c73) to head (28d9589).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #107   +/-   ##
=======================================
  Coverage   99.22%   99.22%           
=======================================
  Files          27       27           
  Lines         642      644    +2     
  Branches      175      172    -3     
=======================================
+ Hits          637      639    +2     
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jperals
Copy link
Member

jperals commented Dec 6, 2024

Has this been somehow tested?

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { unstable_batchedUpdates } from 'react-dom';
Copy link
Member

Choose a reason for hiding this comment

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

Note that react-dom is a dev dependency —is this okay? Consumers of this package might not get it installed

Copy link
Member Author

Choose a reason for hiding this comment

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

@just-boris
Copy link
Member Author

Has this been somehow tested?

Only manually. This API changes internal react things, you cannot write a test on this

@just-boris just-boris added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit d5f68a1 Dec 6, 2024
36 checks passed
@just-boris just-boris deleted the batch-resize-observer branch December 6, 2024 10:09
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.

2 participants