-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Until pillarjs/send#154 is merged.
Should fix error “WebAssembly.Instance is disallowed on the main thread, if the buffer size is larger than 4KB”
WASM bundle loader
# 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
niieani
reviewed
Jan 23, 2018
return new Promise(function (resolve, reject) { | ||
var script = document.createElement('script'); | ||
script.async = true; | ||
script.type = 'text/javascript'; |
There was a problem hiding this comment.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #473. This omits Rust -> WASM support for now - will come in a separate PR.
cc. @albizures