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

Fix globals, part 1: indexedDB #32040

Merged
merged 6 commits into from
Apr 4, 2024
Merged

Conversation

wbamberg
Copy link
Collaborator

This is the first piece of updating globals, as discussed in https://github.com/orgs/mdn/discussions/360.

It updates a single page, indexedDB, as a test.

The procedure is:

  • yarn content move the global page to be under Window.
  • update the page under Window to be an instance property page, and update the content accordingly
  • create a new version of the page under WorkerGlobalScope, that's worker-specific
  • manually delete the redirect from Web/API/WorkerGlobalScope/indexedDB to Web/API/indexedDB

The BCD is still weird, "api.indexedDB" rather than "api.Window.indexedDB", but I'm not going to try to fix that here.

(In this PR I also updated the main WorkerGlobalScope page to not have a separate section for nonstandard members. For the sake of simplicity, I probably should have left that alone.)

@wbamberg wbamberg requested review from a team as code owners January 31, 2024 21:01
@wbamberg wbamberg requested review from sideshowbarker and removed request for a team January 31, 2024 21:01
@github-actions github-actions bot added Content:WebAPI Web API docs Content:Firefox Content in the Mozilla/Firefox subtree size/m [PR only] 51-500 LoC changed labels Jan 31, 2024
@wbamberg wbamberg requested review from teoli2003 and removed request for sideshowbarker January 31, 2024 21:01
Copy link
Contributor

github-actions bot commented Jan 31, 2024

Preview URLs (8 pages)
Flaws (3)

Note! 7 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Mozilla/Firefox/Releases/38
Title: Firefox 38 for developers
Flaw count: 3

  • macros:
    • /en-US/docs/Web/CSS/:unresolved does not exist
    • /en-US/docs/Web/API/CanvasRenderingContext2D/clearHitRegions does not exist
  • broken_links:
    • Can't resolve /en-US/docs/Mozilla/JavaScript_code_modules/Downloads.jsm/DownloadTarget
External URLs (3)

URL: /en-US/docs/Mozilla/Firefox/Releases/38
Title: Firefox 38 for developers


URL: /en-US/docs/Mozilla/Firefox/Releases/20
Title: Firefox 20 for developers


URL: /en-US/docs/Web/API/WorkerGlobalScope/indexedDB
Title: WorkerGlobalScope: indexedDB property

(comment last updated: 2024-03-01 07:10:24)

Copy link
Contributor

github-actions bot commented Feb 9, 2024

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

- {{domxref("caches", "WorkerGlobalScope.caches")}} {{ReadOnlyInline}}
- : Returns the {{domxref("CacheStorage")}} object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
- {{domxref("console")}} {{ReadOnlyInline}} {{Non-standard_inline}}
- : Returns the {{domxref("console")}} associated with the worker.
- {{domxref("crossOriginIsolated", "WorkerGlobalScope.crossOriginIsolated")}} {{ReadOnlyInline}}
- : Returns a boolean value that indicates whether the website is in a cross-origin isolation state.
- {{domxref("crypto_property", "WorkerGlobalScope.crypto")}} {{ReadOnlyInline}}
- : Returns the {{domxref("Crypto")}} object associated to the global object.
- {{domxref("WorkerGlobalScope.fonts")}} {{ReadOnlyInline}}
- : Returns the {{domxref("FontFaceSet")}} associated with the worker.
- {{domxref("indexedDB", "WorkerGlobalScope.indexedDB")}} {{ReadOnlyInline}}
Copy link
Contributor

@OnkarRuikar OnkarRuikar Feb 29, 2024

Choose a reason for hiding this comment

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

Suggested change
- {{domxref("indexedDB", "WorkerGlobalScope.indexedDB")}} {{ReadOnlyInline}}
- {{domxref("WorkerGlobalScope.indexedDB")}} {{ReadOnlyInline}}

RX \{\{ ?domxref ?\(['"]indexedDB will give you 11 more occurrences.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can only find 5:

files/en-us/web/api/window/index.md
60:- {{domxref("indexedDB", "Window.indexedDB")}} {{ReadOnlyInline}}

files/en-us/web/api/workerglobalscope/index.md
30:- {{domxref("indexedDB", "WorkerGlobalScope.indexedDB")}} {{ReadOnlyInline}}

files/en-us/web/api/indexeddb_api/index.md
38:  - : Provides access to a database. This is the interface implemented by the global object {{domxref("indexedDB")}} and is therefore the entry point for the API.

files/en-us/web/progressive_web_apps/how_to/share_data_between_apps/index.md
282:In this code example, the shared files are extracted from the form data and the user is redirected to a different page. It's up to you, using the code in your service worker, to handle the extracted files as you want. For example, you can send them to your app's main JavaScript code using the {{domxref("Worker.postMessage()")}} method or store them in an {{domxref("IndexedDB")}} database which can be accessed both by your service worker and app's main JavaScript code.

files/en-us/mozilla/firefox/releases/38/index.md
87:- The prefixed version of {{domxref("indexedDB")}}, `mozIndexedDB` has been removed ([Firefox bug 975699](https://bugzil.la/975699)).

...can you list the others please?

Copy link
Contributor

Choose a reason for hiding this comment

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

...can you list the others please?

My bad. The regex included {{domxref("IndexedDB API", "IndexedDB", "", "nocode")}} as well.
However following could be changed

"properties": ["indexedDB"],

to one of the following:

  • "properties": ["Window.indexedDB"],
  • "properties": ["Window.indexedDB", "WorkerGlobalScope.indexedDB"],

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, good call on groupdata -> e9fbac9.

@OnkarRuikar
Copy link
Contributor

@wbamberg
Copy link
Collaborator Author

Don't know why

* https://pr32040.content.dev.mdn.mozit.cloud/en-US/docs/Web/API/Window/indexedDB

* https://pr32040.content.dev.mdn.mozit.cloud/en-US/docs/Web/API/WorkerGlobalScope/indexedDB

still redirect and throw 404?

May be rebasing will help.

I think but am not sure that preview doesn't handle changes to redirects. I think these links work locally.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Feb 29, 2024
@github-actions github-actions bot added the Content:PWA Progressive Web Apps content label Feb 29, 2024
Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

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

Thank you for the change.

This looks exactly how I expect globals to be. (We point to the same BCD id, which is the right thing to do for now)

@teoli2003 teoli2003 merged commit 9912dd7 into mdn:main Apr 4, 2024
10 checks passed
@wbamberg wbamberg mentioned this pull request Apr 9, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:PWA Progressive Web Apps content Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants