Skip to content

[docs-infra] Add More Highlighting Extensions#1373

Merged
dav-is merged 24 commits into
masterfrom
docs-infra/further-extend-syntax
Jun 3, 2026
Merged

[docs-infra] Add More Highlighting Extensions#1373
dav-is merged 24 commits into
masterfrom
docs-infra/further-extend-syntax

Conversation

@dav-is
Copy link
Copy Markdown
Member

@dav-is dav-is commented May 4, 2026

Add support for --color-docs-infra-syntax-punctuation, --color-docs-infra-syntax-jsx-variable, and --color-docs-infra-syntax-property-string, --color-docs-infra-syntax-object-property, --color-docs-infra-syntax-template-expression, --color-docs-infra-syntax-template-delimiter

Preview Deploy

…nfra-syntax-jsx-variable, and --color-docs-infra-syntax-property-string

Co-authored-by: Copilot <copilot@github.com>
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 4, 2026

Deploy preview

Bundle size

Total Size Change: 🔺+3.53KB(+0.14%) - Total Gzip Change: 🔺+1.05KB(+0.15%)
Files: 63 total (0 added, 0 removed, 2 changed)

Show details for 63 more bundles

@mui/internal-docs-infra/CodeProviderparsed: 🔺+3.53KB(+2.35%) gzip: 🔺+1.04KB(+2.34%)
@mui/internal-docs-infra/abstractCreateDemoparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/abstractCreateDemoClientparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/abstractCreateStreamparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/abstractCreateTypesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/ChunkProviderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/cliparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CodeControllerContextparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CodeExternalsContextparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CodeHighlighterparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CodeHighlighter/errorsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CodeHighlighter/typesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CoordinatedLazyparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/CoordinatedLazy/typesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/createDemoDataparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/createDemoData/typesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/createSitemapparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/createSitemap/typesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useCodeparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useCodeWindowparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useCoordinatedparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useCopierparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useDemoparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useErrorsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useLocalStorageStateparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/usePreferenceparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useScrollAnchorparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useSearchparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useSearch/typesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useStreamparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useStream/typesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useTypeparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useTypesparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/useUrlHashStateparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/internal-docs-infra/withDocsInfraparsed: 0B(0.00%) gzip: 0B(0.00%)
addLineGuttersparsed: 0B(0.00%) gzip: 0B(0.00%)
CodeHighlighterChunkparsed: 0B(0.00%) gzip: 0B(0.00%)
CodeHighlighterClientparsed: 0B(0.00%) gzip: 0B(0.00%)
CodeInitialSourceLoaderparsed: 0B(0.00%) gzip: 0B(0.00%)
CodeSourceLoaderparsed: 0B(0.00%) gzip: 0B(0.00%)
createFrameparsed: 0B(0.00%) gzip: 0B(0.00%)
createParseSourceWorkerClientparsed: 0B(0.00%) gzip: 🔺+7B(+0.91%)
EditingEngineparsed: 0B(0.00%) gzip: 0B(0.00%)
embedTransformsparsed: 0B(0.00%) gzip: 0B(0.00%)
enhanceCodeEmphasisparsed: 0B(0.00%) gzip: 0B(0.00%)
findExpandingRangesparsed: 0B(0.00%) gzip: 0B(0.00%)
getHastTextContentparsed: 0B(0.00%) gzip: 0B(0.00%)
grammarLoadersparsed: 0B(0.00%) gzip: 0B(0.00%)
grammarMapsparsed: 0B(0.00%) gzip: 0B(0.00%)
grammarsparsed: 0B(0.00%) gzip: 0B(0.00%)
loadIsomorphicCodeVariantparsed: 0B(0.00%) gzip: 0B(0.00%)
parseSourceparsed: 0B(0.00%) gzip: 0B(0.00%)
source.cssparsed: 0B(0.00%) gzip: 0B(0.00%)
source.jsparsed: 0B(0.00%) gzip: 0B(0.00%)
source.jsonparsed: 0B(0.00%) gzip: 0B(0.00%)
source.mdxparsed: 0B(0.00%) gzip: 0B(0.00%)
source.shellparsed: 0B(0.00%) gzip: 0B(0.00%)
source.tsparsed: 0B(0.00%) gzip: 0B(0.00%)
source.tsxparsed: 0B(0.00%) gzip: 0B(0.00%)
source.yamlparsed: 0B(0.00%) gzip: 0B(0.00%)
text.html.basicparsed: 0B(0.00%) gzip: 0B(0.00%)
text.mdparsed: 0B(0.00%) gzip: 0B(0.00%)
TransformEngineparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Performance

