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

Closed
1 task
tobie opened this issue Jun 21, 2017 · 11 comments
Closed
1 task

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

tobie opened this issue Jun 21, 2017 · 11 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 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, provided you also similarly update PerformanceEntry in its relevant specification:

[Exposed=(Window,Worker)]
interface PerformanceResourceTiming : PerformanceEntry {
    readonly attribute DOMString initiatorType;
    // 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 22, 2017
28 tasks
@igrigorik
Copy link
Member

@tobie was the dependency in respec already updated? I'm seeing new WebIDL failures on https://w3c.github.io/navigation-timing/ that are causing all the links and references to be broken.

@tobie
Copy link
Member Author

tobie commented Jun 28, 2017

Yes, @marcoscaceres updated Respec yesterday: https://github.com/w3c/respec/pull/1300.

Is there something we could do better next time so you don't feel like we've pulled the rug from under you?

@igrigorik
Copy link
Member

Yikes, well.. this was a very short (and unspecified) deadline, which doesn't make things easy. We have a lot of folks referencing the github.io versions, which are both broken at the moment. IMO, breaking changes like this need to have a much longer lead time.

@siusin @toddreifsteck any objections to us merging above toJSON changes?

@marcoscaceres
Copy link
Member

Yeah, I should have added a warning. I figured this way we would just break things and quickly fix them.

@marcoscaceres
Copy link
Member

(it only affects very few specs and it's a very easy fix - can send PR)

@igrigorik
Copy link
Member

The affected specs are: HR-Time (w3c/hr-time#49), Resource Timing (w3c/navigation-timing#72), Navigation Timing. Any others I'm overlooking?

@tobie
Copy link
Member Author

tobie commented Jun 28, 2017

…and Performance Timeline (w3c/performance-timeline#82).

@tobie
Copy link
Member Author

tobie commented Jun 28, 2017

Can't these specs just link to a previous version of Respec in the meantime?

@igrigorik
Copy link
Member

Add Server-Timing to that list: https://w3c.github.io/server-timing/

@tobie yes, we could, but this is unnecessary pain -- I think we could have handled this a bit better.

@tobie
Copy link
Member Author

tobie commented Jun 28, 2017

I think we could have handled this a bit better.

I can't disagree. I'm just trying to help find a solution for now and try to figure out how this can be improved next time.

On that latter topic I've opened a bug here: whatwg/webidl#379.

@igrigorik
Copy link
Member

Resolved via #114.

igrigorik added a commit to w3c/hr-time that referenced this issue Jul 21, 2017
igrigorik added a commit to w3c/performance-timeline that referenced this issue Jul 21, 2017
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

3 participants