Skip to content

chore: ts explicit module boundary RAC #8381

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Jun 11, 2025

Closes

next instalment, same way of verifying, see description (#8375) in addition to ts differ

any questions of types should be validated against https://app.unpkg.com/react-aria-components@1.10.1/files/dist/types.d.ts

I figured out the syntax for the function stories halfway through. Technically that syntax is deprecated, so i just left the ones i converted to the object format. We have to do it eventually. I did the rest as function format to minimise the diff.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Jun 11, 2025

Build successful! 🎉

@@ -508,7 +512,9 @@ export interface GridListLoadingSentinelProps extends Omit<LoadMoreSentinelProps
isLoading?: boolean
}

export const UNSTABLE_GridListLoadingSentinel = createLeafComponent('loader', function GridListLoadingIndicator<T extends object>(props: GridListLoadingSentinelProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {
Copy link
Member Author

Choose a reason for hiding this comment

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

the generic T seems to be unused if I've understood the types correctly

Copy link
Member

Choose a reason for hiding this comment

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

yeah I think you are right, not sure why I used the generic tbh but this looks correct

Base automatically changed from ts-more-explicit-modules to main June 11, 2025 20:40
@rspbot
Copy link

rspbot commented Jun 11, 2025

Build successful! 🎉

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

did a sweep, the types look good to me and the tsdiffer results checked out. Bit curious that there were more things that came up running yarn lint with the tsconfig from #8375 (comment) than with the same config on main though

@@ -508,7 +512,9 @@ export interface GridListLoadingSentinelProps extends Omit<LoadMoreSentinelProps
isLoading?: boolean
}

export const UNSTABLE_GridListLoadingSentinel = createLeafComponent('loader', function GridListLoadingIndicator<T extends object>(props: GridListLoadingSentinelProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {
Copy link
Member

Choose a reason for hiding this comment

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

yeah I think you are right, not sure why I used the generic tbh but this looks correct

@snowystinger
Copy link
Member Author

snowystinger commented Jun 13, 2025

did a sweep, the types look good to me and the tsdiffer results checked out. Bit curious that there were more things that came up running yarn lint with the tsconfig from #8375 (comment) than with the same config on main though

@LFDanLu
I don't follow? you mean all the other PRs I've opened?
Or are you talking about how some of these explicit module boundaries hide other issues until you fix them?

@LFDanLu
Copy link
Member

LFDanLu commented Jun 13, 2025

More of the latter I suppose, just reflecting that I was surprised that more stuff got caught by lint after the fixes in this PR when compared to main. Hard for me to parse the entire lint diff though hence the slight concern

@rspbot
Copy link

rspbot commented Jun 16, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 16, 2025

## API Changes

react-aria-components

/react-aria-components:UNSTABLE_GridListLoadingSentinel

-UNSTABLE_GridListLoadingSentinel <T extends {}> {
+UNSTABLE_GridListLoadingSentinel {
   children?: ReactNode
   className?: string
   isLoading?: boolean
   scrollOffset?: number = 1
   style?: CSSProperties
 }

/react-aria-components:UNSTABLE_ListBoxLoadingSentinel

-UNSTABLE_ListBoxLoadingSentinel <T extends {}> {
+UNSTABLE_ListBoxLoadingSentinel {
   children?: ReactNode
   className?: string
   isLoading?: boolean
   scrollOffset?: number = 1
   style?: CSSProperties
 }

/react-aria-components:UNSTABLE_TableLoadingSentinel

-UNSTABLE_TableLoadingSentinel <T extends {}> {
+UNSTABLE_TableLoadingSentinel {
   children?: ReactNode
   className?: string
   isLoading?: boolean
   scrollOffset?: number = 1
   style?: CSSProperties
 }

/react-aria-components:UNSTABLE_TreeLoadingIndicator

-UNSTABLE_TreeLoadingIndicator <T extends {}> {
+UNSTABLE_TreeLoadingIndicator {
   children?: ReactNode | ((UNSTABLE_TreeLoadingIndicatorRenderProps & {
     defaultChildren: ReactNode | undefined
 })) => ReactNode
     defaultClassName: string | undefined
 })) => string
   style?: CSSProperties | ((UNSTABLE_TreeLoadingIndicatorRenderProps & {
     defaultStyle: CSSProperties
 })) => CSSProperties | undefined
 }

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.

3 participants