w3c / push-api

Push API
https://w3c.github.io/push-api/
Other
145 stars 40 forks source link

WebIDL serializer has been deprecated in favor of toJSON operation #266

Closed tobie closed 7 years ago

tobie commented 7 years ago

Hi!

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

To deal with common cases, we added a new [Default] extended attribute which triggers the default toJSON operation 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 into a vanilla JSON object.

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

There's an example 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 explicitly.

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!