fix(encoding): Fix incorrect fields count#11905
Conversation
|
7769d2c to
013d364
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 013d364fda
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let count = data.fields.len(); | ||
| }) | ||
| .collect::<Vec<_>>(); | ||
| let count = fields.len(); |
There was a problem hiding this comment.
Add a changeset for the breaking encoding format
When this is released, this line changes the wire format for any derived struct with #[encoding(ignore)] fields, for example a struct with one serialized field now emits the field bare instead of an array. The commit also marks this as a breaking change, but there is no .changeset entry; tools/swc-releaser returns without bumping anything when the changeset is empty, so ast_node/exposed downstream crates could ship incompatible Encode/Decode behavior under the old versions.
Useful? React with 👍 / 👎.
Description:
Currently, our
encodingmod does not correctly handle theignoreattr when get fields count.BREAKING CHANGE:
This doesn't cause a problem now because both encode and decode use wrong count. However, it's important to note that this fix will result in a breaking change.
Related issue (if exists):