Skip to content

fix: isolate processor caches by plugin function identity - #702

Merged
farnabaz merged 1 commit into
vercel:mainfrom
Claire-ovo:fix/plugin-cache-identity
Oct 28, 2026
Merged

farnabaz merged 1 commit into
vercel:mainfrom
Claire-ovo:fix/plugin-cache-identity

Conversation

@Claire-ovo

Copy link
Copy Markdown
Contributor

Processor cache keys currently use plugin function names. Two closures returned by the same factory can therefore share a processor, causing one Streamdown instance to render with another instance's plugin behavior.

Use stable WeakMap-backed function IDs for bare and tuple remark/rehype plugins. Preserve reuse for the same function and the existing option serialization. Add eight regression/control cases and a patch changeset. No public API or styling changes.

Validation: six new cases fail on main; all eight pass with the fix. The streamdown suite passes 1,310 tests; the other five package test tasks were cache hits. Package and website builds, repository lint, and 17 workflow-action tests pass. Chrome checks pass at desktop/mobile viewports in static/streaming modes, including content updates.

Full-package tsc reports the same 210 diagnostics on main and this branch, with no added diagnostics by file/code/message comparison. Function-valued options and preset serialization are outside this change.

AI-assisted implementation and validation.

@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@Claire-ovo is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@farnabaz farnabaz 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.

LGTM, Thanks

@farnabaz
farnabaz merged commit ec1489a into vercel:main Oct 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants