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

@mainframework/dom-signals-unplugin

v1.0.0

Published

Unplugin integration for @mainframework/signals Workflow A

Readme

@mainframework/dom-signals-unplugin

npm: https://www.npmjs.com/package/@mainframework/dom-signals-unplugin

Unplugin integration for Workflow A DOM wiring with @mainframework/signals. Register exactly once per app.

Source: mainframework-com/signals-plugins (mainframework-dom-signals-unplugin)

Requires: @mainframework/signals in the app — https://www.npmjs.com/package/@mainframework/signals

Runtime DOM (Workflow B/C, domSignal, useDomSignal): @mainframework/signals README.

pnpm add @mainframework/signals @mainframework/dom-signals-unplugin

Install your bundler (Vite, Webpack, etc.) as usual. Optional peers are listed per section.

Cross-bundler rules

  • Register dom compile once per app (no Babel dom-compile duplicate on the same files).
  • Vite / Rollup / Rspack / …: this unplugin uses enforce: 'pre' (see bundler sections below).
  • Webpack: either domCompiler.webpack() or @mainframework/dom-signals-unplugin/webpack-loader last in rule.use (runs first on the file), not both.

Vite

pnpm add -D vite

vite.config.ts:

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import domCompiler from "@mainframework/dom-signals-unplugin";

export default defineConfig({
  plugins: [domCompiler.vite(), react()],
});

Order: factory sets enforce: 'pre' — do not rely on array position.


Rollup

pnpm add -D rollup @rollup/plugin-node-resolve @rollup/plugin-typescript

rollup.config.js:

import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import domCompiler from "@mainframework/dom-signals-unplugin";

export default {
  input: "src/main.ts",
  output: { file: "dist/bundle.js", format: "es" },
  plugins: [domCompiler.rollup(), resolve(), typescript()],
};

Order: enforce: 'pre'.


Webpack (unplugin)

pnpm add -D webpack webpack-cli

webpack.config.mjs:

import domCompiler from "@mainframework/dom-signals-unplugin";

export default {
  mode: "development",
  entry: "./src/index.tsx",
  module: {
    rules: [
      {
        test: /\.tsx$/,
        use: ["babel-loader"],
      },
    ],
  },
  plugins: [domCompiler.webpack()],
};

Order: enforce: 'pre'. Do not also use webpack-loader on the same files.


Webpack (rule.use loader — choose one path)

webpack.config.mjs:

export default {
  mode: "development",
  entry: "./src/index.tsx",
  module: {
    rules: [
      {
        test: /\.tsx$/,
        use: [
          "babel-loader",
          "@mainframework/dom-signals-unplugin/webpack-loader",
        ],
      },
    ],
  },
};

Loader is last in use so it runs first on the file. Do not add domCompiler.webpack().


esbuild

pnpm add -D esbuild

build.mjs:

import * as esbuild from "esbuild";
import domCompiler from "@mainframework/dom-signals-unplugin";

await esbuild.build({
  entryPoints: ["src/index.tsx"],
  bundle: true,
  outfile: "dist/out.js",
  plugins: [domCompiler.esbuild()],
});

Register dom compile before other transforms that strip TS/JSX.


Bun

pnpm add -D bun

build.ts:

import domCompiler from "@mainframework/dom-signals-unplugin";

await Bun.build({
  entrypoints: ["./src/index.tsx"],
  outdir: "./dist",
  plugins: [domCompiler.bun()],
});

Rspack

pnpm add -D @rspack/core @rspack/cli

rspack.config.mjs:

import domCompiler from "@mainframework/dom-signals-unplugin";

export default {
  entry: { main: "./src/index.tsx" },
  plugins: [domCompiler.rspack()],
};

Order: enforce: 'pre'.


Rsbuild

pnpm add -D @rsbuild/core

rsbuild.config.ts:

import { defineConfig } from "@rsbuild/core";
import domCompiler from "@mainframework/dom-signals-unplugin";

export default defineConfig({
  plugins: [
    {
      name: "dom-compiler",
      setup(api) {
        api.modifyRspackConfig((config) => {
          config.plugins = config.plugins ?? [];
          config.plugins.push(domCompiler.rspack());
          return config;
        });
      },
    },
  ],
});

Verify against your Rsbuild version if the hook name differs. Underlying adapter uses enforce: 'pre'.


Rolldown

Use the Rolldown adapter from the same package:

import domCompiler from "@mainframework/dom-signals-unplugin";

export default {
  input: "src/index.ts",
  plugins: [domCompiler.rolldown()],
};

Order: enforce: 'pre'.


Farm

pnpm add -D @farmfe/core @farmfe/cli

farm.config.ts:

import domCompiler from "@mainframework/dom-signals-unplugin";

export default {
  compilation: {
    input: { index: "./src/index.tsx" },
  },
  plugins: [domCompiler.farm()],
};

Order: enforce: 'pre'.


Options

Pass to domCompiler.vite({ ... }) (same for other adapters):

| Option | Default | Description | |--------|---------|-------------| | markDomDirtyImport | @mainframework/signals/dom/internal | See @mainframework/signals README | | effectImportSources | ["@mainframework/signals"] | | | bindings | [] | | | include | /\.[mc]?[jt]sx?$/ | Module ids to transform | | exclude | /node_modules/ | Skipped ids |

TSX without matching compile patterns: no-op; downstream TS/JSX still runs once.


Troubleshooting

| Symptom | Cause | Fix | |---------|-------|-----| | No rewrite in output | Wrong pipeline order | Use pre or webpack loader-last; compile must see raw TSX | | Rewrite twice / broken AST | Double registration | One of: unplugin, webpack-loader, or Babel plugin — not several | | No rewrite | effect not from effectImportSources | Add module or rename import | | No rewrite | File under node_modules | Adjust exclude / include | | No source map | Missing id | Plugin passes id as filename automatically |

See @mainframework/signals README.