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

Conversation

Projects
None yet
5 participants
@sokra
Member

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 some commits Nov 11, 2017

advanced module type refactoring
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

This comment has been minimized.

Show comment
Hide comment
@webpack-bot

webpack-bot Nov 11, 2017

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

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

This comment has been minimized.

Show comment
Hide comment
@rhmoller

rhmoller 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

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

This comment has been minimized.

Show comment
Hide comment
@TheLarkInn

TheLarkInn Nov 13, 2017

Member

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

Member

TheLarkInn commented Nov 13, 2017

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

@shellscape

This comment has been minimized.

Show comment
Hide comment
@shellscape

shellscape Nov 13, 2017

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@TheLarkInn

TheLarkInn Nov 14, 2017

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@rhmoller

rhmoller 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

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

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

This comment has been minimized.

Show comment
Hide comment
@rhmoller

rhmoller 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

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