-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade Node to 26.2.0 and refresh lockfile dependencies #15
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
293ad73
Upgrade Node toolchain and dependency versions
Jay1 7bc8d3e
Normalize socket data chunks before processing
Jay1 407c639
fix(web): handle Node 26 experimental localStorage global in zustand …
Jay1 21fda52
style: format README.md after merge from main
Jay1 33785b3
style: fix README formatting after rebase
Jay1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| [tools] | ||
| node = "24.13.1" | ||
| node = "26.2.0" | ||
| bun = "1.3.9" |
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Node.js v26.2.0, canglobalThis.localStorageexist outside a browser runtime, and what are the documented conditions/limitations?💡 Result:
In Node.js v26.2.0,
globalThis.localStoragedoes exist as part of a browser-compatible implementation of the Web Storage API [1][2]. However, its availability and behavior depend on specific runtime conditions and CLI configurations: Conditions and Limitations 1. CLI Flag Requirement: To accesslocalStorage, you must provide the--localstorage-fileCLI flag, which specifies the file path where data is stored unencrypted [1][2]. 2. Error Handling: As of Node.js v26.0.0, attempting to accessglobalThis.localStoragewithout providing the--localstorage-fileflag causes the runtime to throw aDOMException[1][2]. This change was introduced for compliance with the Web Storage specification [1]. 3. Nature of Storage: The data is not stored per-user or per-request; it is shared globally across all users and requests within the process context [1][2]. 4. Capacity: The implementation enforces a maximum storage limit of 10 MB [1][2]. 5. Stability: The API is marked as "Release candidate" (Stability: 1.2) and can be explicitly disabled using the--no-experimental-webstorageflag [1][2]. 6. Usage Note: Modifying the specified storage file outside of the Web Storage API is not supported [1][2]. Because this implementation is intended for specific use cases and has strict requirements, developers often continue to use user-land packages (such asnode-localstorage) for legacy compatibility or when a different storage strategy is required [3][4]. Applications relying onlocalStorageshould be aware that its presence in the global scope on Node.js can cause issues for code designed specifically for browser environments that check fortypeof localStorage !== "undefined"without verifying the environment [5][6].Citations:
🌐 Web query:
In zustand v5 (createJSONStorage), what is the behavior when the provided storage getter throws?💡 Result:
In Zustand v5, the createJSONStorage helper function includes a try-catch block around the provided storage getter [1][2]. If the getter function throws an error, the error is caught, and the function returns undefined [1][2]. This behavior is explicitly designed to handle environments where the intended storage might not be available, such as during server-side rendering (SSR) when attempting to access browser-specific APIs like localStorage or sessionStorage [1][2]. By returning undefined, the persist middleware will fail to initialize the storage, effectively bypassing persistence rather than crashing the application [1][2].
Citations:
Guard
getLocalStorage()against Node 26globalThis.localStorageby requiringwindow.typeof localStorage === "undefined"is not a reliable browser check in Node.js 26:globalThis.localStoragecan be present depending on runtime configuration, so this helper may return Node’s Web Storage and route zustand persistence unexpectedly. Throwing in non-browser runtimes is fine—zustand v5createJSONStoragewill catch a throwing getter and disable persistence.🔧 Proposed fix
export function getLocalStorage(): Storage { - if (typeof localStorage === "undefined") { + if ( + typeof window === "undefined" || + typeof window.localStorage === "undefined" + ) { throw new Error("localStorage is not available"); } - return localStorage; + return window.localStorage; }📝 Committable suggestion
🤖 Prompt for AI Agents