Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for ReactiveSet #688

Merged
merged 9 commits into from
Sep 29, 2024
Merged

Fixes for ReactiveSet #688

merged 9 commits into from
Sep 29, 2024

Conversation

Exelord
Copy link
Contributor

@Exelord Exelord commented Sep 8, 2024

Hi @thetarnav and @atk :)

Decided to split this draft PR into 2 chunks Set and Map fixes. Starting with Set here. Best to review commit by commit. Let me know where more reasoning is required, I will add comments.

Thanks!

Copy link

changeset-bot bot commented Sep 8, 2024

🦋 Changeset detected

Latest commit: 32fcb81

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@solid-primitives/set Minor
@solid-primitives/trigger Minor
@solid-primitives/map Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

packages/set/src/index.ts Outdated Show resolved Hide resolved
packages/set/src/index.ts Show resolved Hide resolved
values(): IterableIterator<T> {
return this.keys();

*values(): IterableIterator<T> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Iterators no longer track specific keys. That optimization was working under the assumption that a BREAK will always happen in specific iteration, which might not be always a case as it can depend on external logic. All iterators should always be rerun if any op to the Set will happen.

Copy link
Member

Choose a reason for hiding this comment

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

Can you mention that in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, Could you point me a place where I should do that?

Copy link
Member

Choose a reason for hiding this comment

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

Just another section „break optimization” after the „how to use” should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand what is expected here to document to be honest. There is no break optimization anymore, and the previous was a bug. Should't that be mentioned rather in changelog?

packages/set/src/index.ts Show resolved Hide resolved
packages/set/src/index.ts Show resolved Hide resolved
packages/set/src/index.ts Show resolved Hide resolved
packages/set/src/index.ts Show resolved Hide resolved
packages/set/src/index.ts Outdated Show resolved Hide resolved
packages/set/src/index.ts Outdated Show resolved Hide resolved
Copy link
Member

@thetarnav thetarnav left a comment

Choose a reason for hiding this comment

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

Good changes.

packages/trigger/src/index.ts Outdated Show resolved Hide resolved
packages/set/test/index.test.ts Show resolved Hide resolved
values(): IterableIterator<T> {
return this.keys();

*values(): IterableIterator<T> {
Copy link
Member

Choose a reason for hiding this comment

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

Can you mention that in the docs?

@thetarnav thetarnav merged commit 31f8723 into solidjs-community:main Sep 29, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Sep 29, 2024
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