DRAFT: Combine spark-worker-rs and spark-rs into one#335
Draft
mrxz wants to merge 3 commits intosparkjsdev:mainfrom
Draft
DRAFT: Combine spark-worker-rs and spark-rs into one#335mrxz wants to merge 3 commits intosparkjsdev:mainfrom
mrxz wants to merge 3 commits intosparkjsdev:mainfrom
Conversation
9 tasks
This file contains hidden or 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
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.
Related to #321 and builds upon: #322
This PR combines the
spark-worker-rsandspark-rsprojects into one, reducing bloat of shared code/logic that would otherwise end up in both.wasmfiles. To avoid the combined.wasmfile from being embedded multiple times into the bundle, the WASM module is now passed along to the workers, removing the embedded copy in the embedded worker code.The flow is as follows:
wasm.tsautomatically kicks off the WASM compilingwasm.tsautomatically kicks off the initialization of thespark-rsproject for the main threadSplatMeshno longer statically initializesspark-rs, but instead checks the initialization status throughwasm.tsSplatPagerno longer initializesspark-rs, but instead awaits initialization throughwasm.tsinit-wasmmessage with the WASM moduleThis has a couple of benefits, namely that the wasm blob is only embedded once. The webpack/Next.js workaround is no longer needed. And the WASM module is compiled only once across main thread and workers.
With one less rust project, the
build:wasmscript also takes less time. :-)