-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Optimise bb.js package size and sandox/cli dockerfiles to unbl…
…oat final containers. (#3462) We're making efforts to streamline our container sizes. They shouldn't really be any "bigger" than an equivalent npm download and package install. * bb.js inlined the two wasms creating a 50mb monster index.js because: * The wasm symbol stripping was not being done after wasm creation in the bb wasm container. * The two wasms ended up duplicated in the bundle due to webpack inline the workers, and seemingly unable to reason they're the same thing even using chunks. * Given that bb.js now has a synchronous singleton instantiation of the wasm, we can plumb that compiled module into the async worker version to avoid the duplication. * The above fixes reduce the size of index.js to 11mb, and this compresses very nicely to ~1.7mb for serving over web. * We still produce a "runnable" container in bb.js, for executing the tests, but we use `yarn pack` to produce the publishable artefact, which is what we import downstream. This cuts out 300mb of node_modules, which may just get reimported downstream, but should at least remove duplication and strip back to production on dependencies. * We remove gubbins from bb wasm container that circuits cpp needed, as we have killed it off. * For `sandbox` and `cli` we: * Fix the "productionify" step to clear the cache after to the prod install. It was originally this way around due to use of pnp instead of node_modules (if we really care about size, maybe we should reconsider pnpifying the final runtime?). But, if we're not using pnp, we should purge the `.yarn/cache`. * Blow away all the `src` folders as they're non negligible in size. * Building final "slim" image cherry picks a little more carefully to avoid pulling in some unneeding things (e.g. nargo).
- Loading branch information
1 parent
98d7ba0
commit cb3db5d
Showing
17 changed files
with
1,533 additions
and
1,424 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,6 @@ | |
|
||
# Needed scripts. | ||
!scripts/install-wasi-sdk.sh | ||
!scripts/strip-wasm.sh | ||
!./.clang-format | ||
!./format.sh |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ dest | |
.tsbuildinfo* | ||
*.log | ||
/crs | ||
package.tgz | ||
package |
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
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
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
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
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
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
Oops, something went wrong.