Repository navigation
feat(react): feed the MarkdownContext renderer to web_core's basic catalog - #2910
Merged
Merged
Conversation
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
September 30, 2026 19:47
c8fde76 to
0997cb7
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates A2uiSurface to register the markdown renderer from MarkdownContext with web_core's basic catalog, ensuring consistent markdown rendering across universal Web Components. It also moves MarkdownContext to a shared location and adds a test suite for the markdown bridge. The review feedback suggests replacing useLayoutEffect with an isomorphic layout effect (useIsomorphicLayoutEffect) to prevent potential React SSR warnings in server-side rendering environments.
josemontespg
commented
Sep 30, 2026
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
September 30, 2026 20:43
0997cb7 to
549a734
Compare
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
September 30, 2026 20:52
549a734 to
b558597
Compare
josemontespg
changed the base branch from
react-portal-hosts-node
to
react-implementation-types
September 30, 2026 20:52
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
October 1, 2026 17:25
b558597 to
bd85ea4
Compare
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
October 1, 2026 18:25
bd85ea4 to
42fa87d
Compare
josemontespg
marked this pull request as ready for review
October 1, 2026 18:27
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
October 1, 2026 20:07
42fa87d to
68e2552
Compare
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
2 times, most recently
from
October 1, 2026 20:29
c4aaf4c to
0ad9a89
Compare
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
October 1, 2026 20:43
0ad9a89 to
b8d3b32
Compare
…talog `A2uiSurface` hands the renderer from `MarkdownContext` to web_core's `setMarkdownRenderer`, the same way the Angular renderer does, so universal Web Components in a surface render markdown with the renderer the application already provides to React components. The slot is set in a layout effect, during commit. `MarkdownContext` moves out of the basic catalog folder to `src/v0_9/markdown-context.tsx`; its export from `@a2ui/react/v0_9` does not change.
josemontespg
force-pushed
the
react-markdown-renderer-bridge
branch
from
October 1, 2026 21:28
b8d3b32 to
d6ae4d8
Compare
josemontespg
added a commit
that referenced
this pull request
Oct 5, 2026
The v0_9 React renderer renders the basic catalog through the Web Components in `@a2ui/web_core/v0_9/basic_catalog`, so the 23 duplicated React implementations are removed along with their unit tests.
## What changes for consumers
Import the catalog and the individual components from web_core:
```diff
-import {A2uiSurface, basicCatalog} from '@a2ui/react/v0_9';
+import {A2uiSurface} from '@a2ui/react/v0_9';
+import {basicCatalog} from '@a2ui/web_core/v0_9/basic_catalog';
```
`MarkdownContext` and `useMarkdownRenderer` keep their names, their behaviour, and their import path. `A2uiSurface` already feeds the context value to web_core's basic catalog (#2910), so markdown wiring in consumer code does not change.
Custom React components are unaffected: `createComponentImplementation` still returns a React implementation, and the renderer still renders it through React.
## Breaking
- `@a2ui/react/v0_9` no longer exports `basicCatalog`, `Text`, `Button`, `Card`, or the other basic components.
- The basic catalog no longer server-renders, since custom elements produce no markup outside a browser. An application that needs SSR for these components needs a React-SSR renderer.
## Testing
- `renderers/react` unit tests pass; `integration-scenarios.test.tsx` now drives the web_core catalog end to end and waits for Lit's update cycle.
- The explorer's Karma suite passes against the web component catalog.
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.
Summary
A2uiSurfacehands the renderer fromMarkdownContextto web_core'ssetMarkdownRenderer, the same way the Angular renderer does. Once the renderer hosts universal Web Components (#2849), web_core'sTextrenders markdown with the renderer the application already provides to React components; nothing in the React tree changes today.MarkdownContextmoves out of the basic catalog folder tosrc/v0_9/markdown-context.tsx; its export from@a2ui/react/v0_9does not change.The slot is set in a layout effect, during commit, so it is in place before any Lit element in the surface updates. A surface without a
MarkdownContextrenderer leaves the slot untouched, so a renderer the host registered directly keeps working. Nothing here parses markdown: web_core has no markdown dependency and@a2ui/markdown-itstays opt-in.Changes
A2uiSurface.tsx:useMarkdownRenderer()+useLayoutEffectcallingsetMarkdownRenderer(renderer)when the context provides one.markdown-context.tsx: moved fromcatalog/basic/context/MarkdownContext.tsx; the basic catalog's two imports updated.tests/v0_9/markdown-bridge.test.tsx: the context renderer reachesgetMarkdownRenderer(); no renderer anywhere registers nothing; a host-registered renderer survives a surface without context. refactor(react)!: delete the React basic catalog implementation #2630 extends it to render web_core'sTextthrough the context renderer.Verification
yarn --cwd renderers/react testpasses (479 vitest tests).