-
Notifications
You must be signed in to change notification settings - Fork 42
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
[WEB-4086] Showcase examples via Sandpack #2483
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
79a3854
to
dcc24dc
Compare
9076332
to
be69469
Compare
Previously, we introduced an index page for examples with filtering. In this PR, we hook those cards up to pages showcasing the described examples. This is using Sandpack, a sandboxed Node environment we have used for the Pubsub how to page. Housing Sandpack is a template that contains a Sandpack renderer, a rendered Markdown README content for each example, and other useful design elements.
Word of bot
This pull request includes extensive changes to the
data/createPages/index.ts
file to integrate examples into the page creation process, updates to thegatsby-config.ts
file to add a new source for examples, modifications to several components to support the new examples, and updates to test files to reflect these changes.Integration of Examples into Page Creation
data/createPages/index.ts
: Added imports for examples and their types, defined a newExampleQueryResult
interface, and included a GraphQL query to fetch example files. Implemented a newexampleCreator
function to create pages for each example. [1] [2] [3] [4] [5]Configuration Updates
gatsby-config.ts
: Added a newgatsby-source-filesystem
plugin configuration to source example files from theexamples
directory.Component Modifications
src/components/CodeEditor/Chrome.tsx
andsrc/components/CodeEditor/CodeEditor.tsx
: Introduced atheme
prop to support both light and dark themes. [1] [2]src/components/Examples/ExamplesContent.tsx
: Updated imports and state initialization to use the new examples data structure. [1] [2] [3] [4]src/components/Examples/ExamplesFilter.tsx
: Modified to use the newuseCases
import from examples data. [1] [2]src/components/Examples/ExamplesGrid.tsx
: Updated to use the new examples data structure and improved image handling logic. [1] [2] [3]Test Updates
src/components/Examples/ExamplesContent.test.tsx
: Adjusted tests to reflect the new examples data structure and fixed capitalization in test strings. [1] [2] [3] [4]