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: correctly handle MDX layouts #6845

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danielvaijk
Copy link
Contributor

@danielvaijk danielvaijk commented Aug 30, 2024

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos
  • Infra

Description

This PR has fixes for two things:

  1. I noticed that the link scripts in the package.json were broken since the relative path was incorrect.
  2. A fix for [🐞] MDX layouts currently ignored by transformer. #6844.

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have ran pnpm change and documented my changes
  • I have made corresponding changes to the Qwik docs
  • Added new tests to cover the fix / functionality

@danielvaijk danielvaijk requested a review from a team as a code owner August 30, 2024 13:22
Copy link

changeset-bot bot commented Aug 30, 2024

🦋 Changeset detected

Latest commit: 66db6dc

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

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik-city Patch
eslint-plugin-qwik Patch
@builder.io/qwik Patch
create-qwik 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

Copy link

pkg-pr-new bot commented Aug 30, 2024

Open in Stackblitz

npm i https://pkg.pr.new/@builder.io/qwik@6845
npm i https://pkg.pr.new/@builder.io/qwik-city@6845
npm i https://pkg.pr.new/eslint-plugin-qwik@6845
npm i https://pkg.pr.new/create-qwik@6845

commit: e53c329

Copy link
Contributor

github-actions bot commented Aug 30, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview e53c329

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice but the return value is wrong I think, it needs to have the key on the top level component, no? And the static subtree flag should apply to all

Comment on lines 86 to 88
return typeof MDXLayout === "undefined" ?
_jsxC(RenderOnce, { children: content }, 3, key) :
_jsxC(RenderOnce, { children: _jsxC(MDXLayout, { children: content }, 3, key)});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  const children = typeof MDXLayout === "undefined" ? content : _jsxC(MDXLayout, { children: content }, 3)
  return _jsxC(RenderOnce, children, 3, key);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure tbh. I do know the previous revision worked and so does the one with your suggestion, so I'll take the latter due to my lack of understanding of the rendering nuances of _jsxC. Thanks!

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