-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Split gatsbyjs.org into themes #19105
Comments
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Summary
Split parts of gatsbyjs.org into different themes in so that they can be iterated on faster.
Motivation
gatsbyjs.org takes a long time to build locally: up to ten minutes on a fresh build. This is due to (1) image optimization and (2) computationally expensive sources such as the list of starters and the entire packages directory which contains the source code for all of Gatsby and its official plugins.
This makes working on the website extremely difficult, if not impossible, especially if one needs to make changes in
gatsby-node.js
orgatsby-config.js
, since changes to these files clear the cache and force a complete rebuild. Many potential website changes, such as creating routing for translations are blocked on the slow builds of the website.By splitting off different logical sections of the Gatsby website into themes, we can run those themes individually without building other sections of the website that are more intensive. For example, we can run the "Tutorial" theme without compiling all the sources for "Plugins".
In addition, some of these themes, like for Documentation and Blogs, would be useful to provide to the Gatsby Community.
Detailed Design
Each section of gatsbyjs.org will be split into its own theme:
Each section should be able to:
gatsby-config.js
Each theme should start off as a local plugin and can freely use shared components from
www/src
. If deemed useful to the gatsby community as a whole, the theme can be moved to thepackages
directory.Implementation
Steps:
<Layout>
component tolayouts/index.js
(www) Factor out <Layout> component in dot-org from most pages/templates #21229Problems
So far, I've run into the following issues when trying to refactor into themes:
Creators
template-creator-details
queriesallSitesYaml
to determine which creators worked on what, but that node is associated with the "Showcase" theme.Showcase
gatsby-transformer-screenshot
looks forSitesYaml
nodes by default. However, this and "Starters" would be their own themes, and I don't know if including the plugin in both themes would cause any problems. Ideally the plugin should just not have a default node.In addition, because this section uses a lot of modals, it makes it hard to factor out
Layout
.Drawbacks
Splitting sections up into themes won't help build times if the website in its entirety needs to be worked on. Individual sections can still take a long time (for example, Starters).
Alternatives
Other ways to potentially reduce build time:
The text was updated successfully, but these errors were encountered: