Skip to content

Add docs for grid module#14275

Merged
JamieB-gu merged 2 commits intomainfrom
grid-docs
Jul 25, 2025
Merged

Add docs for grid module#14275
JamieB-gu merged 2 commits intomainfrom
grid-docs

Conversation

@JamieB-gu
Copy link
Contributor

@JamieB-gu JamieB-gu commented Jul 24, 2025

Introduces documentation for the grid module using storybook's addon-docs package. This allows these docs to appear within storybook and take advantage of features like MDX (markdown with JSX), and the included doc blocks such as Source.

The resulting built docs can be seen in the published storybook for this branch.

This change requires enabling the docs addon within storybook's addon-essentials package. It also means setting up aliases for react and react-dom, as adding the docs addon without this resulted in dependency resolution errors across the codebase:

Module not found: Error: Can't resolve 'react' in [...]

Introduces documentation for the `grid` module using storybook's
`addon-docs` package. This allows these docs to appear within storybook
and take advantage of features like MDX (markdown with JSX), and the
included doc blocks such as `Source`.

This change requires enabling the docs addon within storybook's
`addon-essentials` package. It also means setting up aliases for `react`
and `react-dom`, as adding the docs addon without this resulted in
dependency resolution errors across the codebase:

```
Module not found: Error: Can't resolve 'react' in [...]
```
@JamieB-gu JamieB-gu added this to the Health milestone Jul 24, 2025
@JamieB-gu JamieB-gu self-assigned this Jul 24, 2025
@JamieB-gu JamieB-gu requested a review from a team as a code owner July 24, 2025 12:53
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@github-actions
Copy link

github-actions bot commented Jul 24, 2025

Comment on lines +146 to +147
react: 'react',
'react-dom': 'react-dom',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, just setting up the docs addon with no other changes resulted in dependency resolution errors across the codebase:

Module not found: Error: Can't resolve 'react' in [...]

where [...] represents any file where react is imported.

@JamieB-gu JamieB-gu added the run_chromatic Runs chromatic when label is applied label Jul 24, 2025
@github-actions
Copy link

github-actions bot commented Jul 24, 2025

@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jul 24, 2025
@JamieB-gu JamieB-gu added the run_chromatic Runs chromatic when label is applied label Jul 24, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jul 24, 2025
Copy link
Member

@arelra arelra left a comment

Choose a reason for hiding this comment

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

Thank you for creating such detailed and understandable documentation!

I wonder if it's worth adding an MDX viewer to the list of recommended VS Code extensions, so such docs can be read outside of Storybook.

Copy link
Contributor

@marjisound marjisound left a comment

Choose a reason for hiding this comment

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

Thanks for doing this 👏

@JamieB-gu JamieB-gu merged commit 0a2727c into main Jul 25, 2025
32 checks passed
@JamieB-gu JamieB-gu deleted the grid-docs branch July 25, 2025 12:57
@prout-bot
Copy link

Seen on PROD (merged by @JamieB-gu 9 minutes and 6 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants