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

Adapt IDBTransaction & IDBDatabase events to the new event structure #13040

Merged
merged 10 commits into from
Feb 16, 2022

Conversation

teoli2003
Copy link
Contributor

@teoli2003 teoli2003 commented Feb 16, 2022

This PR updates the IDBTransaction & IDBDatabase interfaces for new-style event pages. (see the template).

On IDBTransaction: abort and error are bubbling, complete not.
On IDBDatabase: close and versionchange events.

Link to the companion bcd PR: mdn/browser-compat-data#15006

1. If the XYZ event is bubbling

  • Start with the interface the event is fired at (and not bubbling too), say xxxxxxxx, and apply part 2 or 3 below, whichever is relevant.
  • For each interface it is bubbling to:
    • If onXYZ exists, delete it: yarn content delete Web/API/yyyyyyy/onXYZ --redirect /en-US/docs/Web/API/xxxxxx/XYZ_event
    • N/A If not, create a redirect: yarn content add-redirect
    • If XYZ_event, delete it: yarn content delete Web/API/yyyyyyy/XYZ_event --redirect /en-US/docs/Web/API/yyyyyyy/XYZ_event
    • N/A If not, create a redirect: yarn content add-redirect
    • List the bubbling event in each interface they bubbles to.

2. When onXYZ exists and XYZ_event not, for each onXYZ

  • N/A yarn content move /Web/API/xxxx/onXYZ /Web/API/xxxx/XYZ_event
  • N/A Update browser-compat front-runner key
  • N/A Update title front-runner key to: Interface: XYZ event (with ticks!)
  • N/A Remove Property and Event Handler from the tag list and add Event instead (more cleaning possible)
  • N/A Check if the event bubbles. Do nothing if not.
    • N/A Add a sentence about bubbling in the description:
    • N/A Add a Bubbling section.
  • N/A Change intro to explain the event itself and no more just onXYZ.

    Example: "The levelchange event of the Battery Status API is fired when the battery {{domxref("BatteryManager.level","level")}} property is updated."

  • N/A Copy the syntax section from the template, and fix the names of event and of the onXYZ property
  • N/A Add the Event type section (two texts possible! If inheritance is not only Event, do these additional steps:
    • N/A Update the argument of {{InheritanceDiagram}}
    • N/A Add the Event properties section and list the parameters, taken from the interface of the event type
  • N/A Check that no mention of this onXYZ is a link.
  • N/A Check that links to onXYZ is a link to the adequate XYZ_event

3. When both onXYZ and XYZ_event exist:

  • Move any relevant info from onXYZ to XYZ_eventpage
  • Check if the event bubbles. Do nothing if not.
    • Add a sentence about bubbling in the description:
    • Add a Bubbling section.
  • Update intro to explain the event itself (it may be already ok).

    Example: "The levelchange event of the Battery Status API is fired when the battery {{domxref("BatteryManager.level","level")}} property is updated."

  • Copy the syntax section from the template, and fix the names of event and of the onXYZ property
  • Add the Event type section (two texts possible! If inheritance is not only Event, do these additional steps:
    • N/A Update the argument of {{InheritanceDiagram}}
    • N/A Add the Event properties section and list the parameters, taken from the interface of the event type
  • Check that no mention of this onXYZ is a link.
  • Check that links to onXYZ is a link to the adequate XYZ_event
  • yarn content delete Web/API/xxxx/onXYZ --redirect /en-US/docsWeb/API/xxxx/XYZ_event

4. On the API interface page:

  • If existing, remove the Event handlers section
  • If not there, add the Events section
  • Check that there are no links to onXYZ.

5. On each page of the interface and the API overview page:

  • Check that there are no links to onXYZ.
  • Check that examples uses the modern syntax for defining function in event handler (onXYZ = event => { …} )
  • Check that no {{event} macro is left.
  • Fix flaws (as much as possible); at least, make sure not to introduce new flaws.
  • Check that if an event is linked to a property value, that property documents when this event is fired.

    Example: "When its value changes, the chargingchange event is fired."

6. Optional:

  • Remove gremlins (non-breaking spaces, curly tick, curly double-ticks)
  • If the interface is no more experimental, remove the experimental tags/banners.

7. Administrative:

  • Link to the BCD PR.

@github-actions github-actions bot added the Content:WebAPI Web API docs label Feb 16, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2022

Preview URLs

Flaws

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

URL: /en-US/docs/Web/API/IndexedDB_API
Title: IndexedDB API
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/IDBEnvironment does not exist

URL: /en-US/docs/Web/API/IDBDatabase
Title: IDBDatabase
on GitHub
Flaw count: 7

  • macros:
    • /en-US/docs/Web/API/IDBDatabase/createMutableFile does not exist
  • bad_bcd_links:
    • no explanation!
    • no explanation!
    • no explanation!
    • no explanation!
    • no explanation!
    • and 1 more flaws omitted

URL: /en-US/docs/Web/API/IDBTransaction
Title: IDBTransaction
on GitHub
Flaw count: 3

  • bad_bcd_links:
    • no explanation!
    • no explanation!
    • no explanation!

URL: /en-US/docs/Web/API/IDBTransaction/mode
Title: IDBTransaction.mode
on GitHub
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/IDBTransactionMode does not exist
    • /en-US/docs/Web/API/IDBDatabase/setVersion does not exist

URL: /en-US/docs/Web/API/IDBTransaction/abort_event
Title: IDBTransaction: abort event
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/IDBTransaction/onabort redirects to /en-US/docs/Web/API/IDBTransaction/abort_event

External URLs

URL: /en-US/docs/Web/API/IndexedDB_API
Title: IndexedDB API
on GitHub


URL: /en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
Title: Using IndexedDB
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria
Title: Browser storage limits and eviction criteria
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IndexedDB_API/Basic_Terminology
Title: IndexedDB key characteristics and basic terminology
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IndexedDB_API/Checking_when_a_deadline_is_due
Title: Checking when a deadline is due
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBDatabase
Title: IDBDatabase
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBDatabase/version
Title: IDBDatabase.version
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/close_event
Title: IDBDatabase: close event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBDatabase/createObjectStore
Title: IDBDatabase.createObjectStore()
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/name
Title: IDBDatabase.name
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/objectStoreNames
Title: IDBDatabase.objectStoreNames
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/deleteObjectStore
Title: IDBDatabase.deleteObjectStore()
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/transaction
Title: IDBDatabase.transaction()
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/close
Title: IDBDatabase.close()
on GitHub


URL: /en-US/docs/Web/API/IDBDatabase/versionchange_event
Title: IDBDatabase: versionchange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBTransaction
Title: IDBTransaction
on GitHub


URL: /en-US/docs/Web/API/IDBTransaction/mode
Title: IDBTransaction.mode
on GitHub


URL: /en-US/docs/Web/API/IDBTransaction/error
Title: IDBTransaction.error
on GitHub


URL: /en-US/docs/Web/API/IDBTransaction/abort
Title: IDBTransaction.abort()
on GitHub


URL: /en-US/docs/Web/API/IDBTransaction/objectStore
Title: IDBTransaction.objectStore()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBTransaction/ObjectStoreNames
Title: IDBTransaction.objectStoreNames
on GitHub


URL: /en-US/docs/Web/API/IDBTransaction/db
Title: IDBTransaction.db
on GitHub


URL: /en-US/docs/Web/API/IDBTransaction/abort_event
Title: IDBTransaction: abort event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBTransaction/complete_event
Title: IDBTransaction: complete event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBTransaction/error_event
Title: IDBTransaction: error event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/IDBTransaction/commit
Title: IDBTransaction.commit()
on GitHub

No new external URLs

(this comment was updated 2022-02-16 15:15:18.111023)

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

Nice work on dealing with a bubbling case here! There is some markdown error in one file that needs checking but overall it looks good to me.

I will describe how to do bubbling in the meta docs given it has worked for both you and me this way now.

Co-authored-by: Florian Scholz <fs@florianscholz.com>
@teoli2003 teoli2003 requested a review from Elchi3 February 16, 2022 15:10
@Elchi3 Elchi3 merged commit af0a74a into mdn:main Feb 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants