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

@lynx-js/rsbuild-plugin-canary

v0.3.0-canary-20261204-8de6ab72

Published

An Rsbuild plugin that builds a Lynx app with the Rsbuild CLI directly, without the Rspeedy CLI.

Readme

@lynx-js/rsbuild-plugin

The shared Lynx build engine for Rsbuild and Rspeedy. It handles Lynx module resolution, thread assets, CSS, and native or Web bundle encoding.

Direct Element PAPI applications

Without a DSL plugin, pluginLynx() builds Vanilla Lynx bundles from the standard Rsbuild source.entry configuration:

import { pluginLynx } from '@lynx-js/rsbuild-plugin'
import { defineConfig } from '@rsbuild/core'

export default defineConfig({
  source: {
    entry: {
      main: './src/index.ts',
    },
  },
  environments: { lynx: {}, web: {} },
  plugins: [pluginLynx()],
})

The build emits main.lynx.bundle and main.web.bundle. Each page entry compiles for both threads. Import the two setup functions and select the thread with the compile-time macros.

import { setUpBackgroundThread } from './background.js'
import { setUpMainThread } from './main-thread.js'

if (__MAIN_THREAD__) {
  setUpMainThread()
} else if (__BACKGROUND__) {
  setUpBackgroundThread()
}

Put initialization inside the setup functions and import page styles from the main thread. SWC removes the inactive branch, and Rspack analyzes module side effects in both development and production. An unused setup module can then be omitted from the background build even when it imports a page stylesheet.

String, array, and description entries use Rsbuild module resolution, aliases, source.preEntry, and environment configuration. The engine manages the thread layers and intermediate filenames. No sibling files are discovered. Keep Element PAPI tree creation and mutation on the main thread.

Each thread entry must emit one self-contained JavaScript file. Independent runtimes, shared chunks, dependOn, and dynamic imports that generate async chunks are rejected during compilation. Use performance.chunkSplit.strategy: 'all-in-one' to disable automatic splitting and keep each runtime in its entry.

Direct entries use the encoder and runtime wrapper's default engine version (3.2). Use output.filename.bundle to customize bundle names. Set page options such as enableEventHandleRefactor through pluginLynxConfig; entry assembly does not inject them. Direct entries do not install a hot-update or live-reload client, and their compilation omits the HMR plugin. After the dev server rebuilds, reload the page in its host. The application owns its state, node updates, lifecycle, and communication between threads.

This entry path supports engine API examples, small direct-rendered pages, and code produced by a custom renderer or compiler. It does not install a component framework or promise a performance improvement over one. The template's react_nodiff encoding mode refers to the engine's Element PAPI format and does not add a React runtime.

Framework applications

A framework plugin such as pluginReactLynx generates its own thread entries. The Vanilla fallback runs after DSL bundler-chain hooks. A DSL identifies its entries by assigning its own layers. Separate environments may use a DSL and Vanilla. Mixing their entry layers within one environment is rejected. ReactLynx registers the build engine when needed; add pluginLynx explicitly to customize engine options.

Configure ReactLynx's engine version with pluginReactLynx({ engineVersion }). It takes precedence over the deprecated targetSdkVersion alias and defaults to 3.2.

Polyfills

Polyfills are off by default. To inject them on demand, install core-js in your application and set output.polyfill to 'usage'. The 'entry' mode is also supported and requires an explicit core-js import. Lynx builds use Chrome 92 as an approximation for selecting polyfills; verify API availability for the Lynx runtimes you support.