Skip to content

Conversation

@punkbit
Copy link
Collaborator

@punkbit punkbit commented Feb 2, 2026

Why?

To reduce redundancy found in component import statements, e.g. "@/components/Badge/Badge" requires "Badge" twice. We can omit the second one by leveraging the default resolution, e.g., index, since the directory name is the component name. Consequently, we shorten long paths into an elegant or concise import statement.

⚠️ WARNING: Depends on #773, which should be merged first
🤖 TODO: Once #773 is merged, switch base branch to main.

How?

  • Created default path index files
  • Modifies import statement verbosity

Preview?

LSP Direct to source

demo-lsp-editor-direct-source.mov

Lint warn to import local leaf

demo-lint-import-local-leaf

Copy link
Member

@hoorayimhelping hoorayimhelping left a comment

Choose a reason for hiding this comment

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

I strongly prefer we don't do this. Having a bunch of files named index open in your editor and not being able to tell at a glance which index maps to which file is way worse than having redundancy in imports within the click-ui project (which consumers of Click-UI won't ever see). See screenshot.

When I think about day to day work, I'm much more likely to switch between tabs and be confused by which index tab is which file than I am to actually notice an import path. To me, this convention in the industry feels like prioritizing the aesthetics of not having redundant paths over having contextual information conveyed through filenames.

Screenshot 2025-09-02 at 10 49 18 AM

@DreaminDani
Copy link
Collaborator

Couldn't we get the same experience on the import side by re-exporting a component from the index.ts instead of moving all the files from Component.tsx to index.tsx?

@punkbit
Copy link
Collaborator Author

punkbit commented Feb 2, 2026

Couldn't we get the same experience on the import side by re-exporting a component from the index.ts instead of moving all the files from Component.tsx to index.tsx?

@DreaminDani @hoorayimhelping This a8c8db4#diff-88cf62b736c97cedd374c8c0eaea996c92364a1cb36bcd91368f39f3efa34931R1 would look better for you?

@punkbit
Copy link
Collaborator Author

punkbit commented Feb 2, 2026

LSP Direct to source

See PR attached video demo "LSP Direct to source"

@punkbit punkbit marked this pull request as ready for review February 3, 2026 10:53
Base automatically changed from chore/distribution-unbundled to main February 11, 2026 16:50
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