Skip to content

Conversation

@remorses
Copy link
Contributor

@remorses remorses commented Nov 28, 2025

Currently this PR is not enough to enable bytecode compiliation

  • opentui also needs to remove top level awaits
  • bun --bytecode works by compiling to commonjs. some dependencies have bugs that do not allow it. Throwing the error Expected CommonJS module to have a function wrapper. This us often caused by the use of import.meta.url or other ESM only code. This needs more investigation

Preparation for enabling bytecode compilation (faster startup times).

Related to #4843 and sst/opentui#356

  • global/index.ts: Wrapped async initialization code in an IIFE instead of top-level await
  • index.ts: Changed await cli.parse() to Promise.resolve(cli.parse()).catch().finally() pattern
  • worker.ts: Removed await from Log.init() call (fire-and-forget)

Once opentui PR lands and Bun types are updated, bytecode can be enabled in build.ts with bytecode: true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant