Skip to content

Conversation

@overthemike
Copy link
Collaborator

@overthemike overthemike commented Nov 2, 2025

Related Bug Reports or Discussions

Fixes #

Summary

Check List

  • pnpm run fix for formatting and linting code and docs

@vercel
Copy link

vercel bot commented Nov 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
valtio Ready Ready Preview Comment Nov 2, 2025 2:47pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 2, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

Size Change: +259 B (+1.8%)

Total Size: 14.7 kB

Filename Size Change
./dist/esm/vanilla/utils.mjs 3.69 kB +130 B (+3.65%)
./dist/vanilla/utils.js 3.73 kB +129 B (+3.58%)
ℹ️ View Unchanged
Filename Size
./dist/esm/index.mjs 63 B
./dist/esm/react.mjs 694 B
./dist/esm/react/utils.mjs 257 B
./dist/esm/utils.mjs 68 B
./dist/esm/vanilla.mjs 2.34 kB
./dist/index.js 243 B
./dist/react.js 686 B
./dist/react/utils.js 278 B
./dist/utils.js 248 B
./dist/vanilla.js 2.38 kB

compressed-size-action

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 2, 2025

More templates

npm i https://pkg.pr.new/valtio@1175

commit: efdee3c

@overthemike
Copy link
Collaborator Author

overthemike commented Nov 2, 2025

I added an RSetLike<T> structural type to support any “set-like” object with .has() (not just real Sets) so that there's no reliance on ReadOnlySetLike for older typescript versions

I reimplemented the new set methods using TS overloads so they will accept "Set-like" objects.

Added asIterable() helper (with hasIterator / hasForEach) to normalize Set or Set-like inputs. This shouldn't change any existing runtime behavior with the exception of widening what proxySet accepts as "set-like" objects. asIterable(other) returns other unchanged when it has [Symbol.iterator] so it should be a no-op for existing stuff.

Copy link
Member

@dai-shi dai-shi 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 working on this. Comments below.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

LGTM

@dai-shi dai-shi changed the title changes to proxyset for new typescript impl refactor(utils): changes to proxySet for new typescript impl Nov 3, 2025
@dai-shi dai-shi merged commit f05bc4b into main Nov 3, 2025
33 checks passed
@dai-shi dai-shi deleted the setImpl branch November 3, 2025 01:38
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.

3 participants