Sprints: Refactor IndexedDB events

Created on 5 Feb 2019  Â·  14Comments  Â·  Source: mdn/sprints

Most helpful comment

BCD is deployed, pages are refreshed. Thanks for the reviews!

All 14 comments

This took me much longer than I expected, because the format for these events is totally different from that for https://github.com/mdn/sprints/issues/915, and I didn't think the examples were very useful. So I ended up mostly rewriting them anyway.

I think we have the following structure here and a few things aren't done yet. I think two events that got moved to IDBRequest should actually be moved to IDBOpenRequest. Further, the "Event handler" h3 should become an "Events" h2. I don't know if we want to go the extra mile and create pages for the missing events.

IDBRequest

  • [ ] [Events on overview page](https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest#Event_handlers). This should become an h2 "Events" headline and look like this.
  • [ ] [error](https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/error_event) / onerror
  • [ ] [success](https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/success_event) / onsuccess

IDBOpenRequest

  • [ ] [Events on overview page](https://developer.mozilla.org/en-US/docs/Web/API/IDBOpenDBRequest#Events). This should become an h2 "Events" headline and look like this.
  • [ ] [blocked](https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/blocked_event) (wrong location) / onblocked
  • [ ] [upgradeneeded](https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/upgradeneeded_event) (wrong location) / onupgradeneeded

IDBDatabase

  • [ ] [Events on overview page](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase#Event_handlers). This should become an h2 "Events" headline and look like this.
  • [ ] abort (missing) / onabort
  • [ ] close (missing) / onclose
  • [ ] error (missing) / onerror
  • [ ] [versionchange](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/versionchange_event) / onversionchange

IDBTransaction

  • [ ] [Events on overview page](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction#Event_handlers). This should become an h2 "Events" headline and look like this.
  • [ ] [abort](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/abort_event) / onabort
  • [ ] [complete](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/complete_event) / oncomplete
  • [ ] error (missing) / onerror

I think two events that got moved to IDBRequest should actually be moved to IDBOpenRequest.

It seems I made the mistake of trusting the original pages: https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest/blocked_event$revision/1339258 :(.

should...look like this.

  • error / onerror

I thought from the discussion in https://github.com/mdn/sprints/issues/915 that we were not going with the eventname / oneventname approach, and instead we were just having eventname as the <dt> text?

But if that's so, then I have a problem with missing event pages, because there's nothing to put in the <dt>. Perhaps we will need to create these missing pages, but I wonder how much extra work that will end up being.

I thought from the discussion in #915 that we were not going with the eventname / oneventname approach, and instead we were just having eventname as the <dt> text?

"eventname as the <dt> text" is correct, sorry if the way I commented here is confusing. The actual MDN pages for the Speech pages have been updated to use a better format.

But if that's so, then I have a problem with missing event pages, because there's nothing to put in the <dt>. Perhaps we will need to create these missing pages, but I wonder how much extra work that will end up being.

Yes, we could leave red links in the wiki, if we think it is too much work. I'm unsure about this as I don't know how much time we're allowed to invest.

a few things aren't done yet

(I did know that btw, I was just asking about the missing pages at that point)

I ended up creating those 4 pages. Slightly interestingly, 3 of them are for events that bubble: so for example an error event can fire for an IDBRequest that fails, which can then bubble up to IDBTransaction and IDBDatabase. So we get three pages that are almost the same.

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest#Events
https://developer.mozilla.org/en-US/docs/Web/API/IDBOpenDBRequest#Events
https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction#Events
https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase#Events

Let me know if this looks good! I didn't do the BCD yet.

(I did know that btw, I was just asking about the missing pages at that point)

Sorry, didn't mean to sound snarky with that or anything.

Let me know if this looks good!

This looks really good to me now and is exactly the structure we agreed on I think. I hope it did make sense to you arranging these docs this way. Happy to hear the things that didn't make any sense, but otherwise I think we can call these done now (pending the BCD).

@wbamberg there's been quite a lot of discussion here and review by @Elchi3 ; I just wanted to chek whether you thought I still needed to give these a review (I was down for reviewing these on the list)?

I've looked at a bunch of the pages, and they generally look pretty good anyhow.

The only thing I can see that probably needs a mass change is the addition of "event" at the end of all the page titles, as sheppy suggested in another thread. Provided of course noone violently disagrees ;-)

I think it is a good idea, and Florian already did it on the Web Speech API event pages.

Yes, sorry Chris, I realised too late that I was supposed to be asking you for a review. Actually I should probably apologise to Florian :).

I don't think this needs another review, although I would be happy to get a review of the corresponding BCD PR: https://github.com/mdn/browser-compat-data/pull/3469 so I can close this.

addition of "event"

[edited to correct:]

I think this is a good idea too, and as you say it seems like Florian's on board too.

Also, for the blue box (<table class="properties">), make sure that the first column uses <th scope="row"> and not <td>, otherwise formatting breaks on mobile.

Also, for the blue box (<table class="properties">), make sure that the first column uses <th scope="row"> and not <td>, otherwise formatting breaks on mobile.

Like this?

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Bubbles</th>
   <td>Yes</td>
  </tr>
  <tr>
   <th scope="row">Cancelable</th>
   <td>No</td>
  </tr>
  <tr>
   <th scope="row">Interface</th>
   <td>{{domxref("Event")}}</td>
  </tr>
  <tr>
   <th scope="row">Event handler</th>
   <td><code><a href="/en-US/docs/Web/API/IDBRequest/onerror">onerror</a></code></td>
  </tr>
 </tbody>
</table>

@wbamberg More like this:

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Bubbles</th>
   <td>Yes</td>
  </tr>
  <tr>
   <th scope="row">Cancelable</th>
   <td>No</td>
  </tr>
  <tr>
   <th scope="row">Interface</th>
   <td>{{DOMxRef("Event")}}</td>
  </tr>
  <tr>
   <th scope="row">Event handler</th>
<!-- Use {{DOMxRef(…)}} instead of <a> -->
   <td>{{DOMxRef("IDBRequest.onerror", "onerror")}}</td>
  </tr>
 </tbody>
</table>

P.S.: {{DOMxRef(…)}} had its capitalisation changed.

Yes, sorry Chris, I realised too late that I was supposed to be asking you for a review. Actually I should probably apologise to Florian :).

No worries, I felt like I should review whenever someone gets started with this event work, but I think Chris' reviewing is great, too. So all good. Happy we're all more or less on the same boat about how to this work now.

I think this is a good idea too, and as you say it seems like Florian's on board too.

Yes, I support this.

BCD is deployed, pages are refreshed. Thanks for the reviews!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cheeZery picture cheeZery  Â·  7Comments

mattiapontonio picture mattiapontonio  Â·  5Comments

wbamberg picture wbamberg  Â·  5Comments

marcvangend picture marcvangend  Â·  5Comments

Elchi3 picture Elchi3  Â·  8Comments