Skip to content

chore: Update docs to use subpaths#9857

Open
devongovett wants to merge 9 commits intomainfrom
export-children
Open

chore: Update docs to use subpaths#9857
devongovett wants to merge 9 commits intomainfrom
export-children

Conversation

@devongovett
Copy link
Copy Markdown
Member

This adds exports for child components into subpaths for their parents. For example react-aria-components/ComboBox includes Input, Button, ListBox, etc. This way you only need one import statement to get everything you need. It also has the side-benefit of improving discoverability of which components are supported within a parent using TS autocomplete.

Also updates the documentation examples and starters to use subpath imports. There are several benefits of subpaths, and the only real downside is needing multiple import statements when using multiple components. It's simpler to update the docs to use subpaths by default than attempt to list them all in the API reference. On the flip side it's easy to use the package index if you want.

@rspbot
Copy link
Copy Markdown

rspbot commented Mar 28, 2026

@rspbot
Copy link
Copy Markdown

rspbot commented Mar 28, 2026

@rspbot
Copy link
Copy Markdown

rspbot commented Mar 28, 2026

## API Changes

@react-spectrum/s2

/@react-spectrum/s2:RangeValue

+RangeValue <T> {
+  end: T
+  start: T
+}

Comment on lines +2 to +3
import { Text } from 'react-aria-components/Text';
import { GridListSection, GridListHeader } from 'react-aria-components/GridList';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should really apply lint to our examples so we don't get things like mixed spaces

@@ -12,6 +12,8 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"verbatimModuleSyntax": true,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

out of curiosity, why'd you apply this? i don't disagree with it, just curious

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh, i didn't indent to commit this (at least the customConditions). I added verbatimModuleSyntax because apparently vite uses it by default so when people copy and paste our examples they get a ton of errors. Sigh - another case of we have to be more strict than everyone else.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants