Skip to content

Conversation

tranhl
Copy link
Contributor

@tranhl tranhl commented Jun 6, 2025

This PR adds subpath imports to @tabler/icons-react-native, allowing devs to import the icons they need without importing all Tabler icons:

import IconAdFilled from '@tabler/icons-react-native/IconAdFilled'

I took the liberty of creating a test project for the package to verify that the changes worked as well. The implementation isn't ideal as I'm using a copy of the Vite project from test-react, but it should suffice since subpath imports don't require tree shaking to reduce bundle size.

Fixes #1229

Copy link

vercel bot commented Jun 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
tabler-icons ✅ Ready (Inspect) Visit Preview Jun 6, 2025 7:03am

format: 'cjs',
inputs,
extension: 'cjs',
preserveModules: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was required to emit JS for each individual icon. Prior to this change, JS was only emitted for the entire bundle.

"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Bundler",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to update the module resolution to Bundler in order to get TS working. The test-react project has the same issue, might be something to look into.

Copy link

github-actions bot commented Jul 7, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Lack of activity label Jul 7, 2025
@tranhl
Copy link
Contributor Author

tranhl commented Jul 10, 2025

@codecalm Is there any appetite for getting this PR landed? Let me know if there's anything I can do from my side to move things along 👍

@github-actions github-actions bot removed the stale Lack of activity label Jul 10, 2025
@codecalm codecalm merged commit 10c38a6 into tabler:main Jul 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@tabler/icons-react-native 3.X.X bundle size issue
2 participants