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

Custom bundle loaders + WASM support -> master #565

Merged
merged 32 commits into from
Jan 16, 2018
Merged

Custom bundle loaders + WASM support -> master #565

merged 32 commits into from
Jan 16, 2018

Conversation

devongovett
Copy link
Member

See #473. This omits Rust -> WASM support for now - will come in a separate PR.

cc. @albizures

albizures and others added 30 commits December 16, 2017 14:50
 get rid of wargo
 use wasm32-unknown-unknown
[WIP] Support to rust/wasm
Register custom loaders with `bundler.addBundleLoader`
Enables `bundler.getAsset` method to resolve and process an asset at any time, outside of the normal asset tree construction.
This gives us a separate bundle for each output file.
Allows synchronous import to preload modules in external files, e.g. .wasm file, prior to execution of the JS bundle.

Also processes the HMR runtime like other assets.
No longer returns a URL to the JS bundle if there is a bundle loader defined. This will cause the asset to be preloaded prior to JS bundle execution.
Should fix error “WebAssembly.Instance is disallowed on the main thread, if the buffer size is larger than 4KB”
# Conflicts:
#	src/Bundler.js
#	src/assets/HTMLAsset.js
#	src/packagers/HTMLPackager.js
#	src/worker.js
#	test/utils.js
# Conflicts:
#	src/Bundler.js
#	src/builtins/hmr-runtime.js
#	src/packagers/JSPackager.js
@devongovett devongovett merged commit 244f274 into master Jan 16, 2018
@devongovett devongovett deleted the wasm branch January 16, 2018 05:28
return new Promise(function (resolve, reject) {
var script = document.createElement('script');
script.async = true;
script.type = 'text/javascript';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to set explicit async or type, these are the defaults.

devongovett added a commit that referenced this pull request Oct 15, 2018
* add support to rust/wasm

* use child-process-promise instead of async-child-process

* use parent extension instead of fromHtml flag

* create WasmAsset

* RustAsset refactor
 get rid of wargo
 use wasm32-unknown-unknown

* fix lint errors, remove toml package and delete jsconfig.json

* Inline wasm into JS, instantiate, and return exports

* Split bundle loaders into separate modules

Register custom loaders with `bundler.addBundleLoader`

* Split out build queue logic into its own class

Enables `bundler.getAsset` method to resolve and process an asset at any time, outside of the normal asset tree construction.

* Only add a single asset to bundle if raw packager is used

This gives us a separate bundle for each output file.

* Include used bundle loaders, and preload external modules

Allows synchronous import to preload modules in external files, e.g. .wasm file, prior to execution of the JS bundle.

Also processes the HMR runtime like other assets.

* Register wasm loader

* Replace dedicated WASMAsset with RawAsset

No longer returns a URL to the JS bundle if there is a bundle loader defined. This will cause the asset to be preloaded prior to JS bundle execution.

* Update tests

* Clean up bundling code

* Hopefully fix test in travis

* wasm tests

* Define correct wasm mime type

Until pillarjs/send#154 is merged.

* Use WebAssembly.instantiate instead of constructor

Should fix error “WebAssembly.Instance is disallowed on the main thread, if the buffer size is larger than 4KB”

* Fix test

* Fix PromiseQueue bug

* Remove rust for now. Will be added in a separate PR.
devongovett added a commit that referenced this pull request Oct 15, 2018
* add support to rust/wasm

* use child-process-promise instead of async-child-process

* use parent extension instead of fromHtml flag

* create WasmAsset

* RustAsset refactor
 get rid of wargo
 use wasm32-unknown-unknown

* fix lint errors, remove toml package and delete jsconfig.json

* Inline wasm into JS, instantiate, and return exports

* Split bundle loaders into separate modules

Register custom loaders with `bundler.addBundleLoader`

* Split out build queue logic into its own class

Enables `bundler.getAsset` method to resolve and process an asset at any time, outside of the normal asset tree construction.

* Only add a single asset to bundle if raw packager is used

This gives us a separate bundle for each output file.

* Include used bundle loaders, and preload external modules

Allows synchronous import to preload modules in external files, e.g. .wasm file, prior to execution of the JS bundle.

Also processes the HMR runtime like other assets.

* Register wasm loader

* Replace dedicated WASMAsset with RawAsset

No longer returns a URL to the JS bundle if there is a bundle loader defined. This will cause the asset to be preloaded prior to JS bundle execution.

* Update tests

* Clean up bundling code

* Hopefully fix test in travis

* wasm tests

* Define correct wasm mime type

Until pillarjs/send#154 is merged.

* Use WebAssembly.instantiate instead of constructor

Should fix error “WebAssembly.Instance is disallowed on the main thread, if the buffer size is larger than 4KB”

* Fix test

* Fix PromiseQueue bug

* Remove rust for now. Will be added in a separate PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants