Skip to content

Conversation

danielmbrasil
Copy link
Contributor

@danielmbrasil danielmbrasil commented Mar 28, 2025

Added Web Storage support enabled by default, with the option to disable via --no-webstorage.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/config

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. config Issues or PRs related to the config subsystem needs-ci PRs that need a full CI run. labels Mar 28, 2025
@mcollina
Copy link
Member

To fix the failing test, I would change the error being throw in lib/internal/webstorage.js in a warning, and have localStorage be undefined in that case.

@cjihrig wdyt?

@cjihrig
Copy link
Contributor

cjihrig commented Mar 28, 2025

I would be OK with that behavior. However, the global checking logic in test/common/index.js would probably need to be updated. Otherwise, the new warning will probably be printed for every test that doesn't use localStorage.

@danielmbrasil
Copy link
Contributor Author

I just pushed the suggested changes, and the tests are now passing. @cjihrig, could you please review whether the changes in test/common/index.js make sense?

@cjihrig
Copy link
Contributor

cjihrig commented Mar 28, 2025

Without running the code, it doesn't look correct to me:

globalThis[val] === undefined

By the time we find out that the value is undefined, the warning will have already been emitted, right?

@danielmbrasil
Copy link
Contributor Author

By the time we find out that the value is undefined, the warning will have already been emitted, right?

Yeah, that's right. I'll take a look on how to avoid the warning to be emitted in those cases.

@danielmbrasil danielmbrasil force-pushed the src/unflag-experimental-webstorage branch from b925ca4 to db0cda3 Compare April 2, 2025 17:11
@danielmbrasil
Copy link
Contributor Author

@cjihrig Could you take a look now and see if this is closer to what you were expecting? I added a new check to test/common/index.js that overrides the localStorage getter with an empty object. This prevents the warning from being emitted, and the tests are passing locally.

@danielmbrasil danielmbrasil changed the title src: unflag --experimental-webstorage by default src,lib,test: unflag --experimental-webstorage by default Apr 4, 2025
@danielmbrasil
Copy link
Contributor Author

Moving this as ready for review. I think we should possibly also update doc/api/cli.md and doc/api/globals.md, but I'm not sure how to update those docs for now.

@danielmbrasil danielmbrasil marked this pull request as ready for review April 4, 2025 18:12
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

❌ Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.28%. Comparing base (73b5022) to head (890a794).
⚠️ Report is 116 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/webstorage.js 80.00% 5 Missing ⚠️
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     
Files with missing lines Coverage Δ
lib/internal/process/pre_execution.js 97.15% <100.00%> (-0.28%) ⬇️
src/node_options.cc 77.89% <100.00%> (+0.02%) ⬆️
src/node_options.h 97.89% <100.00%> (ø)
lib/internal/webstorage.js 91.30% <80.00%> (-8.70%) ⬇️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina
Copy link
Member

mcollina commented Apr 7, 2025

A few tests needs fixing but this is good progress!

@danielmbrasil danielmbrasil force-pushed the src/unflag-experimental-webstorage branch 2 times, most recently from 67c3460 to 1857c7f Compare April 7, 2025 16:51
@geeksilva97
Copy link
Contributor

This PR has some conflicts

@danielmbrasil danielmbrasil force-pushed the src/unflag-experimental-webstorage branch 2 times, most recently from 3cda35a to f075423 Compare May 26, 2025 18:50
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@danielmbrasil danielmbrasil force-pushed the src/unflag-experimental-webstorage branch from 6a4ce9f to 6f567ab Compare May 27, 2025 12:37
Copy link
Contributor

@geeksilva97 geeksilva97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate your effort here, Daniel

@geeksilva97 geeksilva97 added the request-ci Add this label to start a Jenkins CI on a PR. label May 29, 2025
@danielmbrasil danielmbrasil force-pushed the src/unflag-experimental-webstorage branch from 1a18d98 to 890a794 Compare September 8, 2025 14:14
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 9, 2025
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
Copy link
Member

mcollina commented Sep 9, 2025

@jasnell PTAL

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 9, 2025
@nodejs-github-bot
Copy link
Collaborator

@geeksilva97 geeksilva97 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Sep 25, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 25, 2025
@nodejs-github-bot nodejs-github-bot merged commit 3312e4e into nodejs:main Sep 25, 2025
68 of 69 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3312e4e

@danielmbrasil danielmbrasil deleted the src/unflag-experimental-webstorage branch September 25, 2025 12:01
@mcollina mcollina added the notable-change PRs with changes that should be highlighted in changelogs. label Sep 25, 2025
Copy link
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @mcollina.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. config Issues or PRs related to the config subsystem needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants