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

feat: use-sync-external-store #234

Merged
merged 40 commits into from
Mar 30, 2022
Merged

feat: use-sync-external-store #234

merged 40 commits into from
Mar 30, 2022

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Sep 4, 2021

This PR uses https://www.npmjs.com/package/use-sync-external-store instead of useMutableSource emulation (useSubscription equivalent). It works both on React 18 and pre-18.

While it doesn't give much difference (technically, it prevents tearing on mount, that's it), and it doesn't change api / behavior, it's a non-trivial change with a new dependency.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 14, 2021

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.

Latest deployment of this branch, based on commit 2c251f7:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration

@github-actions
Copy link

github-actions bot commented Sep 28, 2021

Size Change: -2.85 kB (-6%) ✅

Total Size: 48.9 kB

Filename Size Change
dist/esm/index.js 786 B -573 B (-42%) 🎉
dist/index.js 868 B -573 B (-40%) 🎉
dist/system/index.development.js 967 B -588 B (-38%) 🎉
dist/system/index.production.js 584 B -290 B (-33%) 🎉
dist/umd/index.development.js 1.01 kB -541 B (-35%) 🎉
dist/umd/index.production.js 709 B -281 B (-28%) 🎉
ℹ️ View Unchanged
Filename Size
dist/esm/macro.js 613 B
dist/esm/macro/vite.js 697 B
dist/esm/utils.js 4.04 kB
dist/esm/vanilla.js 1.85 kB
dist/macro.js 910 B
dist/macro/vite.js 982 B
dist/system/macro.development.js 721 B
dist/system/macro.production.js 556 B
dist/system/macro/vite.development.js 828 B
dist/system/macro/vite.production.js 653 B
dist/system/utils.development.js 4.26 kB
dist/system/utils.production.js 2.88 kB
dist/system/vanilla.development.js 1.97 kB
dist/system/vanilla.production.js 1.25 kB
dist/umd/macro.development.js 1.06 kB
dist/umd/macro.production.js 766 B
dist/umd/macro/vite.development.js 1.15 kB
dist/umd/macro/vite.production.js 874 B
dist/umd/utils.development.js 4.83 kB
dist/umd/utils.production.js 3.07 kB
dist/umd/vanilla.development.js 2.06 kB
dist/umd/vanilla.production.js 1.31 kB
dist/utils.js 4.68 kB
dist/vanilla.js 1.95 kB

compressed-size-action

@vercel
Copy link

vercel bot commented Jan 25, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/valtio/8RBT39FXK8hzxM1F9iM3GheATEoh
✅ Preview: https://valtio-git-use-sync-external-store-pmndrs.vercel.app

@dai-shi dai-shi changed the title use-sync-external-store feat: use-sync-external-store Mar 30, 2022
@dai-shi dai-shi marked this pull request as ready for review March 30, 2022 00:23
@dai-shi dai-shi merged commit 7832674 into main Mar 30, 2022
@dai-shi dai-shi deleted the use-sync-external-store branch March 30, 2022 00:25
dai-shi added a commit that referenced this pull request May 20, 2022
… (#461)

* add failing test

* refactor

* fix rendering from parent
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.

1 participant