feat(build): slim txiki.js runtime — binary 6.4 MB → 2.4 MB, v0.9.0 - #36
Merged
Conversation
… MB -> 2.4 MB Switch both runtime acquisition paths to the `slim-ffi` profile published by lukasMega/txiki.js-with-slim-builds (tag slim-v26.6.0-6, txiki.js v26.6.0): libffi in, TLS/WebAssembly/SQLite/mimalloc and the eval/serve/test/bundle/app subcommands out, MinSizeRel + compressed bytecode + hardened + stripped. TLS is not needed at runtime: every fetch() in this repo runs in the browser UI, so the ffi profile saves ~430 KB over ffi-tls for no loss of function. - tjs-download.mjs now fetches the prebuilt slim asset (verified against the release's published sha256). macOS x86_64 has no such asset and gets an actionable error pointing at TJS_FROM_SOURCE=1. - tjs-build.mjs no longer hand-rolls cmake flags; it clones the tag and runs the fork's own scripts/build-dist.mjs --profile ffi, i.e. the exact driver that produces the published assets. It also no-ops when $TJS already exists, which is what the release workflow's runtime cache always assumed. - Release builds therefore download the slim runtime on every platform except macos-x86_64, instead of compiling txiki.js from source on all of them. Measured on macOS arm64: deckbridge 6,690,315 B -> 2,481,492 B. Also re-enables the Linux release matrix (linux-x86_64, linux-arm64). The blocker was mise-action blind-installing the github:lukasMega/txiki.js mise tool, which had no linux-arm64 asset; that tool entry was unused (mise.toml points $TJS at an explicit vendor/ path) and is now gone. mise.toml cleanup along the way: one version variable instead of two, no dead tool/hook blocks, no per-task re-export of env vars mise already exports, and the rust-fmt/rust-clippy/rust-test, run-ts and largeFiles tasks dropped as verbatim duplicates of rust-lint, s and loc.
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.
What
Ships the
slim-ffitxiki.js runtime from lukasMega/txiki.js-with-slim-builds@slim-v26.6.0-6 (txiki.js v26.6.0) on every platform, and bumps to 0.9.0 (merging this fires auto-tag → release).Profile keeps
tjs:ffi, WebCrypto,run/compile, REPL. Drops TLS, WebAssembly, SQLite, mimalloc and theeval/serve/test/bundle/appsubcommands; MinSizeRel + compressed bytecode + hardened + stripped.TLS costs ~430 KB and buys nothing here — every
fetch()in the repo runs in the browser UI, not the runtime.Size (macOS arm64)
deckbridgePackaged
.tar.xz: 1.9 MB.Changes
scripts/tjs-download.mjs— fetchestxiki-slim-ffi-<os>-<arch>.zip. macOS x86_64 has no such asset → explicit error pointing atTJS_FROM_SOURCE=1.scripts/tjs-build.mjs— stops hand-rolling cmake flags; clones the tag and runs the fork's ownscripts/build-dist.mjs --profile ffi(the same driver that builds the published assets). Now also no-ops when$TJSexists — which is what the release workflow's runtime cache always assumed, so localmise run testdrops from ~120 s to ~20 s.release.yml— onlymacos-x86_64builds from source now (TJS_FROM_SOURCEcomes from the matrix); everything else downloads. Linux release builds re-enabled (linux-x86_64,linux-arm64): the blocker was mise-action blind-installing thegithub:lukasMega/txiki.jsmise tool that had no linux-arm64 asset — that tool entry was unused and is now deleted.mise.toml— one version var instead of two; dead tool/hook blocks gone; per-task re-exports of vars mise already exports gone;rust-fmt/rust-clippy/rust-test,run-ts,largeFilesdropped as verbatim duplicates ofrust-lint/s/loc;checkTjsno longer calls$TJS --help(slim compiles help out). 371 → 320 lines.Verified locally (macOS arm64)
BUILDINFO.dlopenoflibhidapi/libdeckbridge_nativeOK./api/stateOK.Untested
Windows (now gets slim via the download path) and the Linux matrix — both are CI-only paths.
fail-fastis off, so a Linux failure wouldn't block the other platforms' artifacts.