Skip to content

fix(core): export SVG and MathML tag-name predicates - #130

Merged
leonidaz merged 1 commit into
mainfrom
fix/export-svg-mathml-tag-predicates
Sep 17, 2026
Merged

leonidaz merged 1 commit into
mainfrom
fix/export-svg-mathml-tag-predicates

Conversation

@leonidaz

@leonidaz leonidaz commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Target compilers currently have to copy the core SVG and MathML tag-name lists to make safe lowering decisions when an element's namespace is unknown. Export isSvgTagName and isMathmlTagName from @tsrx/core, backed by the existing private sets.

The predicates check case-sensitive membership, including SVG names shared with HTML (a, title, script, and style). Existing HTML-first ref-type inference is preserved. Includes API documentation, regression coverage through the package entry, and a patch changeset.

Validation:

  • pnpm test --project tsrx-utils — 663 tests passed
  • pnpm exec tsgo --noEmit -p packages/tsrx/tsconfig.json
  • Prettier check on all changed source, test, and documentation files
  • pnpm changeset:check
  • git diff --cached --check

Closes #127.


Note

Low Risk
Additive export and documentation only; ref-type inference and internal tag sets are unchanged aside from the new public predicates.

Overview
Public API: @tsrx/core now exports isSvgTagName and isMathmlTagName, thin wrappers over the same case-sensitive tag sets already used for element ref typing. Target compilers can reuse those sets for lowering when namespace context is unknown, instead of duplicating the lists locally.

The checks are namespace-independent: isSvgTagName returns true for SVG-only tags and for names shared with HTML (a, title, script, style). createElementRefTargetTypeForName behavior is unchanged—HTML-first inference without an explicit SVG namespace is still the default.

Docs add a Tag-name helpers section in the package README; packages/tsrx/tests/utils/tag-names.test.js covers the package entry, shared names, casing, and ref-type regression. Patch changeset for @tsrx/core.

Reviewed by Cursor Bugbot for commit 852314e. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tsrx-website Ready Ready Preview Sep 17, 2026 5:48pm UTC
tsrx-website-mcp Ready Ready Preview Sep 17, 2026 5:48pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – tsrx-website — 852314ea Deployed Sep 17, 2026 by vercel[bot]
Preview – tsrx-website-mcp — 852314ea Deployed Sep 17, 2026 by vercel[bot]
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.

Export the SVG and MathML tag-name sets from @tsrx/core

1 participant