Skip to content

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Dec 13, 2018

Continuing the cyclical type import dance.

#691 removes some cyclical imports. It also stopped exporting a few color helper functions in the final build (see #718) as I incorrectly assumed that they should be internal. It turns out people are using them, so that PR got reverted in #721.

This PR is #691 EXCEPT the shuffling of the color helpers (I shall fix those cyclical imports while ensuring they are exported in a follow up PR).

Note that this does not move around any base Props interfaces so the styleguide's props explorer is happy with it. (It breaks if you set your components Props as an interface from a different file)

WHY are these changes introduced?

Move us closer to enabling the import/no-cycle rule by fixing several violations.

WHAT is this pull request doing?

Moves some types around to avoid cyclical imports. See #691 for an example of what this means.

How to 🎩

  • Run tests
  • Run yarn run sk type-check to prove typescript is happy
  • Run yarn build-consumer web then run yarn run sk type-check in web to prove there are no missing exports (You may have to install polaris-icons in web as a workaround because build-consumer isn't smart enough to handle updating transitive dependencies)
  • Run yarn build-consumer polaris-styleguide then run yarn run dev and check the props explorer for the DataTable, Tabs and ResourceList components still render the same (You may have to install polaris-icons in web as a workaround because build-consumer isn't smart enough to handle updating transitive dependencies)

@BPScott BPScott temporarily deployed to polaris-react-pr-754 December 13, 2018 20:23 Inactive
@BPScott BPScott force-pushed the cyclical-imports-redux branch from cd7e9e7 to 1cf4095 Compare December 13, 2018 21:16
@BPScott BPScott temporarily deployed to polaris-react-pr-754 December 13, 2018 21:16 Inactive
Move us closer to enabling the `import/no-cycle` rule by fixing several
violations.
Copy link
Member

@chloerice chloerice left a comment

Choose a reason for hiding this comment

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

Code looks good, and I grepped for and tophatted views that use the affected components (like admin/settings/taxes for DataTable, and list views like /admin/products for Tabs) and it's solid.

@BPScott BPScott merged commit b74ceae into master Dec 15, 2018
@BPScott BPScott deleted the cyclical-imports-redux branch December 15, 2018 00:39
@danrosenthal danrosenthal temporarily deployed to production January 7, 2019 14:27 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants