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.
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
Implement first pass of MDXs #507
Implement first pass of MDXs #507
Changes from 1 commit
5846bf9
05eb942
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, I'm using
thematicBreak
in@mdx-deck/mdx-plugin
but with the way the delimiter is used below will eitherhr
orthematicBreak
work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is it won't work because we're operating on MDXHAST (since it's acting as a custom compiler for MDX). But it might make sense to make MDXS more standalone and not use
mdx
core andremark-mdx
directly instead. That would allow us to operate on the MDXAST.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding these architectural things, if
remark-mdxs
(or a different implementation of MDXs) were to be implemented today, do either of you (or @ChristianMurphy or @wooorm) have any recommendations for trying to make a new MDXs PR for MDX v2? Eg. either how / where the PR should be submitted, whether MDXs should be "more standalone" like described above, etc?@EricCote or @ProchaLu (or both) may take a shot at implementing something like this in the next weeks, see the link below. The first idea was to take the implementation in this PR and upgrade it to use MDX v2 APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could actually make this the
MDXLayout
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should prolly make this a shared util.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a usage standpoint, is the thinking that you would use something like a separate webpack loader rule that only parses
.mdxs
files while handling.mdx
files like any other?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's the idea 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like it will turn out to be kind of unfortunate. It means we can't delineate between MDX content and MDXS content when fetching from remote sources that use
text/markdown
content types (mdx still doesn't have it's own entry in the mime-db and even if it did, we're going to want compat with markdown types from headless CMSs anyway).Since every MDXs document is technically a valid MDX document, I'd much rather see a const export used to specify intent to be MDXs content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's a good point 🤔. I'd mostly been thinking about local fs. How do you think intent for MDXs should be expressed?
Something like?:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is the approach I landed on as well. I think that the "first MDX file" in an MDXs document can be used as the "global exports" (compared to exports defined in subsequent "files"), so you'd end up with something like this where the first MDX doesn't have any content, but is just imports/exports.