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

RawJSON objects should be structured serializable/deserializable #10424

Open
hotsphink opened this issue Jun 21, 2024 · 3 comments
Open

RawJSON objects should be structured serializable/deserializable #10424

hotsphink opened this issue Jun 21, 2024 · 3 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: serialize and transfer

Comments

@hotsphink
Copy link

What problem are you trying to solve?

It looks to me like currently these would throw a DataCloneError DOMException according to the whatwg spec: https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal because they have a new [[IsRawJSON]] internal slot. I don't know for sure if whatwg internal slots are the same as tc39 internal slots, but at any rate I don't see any particular reason why these should not be supported for structured serialization/deserialization.

What solutions exist today?

Don't clone them, or rely on engines to clone them in defiance of the current spec text.

How would you solve it?

Add a clause to the StructuredSerializeInternal operation that supports them.

Anything else?

No response

@hotsphink hotsphink added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Jun 21, 2024
@domenic
Copy link
Member

domenic commented Jun 21, 2024

What is a RawJSON object?

@hotsphink
Copy link
Author

Oh, sorry. It's part of a stage 3 proposal at tc39. Perhaps there's a process where things get communicated from there?

@domenic
Copy link
Member

domenic commented Jun 22, 2024

I think opening an issue like this one is the process :)

If the champions think that making these structured serializable is a good idea, and they can get implementer interest (probably via talking to the implementer representatives in TC39), then a pull request adding them to the spec would be welcome.

@whatwg whatwg deleted a comment from Jamirais94 Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: serialize and transfer
Development

No branches or pull requests

3 participants