-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasm packager #9009
Merged
Merged
Wasm packager #9009
Conversation
This file contains 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
mischnic
force-pushed
the
wasm-packager
branch
2 times, most recently
from
May 18, 2023 08:51
8ef43b6
to
216a545
Compare
mischnic
commented
May 18, 2023
Comment on lines
+27
to
+30
sourcemapReference.includes('HASH_REF_') | ||
? // HASH_REF_\w{16} -> \w{8} | ||
sourcemapReference.length - (9 + 16 - 8) | ||
: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite hacky...
mischnic
force-pushed
the
wasm-packager
branch
from
September 18, 2023 12:47
8f6be9c
to
98cab1d
Compare
Benchmark ResultsKitchen Sink ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
|
devongovett
approved these changes
Oct 3, 2023
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.
This came up in #8964
So the usecase is a transformer that outputs a wasm asset with a sourcemap
[strLength, ...strBytes]
constructs. So just replacingHASH_REF_fcf6ff1d86220c0f
to37ce1cf4
changes the bytes but not the length description and thus corrupts the binary. The workaround here is to hardcode that these hash references become 17 bytes shorter (9+16 chars to 8 chars) and setstrLength
to store the length after the hash replacement.replaceStream
) is text-based but runs on all bundles, and the current implementation breaks these bundles because a buffer->string->buffer round trip will modify non-utf8 bytes.replaceStream
can be rewritten using buffers, but I haven't benchmarked yet whether this is slower for JS bundles.It appears to be equal or faster (DATA_*
contain varying numbers of hash reference, from none to one every 10 bytes)