> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Announcing Lynxtron

[← All Posts](/next/blog/)

September 21, 2026

![Wang Zhixuan](https://github.com/icecreamx10.png)Wang ZhixuanMultiplatform Lead @ Lynx![Guo Xi](https://github.com/GuoXi.png)Guo XiEngineering @ Lynx![The Lynx Team](https://github.com/lynx-family.png)The Lynx Teamlynxjs.org

Lynx is moving onto desktop.

**[Lynxtron](/next/lynxtron/index.md)** is an Electron-like app framework powered by Lynx. In a Lynxtron application, the host process keeps the Node.js capabilities desktop apps need, while `LynxWindow` hosts Lynx UI through a light-weight renderer instead of a browser page.

That gives developers a way to build desktop applications with the Lynx UI model, while keeping the runtime lightweight, making native extension a first-class part of the app, and organizing UI code across desktop, web, and mobile-native targets.

## What Lynxtron Is For

Desktop application development often forces a practical choice: move fast with web technology, or spend more native engineering effort to get smaller binaries, better runtime behavior, and deeper system integration. Lynxtron is a third path: use Lynx for UI, use a desktop host process for system capabilities, and use native extensions where native code is the right tool.

Lynxtron centers on three features: Light-weight and Fast, Multiplatform, and Natively Extensible. Here is how those ideas map to desktop application development.

## Explore with Lynxtron Go

[Lynxtron Go](/next/lynxtron/go.md) is the official playground for Lynxtron, and is itself a desktop application built with the Lynxtron framework. It provides templates, a built-in example gallery, an editor, and a console for running and inspecting small Lynxtron applications without first setting up a full project. The runnable examples below can also be opened directly in Lynxtron Go.

:::info Tested versions and platforms

The examples in this article come from the Lynxtron Go 0.1.18 release and use Lynxtron runtime 0.0.28. The desktop examples support macOS on Apple silicon and Intel, and Windows on x64. The Notes example also supports Web. Lynxtron projects require Node.js `^22.18.0 || ^24.0.0 || ^26.0.0`.

:::

## Light-weight and Fast

Lynxtron is Electron-like in the application model, but it does not ship a browser as the UI runtime. [`LynxWindow`](/next/lynxtron/api/@lynx-js/lynxtron/Class.LynxWindow.md) hosts UI through the light-weight Lynx renderer, which keeps the desktop runtime smaller and gives startup, window creation, and memory usage a more direct path.


**This is an example below: benchmark**

**Bundle:** `dist/desktop/main.lynx.bundle`

```ts {17-25,39-52,66-70}
import { app, LynxWindow, lynxBridge } from '@lynx-js/lynxtron';
import { nudgeFramedWindowViewport } from '@lynxtron-examples/config/window';
import { LYNX_BUNDLE_PATH } from './vendorPaths';
import path from 'path';
import { fetchReleaseSize } from './release-size';
import {
  getMemoryUsageDelta,
  getMemoryUsageSnapshot,
  type MemoryUsageDelta,
} from './memory-metrics';

const WINDOW_SETTLE_MS = 800;

// Main body starts after imports. Buffer in memory; print after loadFile returns.
const startupMarks: { stage: string; wallMs: number; monoMs: number }[] = [];
function markStartup(stage: string) {
  startupMarks.push({ stage, wallMs: Date.now(), monoMs: performance.now() });
}
markStartup('main-module-body');

// Use the OS process creation time, not the time this JS module or preload runs.
const processCreatedAt = (process as NodeJS.Process & {
  getCreationTime(): number | null;
}).getCreationTime();
let startupTime: number | null = null;

let mainWindow: LynxWindow | null = null;
let secondWindow: LynxWindow | null = null;
let secondWindowDelta: MemoryUsageDelta | null = null;

function createBenchmarkWindow(title: string, width: number, height: number) {
  const w = new LynxWindow({
    width,
    height,
    title,
    lynxPreference: {
      preload: path.join(__dirname, 'preload.js'),
    },
  });
  nudgeFramedWindowViewport(w, { width, height });
  return w;
}

function registerBridgeHandlers() {
  let releaseSizeRequest: ReturnType<typeof fetchReleaseSize> | undefined;
  lynxBridge.handle('getReleaseSize', async () => {
    try {
      releaseSizeRequest ??= fetchReleaseSize();
      return { ok: true, ...(await releaseSizeRequest) };
    } catch (error) {
      releaseSizeRequest = undefined;
      return { ok: false, error: error instanceof Error ? error.message : 'Release size unavailable' };
    }
  });
  lynxBridge.handle('getStartupTime', () => startupTime);
  lynxBridge.handle('openSecondWindowAndMeasure', () => {
    if (secondWindow) {
      secondWindow.show();
      return { ok: true, delta: secondWindowDelta, alreadyOpen: true };
    }

    const before = getMemoryUsageSnapshot();
    secondWindow = createBenchmarkWindow('Benchmark Dashboard #2', 640, 460);
    secondWindow.on('closed', () => {
      secondWindow = null;
      secondWindowDelta = null;
    });
    secondWindow.show();
    secondWindow.loadFile(LYNX_BUNDLE_PATH);

    return new Promise((resolve) => {
      setTimeout(() => {
        const after = getMemoryUsageSnapshot();
        secondWindowDelta = getMemoryUsageDelta(before, after);
        resolve({ ok: true, delta: secondWindowDelta, alreadyOpen: false });
      }, WINDOW_SETTLE_MS);
    });
  });

  lynxBridge.handle('getSecondWindowDelta', () => ({
    isOpen: secondWindow != null,
    delta: secondWindowDelta,
  }));
}

app.whenReady().then(() => {
  markStartup('app-ready');
  registerBridgeHandlers();
  markStartup('bridge-registered');
  markStartup('window-create-start');
  mainWindow = createBenchmarkWindow('Benchmark Dashboard', 700, 520);
  markStartup('window-create-end');
  markStartup('show-start');
  mainWindow.show();
  markStartup('show-end');
  markStartup('loadFile-start');
  // Lynx architecture: LynxWindow.loadFile synchronously executes Lynx MTS
  // (Main Thread Script) AND the on-screen rendering operations on the main
  // thread. This is not waiting for BTS (Background Thread Script). Its return
  // is therefore the end of those operations, not just a request being queued.
  // Measure Lynx FCP from OS process creation to this synchronous return for the
  // initial main window. Do not substitute a browser-style asynchronous paint
  // assumption or wait for an on-first-screen callback. Extra windows/reloads
  // must not reset the metric.
  // MTS/IFR: https://lynxjs.org/guide/interaction/ifr
  mainWindow.loadFile(LYNX_BUNDLE_PATH);
  const loadFileCompletedAt = Date.now();
  markStartup('loadFile-return');
  if (processCreatedAt != null && processCreatedAt > 0 && processCreatedAt <= loadFileCompletedAt) {
    startupTime = Math.round(loadFileCompletedAt - processCreatedAt);
    console.log(`[Benchmark] Process creation to synchronous loadFile completion: ${startupTime} ms`);
  }
  console.log('[BenchmarkStartup] ' + JSON.stringify({
    pid: process.pid, processCreatedAt, totalMs: startupTime,
    bundleEntrySinceProcessMs: processCreatedAt == null ? null :
      (globalThis as typeof globalThis & { __benchmarkBundleEntryAt: number }).__benchmarkBundleEntryAt - processCreatedAt,
    marks: startupMarks.map((mark, index) => ({
      stage: mark.stage,
      sinceProcessMs: processCreatedAt == null ? null : mark.wallMs - processCreatedAt,
      sincePreviousMs: index === 0 ? null : Number((mark.monoMs - startupMarks[index - 1].monoMs).toFixed(2)),
    })),
  }));
});

```

v0.0.6



> The benchmark reports Lynxtron's baseline package size, startup time, physical memory, JS heap, platform information, and the memory delta after opening a second `LynxWindow`, covering startup and memory use with one or two windows. The screenshot shows a cold launch, excluding the first launch after installation, of the Benchmark example v0.0.6 running on Lynxtron 0.0.28 and Windows 11 x64 (Core Ultra 7 155H with Intel Arc); startup spans process creation through the first content appearing on screen and is not an average.

## Natively Extensible

Lynxtron extends the renderer through [LynxExtensionModule](/next/api/lynx-native-api/lynx-extension-module.md), the Desktop C++ extension API backed by the [public Lynx Native API](/next/api/lynx-native-api/lynx-view.md). This reference covers the native-view lifecycle, registration, and texture APIs used by this example. Native modules use the C++ extension-module wrapper and expose their JavaScript interface through [Node-API](/next/lynxtron/Native-Libraries/NodeJS-Native-Modules.md), while native UI and texture surfaces use the native-view wrappers. In desktop development, it is common for part of an application to need native-rendered graphics or native UI: a camera preview, video surface, map view, drawing canvas, platform control, or any surface that needs hardware access, deeper GPU integration, or system-provided rendering. Lynxtron can combine those native surfaces or native UI with the Lynx runtime, so native-rendered parts stay native while interaction and UI logic can still be built and iterated with Lynx UI.


**This is an example below: native-texture-canvas**

**Bundle:** `dist/desktop/main.lynx.bundle`

```cpp {67-70,93-107}
#include "module/native_texture_canvas_module.h"

#include <cstring>
#include <utility>
#include <vector>

#include "capi/lynx_log_capi.h"
#include "module/native_texture_canvas_view.h"

namespace extension {
namespace {

const uint64_t kNativeTextureCanvasModuleID =
    reinterpret_cast<uint64_t>(&kNativeTextureCanvasModuleID);

Napi::Value SetBrush(const Napi::CallbackInfo& info) {
  Napi::Env env = info.Env();
  if (info.Length() < 4) {
    Napi::TypeError::New(
        env, "Expected (string canvasId, string color, number size, number opacity)")
        .ThrowAsJavaScriptException();
    return env.Null();
  }
  if (!info[0].IsString() || !info[1].IsString()) {
    Napi::TypeError::New(env, "canvasId and color must be strings")
        .ThrowAsJavaScriptException();
    return env.Null();
  }

  std::string canvas_id = info[0].As<Napi::String>().Utf8Value();
  std::string color = info[1].As<Napi::String>().Utf8Value();
  double size = info[2].As<Napi::Number>().DoubleValue();
  double opacity = info[3].As<Napi::Number>().DoubleValue();

  bool success =
      NativeTextureCanvasRegistry::Get().SetBrush(canvas_id, color, size, opacity);
  return Napi::Boolean::New(env, success);
}

Napi::Value Clear(const Napi::CallbackInfo& info) {
  Napi::Env env = info.Env();
  if (info.Length() < 1 || !info[0].IsString()) {
    Napi::TypeError::New(env, "Expected (string canvasId)")
        .ThrowAsJavaScriptException();
    return env.Null();
  }

  std::string canvas_id = info[0].As<Napi::String>().Utf8Value();
  bool success = NativeTextureCanvasRegistry::Get().Clear(canvas_id);
  return Napi::Boolean::New(env, success);
}

Napi::Value NativeTextureCanvasModuleMethodsBinder(
    Napi::Env env, Napi::Value exports, const char* module_name,
    NativeTextureCanvasModule& module) {
  if (!exports.IsObject()) {
    return exports;
  }
  Napi::Object exports_obj = exports.As<Napi::Object>();
  exports_obj.Set("setBrush", Napi::Function::New(env, SetBrush, "setBrush"));
  exports_obj.Set("clear", Napi::Function::New(env, Clear, "clear"));
  return exports;
}

}  // namespace

void NativeTextureCanvasModule::OnLynxViewCreate(lynx_view_t* lynx_view) {
  lynx_view_register_native_view(lynx_view, "native-texture-canvas",
                                 &native_texture_canvas_create_view, lynx_view);
}

void NativeTextureCanvasModule::OnLynxViewDestroy() {}
void NativeTextureCanvasModule::OnRuntimeInit() {}

void NativeTextureCanvasModule::OnRuntimeAttach(
    Napi::Env env,
    std::unique_ptr<lynx::pub::VSyncObserver> vsync_observer) {
  SetNapiInstanceData(
      env, kNativeTextureCanvasModuleID, this,
      [](Napi::Env, void*, void*) {}, nullptr);
}

void NativeTextureCanvasModule::OnRuntimeReady(Napi::Env env,
                                               Napi::Value lynx,
                                               const char* url) {}
void NativeTextureCanvasModule::OnRuntimeDetach() {}
void NativeTextureCanvasModule::OnEnterForeground() {}
void NativeTextureCanvasModule::OnEnterBackground() {}
void NativeTextureCanvasModule::Destroy() {}

}  // namespace extension

LYNX_EXTERN_C lynx_extension_module_t*
native_texture_canvas_module_create_extension_module(void* opaque) {
  auto* module = new extension::NativeTextureCanvasModule();
  lynx_extension_module_t* c_module =
      lynx_extension_module_create_with_finalizer(
          module, [](lynx_extension_module_t* m, void* user_data) {
            if (user_data) {
              delete reinterpret_cast<extension::NativeTextureCanvasModule*>(
                  user_data);
            }
          });

  module->SetCModule(c_module);
  module->SetNapiModuleCreator(&extension::NativeTextureCanvasModuleMethodsBinder);
  return c_module;
}

```

v0.0.8



> Lynx UI controls a native texture surface through a registered native module, keeping native rendering and front-end-style interaction in one component tree.

## Multiplatform

Lynxtron does not lock Lynx to desktop. With Lynx, UI code can run across platforms, including the Web, and can be ported to new hosts with minimal effort.


**This is an example below: cross-platform-notes**

**Bundle:** `dist/desktop/main.lynx.bundle` | Web host: `dist/web/index.html`

```ts {71-87,146-149,165-178}
type NoteSummary = {
  id: string;
  title: string;
  excerpt: string;
  updatedAt: string;
};

type NoteRecord = {
  id: string;
  title: string;
  content: string;
  updatedAt: string;
  createdAt?: string;
};

type NoteDraft = {
  id?: string;
  title?: string;
  content?: string;
};

type PlatformInfo = {
  kind: 'desktop' | 'web';
  runtime: string;
  storage: string;
  detail: string;
};

type DesktopBridge = {
  notes?: {
    list(): NoteSummary[];
    get(id: string): NoteRecord | null;
    create(draft?: NoteDraft): NoteRecord;
    save(draft: NoteDraft): NoteRecord;
    remove(id: string): boolean;
  };
  platform?: {
    getInfo(): {
      kind: 'desktop';
      os: string;
      arch: string;
      storage: 'filesystem';
      storageDir: string;
    };
  };
};

type WebBridge = {
  list(): Promise<NoteSummary[]>;
  get(id: string): Promise<NoteRecord | null>;
  create(): Promise<NoteRecord>;
  save(note: {
    id: string;
    title: string;
    content: string;
  }): Promise<NoteRecord>;
  remove(id: string): Promise<void>;
  platform(): Promise<{
    platform: 'web';
    runtime: 'browser';
    storage: 'localStorage';
    version: string;
  }>;
};

type UnifiedNotesApi = {
  list(): Promise<NoteSummary[]>;
  get(id: string): Promise<NoteRecord | null>;
  create(): Promise<NoteRecord>;
  save(draft: NoteDraft): Promise<NoteRecord>;
  remove(id: string): Promise<boolean>;
  getPlatformInfo(): Promise<PlatformInfo>;
};

function desktopBridge(): DesktopBridge | null {
  try {
    // @ts-ignore - NativeModules is provided by Lynx desktop runtime
    return NativeModules?.nodejs?.exposed ?? null;
  } catch {
    return null;
  }
}

function webBridge(): WebBridge | null {
  try {
    // @ts-ignore - injected by Web Core from lynxView.nativeModulesMap
    return NativeModules?.webNotes ?? null;
  } catch {
    return null;
  }
}

function fallbackSummary(note: NoteRecord): NoteSummary {
  const excerpt = note.content.replace(/\s+/g, ' ').trim().slice(0, 120);
  return {
    id: note.id,
    title: note.title,
    excerpt: excerpt || 'No content yet',
    updatedAt: note.updatedAt,
  };
}

function fallbackApi(): UnifiedNotesApi {
  let record: NoteRecord = {
    id: 'local-fallback',
    title: 'Desktop release plan',
    content:
      '# Desktop release plan\n\nShip the Lynx UI, verify native capabilities, and share one bundle across hosts.',
    updatedAt: new Date().toISOString(),
  };

  return {
    async list() {
      return [fallbackSummary(record)];
    },
    async get(id: string) {
      return id === record.id ? record : null;
    },
    async create() {
      record = {
        id: `local-${Date.now()}`,
        title: 'New idea',
        content: '# New idea\n\nCapture the next product thought here.',
        updatedAt: new Date().toISOString(),
      };
      return record;
    },
    async save(draft: NoteDraft) {
      record = {
        id: draft.id ?? record.id,
        title: draft.title ?? record.title,
        content: draft.content ?? record.content,
        updatedAt: new Date().toISOString(),
      };
      return record;
    },
    async remove(id: string) {
      return id === record.id;
    },
    async getPlatformInfo() {
      return {
        kind: 'web',
        runtime: 'fallback',
        storage: 'memory',
        detail: 'Bridge unavailable',
      };
    },
  };
}

export function getNotesApi(): UnifiedNotesApi {
  const desktop = desktopBridge();
  if (desktop?.notes && desktop.platform) {
    return {
      async list() {
        return desktop.notes!.list();
      },
      async get(id: string) {
        return desktop.notes!.get(id);
      },
      async create() {
        return desktop.notes!.create();
      },
      async save(draft: NoteDraft) {
        return desktop.notes!.save(draft);
      },
      async remove(id: string) {
        return desktop.notes!.remove(id);
      },
      async getPlatformInfo() {
        const info = desktop.platform!.getInfo();
        return {
          kind: 'desktop',
          runtime: `${info.os} ${info.arch}`,
          storage: info.storage,
          detail: info.storageDir,
        };
      },
    };
  }

  const web = webBridge();
  if (web) {
    return {
      async list() {
        return web.list();
      },
      async get(id: string) {
        return web.get(id);
      },
      async create() {
        return web.create();
      },
      async save(draft: NoteDraft) {
        const current = draft.id ? await web.get(draft.id) : null;
        return web.save({
          id: draft.id ?? current?.id ?? `note-${Date.now()}`,
          title: draft.title ?? current?.title ?? 'New idea',
          content: draft.content ?? current?.content ?? '',
        });
      },
      async remove(id: string) {
        await web.remove(id);
        return true;
      },
      async getPlatformInfo() {
        const info = await web.platform();
        return {
          kind: 'web',
          runtime: `${info.runtime} ${info.version}`,
          storage: info.storage,
          detail: 'localStorage',
        };
      },
    };
  }

  return fallbackApi();
}

export type { NoteSummary, NoteRecord, PlatformInfo, UnifiedNotesApi };

```

v0.0.6



> The same Lynx UI consumes one notes API. At build time, the desktop and Web targets wire that API to a Node preload bridge and a browser-side bridge, respectively.

This is the Lynxtron cross-platform engineering model: keep the Lynx UI layer shareable, isolate host-specific logic behind platform adapters, and port the renderer model to new hosts when needed.

## Engineering Boundaries

What matters is the inspectable source boundary: the host process owns desktop capabilities, Lynx UI owns interface and interaction, and native extensions own the platform-specific pieces. Lynxtron's design is not about pushing every capability into one layer. It is about letting each layer own the work it is best suited for.

## Get Started

Follow [Lynxtron Getting Started](/next/lynxtron/introduction.md) to create and run your first project.
