Repository navigation
fix(client): render remote .md when the host ships MarkdownText as React.memo - #102
Merged
Merged
Conversation
…act.memo
The host exports MarkdownText as a React.memo wrapper (typeof 'object',
$$typeof Symbol.for('react.memo')), which createElement accepts. The
`typeof === 'function'` guard therefore yielded null and every remote .md
silently fell back to the raw-source wall (issue flymysql#101).
Also make the render harness stub a memo wrapper, matching the host: the
plain-function stub is why the flymysql#74 test stayed green while production was
broken.
Owner
|
Merged — clean fix, and making the harness stub memo-faithful plus pinning Ships in the next release. Thanks! |
flymysql
added a commit
that referenced
this pull request
Nov 9, 2026
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.
Fixes #101.
What breaks
lib/client.jsdecides whether to render a remote.mdwith the host'sMarkdownTextviaThe host exports
MarkdownTextas aReact.memowrapper(
typeof === 'object',$$typeof === Symbol.for('react.memo')), whichReact.createElementaccepts normally. The guard evaluates tofalse, theviewer takes the raw-source branch, and every remote
.mdrenders as a sourcewall (literal
#,**, backticks) — the regression #64 reported, reachingproduction through a different door since the #74 change.
The fix
Treat host primitives as component types, not functions:
Modal,MenuanduseModalLayerare still plain functions on the builds Ichecked, so this is the only affected primitive; their guards are left alone.
Why the suite didn't catch it
test/harness/render.jsstubbed the primitive as a plain function, i.e. a shapethe host never ships. The stub is now a
React.memowrapper like the real one,and
ui-panels.test.jsadditionally pinsmdEls[0].type.$$typeof === Symbol.for('react.memo'), so the memo path is what gets asserted.Verified locally that the test is a real guard: with only
lib/client.jsreverted to the strict check, the #74 test fails with
and passes with the fix.
Verification
node --check lib/*.js— cleannode check.mjs—OK: no framework-constraint violationsnpm test— 1040 pass / 0 fail / 7 skippednpm run test:coverage:gate—weighted line coverage: 81.4% >= 70%, per-file floors OKone-line guard change —
h1/h2/h30 → 18, tables 0 → 4, inline code 0 → 472,literal backticks/asterisks gone.