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

enhancement (docs, www): MDX component alias #23209

Merged
merged 10 commits into from
May 1, 2020
Merged

Conversation

tesseralis
Copy link
Contributor

Description

  • Install gatsby-alias-imports
  • Add the @component alias pointing to www/src/components
  • Remove most components from www/gatsby-plugin-theme-ui/components and instead import them using the new alias
  • Update documentation in contributing/docs-and-blog-components.

Motivation

See: #20795 (comment)

Open Questions

  • What level of granularity do we want? Should we use a @site/@www alias instead?
  • Should we discourage people from using the alias within www?

Related Issues

fixes: #20795
partially fixes: #21470

# Conflicts:
#	docs/contributing/docs-and-blog-components.md
#	www/src/gatsby-plugin-theme-ui/components.js
# Conflicts:
#	docs/contributing/docs-and-blog-components.md
#	www/src/gatsby-plugin-theme-ui/components.js
gillkyle
gillkyle previously approved these changes Apr 24, 2020
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.

I think if this helps unblock internationalization then it's worth getting merged in. The questions on level of granularity and discouraging it from being used seem like they could be answered in the future too (if they become problems) 🤷

I'm not sure personally what issues could be run into doing this, but if it's working for Docusaurus and might work for us I say great!

# Conflicts:
#	www/package.json
Copy link

@AishaBlake AishaBlake left a comment

Choose a reason for hiding this comment

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

This is looking good! I think this is a good case for using an alias.

@@ -156,77 +156,24 @@ Rendered, the component looks like this:
Connect your Gatsby site to Storage Provider for automatic deployments
</CloudCallout>

Choose a reason for hiding this comment

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

The ComponentModel was recently made more flexible, so I think it's worth keeping the documentation for it since we'll be able to use it in more places.

@tesseralis tesseralis requested a review from a team as a code owner April 30, 2020 01:08
Copy link

@AishaBlake AishaBlake left a comment

Choose a reason for hiding this comment

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

Checked through the places these components are used and everything is looking good!

@AishaBlake AishaBlake merged commit 215b107 into master May 1, 2020
@delete-merged-branch delete-merged-branch bot deleted the mdx-component-alias branch May 1, 2020 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants