Skip to content

Introduce Bun as a runtime option alongside Node.js for Cfx.re server #3615

Description

@Kuuzoo

What happened?

Currently, the Cfx.re server only supports Node.js/V8 for JavaScript runtime. This limits experimentation with alternative runtimes such as Bun, which has recently gained traction due to performance benefits, in-house TypeScript support, and native integrations.

Expected result

The Cfx.re server should optionally allow using Bun as a runtime next to Node.js. This would give developers more flexibility and enable projects to take advantage of Bun’s performance and TypeScript-first approach.

Importancy

None.

Area(s)

ScRT: JS

Additional information

Challenges and considerations:

  • Bun uses JavaScriptCore (JSC) instead of V8. The Cfx.re server currently integrates tightly with V8.
  • There is no official C++ embedding API for Bun yet, which may complicate direct integration.

Potential improvements:

  • Performance: Bun is significantly faster in many benchmarks.
  • Native implementations (Zig-based) for SQL and other system bindings could replace heavier JS wrappers.
  • In-house TypeScript support: eliminates the need to transpile TS → JS, streamlining developer workflow.

This request is not to replace Node.js but to explore the option of running Bun alongside it, opening the door for better performance and developer ergonomics in the long term.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ScRT: JSIssues/PRs related to the JavaScript scripting runtimebug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions