webtiming / timingobject

Defines the HTML5 Timing object at the basis of multi-device synchronization matters
25 stars 4 forks source link

Replace usage of `Object.observe()` #32

Open chrisguttandin opened 1 year ago

chrisguttandin commented 1 year ago

Since Object.observe() has turned out to be a dead end I think the spec needs to be updated to use something else.

It's currently used by the TimingObject to observe the vector property of a TimingProvider. I would like to suggest to use an event on the TimingProvider instead to communicate vector updates. We could use the same change event that's already available on a TimingObject and add it to the TimingProvider interface, too. A TimingObject could then listen for this event instead of observing the vector property.

ingararntzen commented 1 year ago

Agreed. The timing object specification draft has not received any significant updates since it was first proposed back in 2015. Notably, the timingsrc implementation has been developed after this and it implements the timing provider by emitting events for vector change and skew change more or less exactly as you propose.

As such, I regard the timingsrc implementation as the most up-to-date description of timing object api.

chrisguttandin commented 1 year ago

Should I try to craft a PR for that change?

ingararntzen commented 1 year ago

That would be great indeed!

That said, I think the draft spec document is in need of a quite extensive cleanup in order to be really useful as a reference :)

chrisguttandin commented 1 year ago

That's true. Unfortunately I have no experience with updating ReSpec, WebIDL references and all that.

tidoust commented 1 year ago

Unfortunately I have no experience with updating ReSpec, WebIDL references and all that.

Refreshing ReSpec, that I can take care of! I'll prepare a PR. That won't provide the cleanup that would be needed, but should at least ease future potential edits.

tidoust commented 1 year ago

Refreshing ReSpec, that I can take care of! I'll prepare a PR.

Done in #34