Repository navigation
feat(convert)!: write path ids as decimal strings in object JSON - #72
Merged
Merged
Conversation
A path id is a 64-bit integer. Written as a JSON number, a reader that parses
numbers as doubles (JavaScript's JSON.parse) rounds most of them, so the
object a reference names could not be looked up by its id there. Object JSON
now writes every path id as its decimal string: the pathId of a {"$ref"}, and
the pathId and transformPathId of a prefab's nodes and components. The object
id "<file>:<pathId>" is the reference's file and pathId as written.
The converters whose documents hold references move to a new version
(sprite.png/3, prefab.json/3, material.json/2, clip.json/3,
controller.json/3, mono.json/3, font/3, shader.json/2, generic.json/3), so
their results are made again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A path id is a 64-bit integer. As a JSON number it is rounded by readers that parse numbers as doubles (JavaScript's
JSON.parse), so a player could not look up the object a reference names by its id. Object JSON now writes path ids as decimal strings:{"$ref": {"file", "pathId"}}(also the unresolved{"fileId", "pathId"}form);pathIdandtransformPathIdof prefab nodes, and thepathIdof their components.The object id
<file>:<pathId>is the reference'sfileandpathIdas written. Converters whose documents carry references get a new version (sprite.png/3,prefab.json/3,material.json/2,clip.json/3,controller.json/3,mono.json/3,font/3,shader.json/2,generic.json/3);docs/stages.mdand the golden records follow.Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com