feat(web_core): add universal markdown fallback in text component - #2272
Draft
josemontespg wants to merge 1 commit into
Draft
feat(web_core): add universal markdown fallback in text component#2272josemontespg wants to merge 1 commit into
josemontespg wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces @a2ui/markdown-it as an optional peer dependency to @a2ui/web_core to enable automatic Markdown rendering for text components, alongside adding unit tests for the MarkdownDirective. Feedback on these changes suggests improving the directive's robustness against race conditions by using an auto-incrementing renderId counter instead of simple value comparison. Additionally, the reviewer recommends caching the resolved renderer state synchronously to avoid unnecessary microtask overhead on subsequent renders, and removing the console warning when the optional peer dependency is not installed to prevent console clutter.
josemontespg
force-pushed
the
web-core-universal-markdown
branch
from
August 14, 2026 19:17
9d695e6 to
5737a58
Compare
josemontespg
marked this pull request as draft
August 14, 2026 19:22
josemontespg
force-pushed
the
web-core-universal-markdown
branch
7 times, most recently
from
August 17, 2026 19:33
362589a to
565018c
Compare
josemontespg
force-pushed
the
web-core-universal-markdown
branch
from
August 17, 2026 20:31
565018c to
a6e29ba
Compare
josemontespg
force-pushed
the
web-core-universal-markdown
branch
2 times, most recently
from
August 17, 2026 20:57
d4d8c50 to
d54e001
Compare
josemontespg
force-pushed
the
web-core-universal-markdown
branch
from
August 17, 2026 21:27
d54e001 to
167476d
Compare
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.
Description
Implements universal markdown fallback support in
@a2ui/web_corebasic catalog text component.Key Changes
Dynamic Optional Markdown Renderer:
import('@a2ui/markdown-it')fallback when no custommarkdownRendereris provided via@lit/contextor component properties.@a2ui/markdown-itis available in consumer bundles, text components asynchronously render rich Markdown into contextual DOM fragments.@a2ui/markdown-itis not installed or fails to load, text components gracefully fallback to plain text rendering without runtime errors or console spam.Race Condition Prevention:
if (value !== this.lastValue) return;) inMarkdownDirectivefor both custom renderers and dynamic default renderer resolutions to prevent out-of-order renders during rapid text updates (e.g. streaming LLM responses).Peer Dependency & Documentation:
@a2ui/markdown-itinpeerDependencies(marked optional) anddevDependenciesinweb_core/package.json.renderers/web_core/CHANGELOG.md.Testing:
renderers/web_core/src/v0_9/basic_catalog/directives/markdown.test.tsverifying fallback rendering, custom renderers, and out-of-order promise resolution protection.Pre-launch Checklist