Repository navigation
perf(bundle): isolate MDX parser from the default Markdown entry - #149
Merged
Merged
Conversation
Move synchronous MDX parsing to the mdx subpath. Build separate runtime and type bundles for both entries. Measure bundle size, cold load, heap use, and MDX load cost. Keep this change experimental because MDX imports must change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experiment
Move synchronous MDX parsing to
@lint-md/parser/mdx.Keep Markdown parsing in the default entry.
Build separate CommonJS, ESM, and type bundles.
Measurements
The baseline is commit
22b995f.Node 24.15.0 ran nine fresh processes per case with about 16 KiB of input.
Values are medians.
The four split bundles total 1,356,173 B.
The two baseline bundles total 967,924 B.
The split adds 388,249 B of uncompressed JavaScript files.
The benchmark commands and full results are in
docs/mdx-entry-experiment.md.Tradeoffs
Default imports load less code and use less heap.
MDX imports gain no clear cold load improvement.
Existing MDX imports need a new path.
Both entries contain separate error class instances.
This change needs a major release or a migration plan before adoption.
Verification
pnpm run buildpnpm run lintpnpm run test(2024 tests pass)No sensitive data was changed or shared.