Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
tobie opened this issue Jun 22, 2017 · 0 comments
Closed
1 task

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

tobie opened this issue Jun 22, 2017 · 0 comments

Comments

@tobie
Copy link
Member

tobie commented Jun 22, 2017

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 only the following interface in this spec is impacted by this change:

It's a good candidate for the default toJSON operation, so the below should be all you need:

[Exposed=(Window,Worker)]
interface PerformanceEntry {
    readonly attribute DOMString           name;
    readonly attribute DOMString           entryType;
    readonly attribute DOMHighResTimeStamp startTime;
    readonly attribute DOMHighResTimeStamp duration;
    [Default] object toJSON();
};

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant