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

feat: mdx loader fallback, allow importing mdx docs from anywhere #5299

Merged
merged 8 commits into from
Aug 6, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Aug 5, 2021

Motivation

We should allow importing MDX files that are outside the content plugin folders.

This is particularly helpful if some user wants to display the repo/README.md in his site: he can just import the file from an existing doc as a partial.

Of course we still have the annoying TOC headings issue so this use-case is not 100% solved (#3915)

This still solves a few issues users already reported, such as this one where the user tries to import an MDX file from src/components/_markdownPartial.mdx, for which no mdx-loader was configured (#5286)

Users expect to be able to import an MDX file, no matter where it's located.

There are shortcomings to the current system though, as the remark/rehype plugins and the additional linkify logic of the issues won't be applied to this out-of-content-plugin mdx file. For this to work we probably need better markdown infrastructure. The current solution is a good enough one, but may not work in all use-cases. Let's wait for someone to complain and see if it's worth improving it.

Also move some dogfooding stuff to the _dogfooding folder

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

Dogfooding in the test instances

Also displaying the changelog on our own website: https://deploy-preview-5299--docusaurus-2.netlify.app/community/changelog/

@slorber slorber requested a review from lex111 as a code owner August 5, 2021 14:47
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 5, 2021
@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Aug 5, 2021
@netlify
Copy link

netlify bot commented Aug 5, 2021

✔️ [V2]

🔨 Explore the source changes: d38980e

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/610cf92464b4e60008c97573

😎 Browse the preview: https://deploy-preview-5299--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 74
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5299--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

Size Change: +875 B (0%)

Total Size: 787 kB

Filename Size Change
website/.docusaurus/globalData.json 36.1 kB +145 B (0%)
website/build/assets/js/main.********.js 403 kB +732 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 93.4 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 63.9 kB 0 B
website/build/blog/index.html 27.8 kB 0 B
website/build/docs/index.html 41.9 kB -1 B (0%)
website/build/docs/installation/index.html 49.6 kB -1 B (0%)
website/build/index.html 28.7 kB 0 B
website/build/tests/docs/index.html 22.6 kB 0 B
website/build/tests/docs/standalone/index.html 20.5 kB 0 B

compressed-size-action

@slorber slorber changed the title feat: mdx loader fallback feat: mdx loader fallback, allow importing mdx docs from anywhere Aug 6, 2021
@slorber slorber merged commit 916b821 into master Aug 6, 2021
@slorber slorber deleted the slorber/fallback-mdx-loader branch August 6, 2021 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants