Skip to content

Conversation

@taras
Copy link
Member

@taras taras commented Jan 21, 2026

Summary

Extracts MDX/Markdown processing utilities from effection/www into a reusable @effectionx/mdx package.

Features

  • useMDX(markdown, options) - Low-level MDX evaluation with Effection

    • User provides JSX runtime (jsx, jsxs, Fragment)
    • Supports remark/rehype plugins
  • useMarkdown(markdown, options) - Convenience wrapper with common plugins

    • GFM (GitHub Flavored Markdown)
    • Prism syntax highlighting
    • Slug generation
    • Autolink headings
  • replaceAll(input, regex, replacer) - Async regex replacement helper

  • createJsDocSanitizer(resolver) - Convert JSDoc {@link X} syntax to markdown links

Design Decisions

  • No default JSX runtime - User must provide their own runtime, making the package framework-agnostic
  • Common plugins included in useMarkdown but no site-specific CSS classes
  • Effection Operations - uses operations instead of async/await.

Tests

30 tests covering:

  • Effection integration (yield, spawn)
  • JSX runtime usage verification
  • Error handling (invalid MDX, runtime errors)
  • Plugin support (remark and rehype)
  • JSDoc sanitizer patterns
  • Async replacement

Extract MDX/Markdown processing utilities with Effection structured
concurrency support:

- useMDX: Low-level MDX evaluation (user provides JSX runtime)
- useMarkdown: Convenience wrapper with common plugins (GFM, Prism,
  slug, autolink headings)
- replaceAll: Async regex replacement helper
- createJsDocSanitizer: Convert JSDoc @link syntax to markdown links

Includes 30 tests covering all functionality.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/mdx@132

commit: ba4d9c7

@cowboyd
Copy link
Member

cowboyd commented Jan 22, 2026

All async functions return Effection Operations for structured concurrency

What does that mean?

@taras
Copy link
Member Author

taras commented Jan 22, 2026

It just means it uses operations everywhere instead of async/await. it's a bit of friendly AI slop. It generated this PR description from commit.

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.

3 participants