Skip to content

ref(scraps): Isolate CodeBlock and Prism in their own entry point - #129522

Merged
natemoo-re merged 4 commits into
masterfrom
ref/de-1740-code-block
Nov 3, 2026
Merged

natemoo-re merged 4 commits into
masterfrom
ref/de-1740-code-block

Conversation

@natemoo-re

@natemoo-re natemoo-re commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

CodeBlock and its Prism loader now ship from @sentry/scraps/codeBlock, with scoped syntax styles for installed consumers. @sentry/scraps/code exports only InlineCode and its styles, so inline rendering does not load Prism. App callers, Markdown highlighting, and stories use the appropriate public entry point.

The dynamic grammar loader resolves from the published package and loads dependencies before the dependent grammar. Local packed-consumer checks verify TSX with JSX and TypeScript dependencies, unsupported-language handling, SSR, public declarations, and importing InlineCode without loading Prism. Focused package tests (8), affected app tests (49), type checking, lint, full knip, and packing pass. Packed-consumer scripts are local verification only.

Review focus: verify the separate entry graphs keep Prism out of InlineCode imports, syntax styles stay scoped, and dependent grammars load in order. This unlocks Markdown (DE-1741), then Chat (DE-1744).

closes DE-1740

Unchanged

Location Before & After
Settings › Projects › Source Maps, React Native Settings › Projects › Source Maps, React Native before and after

Keep syntax styles with the component and load grammar dependencies in order from the installed package. Expose rendering and language helpers without app aliases.

Refs DE-1740
@linear-code

linear-code Bot commented Nov 2, 2026

Copy link
Copy Markdown

DE-1740

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 2, 2026
Publish CodeBlock at its own codeBlock entry point while keeping the code barrel limited to InlineCode. Keep packed-consumer checks local.
@natemoo-re natemoo-re changed the title ref(scraps): Extract CodeBlock and packaged Prism loading ref(scraps): Isolate CodeBlock and Prism in their own entry point Nov 2, 2026
# Conflicts:
#	static/packages/scraps/package.json
@natemoo-re
natemoo-re marked this pull request as ready for review November 3, 2026 16:13
@natemoo-re
natemoo-re requested review from a team as code owners November 3, 2026 16:13
@natemoo-re
natemoo-re enabled auto-merge (squash) November 3, 2026 16:31
@natemoo-re
natemoo-re merged commit 05cbd9c into master Nov 3, 2026
81 checks passed
@natemoo-re
natemoo-re deleted the ref/de-1740-code-block branch November 3, 2026 16:37

This branch was successfully deployed

1 active deployment
Preview — 5ce55032 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants