Skip to content
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

Type tidying #2631

Merged
merged 2 commits into from
Jan 21, 2020
Merged

Type tidying #2631

merged 2 commits into from
Jan 21, 2020

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Jan 18, 2020

WHY are these changes introduced?

While rumbling through #2625 I found a bunch of cases where our components exported types that either weren't needed outside of that component, or could be made so with a bit of refactoring, and pushing usage towards referencing something living on a Props interface.

This shrinks the amount of exports in a few components.

Note that this has no effect on the types we export publicly - they all remain the same.

WHAT is this pull request doing?

Stop exporting a handful of types that weren't used outside that the file they are defined in.

Perform some refactoring so that some types are no longer used outside of the file they are defined in.

A common example is that instead of importing and using PreferredPosition from src/components/PositionedOverlay, instead import PositionedOverlayProps and reference PositionedOverlay['preferredPosition'], at which point PreferredPosition no longer needs to be exported.

How to 🎩

Tests and type-checking pass
Note that src/components/index.ts is unmodified so our public APIs are unaffected.

@BPScott BPScott requested a review from amrocha January 18, 2020 02:21
@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2020

💦 Potential splash zone of changes introduced to src/**/*.tsx in this pull request:

Files modified20
Files potentially affected52

Details

All files potentially affected (total: 52)
🧩 src/components/Autocomplete/Autocomplete.tsx (total: 0)

Files potentially affected (total: 0)

🧩 src/components/Autocomplete/components/ComboBox/ComboBox.tsx (total: 1)

Files potentially affected (total: 1)

🧩 src/components/Badge/Badge.tsx (total: 26)

Files potentially affected (total: 26)

🧩 src/components/Badge/tests/Badge.test.tsx (total: 0)

Files potentially affected (total: 0)

🧩 src/components/ColorPicker/ColorPicker.tsx (total: 0)

Files potentially affected (total: 0)

🧩 src/components/ColorPicker/components/AlphaPicker/AlphaPicker.tsx (total: 1)

Files potentially affected (total: 1)

🧩 src/components/ColorPicker/components/HuePicker/HuePicker.tsx (total: 1)

Files potentially affected (total: 1)

🧩 src/components/ColorPicker/components/Slidable/Slidable.tsx (total: 3)

Files potentially affected (total: 3)

🧩 src/components/Filters/Filters.tsx (total: 0)

Files potentially affected (total: 0)

🧩 src/components/Filters/components/ConnectedFilterControl/ConnectedFilterControl.tsx (total: 1)

Files potentially affected (total: 1)

🧩 src/components/Filters/components/ConnectedFilterControl/tests/ConnectedFilterControl.test.tsx (total: 0)

Files potentially affected (total: 0)

🧩 src/components/Form/Form.tsx (total: 3)

Files potentially affected (total: 3)

🧩 src/components/Popover/Popover.tsx (total: 23)

Files potentially affected (total: 23)

🧩 src/components/Popover/components/PopoverOverlay/PopoverOverlay.tsx (total: 24)

Files potentially affected (total: 24)

🧩 src/components/PositionedOverlay/PositionedOverlay.tsx (total: 28)

Files potentially affected (total: 28)

🧩 src/components/Stack/Stack.tsx (total: 28)

Files potentially affected (total: 28)

🧩 src/components/Tabs/Tabs.tsx (total: 0)

Files potentially affected (total: 0)

🧩 src/components/Tabs/components/TabMeasurer/TabMeasurer.tsx (total: 1)

Files potentially affected (total: 1)

🧩 src/components/Tooltip/Tooltip.tsx (total: 3)

Files potentially affected (total: 3)

🧩 src/components/Tooltip/components/TooltipOverlay/TooltipOverlay.tsx (total: 4)

Files potentially affected (total: 4)


This comment automatically updates as changes are made to this pull request.
Feedback, troubleshooting: open an issue or reach out on Slack in #polaris-tooling.

Copy link
Member

@AndrewMusgrave AndrewMusgrave left a comment

Choose a reason for hiding this comment

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

💯

@BPScott BPScott added the 🤖Skip Changelog Causes CI to ignore changelog update check. label Jan 21, 2020
@BPScott BPScott merged commit 4fd27a0 into master Jan 21, 2020
@BPScott BPScott deleted the type-tidying branch January 21, 2020 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖Skip Changelog Causes CI to ignore changelog update check.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants