Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 6cbd973 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
/bonk review this |
|
|
||
| A `Temporal.Instant`, `Temporal.PlainDate`, or `Temporal.Duration` value, respectively. The string is | ||
| the value's `toJSON()` output, an ISO 8601 string, and the receiver reconstructs the value with the | ||
| matching `from()`, e.g. `Temporal.Instant.from(string)`. The encoding is lossless: instants keep |
There was a problem hiding this comment.
The encoding isn't lossless for Temporal.Duration. toJSON() folds sub-second units into the seconds field, so the round trip changes the duration's fields even though the total stays the same. Checked with Node --harmony-temporal:
D.from({milliseconds: 1500}).toJSON() // "PT1.5S"
D.from("PT1.5S") // seconds: 1, milliseconds: 500 (was milliseconds: 1500)
D.from({seconds: 59, milliseconds: 1000}) // -> "PT60S" -> seconds: 60, milliseconds: 0That's a spec limitation of Duration's ISO string form, so the wire format can't avoid it without encoding the fields one by one. Please narrow the claim here (and in the comment at src/serialize.ts:394), for example: "Durations keep their total length, but sub-second units may be rebalanced into seconds." The alternative is a field-wise encoding if callers need exact fields.
|
Review: 1 finding. I posted 1 inline comment on the PR. Ran Node with Not raised inline:
|
|
clanky review |
|
💬 Approved with comments — The Temporal serialization is implemented cleanly and is tested. There is one WARNING: the validator package and its docs do not cover the new Temporal types. There is also one INFO about the Temporal tests possibly skipping silently in Node. Findings: 1 warning · 1 info The decision is advisory: this comment never approves, blocks or requests changes on the pull request. 🔧 Fix with your agentPaste the following into your coding agent to investigate and fix these issues. 📋 Code Quality: 💬 1 infoThe implementation is correct and covers every typeForRpc consumer in core.ts. There is one INFO about the tests possibly skipping silently. Recommendation: 💬 Optional Nits
View full reviewSilent skip risk ( If the
Checked and found fine:
📝 Documentation:
|
No description provided.