This package provides a prepatched version of Ink with Socket-specific fixes and optimizations.
-
signal-exit import fix: Changes the default import to named import for compatibility with modern ESM bundlers
import signalExit from 'signal-exit'→import { onExit as signalExit } from 'signal-exit'
-
devtools removal: Removes the conditional devtools import that uses top-level await, which causes bundling issues
- Replaces dynamic devtools loading with a no-op function
- Prevents
react-devtools-corefrom being required as a dependency
The build rewires all yoga-layout imports to use socket-btm's synchronous yoga-sync:
import Yoga from 'yoga-layout'→import Yoga from './yoga-sync.mjs'- Bundles
yoga-sync.mjsfromyoga-layout-builder/build/dev/<platform-arch>/out/Final/ - Removes
yoga-layoutfrom dependencies (no external yoga dependency needed)
This provides:
- Synchronous WASM instantiation (no async loading)
- Embedded WASM binary (no separate .wasm file to load)
- Optimized build from yoga-layout-builder
The dist/ directory contains the complete ink package ready to use:
- All ink source files with patches applied
build/yoga-sync.mjs- Bundled synchronous yoga layout enginepackage.jsonwithyoga-layoutdependency removed
Prerequisites: Build yoga-layout-builder first:
cd ../yoga-layout-builder
pnpm run buildThen build ink:
pnpm run buildWhen ink is updated upstream:
- Update the version in
package.jsonsources - Update the patch files in
patches/ - Verify
YOGA_IMPORT_FILESlist inscripts/build.mtsmatches ink's imports - Rebuild and test
- Upstream: https://github.com/vadimdemedes/ink
- Version: 7.0.0