Skip to content
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

Clarify localStorage maximum #32225

Merged
merged 3 commits into from
Apr 10, 2024
Merged

Clarify localStorage maximum #32225

merged 3 commits into from
Apr 10, 2024

Conversation

smith558
Copy link
Contributor

@smith558 smith558 requested a review from a team as a code owner February 11, 2024 17:30
@smith558 smith558 requested review from Elchi3 and removed request for a team February 11, 2024 17:30
@github-actions github-actions bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Feb 11, 2024
Copy link
Contributor

github-actions bot commented Feb 11, 2024

Preview URLs

(comment last updated: 2024-04-10 00:26:46)

@wbamberg
Copy link
Collaborator

Thanks for your PR, @smith558 ! These days the definitive place where we talk about storage limits is https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria. So I think it would be better not to talk about storage limits in https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API, and instead link to https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria.

So what I think we should do here is: delete both bullets that start with "Storage limit is...", and after the following paragraph (the one beginning "These mechanisms are..." have a new paragraph, something like:

To learn about the amount of storage available using the APIs, and what happens when stprage limits are exceeded, see Storage quotas and eviction criteria.

@bsmth bsmth added the awaiting response Awaiting for author to address review/feedback label Mar 20, 2024
@bsmth
Copy link
Member

bsmth commented Mar 20, 2024

Hi @smith558 - there are some reviewer comments outstanding for you to take a look at. Do you plan to come back to this one? Thank you :)

@smith558
Copy link
Contributor Author

Hi @smith558 - there are some reviewer comments outstanding for you to take a look at. Do you plan to come back to this one? Thank you :)

Hi. Thanks for the reminder. Will have a look at this within the next few days.

@bsmth
Copy link
Member

bsmth commented Apr 9, 2024

Hi @smith558 - are you okay with maintainers making the suggested changes to your branch? Will has suggested something like this (deletions in red and additions in green):

 - `localStorage` does the same thing, but persists even when the browser is closed and reopened.
-
-  - Stores data with no expiration date, and gets cleared only through JavaScript, or clearing the Browser cache / Locally Stored Data.
-  - Storage limit is usually also at most 5MB (may vary between browsers).

These mechanisms are available via the {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} properties (to be more precise, the `Window` object implements the `WindowLocalStorage` and `WindowSessionStorage` objects, which the `localStorage` and `sessionStorage` properties hang off) — invoking one of these will create an instance of the {{domxref("Storage")}} object, through which data items can be set, retrieved and removed. A different Storage object is used for the `sessionStorage` and `localStorage` for each origin — they function and are controlled separately.
+To learn about the amount of storage available using the APIs, and what happens when storage limits are exceeded, see [Storage quotas and eviction criteria](/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria).

@smith558
Copy link
Contributor Author

smith558 commented Apr 9, 2024

Hi @smith558 - are you okay with maintainers making the suggested changes to your branch? Will has suggested something like this (deletions in red and additions in green):

 - `localStorage` does the same thing, but persists even when the browser is closed and reopened.
-
-  - Stores data with no expiration date, and gets cleared only through JavaScript, or clearing the Browser cache / Locally Stored Data.
-  - Storage limit is usually also at most 5MB (may vary between browsers).

These mechanisms are available via the {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} properties (to be more precise, the `Window` object implements the `WindowLocalStorage` and `WindowSessionStorage` objects, which the `localStorage` and `sessionStorage` properties hang off) — invoking one of these will create an instance of the {{domxref("Storage")}} object, through which data items can be set, retrieved and removed. A different Storage object is used for the `sessionStorage` and `localStorage` for each origin — they function and are controlled separately.
+To learn about the amount of storage available using the APIs, and what happens when storage limits are exceeded, see [Storage quotas and eviction criteria](/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria).

Yes! Apologies, I have been pretty tight with my schedule recently.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Apr 10, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Apr 10, 2024
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Apr 10, 2024
@wbamberg
Copy link
Collaborator

@bsmth , I made some slightly more extensive changes. It's still not great but better.

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Thanks, both! Looks good to me 👍🏻

@bsmth bsmth removed the awaiting response Awaiting for author to address review/feedback label Apr 10, 2024
@bsmth bsmth merged commit a838c19 into mdn:main Apr 10, 2024
8 checks passed
@smith558 smith558 deleted the patch-4 branch April 10, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants