src,lib,test: unflag --experimental-webstorage by default - #57666
nodejs-github-bot merged 33 commits into
Conversation
|
Review requested:
|
|
To fix the failing test, I would change the error being throw in lib/internal/webstorage.js in a warning, and have @cjihrig wdyt? |
|
I would be OK with that behavior. However, the global checking logic in |
|
I just pushed the suggested changes, and the tests are now passing. @cjihrig, could you please review whether the changes in |
|
Without running the code, it doesn't look correct to me: By the time we find out that the value is |
Yeah, that's right. I'll take a look on how to avoid the warning to be emitted in those cases. |
b925ca4 to
db0cda3
Compare
|
@cjihrig Could you take a look now and see if this is closer to what you were expecting? I added a new check to |
|
Moving this as ready for review. I think we should possibly also update |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57666 +/- ##
==========================================
+ Coverage 88.26% 88.28% +0.02%
==========================================
Files 701 701
Lines 206644 206676 +32
Branches 39737 39738 +1
==========================================
+ Hits 182386 182472 +86
+ Misses 16279 16237 -42
+ Partials 7979 7967 -12
🚀 New features to boost your workflow:
|
|
A few tests needs fixing but this is good progress! |
67c3460 to
1857c7f
Compare
|
This PR has some conflicts |
3cda35a to
f075423
Compare
6a4ce9f to
6f567ab
Compare
geeksilva97
left a comment
There was a problem hiding this comment.
Appreciate your effort here, Daniel
Node.js 25 became "current" and our CI is now testing it. We now have a failure because "localStorage" is now a thing in Node.js but it's not properly enabled without the arg. So @typescript/vfs, which in the browser detects a "localStorage" and tries to use it (but previously in Node.js wouldn't find it so wouldn't try) finds an implementation that's incomplete. This change activates it, so we don't get the error. But we don't really need it, so this can be wound back when we have a fix in vfs or somewhere else in the stack. Ref: nodejs/node#57666 Ref: microsoft/TypeScript-Website#3449 Ref: microsoft/TypeScript-Website#3450
Node.js 25 became "current" and our CI is now testing it. We now have a failure because "localStorage" is now a thing in Node.js but it's not properly enabled without the arg. So @typescript/vfs, which in the browser detects a "localStorage" and tries to use it (but previously in Node.js wouldn't find it so wouldn't try) finds an implementation that's incomplete. This change activates it, so we don't get the error. But we don't really need it, so this can be wound back when we have a fix in vfs or somewhere else in the stack. Ref: nodejs/node#57666 Ref: microsoft/TypeScript-Website#3449 Ref: microsoft/TypeScript-Website#3450
For now, web storage is enabled by default. Refs: nodejs#57666
因 nodejs/node#57666 原因,与 webStorage 相关的测试暂时不兼容。
…Ozone#329) Node.js 25 became "current" and our CI is now testing it. We now have a failure because "localStorage" is now a thing in Node.js but it's not properly enabled without the arg. So @typescript/vfs, which in the browser detects a "localStorage" and tries to use it (but previously in Node.js wouldn't find it so wouldn't try) finds an implementation that's incomplete. This change activates it, so we don't get the error. But we don't really need it, so this can be wound back when we have a fix in vfs or somewhere else in the stack. Ref: nodejs/node#57666 Ref: microsoft/TypeScript-Website#3449 Ref: microsoft/TypeScript-Website#3450
…rkers The Node 26.x leg added in the previous commit failed CI: Node >=25 enables a native `localStorage` global by default (nodejs/node#57666), which throws a DOMException without --localstorage-file and shadows jsdom's own window.localStorage before vitest-environment-jsdom can install it. Every test touching localStorage saw it as undefined (WhatsNewModal.test.tsx, page.test.tsx's BITB-029 case), while 22.x was unaffected since the global is opt-in-only before Node 25. Pass --no-experimental-webstorage to vitest's worker processes via the now-flat `execArgv` option (Vitest 4 removed the old `poolOptions.threads/forks.execArgv` nesting) so jsdom's localStorage wins again. Verified 773/773 unit tests, lint, and type-check pass locally with the flag applied; confirmed via Node's own changelog that the flag was introduced alongside --experimental-webstorage in v22.4.0, so it's a recognized no-op on the 22.x leg too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQfpC1H5MQRgQWuTfyWSMp
Added Web Storage support enabled by default, with the option to disable via
--no-webstorage.