Skip to content

Conversation

littledan
Copy link
Contributor

@littledan littledan commented Jan 13, 2021

This patch lets Temporal objects be serialized, both in storage and with
postMessage, if they use built-in calendars and timezones. This is the
only expected integration of Temporal with HTML/DOM expected initially;
see earlier discussion in w3ctag/design-reviews#311

The current draft just includes Temporal.PlainDate, and it will be extended
to all of the Temporal types after initial review. This patch should not be
landed until (at least) Temporal reaches Stage 3.

(See WHATWG Working Mode: Changes for more details.)


/infrastructure.html ( diff )
/structured-data.html ( diff )

Base automatically changed from master to main January 15, 2021 07:58
@littledan
Copy link
Contributor Author

The changes that @Ms2ger made to include all appropriate Temporal objects and serialize exclusively built-in things LGTM. AFAIK, these are all the changes needed to integrate Temporal into HTML.

@Ms2ger Ms2ger marked this pull request as ready for review January 29, 2021 10:16
@domenic domenic force-pushed the structured-clone-temporal branch 2 times, most recently from 81f0aae to bcfc01a Compare August 11, 2021 16:07
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased this and fixed some editorial nits. It LGTM but needs implementer interest (probably we have it through the TC39 process?) and, most importantly, tests.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calendar user code thread seems to not yet be resolved?

@domenic domenic added the needs tests Moving the issue forward requires someone to write tests label Aug 11, 2021
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK cool. Just waiting on tests, implementer interest, and browser bugs then before we can merge.

@Ms2ger Ms2ger force-pushed the structured-clone-temporal branch from 4338a93 to 50b7305 Compare June 20, 2024 09:45
This patch lets Temporal objects be serialized, both in storage and with
postMessage, if they use built-in calendars and timezones. This is the
only expected integration of Temporal with HTML/DOM expected initially;
see earlier discussion in w3ctag/design-reviews#311

Co-authored-by: Domenic Denicola <[email protected]>
Co-authored-by: Ms2ger <[email protected]>
@Ms2ger
Copy link
Member

Ms2ger commented Jun 21, 2024

I updated this to match the consensus from the 102nd TC39 Meeting (12 June), notably dropping Calendar and TimeZone objects. (These changes have not all made it into the proposal spec text yet.) I also wrote a wpt PR with some tests. I'm not sure if this needs independent implementer interest signals / implementation bugs, but if so, I'll deal with that next week.

@domenic
Copy link
Member

domenic commented Jun 24, 2024

Editorial nit: we prefer to avoid single-step <ol>s, so instead of

  1. If ...
    1. Set value ...

we'd write

  1. If ..., then set value ...

Because of the force-pushing, I can't tell if this has been there the whole time and we hadn't caught it previously (sorry if so!), or if it was introduced in recent revisions.

Anyway, normative contents still LGTM.

It would be good to have independent bugs, since structured serialization is often dealt with by different browser teams.

For implementer interest, if you have some indication that TC39 consensus includes structured serialization, then that's enough. (I'm unclear whether the consensus you're referring to in the above comment is for structured serialization, or whether it's for dropping Calendar and TimeZone objects.)

When should we merge this? I guess Temporal is stage 3, which is when we've merged things into HTML in the past. So I'm happy to merge once the checkboxes are checked, as long as you are.

@Ms2ger Ms2ger removed the needs tests Moving the issue forward requires someone to write tests label Jun 26, 2024
@Ms2ger
Copy link
Member

Ms2ger commented Jun 26, 2024

Thanks!

Editorial nit: we prefer to avoid single-step <ol>s, so instead of

  1. If ...

    1. Set value ...

we'd write

  1. If ..., then set value ...

Because of the force-pushing, I can't tell if this has been there the whole time and we hadn't caught it previously (sorry if so!), or if it was introduced in recent revisions.

The previous version had substeps to handle user-defined time zones and calendars. I'd like to maybe slightly push back against this comment, though, because I think merging the substep into the previous paragraph would be somewhat less readable due to the quite big records I'm creating. I defer to you if you do still want me to do it, though.

Anyway, normative contents still LGTM.

It would be good to have independent bugs, since structured serialization is often dealt with by different browser teams.

Filed those.

For implementer interest, if you have some indication that TC39 consensus includes structured serialization, then that's enough. (I'm unclear whether the consensus you're referring to in the above comment is for structured serialization, or whether it's for dropping Calendar and TimeZone objects.)

Sorry for the confusion - the TC39 consensus was for dropping Calendar and TimeZone objects. My understanding is that structured cloning hasn't really been discussed in TC39. I filed standards positions issues to make sure.

When should we merge this? I guess Temporal is stage 3, which is when we've merged things into HTML in the past. So I'm happy to merge once the checkboxes are checked, as long as you are.

I guess we can give a bit of time for people to respond to the standards positions, but apart from that, I'd be happy to merge.

@annevk
Copy link
Member

annevk commented Jul 5, 2024

I heard that V8 doesn't want to add this per the latest TC39 meeting? What about SpiderMonkey? JSC is somewhat neutral.

I agree that normally we'd just add Stage 3, but if implementer interest is not really there I'm less sure.

cc @syg @codehag @mgaudet

@annevk annevk changed the title [WIP] Temporal proposal HTML serialization support Temporal proposal HTML serialization support Jul 5, 2024
@mgaudet
Copy link
Contributor

mgaudet commented Jul 9, 2024

Regarding structured clone, we'll work through the Mozilla standards position to develop a real position. I can't speak for V8, but I don't think Temporal's trajectory has changed particularly.

@controversial
Copy link

I heard that V8 doesn't want to add this per the latest TC39 meeting

@annevk could you point to the spot in the tc39 meeting notes where that’s established? I couldn’t find it in a quick scan through the 2024-06 notes

@syg
Copy link
Contributor

syg commented May 8, 2025

Sorry I don't actually remember discussing serialization of Temporal objects. At this time I can't reconstruct any reasons why V8 would be against it.

@annevk
Copy link
Member

annevk commented May 9, 2025

No implementer being against it is good, but not sufficient. Is any implementer interested in doing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

8 participants