Releases: lxsmnsyc/solid-marked
Release list
0.8.0
Highlights
This release rebuilds how solid-marked is packaged, adds the missing HTML builtin, and fixes two bugs that made the published packages hard to consume.
Important
solid-marked, unplugin-solid-marked and vite-plugin-solid-marked are now ESM-only, and require Node ^20.19.0 || >=22.12.0. See Breaking changes below.
Breaking changes
ESM-only
The CommonJS builds never worked. require('solid-marked/compiler') threw github_slugger.default is not a constructor, and require('unplugin-solid-marked').default was undefined. The whole dependency graph — github-slugger, mdast-util-*, micromark-* — is ESM-only, and the CommonJS bundle wrapped those ESM namespaces a second time when interoperating with them.
Rather than keep an entry point that crashes on import, the require conditions and *.cjs files are gone. Every supported bundler already resolves the import condition, and Node 20.19+/22.12+ can require() these packages through require(esm).
engines.node is now ^20.19.0 || >=22.12.0
It previously claimed >=10, which predated the ESM-only dependency graph by years. It now states the range the toolchain actually needs, and the one where require(esm) is available.
Export conditions
The development and production export conditions have been dropped — no code branched on them. The build now emits dist/<entry>.js plus its declaration file.
New
The HTML builtin
MDXBuiltinComponents declares an HTML component, and the runtime <Markdown> component renders html nodes through it instead of throwing invalid node. The compiler handles html nodes at the document root too.
Raw HTML is handed to your component as a string — it is never injected into the page, so escaping or rendering it stays your decision.
<Markdown
builtins={{
HTML: props => <div innerHTML={props.children ?? ''} />,
}}
>
{source}
</Markdown>Prop types re-exported from the package root
MDXBuiltinComponents, MDXProps and the per-node prop types no longer have to be imported from solid-marked/compiler:
import type { HeadingProps, MDXBuiltinComponents } from 'solid-marked';solid-marked/env export
"types": ["solid-marked/env"] now resolves through the exports map.
Fixes
Markdown imports type-check again
src/global-types.d.ts had a top-level import, which made TypeScript treat its declare module '*.md' blocks as module augmentations rather than ambient wildcard modules. Importing a markdown file in a consumer project failed with Cannot find module './Doc.md'. The declarations no longer import anything at the top level.
noDynamicComponents accepts 'only-mdx' in the plugins
SolidMarkedPluginOptions.noDynamicComponents was typed boolean, even though the value is passed straight to a compiler that also accepts 'only-mdx'. It is now typed boolean | 'only-mdx'.
Tooling
- Builds moved from
pridepackto tsdown, with publint running on every build. - Linting and formatting moved from Biome to oxlint (type-aware, via
@lxsmnsyc/oxlint-config) and oxfmt. unplugin-solid-markedmoves tounpluginv3 — the deprecatedloadIncludehooks are replaced by theload.filterAPI, andhandleHotUpdatebyhotUpdate. Vite 8 is now supported alongside Vite 7.- Tests grew from 81 to 124, adding runtime-renderer coverage, compiler options, frontmatter, source maps, and real
vite.buildintegration tests for the plugin. - Dependencies updated:
solid-js1.9.15,vitest4.1,source-map0.8,toml5,yaml2.9,seroval1.6.
Docs
The README has been restructured around a working quick start, a compile API reference with an options table, and a table of all 24 builtins with their mdast node and props. Every exported symbol now carries JSDoc, and both demos in examples/ were modernised.
Install
npm i solid-js solid-marked
npm i -D vite-plugin-solid-marked vite-plugin-solidFull changelog: https://github.com/lxsmnsyc/solid-marked/compare/solid-marked@0.7.0...solid-marked@0.8.0
v0.6.0
This release adds solid-marked/component, which exports a Markdown component you can use to render Markdown during runtime.
import Markdown from 'solid-marked/component';
const content = (
<Markdown
builtins={{
Root(props) {
return (
<div>
{props.children}
</div>
);
},
Blockquote(props) {
return (
<blockquote>
{props.children}
</blockquote>
);
},
}}
>
{'> This is a blockquote.'}
</Markdown>
);Other changes:
- Drop support for
Footnotecomponent, in compliance withmdast.
v0.5.0
- Add
unplugin - Move
solid-markedtosolid-marked/compiler - Add
MDXProvideranduseMDXinsolid-marked - Make
useMDXimport source optional - Set
solid-markedas default import source - Add support for
yaml - Add support for
toml - Add support for
frontmatter - Add support for Table Of Contents generation
- Add slugged ids for
<Heading> - Add
isHeadproperty to<TableRow> - Fix source maps
- Fix JS expression compilation