fix: change serialization format from FormData to MessagePack #5
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.
Types of changes
Description
This PR replaces
FormData
with MessagePack as r19's serialization format. MessagePack is implemented using the@msgpack/msgpack
package.FormData
is implemented differently depending on the runtime environment. Browsers, various Node.js versions, polyfills, and JS browser-like environments each have quirks in their implementations. Quirks lead to unexpected incompatiblities.Rather than use a format that may not always serialize or deserialize in a consistent manner, we can use a standardized format, like MessagePack. MessagePack is an efficient binary serialization format that supports native JavaScript data, like objects, Dates, and more. Binary data, like images, can be transferred easily as well.
FormData
was originally selected to minimize the package's size. Using native browser code means r19 can be shipped with less code. Unfortunately, limited Node.js support for FormData at this time makes it an unsuitable choice.Checklist: