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

solid-tag-1

v0.0.1

Published

Independent JSX/TSX to Solid 1.x solid-js/html tagged-template transformer

Readme

solid-tag-1

Transform Solid 1.x JSX and TSX into JavaScript using the official solid-js/html tagged-template runtime. No JSX build step is required after transformation.

solid-tag-1 is an independent transformer for Solid 1.x. It does not depend on the Solid 2 solid-tag package or on Browser Module Runtime.

Install

npm install solid-tag-1 solid-js@^1

The transformer is a Node.js ESM package (Node.js 20+) and uses the TypeScript compiler API to parse JSX/TSX. Install solid-js 1.x in the application that runs the generated code. The library does not bundle the Solid runtime.

For Bun:

bun add solid-tag-1 solid-js@^1

Programmatic API

import { transform } from 'solid-tag-1';

const source = `
  import { createSignal } from 'solid-js';

  export default function Counter() {
    const [count, setCount] = createSignal(0);
    return (
      <button onClick={() => setCount(n => n + 1)}>
        Clicks: {count()}
      </button>
    );
  }
`;

const { code, transformed, filename } = transform(source, {
  filename: 'Counter.jsx'
});

console.log(code);

The generated JavaScript imports html from solid-js/html automatically and preserves reactive expressions as lazy template interpolations. It still needs a module host/bundler/browser environment able to resolve solid-js imports. Transformation itself does not mount the component.

transform(source, options?) returns { code, transformed, filename }. For a string-only result, use transformJSX(source, options?):

import { transformJSX } from 'solid-tag-1';

const js = transformJSX('const view = <span>{name()}</span>;');

Both transform and transformJSX are named exports. transform is also the default export.

Options

| Option | Default | Description | | --- | --- | --- | | filename | input.jsx | Source filename; .tsx enables TypeScript stripping by default. | | autoImport | true | Insert an import of the solid-js/html tag when JSX is found. | | tagIdentifier | __solidTag1Html | Preferred generated tag binding; when auto-importing, name collisions are avoided. | | transpileTS | true for .tsx, otherwise false | Strip TypeScript syntax after JSX conversion. | | compilerOptions | ES2022 / ESNext defaults | Additional TypeScript transpilation options. |

To use a host-provided tag instead of an automatic import:

const { code } = transform('const view = <p>Hello</p>;', {
  filename: 'view.jsx',
  autoImport: false,
  tagIdentifier: 'html'
});
// The host must provide a binding named `html`.

For malformed JSX or unsupported constructs, the transformer throws a SyntaxError or TransformError with a source location where available.

Command-line interface

npx solid-tag-1 src/Counter.jsx -o dist/Counter.js
npx solid-tag-1 src/Counter.tsx -o dist/Counter.js
npx solid-tag-1 src/Counter.jsx --no-import --tag html -o dist/Counter.js

Omit -o to write transformed JavaScript to stdout. Use --help to display CLI usage.

JSX/TSX coverage

The transformer supports native elements, component tags (including member expressions such as <UI.Button />), fragments, nested JSX, JSX in callbacks and conditionals, dynamic children and attributes, spreads, event callbacks, basic refs and use: directives, and common Solid control-flow component syntax such as For and Show.

It also supports TSX input with basic TypeScript syntax stripping. The implementation has browser-tested differential fixtures comparing observable behavior with the official Solid 1 JSX compiler; this does not guarantee equivalence for every JSX construct.

Limitations: The package targets client-side rendering; it does not implement SSR, hydration, or library source maps. Some ref, directive, component-prop, and event semantics can differ from the official JSX compiler in untested cases. The upstream Solid 1 HTML runtime can use dynamic function generation, so strict Content Security Policies may require additional configuration. Only compile trusted source.

Using it through solid-tag

When using a version of solid-tag that exports the optional ./solid1 entry point, install both packages:

npm install solid-tag solid-tag-1
import { transform } from 'solid-tag/solid1';

This entry point re-exports solid-tag-1; it does not merge Solid 1 and Solid 2 compiler implementations. You can always import from solid-tag-1 directly.

License

MIT.