Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remarkMdxish performance issue on huge sites #3572

Merged

Conversation

hippotastic
Copy link
Contributor

Changes

  • Fixes an issue reported by JamesScheller in our Discord support channel that causes a Maximum call stack size exceeded error when building sites with hundreds of Markdown pages.
  • Background: The makeFromMarkdownLessStrict fix introduced in beta 41 was applied once per page render, inadvertently wrapping the extension function in multiple layers of fix functions. This caused the call stack to grow indefinitely.
  • This PR changes this behavior by preparing all extensions (including the fix) just once and then reusing the prepared extensions later.

Testing

  • Ran all tests.
  • Successfully built the private example repo provided by the original issue reporter.

Docs

  • Not a visible change, just a bugfix.

@changeset-bot
Copy link

changeset-bot bot commented Jun 10, 2022

🦋 Changeset detected

Latest commit: 8dbfd5e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/markdown-remark Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the feat: markdown Related to Markdown (scope) label Jun 10, 2022
@hippotastic
Copy link
Contributor Author

@natemoo-re PTAL :) This is a fix for an unwanted side effect caused by a previous fix. 😅

@natemoo-re natemoo-re merged commit 5c73f61 into withastro:main Jun 10, 2022
@natemoo-re
Copy link
Member

Thanks @hippotastic!

@github-actions github-actions bot mentioned this pull request Jun 10, 2022
@hippotastic hippotastic deleted the fix/remark-mdxish-performance branch June 10, 2022 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: markdown Related to Markdown (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants