[w3c/push-api] WebIDL serializer has been deprecated in favor of toJSON operation (#266)

Hi!

We recently [deprecated WebIDL serializers][0]. You can now directly specify [toJSON operations][1] instead, which you previously weren't allowed to do.

To deal with common cases, we added a new [\[Default\] extended attribute][2] which triggers the [default toJSON operation][3] that behaves similarly to how `serializers={attributes}` or `serializers={attributes, inherit}` used to. That is, it serializes all attributes that are of a [JSON type][4] into a vanilla JSON object.

It seems at least the following interface in this spec is impacted by this change:

- [ ] [`PushSubscription`](https://w3c.github.io/push-api/#pushsubscription-interface)

There's [an example][5] of a custom `toJSON` operation in the WebIDL spec to get you going. Overall, it doesn't seem like you'll need to change a lot of things beyond specifying an output format more explicitely.

I'm sorry for the inconvenience this causes, but our hope is that this ultimately makes things a lot simpler and clearer for everybody.

Please feel free to reach out if you have any questions.

Thanks!

[0]: https://github.com/heycam/webidl/commit/a505f33
[1]: https://heycam.github.io/webidl/#idl-tojson-operation
[2]: https://heycam.github.io/webidl/#Default
[3]: https://heycam.github.io/webidl/#es-default-tojson
[4]: https://heycam.github.io/webidl/#dfn-json-types
[5]: https://heycam.github.io/webidl/#tojson-example

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/issues/266

Received on Thursday, 22 June 2017 11:07:47 UTC