Skip to content

feat: add a markdown-exit/parser entry without the renderer and presets - #46

Closed
onmax wants to merge 1 commit into
serkodev:mainfrom
onmax:feat/parser-entry
Closed

onmax wants to merge 1 commit into
serkodev:mainfrom
onmax:feat/parser-entry

Conversation

@onmax

@onmax onmax commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

resolves #42

import { Parser } from 'markdown-exit/core' also bundles the renderer and presets, because core builds as one chunk. apps that only call parse(), like Comark, ship code they never run.

this adds markdown-exit/parser, which exports Parser, Token and what ./parser already exports (Ruler, the state classes, defaultOptions). it leaves out linkify-it like markdown-exit/core, and markdown-exit and markdown-exit/core don't change. a test checks that the entry bundles neither the renderer nor the presets and that Parser gives the same tokens as MarkdownExit. the quick start has a short section on it.

KiB, minified / gzip 2.1.3 this PR
markdown-exit/core 98.34 / 33.96 98.35 / 33.95
markdown-exit/parser 89.99 / 31.27

esbuild 0.28, minified ESM, gzip -9.

Parser has no use(), set() or utils, so markdown-it plugins can't be passed to it as they are. Comark would need a small adapter for its users' plugins, which I'd do on the Comark side.

@codspeed

codspeed Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 6 untouched benchmarks


Comparing onmax:feat/parser-entry (af8bc90) with main (ac3d1ed)

Open in CodSpeed

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.

Parser from markdown-exit/core still bundles the renderer and presets

1 participant