Skip to content

Conversation

@chuganzy
Copy link
Contributor

@chuganzy chuganzy commented Oct 1, 2025

This PR just rollbacks mapTick in the CompositeList to use counter-based update for the better memory-efficiency.

Theads: #2675 (comment)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 1, 2025

vite-css-base-ui-example

pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@2880
pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@2880

commit: fc7417b

@chuganzy chuganzy changed the title [composite] Rollback to use counter-based update [composite] Rollback CompositeList to use counter-based update Oct 1, 2025
@chuganzy chuganzy marked this pull request as ready for review October 1, 2025 14:03
@netlify
Copy link

netlify bot commented Oct 1, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit fc7417b
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68de1c5e18a0cd000820a6de
😎 Deploy Preview https://deploy-preview-2880--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines 30 to 33
// `mapTick` intentionally uses a counter-based update rather than unique objects.
// This is because the chance of precision loss in the counter is extremely low,
// while `mapTick` updates relatively often and is more memory-efficient.
const [mapTick, setMapTick] = React.useState(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment is too long relatively to the importance of that line of code. I'd compact it in a single-line comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing and pushed a commit to shorten it
4ccac87

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for taking care of it. 🙏

@LukasTy LukasTy changed the title [composite] Rollback CompositeList to use counter-based update [composite] Rollback CompositeList to use counter-based update Oct 2, 2025
@LukasTy LukasTy added the type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. label Oct 2, 2025
@mui-bot
Copy link

mui-bot commented Oct 2, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react ▼-1B(0.00%) ▼-4B(0.00%)

Details of bundle changes

@LukasTy LukasTy merged commit b7624d4 into mui:master Oct 2, 2025
21 checks passed
@chuganzy chuganzy deleted the revert-tick branch October 2, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: composite type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants