Repository navigation
Conversation
[Medium impact] The change reaches wasm imports handled by this plugin. The PR appears safe to merge, with a non-blocking request to cover the other changed loading paths. Findings
Reviews (1) · Last reviewed commit: "fix(wasm): handle wasm files imported wi..." · Reviewed by Greptile |
| const plugin = wasmPlugin(); | ||
| const binary = await plugin.load.call({ addWatchFile() {} }, id, { rawId }); | ||
| const { code } = plugin.transform.call({}, binary, id, { rawId }); | ||
| expect(code).toContain('_loadWasmModule(0, null, '); |
There was a problem hiding this comment.
Other loading paths lack coverage
The new test only checks default inline loading. It never reaches the changed copies[rawId], filename, or syncFiles branches, so mistakes there can pass unnoticed. Add attributed-import cases with maxFileSize: 0 and with sync set. Check that the first emits and references the expected asset, while the second stays inline and generates a synchronous loader.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Missed #2047, closing in favor of that! |
Rollup Plugin Name:
wasmThis PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
In Rollup 5, import attributes are appended to
idas a query string, with the original ID passed viarawId. UseloadOptions.rawIdandtransformOptions.rawId(falling back toid) so.wasmfiles imported with import attributes are handled properly.