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 #72

Closed
3 tasks
tobie opened this issue Jun 21, 2017 · 3 comments
Closed
3 tasks

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

tobie opened this issue Jun 21, 2017 · 3 comments

Comments

@tobie
Copy link
Member

tobie commented Jun 21, 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 the following interfaces in this spec are impacted by this change:

All of these seem good candidate for the default toJSON operation, so the below should be all you need, provided you also similarly update PerformanceResourceTiming and PerformanceEntry in their relevant specifications:

interface PerformanceNavigationTiming : PerformanceResourceTiming {
    readonly attribute DOMHighResTimeStamp unloadEventStart;
    // etc...
    [Default] object toJSON();
};

[Exposed=Window]
interface PerformanceTiming {
    readonly attribute unsigned long long navigationStart;
    // etc...
    [Default] object toJSON();
};

[Exposed=Window]
interface PerformanceNavigation {
    const unsigned short TYPE_NAVIGATE = 0;
    // etc...
    [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!

@tobie tobie mentioned this issue Jun 21, 2017
28 tasks
@igrigorik
Copy link
Member

@tobie ditto for this spec: w3c/resource-timing#112 (comment)

@tobie
Copy link
Member Author

tobie commented Jun 28, 2017

Yes, Respec got updated yesterday: w3c/respec#1300.

@igrigorik
Copy link
Member

Resolved via #76

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

2 participants