Skip to content
New issue

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

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

Already on GitHub? # to your account

refactor(internals): isolated mounted map in store #2967

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Feb 1, 2025

should be merged after #2911.
Changing my mind, and merging into #2911.

Copy link

vercel bot commented Feb 1, 2025

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

Name Status Preview Comments Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 2:07am

@dai-shi dai-shi added this to the v2.12.0 milestone Feb 1, 2025
Copy link

codesandbox-ci bot commented Feb 1, 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.

Copy link

github-actions bot commented Feb 1, 2025

LiveCodes Preview in LiveCodes

Latest commit: 475484b
Last updated: Feb 3, 2025 2:06am (UTC)

Playground Link
React demo https://livecodes.io?x=id/GNTTV8PTB

See documentations for usage instructions.

Copy link

pkg-pr-new bot commented Feb 1, 2025

Open in Stackblitz

More templates

npm i https://pkg.pr.new/jotai@2967

commit: 475484b

Copy link

github-actions bot commented Feb 1, 2025

Size Change: +204 B (+0.21%)

Total Size: 98.9 kB

Filename Size Change
./dist/esm/vanilla/internals.mjs 3.9 kB +30 B (+0.77%)
./dist/system/vanilla/internals.development.js 4.07 kB +35 B (+0.87%)
./dist/system/vanilla/internals.production.js 2.53 kB +34 B (+1.36%)
./dist/umd/vanilla/internals.development.js 5.25 kB +32 B (+0.61%)
./dist/umd/vanilla/internals.production.js 3.33 kB +36 B (+1.09%)
./dist/vanilla/internals.js 5.12 kB +37 B (+0.73%)
ℹ️ View Unchanged
Filename Size
./dist/babel/plugin-debug-label.js 933 B
./dist/babel/plugin-react-refresh.js 1.14 kB
./dist/babel/preset.js 1.41 kB
./dist/esm/babel/plugin-debug-label.mjs 1 kB
./dist/esm/babel/plugin-react-refresh.mjs 1.2 kB
./dist/esm/babel/preset.mjs 1.49 kB
./dist/esm/index.mjs 62 B
./dist/esm/react.mjs 1.41 kB
./dist/esm/react/utils.mjs 747 B
./dist/esm/utils.mjs 67 B
./dist/esm/vanilla.mjs 1.19 kB
./dist/esm/vanilla/utils.mjs 5.05 kB
./dist/index.js 242 B
./dist/react.js 1.44 kB
./dist/react/utils.js 1.39 kB
./dist/system/babel/plugin-debug-label.development.js 1.11 kB
./dist/system/babel/plugin-debug-label.production.js 775 B
./dist/system/babel/plugin-react-refresh.development.js 1.3 kB
./dist/system/babel/plugin-react-refresh.production.js 928 B
./dist/system/babel/preset.development.js 1.59 kB
./dist/system/babel/preset.production.js 1.14 kB
./dist/system/index.development.js 252 B
./dist/system/index.production.js 183 B
./dist/system/react.development.js 1.56 kB
./dist/system/react.production.js 865 B
./dist/system/react/utils.development.js 859 B
./dist/system/react/utils.production.js 462 B
./dist/system/utils.development.js 257 B
./dist/system/utils.production.js 187 B
./dist/system/vanilla.development.js 1.25 kB
./dist/system/vanilla.production.js 424 B
./dist/system/vanilla/utils.development.js 5.26 kB
./dist/system/vanilla/utils.production.js 3.15 kB
./dist/umd/babel/plugin-debug-label.development.js 1.07 kB
./dist/umd/babel/plugin-debug-label.production.js 852 B
./dist/umd/babel/plugin-react-refresh.development.js 1.27 kB
./dist/umd/babel/plugin-react-refresh.production.js 1 kB
./dist/umd/babel/preset.development.js 1.54 kB
./dist/umd/babel/preset.production.js 1.22 kB
./dist/umd/index.development.js 383 B
./dist/umd/index.production.js 328 B
./dist/umd/react.development.js 1.56 kB
./dist/umd/react.production.js 936 B
./dist/umd/react/utils.development.js 1.53 kB
./dist/umd/react/utils.production.js 1.01 kB
./dist/umd/utils.development.js 399 B
./dist/umd/utils.production.js 342 B
./dist/umd/vanilla.development.js 1.97 kB
./dist/umd/vanilla.production.js 530 B
./dist/umd/vanilla/utils.development.js 6.25 kB
./dist/umd/vanilla/utils.production.js 3.78 kB
./dist/utils.js 247 B
./dist/vanilla.js 2 kB
./dist/vanilla/utils.js 6.11 kB

compressed-size-action

@dai-shi dai-shi removed this from the v2.12.0 milestone Feb 3, 2025
@dai-shi dai-shi marked this pull request as ready for review February 3, 2025 02:09
@dai-shi dai-shi merged commit 1136ba6 into feat/core/expose-internals-instead-of-derive Feb 3, 2025
45 checks passed
@dai-shi dai-shi deleted the refactor/internals/store-mounted branch February 3, 2025 02:10
dai-shi added a commit that referenced this pull request Feb 11, 2025
* wip: expose internal functions

* rename

* tests following the change

* separate internals entrypoint

* fix entries

* fix for umd, still wip

* revert them

* revert changes

* rename readme

* internals entry point

* impl

* fix store test

* derive test

* effect test

* fix rollup config

* hack types

* fix workflow files

* fix workflow files again

* hack types again

* fix rollup config

* ts ignore

* tried this?

* test: rename

* follow the change

* I think this is unnecessary

* fix AtomState type

* do not enumerate secret methods

* even better

* refactor

* another refactor

* wip: building-block functions

* give up scope tests for now

* some more refactors

* fix workflow file

* use symbol instead of weakmap for cancelable promise

* fix typo

* expose util and tentative functions

* does this fix?

* catch error from f hook

* only keeps one error

* do we want to support falsy errors?

* going back the circle

* store hook for atoms util

* does this help?

* for ts3.9

* store hooks tweaks (#2969)

* lazy assign store hooks internally

* initializeStoreHooks

* make it work with node 18

* refactor(internals): isolated mounted map in store (#2967)

* refactor(internals): isolated mounted map in store

* give up derive test

* rev4 compatibility

* a silly mistake

* storeHooks minor improvement (#2970)

* storeHooks: return delete function from add

* Update src/vanilla/internals.ts

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

* refactor(internals): store state in store args (#2972)

* refactor(internals): atomStateMap in storeState

* store args for everything and create building blocks

* createStoreArgs

* refactor

* refactor and type

* export internal types

* simplify types

* prefer readonly modifier

* expose building blocks

* elminate store args

* expose building blocks (#2974)

* expose building blocks

* elminate store args

* move top-level functions to createBuildingBlocks and add some organization

* tweak createBuildingBlocks

* update store and tests invocation of INTERNAL_createBuildingBlocks

* fix lint and decomposition

* refactor(internals): simplify building blocks

---------

Co-authored-by: daishi <daishi@axlight.com>

* comments

* customizable building blocks

* ts hack

* ts hack 2

* minor change

* nice to remove !

* refactor

* full building blocks (#2977)

* return a complete building blocks array

* return mutable building blocks

* revert to default function argument style

---------

Co-authored-by: daishi <daishi@axlight.com>

---------

Co-authored-by: David Maskasky <dmaskasky@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant