Skip to content

feat: add type-extractor package #5948

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joshblack
Copy link
Member

@joshblack joshblack commented Apr 21, 2025

Continues off an idea we had last year where it would be cool to have a package that we could use to parse type information automatically.

This is currently a WIP but wanted to get something up in case people wanted to collaborate on it 👀 A lot of the support for primitives is there and the active work now is on understanding references and how we would like to serialize that to be used in docs. Specifically, a reference is when we have things like React.ComponentPropsWithoutRef.

One thing that I'm having trouble with is when to use ts.Type versus ts.TypeNode. It seems like when trying to extract type information from ts.Type, we are getting access to an underlying type instead of being able to trace the references. For example:

type T1 = number;
type T2 = Array<T1>;

In the case above, T2 would just give us Array<number> but we would like to keep track of all references for better support in the documentation site.

Copy link

changeset-bot bot commented Apr 21, 2025

⚠️ No Changeset found

Latest commit: 466d253

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label Apr 21, 2025
Copy link
Contributor

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 103.03 KB (0%)
packages/react/dist/browser.umd.js 103.31 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant