-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(typescript): Refactor carbon/react index.js to index.ts to expose new typescript typings #12787
fix(typescript): Refactor carbon/react index.js to index.ts to expose new typescript typings #12787
Conversation
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-components-react ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@mbarrer It looks like the refactor changed the order/format of the public api snapshot and the inline snapshot of component exports. This is why the ci status check is failing. You can update both by running |
@tay1orjones Updated, is that command generally something we should be running for every PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to view the public api snapshot, and the diff is huge it won't load:
This file is built by looping over the keys of an object containing all the exports. My assumption is that the type of these objects has shifted some, and caused the exports to reorder, resulting in the huge diff. I think we could try to get a PR in to sort these first, then update this PR with that so the diff here might be more manageable.
It worries me to merge this without being able to verify what has changed in the public api snapshot file.
Yeah when adding types, I think the public api snapshot may change due to additions. It will likely need updated for every PR adding types for components. |
packages/react/src/components/ToggleSmall/ToggleSmall.Skeleton.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbarrer I hope you don't mind, I pushed an update here that will alphabetize exports and component api for the public api snapshot. This brought everything in line and now shows a much more small (and expected! 😅 ) diff.
Pending @jdharvey-ibm's comments, I think this looks good to go.
@jdharvey-ibm Updated with those suggestions. Overall I think this looks pretty darn clean! 😄 |
…o expose new typescript typings (carbon-design-system#12787)" This reverts commit 7dc8160.
Convert the main index.js to a
ts
file to expose the new typings we are adding for each component to the consumer.Changelog
Changed
src/index.js
tosrc/index.ts
export * from
. This will automatically export every named export declared in the file.Component/index.js
fileTesting / Reviewing
All existing component imports for the storybook should be valid and rendering. In a typescript environment, you should be able to import and reference the
Checkbox
component and its typings (CheckboxProps
)