Skip to content

DNM: chore: TS explicit module boundary starters #8389

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 3 commits into
base: main
Choose a base branch
from

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Jun 12, 2025

Closes

Same test instructions as #8375

Require some opinions here, should the starters adhere to this? For some reason they are checked during tsc.
If they should, then do we want ReactNode? or JSX.Element?

I think it should be ReactNode because newer versions of React appear to prefer that.

I think it's being process by TS due to our tsconfig

    "paths": {
      "tailwind-starter/*": ["./starters/tailwind/src/*"]
    }

✅ 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 12, 2025

Build successful! 🎉

@LFDanLu
Copy link
Member

LFDanLu commented Jun 13, 2025

I think it should be fine to run tsc against the starters, think people ran into issues when doing so via #7434 right?

@snowystinger
Copy link
Member Author

I think it should be fine to run tsc against the starters, think people ran into issues when doing so via #7434 right?

Right, but we could run a different config setup against it possibly. I'm not sure everyone wants all the extra type definitions that come with explicit module boundaries, it's pretty noisy as you can see, basically all exported types are duplicated.

@rspbot
Copy link

rspbot commented Jun 16, 2025

Build successful! 🎉

@LFDanLu
Copy link
Member

LFDanLu commented Jun 17, 2025

I see, that makes sense. I'll need to take a look at the config more closely to see what a good middle ground is

@@ -29,18 +29,18 @@ export const fieldBorderStyles = tv({
true: 'border-gray-200 dark:border-zinc-700 forced-colors:border-[GrayText]'
}
}
});
}) as any;
Copy link
Member

Choose a reason for hiding this comment

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

?

@devongovett
Copy link
Member

should the starters adhere to this? For some reason they are checked during tsc.

did you try adding it to the "exclude" list?

@snowystinger
Copy link
Member Author

should the starters adhere to this? For some reason they are checked during tsc.

did you try adding it to the "exclude" list?

Yes, I tried adding it to the exclude list. But I don't think we actually want to exclude it, unless we want a separate typecheck for it that doesn't do module boundaries

@devongovett
Copy link
Member

unless we want a separate typecheck for it that doesn't do module boundaries

I thought that was what you were asking.

The starters do have their own separate tsconfigs too, so I think they do get type checked separately already.

@rspbot
Copy link

rspbot commented Jun 18, 2025

Build successful! 🎉

@snowystinger
Copy link
Member Author

snowystinger commented Jun 18, 2025

You would think that based on them having their own tsconfig, however, if I turn on the isolatedDeclarations in our root config, suddenly these files start failing.

Adding to exclude doesn't do anything, I think because of the paths I mentioned earlier.

If I remove the paths, then dev/docs/pages starts failing because it imports from the starters and suddenly it can't find them.

Do things change enough with your new docs that I should hold off on these?

@devongovett
Copy link
Member

devongovett commented Jun 20, 2025

Yes, unless we want to fix all the as any. I don't think that would be good to publish in our docs :D Let's figure out how to exclude these.

@snowystinger snowystinger changed the title chore: TS explicit module boundary starters DNM: chore: TS explicit module boundary starters Jun 21, 2025
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