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

chore(www): Make components used in MDX globally available #20685

Merged
merged 1 commit into from
Jan 22, 2020
Merged

chore(www): Make components used in MDX globally available #20685

merged 1 commit into from
Jan 22, 2020

Conversation

tesseralis
Copy link
Contributor

Description

Make (most) website components used in MDX files globally available. This allows them to be easily referenced in translated docs pulled in from other repos.

The only ones not made available are <APIReference> and <GraphqlApiQuery>, which we'll do as part of #18704.

Related Issues

Fixes: #19036

@tesseralis tesseralis requested review from a team as code owners January 17, 2020 22:13
@@ -212,6 +202,14 @@ items={[
slug={props.slug}
/>

---

## Other available components
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 wondering if we should get rid of this section entirely. The remaining components here (Breadcrumb and TableOfContents) aren't really things that you'd import -- they're automatically added to pages in the site layout.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah they may not make the most sense in this file compared to other components, but I think someone had pointed out it being good to document what those 2 components were doing since edits to the doc-links.yaml and frontmatter that contributors often touch has a tableOfContentsDepth and a breadcrumbTitle. Recording it here was probably just the best place I found 🤷‍♂️

Copy link
Contributor

@gillkyle gillkyle left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 these components all seem pretty small and aiding translation efforts seems like a worthwhile reason to make them globally available.

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Thanks! - Note this doesn't change (much) in regards to bundle sizes, because mdx imports end up in app chunk anyway, and this PR doesn't change that. There are slight changes in produced bundles - https://www.diffchecker.com/IP8oskzq but that's more of a reordering things happening because of imports happening in different places

@pieh pieh changed the title chore(www) Make components used in MDX globally available chore(www): Make components used in MDX globally available Jan 22, 2020
@pieh pieh merged commit 930cd31 into gatsbyjs:master Jan 22, 2020
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.

Make website components used in MDX files globally available
3 participants