Total duration: 19.71 ms -0.40 ms(-2.0%) | Renders: 4 (+0) | Paint: 81.27 ms -1.03 ms(-1.2%)

No significant changes — details


Check out the code infra dashboard for more information about this PR.

@dav-is dav-is added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels May 4, 2026
@dav-is dav-is changed the title [docs-infra] Add more highlighting extensions [docs-infra] Add More Highlighting Extensions May 4, 2026
@dav-is dav-is self-assigned this May 6, 2026
@dav-is dav-is added this to the docs-infra v0.11 milestone May 7, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label May 8, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label May 8, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label May 13, 2026
@oliviertassinari oliviertassinari temporarily deployed to docs-infra/further-extend-syntax - mui-tools-public PR #1373 May 13, 2026 19:53 — with Render Destroyed
@oliviertassinari oliviertassinari temporarily deployed to docs-infra/further-extend-syntax - code-infra-dashboard PR #1373 May 13, 2026 19:53 — with Render Destroyed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional docs-infra syntax token classes to improve fine-grained theming of highlighted code, particularly for punctuation/operators, JSX expression variables, object-literal keys, and template-literal interpolations (including inline code snippets).

Changes:

  • Extend extendSyntaxTokens with new additive classes (di-pu, di-jv, di-op, di-ps, di-te, di-td) and supporting parsing/state tracking.
  • Improve inline highlighting for “bare object literal” snippets by temporarily wrapping in parentheses and stripping the wrapper post-highlight.
  • Update docs, demos, snapshots, and tests to reflect the new token classes and styling variables.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/docs-infra/src/pipeline/transformHtmlCodeInline/user.spec.ts Adds coverage for inline TSX bare-object-literal highlighting behavior.
packages/docs-infra/src/pipeline/transformHtmlCodeInline/transformHtmlCodeInline.ts Wraps bare object-literal inline snippets for correct expression tokenization; strips wrapper after highlighting.
packages/docs-infra/src/pipeline/transformHtmlCodeInline/removeSuffixFromHighlightedNodes.ts Adds suffix-stripping helper for post-highlight wrapper removal.
packages/docs-infra/src/pipeline/parseSource/parseSource.test.ts Updates expectations to assert new di-op extraction behavior for object keys.
packages/docs-infra/src/pipeline/parseSource/extendSyntaxTokens.ts Implements new token extensions (punctuation, JSX vars, object keys, template interpolation regions/delimiters) and improves JSX-vs-generics handling.
packages/docs-infra/src/pipeline/parseSource/extendSyntaxTokens.test.ts Adds/adjusts tests for new token classes and JSX generic edge cases.
packages/docs-infra/src/pipeline/loadServerTypes/snapshots/highlightTypes.test.ts.snap Updates snapshot output to include new additive classes (notably di-pu / di-jv).
packages/docs-infra/src/pipeline/enhanceCodeEmphasis/enhanceCodeEmphasis.test.ts Updates snapshots to reflect new additive classes in rendered emphasized output.
docs/app/docs-infra/pipeline/parse-source/page.mdx Documents the new di-* token classes and their intended semantics/scope.
docs/app/docs-infra/hooks/use-code-window/demos/CollapsibleDemoContent.tsx Switches demo styling import to the local syntax stylesheet.
docs/app/docs-infra/components/code-highlighter/demos/syntax.css Adds CSS variables + rules for the new di-* classes (and centralizes starry-night style import).

@dav-is dav-is marked this pull request as ready for review June 3, 2026 01:03
@dav-is dav-is merged commit 4c7e314 into master Jun 3, 2026
15 checks passed
@dav-is dav-is deleted the docs-infra/further-extend-syntax branch June 3, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants