Skip to content

refactor(web-core): decouple v0.9 markdown renderer types - #2105

Open
gaoachao wants to merge 2 commits into
a2ui-project:mainfrom
gaoachao:p/gcc/add-v09-markdown-renderer
Open

refactor(web-core): decouple v0.9 markdown renderer types#2105
gaoachao wants to merge 2 commits into
a2ui-project:mainfrom
gaoachao:p/gcc/add-v09-markdown-renderer

Conversation

@gaoachao

@gaoachao gaoachao commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

This PR gives the v0.9 web renderer stack its own Markdown renderer types instead of importing them from the v0.8 entry point.

The change:

  • Adds MarkdownRenderer, MarkdownRendererOptions, and MarkdownRendererTagClassMap to @a2ui/web_core/v0_9.
  • Updates the Lit and React v0.9 renderers to use the new version-specific types.
  • Declares @a2ui/markdown-it as implementing both the v0.8 and v0.9 MarkdownRenderer interfaces.
  • Updates the CHANGELOG files for all affected packages.

This is a type and package-boundary change. It does not change Markdown rendering behavior at runtime.

Closes #1171.

Validation

  • yarn workspace @a2ui/web_core test — 279 tests passed.
  • yarn workspace @a2ui/markdown-it test — 10 tests passed.
  • yarn workspace @a2ui/lit test:unit — 96 tests passed, 3 skipped.
  • Lit browser integration tests — 135 tests passed.
  • yarn workspace @a2ui/react test — passed.
  • Formatting and lint checks passed for all affected workspaces.

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file.
  • I updated/added relevant documentation. The new public types include API documentation; no standalone guide changes were needed.
  • My code changes (if any) have tests.
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

If you need help, consider asking for advice on the discussion board.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces version-specific markdown renderer types in @a2ui/web_core/v0_9 and updates the Lit, React, and markdown-it renderers to use these new types instead of the generic ones. Specifically, renderMarkdown in the markdown-it renderer has been updated to support both v0.8 and v0.9 MarkdownRenderer interfaces. There are no review comments, so I have no additional feedback to provide.

@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Jul 28, 2026
@Varun-S10 Varun-S10 self-assigned this Jul 31, 2026
@Varun-S10

Copy link
Copy Markdown
Collaborator

Hi @gaoachao, We have verified that this PR successfully resolves issue. However, your branch is currently out of date with the base branch (main). Could you please update your branch and let us know once updated? That will help us run the latest CI checks. Thanks again for your contribution

@Varun-S10 Varun-S10 added status: waiting-for-author-response and removed status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs labels Jul 31, 2026
@gaoachao

Copy link
Copy Markdown
Contributor Author

@Varun-S10 Thanks! I’ve updated the branch with the latest main. Please feel free to rerun the CI checks.

@Varun-S10

Copy link
Copy Markdown
Collaborator

@gaoachao, I have reviewed and verified the changes. Thank you for your contribution.

Hi @ditman, I would like to escalate this PR. Could you please take a look?

@ditman

ditman commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Gladly! Thanks for drawing my attention to this one!

@ditman
ditman self-requested a review July 31, 2026 18:30

@ditman ditman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple of small comments here. /cc @josemontespg FYI!


import markdownit from 'markdown-it';
import * as Types from '@a2ui/web_core';
import type {MarkdownRendererTagClassMap} from '@a2ui/web_core/v0_9';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is MarkdownRendererTagClassMap a v0.9 only thing, or does it also exist in v0.8? If it's in both renderers, this would break in v0.8 right? Does this need the same XXV08 & XXV09 trick as the renderMarkdown function type in markdown.ts?

export * from './catalog/function_invoker.js';
export * from './catalog/types.js';
export * from './common/events.js';
export * from './types.js';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please, do not to export *. Similarly to what we did in signals.js below, please explicitly name what's being exported from ./types.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MarkdownRenderer abstraction to v0.9 web_core

3 participants