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.
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}
orserializers={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:
PushSubscription
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!