Skip to content
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

add experimental WebAssembly support #5945

Merged
merged 12 commits into from Nov 15, 2017
Merged

add experimental WebAssembly support #5945

merged 12 commits into from Nov 15, 2017

Conversation

sokra
Copy link
Member

@sokra sokra commented Nov 10, 2017

What kind of change does this PR introduce?
feature

Did you add tests for your changes?
yes

If relevant, link to documentation update:
TODO

Summary
add Module.type
add wasm, json, js/auto and js/esm types
allow to set type by rules
set default type by extension
allow Main/ChunkTemplate to generate multiple assets
add more parsers for different types
parser plugins should now add by module type

Does this PR introduce a breaking change?
yes

Other information

added json type
.mjs default to javascript/esm type
adjusted parser plugins to react on module type
@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@rhmoller
Copy link

Hi,

I have been experimenting with this branch. It seems to build fine but webpack-dev-server is unable to run it. The .module.wasm gets served as application/octet-stream instead of application/wasm.

First the mime module does not know the .wasm extension and secondly the middleware.js appends "; charset=UTF-8" to all content types which it should not do for wasm.

See https://github.com/rhmoller/webpack-webassembly-tester

@TheLarkInn
Copy link
Member

Thanks for this. I'm going to have @shellscape dig into this specifically for WDS/WDM

@shellscape
Copy link
Contributor

Once this is merged we'll have to setup a test in WDS that fails and I can work backwards from there. I don't have any web assembly experience so I'm not sure how to setup that up at the moment.

@TheLarkInn
Copy link
Member

@rhmoller, do you have interest in assisting @shellscape with setting this up? It would be very beneficial to have the support for WDS aw soon as possible even if it merges only to the webpack/webpack#next branch.

@rhmoller
Copy link

Sure, I would love to help moving this forward.
I guess it will start with an extra test for the .wasm extension around here
https://github.com/webpack/webpack-dev-middleware/blob/master/test/Server.test.js#L57-L62

@sokra sokra merged commit ccdba7b into next Nov 15, 2017
@sokra sokra deleted the feature/webassembly branch November 15, 2017 21:19
badboy referenced this pull request in mgattozzi/mgattozzi Nov 17, 2017
@rhmoller
Copy link

I have a created an issue for the dev-server issue here. I will add details and work on a pull request there.

webpack/webpack-dev-middleware#229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants