Bump wasm-bindgen and fix patch.mjs to handle new wasm-bindgen output format#82
Open
Bump wasm-bindgen and fix patch.mjs to handle new wasm-bindgen output format#82
wasm-bindgen and fix patch.mjs to handle new wasm-bindgen output format#82Conversation
Copilot
AI
changed the title
[WIP] Fix CI failure in pubky-app-specs
Fix patch.mjs to handle new wasm-bindgen 0.2.103+ output format
Dec 1, 2025
Closed
516a8f7 to
4bcd557
Compare
wasm-bindgen and fix patch.mjs to handle new wasm-bindgen output format
Fix JS binding patch scripts for wasm-bindgen 0.2.108 CJS output changes
4bcd557 to
63d89d6
Compare
Contributor
|
I updated these dependencies to latest and re-generated the patch fixes. The new patch changes are considerably smaller and simpler than the previous version of this PR (see diff). |
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.
This PR bumps
wasm-bindgen1 and related dependencies (js-sys,web-sys).Due to changes in
wasm-bindgen, ourpatch.mjsandpatch_async.mjsneeded updating too. Below is an LLM summary of these changes:wasm-bindgen 0.2.108 changed its CJS output format, breaking the
patch.mjs/patch_async.mjsCJS→ESM transform scripts.Key differences in newer wasm-bindgen output:
exports.XXX = XXX;instead ofmodule.exports.XXX = ...const wasmPath/const wasmBytesinstead ofconst path/const bytesvar exports = module.exportspreambleChanges to
src/bin/patch.mjsandsrc/bin/patch_async.mjsObject.freezedeclarations and addexportkeyword directly, replacing the duplicate re-export approach that caused the name collisionexports.XXX = XXX;lines and addexportto their declarationsexports.*→imports.*— convert bareexports.XXX = XXX;(undefined in ESM scope) toimports.XXX = XXX;for theglobalThis.pubkyregistryconst imports = {}at top of generated ESM output (no longer provided by wasm-bindgen boilerplate)const path/const bytes) and new (const wasmPath/const wasmBytes) variable names, capturing the actual bytes variable name for use in the replacementFootnotes
See changelog (0.2.100 - 0.2.108): https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md ↩