Draft
Conversation
…e wrapper Replace this.Parser.prototype.blockTokenizers/eat() approach with a self.parse wrapper that strips HTML comments from raw vfile contents before parsing. Compatible with both unified v9 (current) and v11 (target). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…wrapper Replace this.Parser.prototype.inlineTokenizers/eat() approach with a self.parse wrapper that converts <https://...> autolinks to standard [url](url) markdown syntax before parsing. This prevents remark-mdx from interpreting autolinks as JSX elements. Compatible with both unified v9 (current) and v11 (target). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… APIs Replace private imports from remark-mdx/lib/serialize/ and @mdx-js/util with inlined equivalents: - serializeTags (from remark-mdx/lib/serialize/mdx-element) - serializeMdxExpression (from remark-mdx/lib/serialize/mdx-expression) - toTemplateLiteral (from @mdx-js/util) - hastToProps replaces hast-to-hyperscript + fakeReactCreateElement Generated output is identical. Removes dependencies on private internal APIs that won't exist in newer remark-mdx versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…all API
Replace `require('mdast-util-to-hast/lib/all')` with inlined `all` and
`one` functions. This removes the last private API import, making the
code resilient to internal restructuring in newer mdast-util-to-hast
versions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove @mdx-js/util and hast-to-hyperscript since their functionality was inlined in the previous commits. These packages are no longer imported anywhere. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Closes: #4961
Removes all deprecated API usage and private/internal imports from the unified/remark ecosystem in the
documentation-framework build scripts. This makes the code resilient to patch/minor version changes and is a
prerequisite for eventually upgrading to the latest ESM-only versions of these packages.
Changes
Phase 1: Replace deprecated remark plugin APIs
that strips HTML comments from raw markdown before parsing
that converts https://... autolinks to standard markdown link syntax
Phase 2: Inline private API imports
indentStr from remark-mdx/lib/util/, toTemplateLiteral from @mdx-js/util, and replaced hast-to-hyperscript +
fakeReactCreateElement with a simple hastToProps function
Validation
All 230 markdown files in the documentation-site processed successfully with zero diff in generated output.
Future work
These changes are a prerequisite for upgrading the unified/remark ecosystem to the latest ESM-only versions (unified
v11, remark-parse v11, remark-mdx v3, etc.). That upgrade is a larger coordinated effort requiring ESM conversion of the
build scripts and AST node type updates.