npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sigx/lynx-plugin

v0.2.7

Published

Rspack/Rspeedy plugin for SignalX Lynx dual-thread rendering

Readme

@sigx/lynx-plugin

Rspack/Rspeedy plugin for SignalX on Lynx. Splits a single user app into the two bundles Lynx requires (background JS + main-thread Lepus) and runs the SWC worklet transform that powers 'main thread'-marked event handlers.

Installation

npm install -D @sigx/lynx-plugin
// rspeedy.config.ts (or rspack.config.ts)
import { defineConfig } from '@lynx-js/rspeedy';
import { sigxLynxPlugin } from '@sigx/lynx-plugin';

export default defineConfig({
  plugins: [sigxLynxPlugin()],
});

What it does

  1. Two-bundle split. Lynx ships JS to two contexts on the device:

    • The background bundle — your sigx components, signals, effects, fetch logic.
    • The main-thread bundle — only the worklet handlers extracted from your source, plus the runtime bootstrap.

    The plugin sets up a separate webpack rule so user source files are processed twice: once with the BG-target transform, once with the LEPUS-target transform.

  2. Worklet transform. Files containing the string 'main thread' are run through @lynx-js/react/transform. The transform:

    • Replaces a worklet expression in the BG bundle with a {_wkltId, _c} placeholder so the BG renderer can reference it without shipping the function body.
    • Emits registerWorkletInternal("main-thread", "<id>", function(...) { ... }) calls into the MT bundle so Lynx native can invoke the worklet body when it dispatches a touch event.
  3. MT-bundle bootstrap. Every file in the MT bundle gets three side-effect imports prepended:

    • @sigx/lynx-runtime-main/entry-main — installs the processData / renderPage / sigxPatchUpdate globals Lynx expects.
    • @lynx-js/react/runtime/worklet-runtime/main.js — populates lynxWorkletImpl, registerWorkletInternal, runWorklet.
    • @sigx/lynx-runtime-main/install-hybrid-worklet — registers the hybrid dispatcher used by the bindtap + main-thread-bindtap slot machine.

    Listing them as separate entries in webpack isn't sufficient because the chunk graph can evaluate user code before the bootstrap chain. Prepending side-effect imports per-file forces the dep-graph order.

  4. Workspace import preservation. Top-level imports of @sigx/* packages (e.g. import { Draggable } from '@sigx/gestures') are preserved as side-effect imports on the MT layer, so workspace component packages that ship MT worklets get walked by webpack and their registerWorkletInternal calls land in the MT bundle.

Worklet author quick reference

Mark an event handler as MT-thread by adding the directive as the first statement:

<view
  main-thread-bindtap={(e) => {
    'main thread';
    elRef.current?.setStyleProperties({ opacity: '0.5' });
  }}
/>

The plugin handles the rest — the handler body lives in the MT bundle, the BG bundle keeps a {_wkltId, _c} placeholder, and Lynx native dispatches the touch event directly to the MT thread.

For higher-level abstractions (drag, tap, swipe, animations), see @sigx/gestures.

Limitations

  • Custom worklet bodies require 'main thread' directives. Worklets aren't auto-detected from JSX shape; the directive is the marker.
  • Variables declared inside a worklet body are MT-locals. They can't cross the bridge via runOnBackground closure capture — pass them as arguments instead. See @sigx/gestures README, "Performance notes."
  • Mappers for useAnimatedStyle ship as MT-side code. Custom mappers must be registered from a MT-side module via registerMapper(name, fn) — BG-side useAnimatedStyle only carries the name across the build pipeline.

License

MIT