Skip to content

feat!: adopt react-markdown-10 API on Solid 2, tested and built under bun - #1

Merged
mattwilkinsonn merged 1 commit into
mainfrom
compass-ui/rig-2187-markdown-react10-fork
Aug 22, 2026
Merged

feat!: adopt react-markdown-10 API on Solid 2, tested and built under bun#1
mattwilkinsonn merged 1 commit into
mainfrom
compass-ui/rig-2187-markdown-react10-fork

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Replaces the Solid-1 upstream renderer with the react-markdown-10 API
(upstream PR andi23rosca#44 + andi23rosca#45), re-ported to Solid 2, and ships the bun test
harness that runs the component suite. Supersedes the earlier draft of
this PR, which was based on the pnpm+vitest toolchain that main retired
when it converted to bun + biome.

Source

  • src/index.tsx — the react-markdown-10 renderer (Markdown,
    MarkdownAsync, MarkdownResource, defaultUrlTransform) built on
    hast-util-to-jsx-runtime, re-ported to Solid 2 (@solidjs/web,
    createStore/reconcile, owned-write signals).
  • src/jsx-runtime.ts — fork-local JSX runtime for
    hast-util-to-jsx-runtime over Solid-2 primitives, replacing the
    Solid-1-bound solid-jsx dependency.
  • src/types.ts — public option/component types over @solidjs/web JSX.
  • Retires the Solid-1 renderer: renderer.tsx, rehype-filter.ts,
    utils.ts, utils.test.ts.

Test harness (bun)

main runs bun test, which has no Vite pipeline and no Solid JSX
transform, so the Solid-2 component suite needs a harness:

  • test/setup.ts — a Bun.plugin preload that runs babel-preset-solid
    over .tsx sources (SOLID_GENERATE picks dom vs ssr output) and
    registers happy-dom globals for the client leg only.
  • bunfig.toml — wires the preload into bun test.
  • Two legs mirror the retired vitest --mode ssr split:
    test:client (happy-dom, --conditions=browser --conditions=development)
    and test:ssr (node env, --conditions=development for devlop
    assertion messages). bun run test runs both.
  • test/client.test.tsx (11) + test/server.test.tsx (20) converted from
    vitest to bun:test; @solidjs/testing-library bumped to 1.0.0-beta.2
    (the Solid-2 line — imports from @solidjs/web, drops the removed
    onError, which bun's strict ESM rejects where vitest silently tolerated).

Packaging

  • package.json — Solid-2 peers (solid-js, @solidjs/web ^2.0.0-rc.0),
    3.0.0-rc.0, bun harness devDeps, two-leg test scripts.
  • biome.json — disables the React-specific noChildrenProp rule
    (children as a prop is this package's public API).
  • .github/workflows/ci.yml + publish.yml — run bun run test (both
    legs); publish.yml converted pnpm -> bun, tag-driven, dist-tag aware
    (next for prereleases, latest otherwise).

Spec-impact: none. Refs RIG-2187, RIG-2358.

@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

RIG-2187

RIG-2358

@rigel-mintaka
rigel-mintaka force-pushed the compass-ui/rig-2187-markdown-react10-fork branch from eb07a2b to 881a5aa Compare August 21, 2026 06:10
@rigel-mintaka
rigel-mintaka marked this pull request as draft August 21, 2026 22:15
@rigel-mintaka rigel-mintaka changed the title feat!: adopt react-markdown-10 API (PR #44 + #45), re-ported to Solid 2 feat!: adopt react-markdown-10 API on Solid 2, tested under bun Aug 22, 2026
@rigel-mintaka
rigel-mintaka force-pushed the compass-ui/rig-2187-markdown-react10-fork branch from 6b4e386 to 96ba01f Compare August 22, 2026 04:48
@rigel-mintaka rigel-mintaka changed the title feat!: adopt react-markdown-10 API on Solid 2, tested under bun feat!: adopt react-markdown-10 API on Solid 2, tested and built under bun Aug 22, 2026
@rigel-mintaka
rigel-mintaka force-pushed the compass-ui/rig-2187-markdown-react10-fork branch from 96ba01f to 0af8d05 Compare August 22, 2026 12:33
… bun

Replaces the Solid-1 upstream renderer with the react-markdown-10 API
(upstream PR andi23rosca#44 + andi23rosca#45), re-ported to Solid 2, and ships the bun test
harness + bun build that the fork's bun + biome toolchain needs.

## Source

- `src/index.tsx` — the react-markdown-10 renderer (`Markdown`,
  `MarkdownAsync`, `MarkdownResource`, `defaultUrlTransform`) built on
  `hast-util-to-jsx-runtime`, re-ported to Solid 2 (`@solidjs/web`,
  `createStore`/`reconcile`, owned-write signals).
- `src/jsx-runtime.ts` — fork-local JSX runtime for
  `hast-util-to-jsx-runtime` over Solid-2 primitives, replacing the
  Solid-1-bound `solid-jsx` dependency.
- `src/types.ts` — public option/component types over `@solidjs/web` `JSX`.
- Retires the Solid-1 renderer: `renderer.tsx`, `rehype-filter.ts`,
  `utils.ts`, `utils.test.ts`.

## Build (bun)

`build.ts` builds `dist/` with `babel-preset-solid@2` (the Solid compiler)
as the one transform, in two output modes:

- Compiled (`index.js` dom/prod, `dev.js` dom/dev, `server.js` ssr) — Solid
  compiles the JSX to `@solidjs/web` runtime calls, then `bun build` bundles
  the now JSX-free modules. `bun build` never sees JSX.
- Source (`index.jsx` + a sibling `jsx-runtime.js`) — babel strips types but
  leaves the JSX untransformed, written directly, so the `solid` export
  condition ships raw JSX for a consuming app's own Solid compiler (matching
  its exact `solid-js` version and generate settings). This variant is not
  routed through `bun build`, whose own automatic JSX-runtime transform would
  emit a `@solidjs/web/jsx-dev-runtime` import that subpath does not provide.
- `index.d.ts` via `tsc --project tsconfig.build.json`.
- `scripts/smoke-dist.ts` guards the published artifact: imports each compiled
  entry and asserts the public API resolves, and compiles the `.jsx` source
  entry the way a consumer would, asserting it targets `@solidjs/web` and never
  a removed subpath. Chained into `build` and run in CI + before publish, so a
  dead-on-arrival bundle fails the gate (nothing else imports `dist`).
- Runtime deps are declared under `dependencies` (externalized in dist);
  peer deps under `peerDependencies`; build/harness tooling under
  `devDependencies`.

## Test harness (bun)

`bun test` has no Vite pipeline and no Solid JSX transform, so the Solid-2
suite needs a harness:

- `test/setup.ts` — a `Bun.plugin` preload that runs `babel-preset-solid`
  over `.tsx` sources (`SOLID_GENERATE` picks `dom` vs `ssr`) and registers
  happy-dom globals for the client leg only.
- `bunfig.toml` — wires the preload into `bun test`.
- Two legs mirror the retired vitest `--mode ssr` split:
  `test:client` (happy-dom, `--conditions=browser --conditions=development`)
  and `test:ssr` (node env, `--conditions=development` for `devlop`
  assertion messages). `bun run test` runs both.
- `test/client.test.tsx` (11) + `test/server.test.tsx` (20) converted from
  vitest to `bun:test`; `@solidjs/testing-library` bumped to `1.0.0-beta.2`
  (the Solid-2 line — imports from `@solidjs/web`, drops the removed
  `onError`, which bun's strict ESM rejects where vitest silently tolerated).

## Packaging

- `package.json` — Solid-2 peers (`solid-js`, `@solidjs/web` `^2.0.0-rc.0`),
  `3.0.0-rc.0`, runtime `dependencies` + bun harness/build devDeps, two-leg
  test scripts, `bun run build.ts` build.
- `biome.json` — disables the React-specific `noChildrenProp` rule
  (`children` as a prop is this package's public API).
- `.github/workflows/ci.yml` + `publish.yml` — run `bun run test` (both
  legs) + `bun run build` (which self-verifies via the dist smoke check);
  `publish.yml` converted pnpm -> bun, tag-driven, dist-tag aware.

Spec-impact: none. Refs RIG-2187, RIG-2358.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-ui/rig-2187-markdown-react10-fork branch from 0af8d05 to 2334f3a Compare August 22, 2026 13:13
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review August 22, 2026 13:24
@mattwilkinsonn
mattwilkinsonn merged commit 1b83189 into main Aug 22, 2026
1 check passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-ui/rig-2187-markdown-react10-fork branch August 22, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants