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

v5 #2138

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft

v5 #2138

wants to merge 51 commits into from

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Oct 22, 2023

@vercel
Copy link

vercel bot commented Oct 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zustand-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2024 5:57am

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 22, 2023

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 Oct 22, 2023

Size Change: -46.6 kB (-88.3%) 🏆

Total Size: 6.17 kB

Filename Size Change
dist/context.js 0 B -820 B (removed) 🏆
dist/esm/context.js 0 B -612 B (removed) 🏆
dist/esm/index.js 0 B -736 B (removed) 🏆
dist/esm/middleware.js 0 B -3.88 kB (removed) 🏆
dist/esm/middleware/immer.js 0 B -210 B (removed) 🏆
dist/esm/react/shallow.js 0 B -465 B (removed) 🏆
dist/esm/shallow.js 0 B -499 B (removed) 🏆
dist/esm/traditional.js 0 B -421 B (removed) 🏆
dist/esm/vanilla.js 0 B -656 B (removed) 🏆
dist/esm/vanilla/shallow.js 0 B -355 B (removed) 🏆
dist/index.js 244 B -660 B (-73.01%) 🏆
dist/middleware.js 3.53 kB -904 B (-20.41%) 🎉
dist/middleware/immer.js 229 B -99 B (-30.18%) 🎉
dist/react/shallow.js 222 B -857 B (-79.43%) 🏆
dist/shallow.js 191 B -931 B (-82.98%) 🏆
dist/system/context.development.js 0 B -696 B (removed) 🏆
dist/system/context.production.js 0 B -390 B (removed) 🏆
dist/system/index.development.js 0 B -920 B (removed) 🏆
dist/system/index.production.js 0 B -431 B (removed) 🏆
dist/system/middleware.development.js 0 B -4.01 kB (removed) 🏆
dist/system/middleware.production.js 0 B -2.63 kB (removed) 🏆
dist/system/middleware/immer.development.js 0 B -293 B (removed) 🏆
dist/system/middleware/immer.production.js 0 B -187 B (removed) 🏆
dist/system/react/shallow.development.js 0 B -566 B (removed) 🏆
dist/system/react/shallow.production.js 0 B -384 B (removed) 🏆
dist/system/shallow.development.js 0 B -546 B (removed) 🏆
dist/system/shallow.production.js 0 B -331 B (removed) 🏆
dist/system/traditional.development.js 0 B -537 B (removed) 🏆
dist/system/traditional.production.js 0 B -359 B (removed) 🏆
dist/system/vanilla.development.js 0 B -698 B (removed) 🏆
dist/system/vanilla.production.js 0 B -327 B (removed) 🏆
dist/system/vanilla/shallow.development.js 0 B -428 B (removed) 🏆
dist/system/vanilla/shallow.production.js 0 B -308 B (removed) 🏆
dist/traditional.js 425 B -47 B (-9.96%) 👏
dist/umd/context.development.js 0 B -928 B (removed) 🏆
dist/umd/context.production.js 0 B -568 B (removed) 🏆
dist/umd/index.development.js 0 B -1.03 kB (removed) 🏆
dist/umd/index.production.js 0 B -558 B (removed) 🏆
dist/umd/middleware.development.js 0 B -4.58 kB (removed) 🏆
dist/umd/middleware.production.js 0 B -2.97 kB (removed) 🏆
dist/umd/middleware/immer.development.js 0 B -482 B (removed) 🏆
dist/umd/middleware/immer.production.js 0 B -342 B (removed) 🏆
dist/umd/react/shallow.development.js 0 B -1.22 kB (removed) 🏆
dist/umd/react/shallow.production.js 0 B -887 B (removed) 🏆
dist/umd/shallow.development.js 0 B -1.24 kB (removed) 🏆
dist/umd/shallow.production.js 0 B -875 B (removed) 🏆
dist/umd/traditional.development.js 0 B -652 B (removed) 🏆
dist/umd/traditional.production.js 0 B -465 B (removed) 🏆
dist/umd/vanilla.development.js 0 B -836 B (removed) 🏆
dist/umd/vanilla.production.js 0 B -430 B (removed) 🏆
dist/umd/vanilla/shallow.development.js 0 B -1.11 kB (removed) 🏆
dist/umd/vanilla/shallow.production.js 0 B -840 B (removed) 🏆
dist/vanilla.js 416 B -300 B (-41.9%) 🎉
dist/vanilla/shallow.js 563 B -413 B (-42.32%) 🎉
dist/react.js 353 B +353 B (new file) 🆕

compressed-size-action

@sewera
Copy link
Collaborator

sewera commented Oct 22, 2023

Maybe consider changing React Snowpack to React Vite on CodeSandbox?

@dai-shi
Copy link
Member Author

dai-shi commented Oct 22, 2023

I think you can just add it, if you are talking about .codesandbox/ci.json.
Feel free to open a PR to the main branch.
I don't know if the container sandbox is already supported.

@sewera
Copy link
Collaborator

sewera commented Oct 22, 2023

I'll see if I've got some time in the nearest future :)

@TheMikeyRoss
Copy link

I'm a noob learning things and asking around.

I noticed many libraries dropping default exports. may I ask why?

@dai-shi
Copy link
Member Author

dai-shi commented Nov 22, 2023

@TheMikeyRoss Can you open a new discussion? https://github.com/pmndrs/zustand/discussions/new

@charkour
Copy link
Collaborator

charkour commented Dec 9, 2023

@dai-shi, I see the checklist in the PR description, could I help tackle some of the bullet points? Thanks

@dai-shi
Copy link
Member Author

dai-shi commented Dec 9, 2023

@charkour I was wondering when we should start this, but if you are interested please go ahead. Note that I may have some hidden requirements which isn't described well in the bullet points, so bear with me. (I think I should work on the TS one on my own.)

We do something like this pmndrs/valtio#810, so please open PRs for each point against v5 branch.

@charkour
Copy link
Collaborator

charkour commented Dec 9, 2023

Sounds great! I can start on dropping the default exports.

No worries on the hidden requirements, I'm happy to help and let you take over if you disagree with one of my changes.

* fix: drop default exports for v5

* chore: remove default from cjs build

* refactor: export shallow in v5

* fix: remove `addModuleExport` option for cjs.
@dbritto-dev
Copy link
Collaborator

dbritto-dev commented Mar 10, 2024

Hi. Thanks for the library, always nice. I have one minor question: why the code is remained for createState that being nullable in createStore, which was previously left for context?

I checked out v5 and saw that removing it still passes all my tests, is it for external libraries?

export const createStore = ((createState) =>

  createState ? createStoreImpl(createState) : createStoreImpl) as CreateStore

@bluejoyq that's for middlewares

@dai-shi
Copy link
Member Author

dai-shi commented Mar 10, 2024

that's for typescript for middleware. it's redundant for JS. can't be helped.

@dai-shi
Copy link
Member Author

dai-shi commented Mar 23, 2024

* chore: remove devtools extension warning

* docs: add devtools link to readme

* chore: remove unused test

* chrome: remove unused tests

* chore: remove unused test

* Revert "chore: remove unused test"

This reverts commit 0fa2a75.

* update test name
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.

None yet

8 participants