chore: Update docs to use subpaths#9857
Conversation
|
Build successful! 🎉 |
|
Build successful! 🎉 |
| import { Text } from 'react-aria-components/Text'; | ||
| import { GridListSection, GridListHeader } from 'react-aria-components/GridList'; |
There was a problem hiding this comment.
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, | |||
There was a problem hiding this comment.
out of curiosity, why'd you apply this? i don't disagree with it, just curious
There was a problem hiding this comment.
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.
|
Build successful! 🎉 |
## API Changes
@react-spectrum/s2/@react-spectrum/s2:RangeValue+RangeValue <T> {
+ end: T
+ start: T
+} |
LFDanLu
left a comment
There was a problem hiding this comment.
Did a spot check in the docs and a quick sweep comparing the API section with what got re-exported, noted some additional components for re-export consideration, lemme now what you think
There was a problem hiding this comment.
would exporting Avatar be appropriate here too?
There was a problem hiding this comment.
Same for ComboBox, Picker, ToggleButton, TagGroup?
There was a problem hiding this comment.
it's a tradeoff between exporting every possible component you could potentially include and bundle size. I definitely want to include the ones you'd always or at least usually use, and definitely ones that aren't standalone (like Text), but not sure about the less common ones.
There was a problem hiding this comment.
thats fair, I'm fine with the current set we have then
There was a problem hiding this comment.
What about slot supported children as documented in https://d1pzu54gtk2aed.cloudfront.net/pr/b55aadca2046d5e8969d4df529c2dd8ef98b48da/ListView#slots?
like Image/ActionMenu/ActionGroup? Same kind of deal in Card + TreeView
There was a problem hiding this comment.
Maybe should include Button/ButtonGroup? Seems pretty common to tie though together
There was a problem hiding this comment.
common but not required... idk
|
Also happy to approve if we wanna try and get this into testing |
This adds exports for child components into subpaths for their parents. For example
react-aria-components/ComboBoxincludes 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.