V5 : Split package, formatter support and Jotai 2.20 support#5
Merged
Conversation
Split the core logger from its console formatter.
The core handle only scheduling and filtering options and accepts a new `formatter` option.
The new `consoleFormatter` factory creates the built in console formatter and accepts the old display options (`domain`, `logger`, `colorScheme`, etc.).
Add the `formatter` option to `bindAtomsLoggerToStore` and `useAtomsLogger` to replace the default console output with any custom function.
BREAKING CHANGE: formatting options that were present in `bindAtomsLoggerToStore` and `useAtomsLogger` are now moved to the new `consoleFormatter` factory options.
Migration:
Before: `bindAtomsLoggerToStore(store, { stringifyLimit: 100 })`
After: `bindAtomsLoggerToStore(store, { formatter: consoleFormatter({ stringifyLimit: 100 }) })`
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
BREAKING CHANGE: rename logger's type AtomsLoggerOptions to AtomLoggerOptions
The store is no longer mutated. Instead, `createLoggedStore` returns a **new** store that shares all internal state with the parent but intercepts `get`, `set` and `sub` for logging. On the React side, `AtomLoggerProvider` propagates the logged store to children via a Jotai `<Provider>`, retrieving the parent store from context automatically. This approach aligns with Jotai's internal `INTERNAL_buildStoreRev2` API introduced in jotai v2.15 (see [pmndrs/jotai#3149](pmndrs/jotai#3149)). BREAKING CHANGE: A migration guide from v4 to v5 is present in the README. TLDR : - `useAtomsLogger` is replaced by `AtomLoggerProvider`, a Provider-like component that automatically picks up the nearest Jotai store from context and wraps children in a new logged store. - `bindAtomsLoggerToStore` is replaced by `createLoggedStore` that creates and return a new store. - `isAtomsLoggerBoundToStore` removed → use `isLoggedStore` - `createLoggedStore` **throws** instead of returning `false`
81dec2c to
934fe14
Compare
Wendystraite
commented
May 3, 2026
Wendystraite
commented
May 4, 2026
BREAKING CHANGE: only jotai 2.20.0 and up is supported due to changes in their internal APIs.
…e consistent types with dependencies
bc683a0 to
62082f6
Compare
…eferences to some helpers
…d of storing it in the logger's state
Wendystraite
commented
May 7, 2026
Wendystraite
commented
May 7, 2026
Wendystraite
commented
May 7, 2026
Wendystraite
commented
May 7, 2026
commit: |
🦋 Changeset detectedLatest commit: d363290 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
0ee3840 to
b24ac67
Compare
…mounted events Initialized, changed and mounted events now show their dependents and pending promises atoms that were added later in the transaction. This act like how dependencies were tracked.
…s on initialized/mounted events
8849139 to
e08d6c1
Compare
fcf33af to
c71a205
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Future V5 API.
Checks
What's new ?
Split the package into vanilla/react/formatter entry points
formatteroption.consoleFormatterfactory creates the built in console formatter and accepts the old display options (domain,logger,colorScheme, etc.).formatteroption tobindAtomsLoggerToStoreanduseAtomsLoggerto replace the default console output with any custom function.Replace the mutation-based API with a derived-store API
createLoggedStorereturns a new store that shares all internal state with the parent but interceptsget,setandsubfor logging.AtomLoggerProviderpropagates the logged store to children via a Jotai<Provider>, retrieving the parent store from context automatically.INTERNAL_buildStoreRev2API introduced in jotai v2.15 (see feat(internals): External building blocks surface pmndrs/jotai#3149)).Jotai 2.20 "Rev3" API support
Waiting for Jotai 2.20 due to a future breaking change in pmndrs/jotai#3293.
See milestone: https://github.com/pmndrs/jotai/milestone/120.
Breaking changes
A migration guide from v4 to v5 is present in the README.
Migration:
bindAtomsLoggerToStoreanduseAtomsLoggerare now moved to the newconsoleFormatterfactory options.bindAtomsLoggerToStore(store, { stringifyLimit: 100 })createLoggedStore(store, { formatter: consoleFormatter({ stringifyLimit: 100 }) })useAtomsLoggeris replaced byAtomLoggerProvider, a Provider-like component that automatically picks up the nearest Jotai store from context and wraps children in a new logged store.bindAtomsLoggerToStoreis replaced bycreateLoggedStorethat creates and return a new store.isAtomsLoggerBoundToStoreremoved → useisLoggedStorecreateLoggedStorethrows instead of returningfalse