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

fix: replace barrel imports with relative paths #677

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

tigranpetrossian
Copy link
Contributor

Switch out import {} from 'native' with relative imports to avoid Storybook Native crashing from unresolved tsconfig paths.

Copy link
Contributor

@pete-watters pete-watters left a comment

Choose a reason for hiding this comment

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

Nice work @tigranpetrossian 👍

Is this clash as we are exporting things from native.ts?

Maybe we could rename that slightly instead and keep the barrel imports?

@tigranpetrossian
Copy link
Contributor Author

Nice work @tigranpetrossian 👍

Is this clash as we are exporting things from native.ts?

Maybe we could rename that slightly instead and keep the barrel imports?

Two separate issues:

  1. Importing X from Y via 'native' (barrel exports), while X is being imported and exported from 'native'. So that's a circular reference.
  2. Storybook native doesn't resolve absolute imports.

These were the only few imports used this way in the entire library, the rest of the files use relative paths.
I think we should use aliases in the packages in the same way we use in mobile, but apparently tsup doesn't currently work with import X from '@/components/X' either, so we'll need to look into other bundling libraries first.

@tigranpetrossian tigranpetrossian added this pull request to the merge queue Dec 4, 2024
Merged via the queue into dev with commit 68571c0 Dec 4, 2024
11 checks passed
@tigranpetrossian tigranpetrossian deleted the fix/approver-imports branch December 4, 2024 09:58
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.

2 participants