refactor(web-core): decouple v0.9 markdown renderer types - #2105
refactor(web-core): decouple v0.9 markdown renderer types#2105gaoachao wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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.
|
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 Thanks! I’ve updated the branch with the latest main. Please feel free to rerun the CI checks. |
|
Gladly! Thanks for drawing my attention to this one! |
ditman
left a comment
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
Please, do not to export *. Similarly to what we did in signals.js below, please explicitly name what's being exported from ./types.js
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:
MarkdownRenderer,MarkdownRendererOptions, andMarkdownRendererTagClassMapto@a2ui/web_core/v0_9.@a2ui/markdown-itas implementing both the v0.8 and v0.9MarkdownRendererinterfaces.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.yarn workspace @a2ui/react test— passed.Pre-launch Checklist
One time:
For this PR:
If you need help, consider asking for advice on the discussion board.