-
-
Notifications
You must be signed in to change notification settings - Fork 669
Improve Webpack loader #120
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
Comments
Thanks for the insights! Does the |
Btw. here's a prototype for the webpack component, but I'm not quite content with the base64 encoding step because it breaks source map support. |
No it will return the
We'll use instantiateStreaming when available and fallback if not. For
Webpack will do the linking, you need to emit and require local files.
Yes I saw it, synchronous + inline buffer approach has many disadvantages. I wouldn't recommend it. |
I see, thanks. So proper integration with webpack will require support for external imports in AssemblyScript first because there is no other way to specify imports :) |
Yeah, maybe we can keep it internal just to test the integration but that would also enable a better integration with the user's JavaScript code. |
Yeah, one of the reasons why it's currently using the |
I think it'd be great (if this isn't the case already) that an AssemblyScript module could export a Eventually the internal implementation could be replaced with references and object types to make it fast. |
Using the example from assemblyscript-typescript-loader, if we have some AssemblyScript code: // ... code omitted for brevity ...
export function step(): void {
// ... code omitted for brevity ...
} then instead of importing it into regular TypeScript like this: import asmPromise from "./assemblyscript/moduleEntry.ts";
asmPromise().then(function(asmModule){
// here you can use the wasm.exports
asmModule.step();
}) we'd import it like the following (which will work with top-level await): import {step} from "./assemblyscript/moduleEntry.ts";
// use the wasm.exports
step() |
Closing this issue as part of 2020 vacuum because it has been lingering for quite some time without being resolved. If it's still an issue important to you, feel free to open a new one! |
Wait, does that mean I can setup my webpack config like that? Or there should be some glue-code from @assemblyscript/loader, too? |
With the new wasm pipeline in Webpack (> 4.8.0), loader can now directly emit a wasm binary.
I have a very simple demo here: https://github.com/xtuc/c-webpack-demo.
The idea would be to allow:
and the user would just:
The text was updated successfully, but these errors were encountered: