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

@sokra sokra changed the base branch from master to next Nov 10, 2017
@webpack-bot webpack-bot added PR: next and removed PR: conflict labels Nov 10, 2017
@sokra sokra closed this Nov 10, 2017
@sokra sokra reopened this Nov 10, 2017
sokra added 3 commits Nov 11, 2017
added json type
.mjs default to javascript/esm type
adjusted parser plugins to react on module type
@webpack-bot webpack-bot added PR: CI-ok and removed PR: CI-not-ok labels Nov 11, 2017
@webpack-bot
Copy link
Contributor

@webpack-bot webpack-bot commented Nov 11, 2017

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

@rhmoller
Copy link

@rhmoller rhmoller commented Nov 12, 2017

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

@TheLarkInn TheLarkInn commented Nov 13, 2017

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

@shellscape
Copy link
Contributor

@shellscape shellscape commented Nov 13, 2017

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

@TheLarkInn TheLarkInn commented Nov 14, 2017

@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

@rhmoller rhmoller commented Nov 14, 2017

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
8 of 12 checks passed
8 of 12 checks passed
codecov/changes/integration 2 files have unexpected coverage changes not visible in diff.
Details
codecov/patch/integration 88.69% of diff hit (target 90%)
Details
codecov/project/integration 91.45% (-0.07%) compared to b7c746d
Details
coverage/coveralls Coverage decreased (-0.07%) to 93.414%
Details
ci/circleci Your tests passed on CircleCI!
Details
codacy/pr Good work! A positive pull request.
Details
codecov/changes/unit No unexpected coverage changes found.
Details
codecov/patch/unit 30.66% of diff hit (target 0%)
Details
codecov/project/unit 47.8% (target 0%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
@sokra sokra deleted the feature/webassembly branch Nov 15, 2017
badboy referenced this pull request in mgattozzi/mgattozzi Nov 17, 2017
@rhmoller
Copy link

@rhmoller rhmoller commented Nov 17, 2017

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
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.