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

Components exported with "export * from ..." are shown in error in the drawer #99

Open
aymericfraise opened this issue Nov 17, 2021 · 2 comments

Comments

@aymericfraise
Copy link

aymericfraise commented Nov 17, 2021

Hi, first off thanks for maintaining this really useful extension. I came accross this behaviour :

If your root file imports a child component from an index file that does export * from ..., then the child component appears red in the tree view and you can't expand it.

You can reproduce the issue with the following project :

Folder structure :

App.tsx
home/
├─ index.ts
├─ Home.tsx

Home.tsx :

export const Home = () => (<></>);

index.ts :

export * from './Home';

App.tsx :

import { Home } from './home';
export const App = () => (<Home />);

With this project if you select App.tsx as the root file in sapling then Home appears red and you can't expand it.

I get the issue on the latest version of vscode on Windows.

Thanks

@PLCoster
Copy link
Collaborator

Hi @aymericfraise,

Thanks for creating this issue - we are aware that Sapling is not currently capable of handling 'index imports' as you demonstrate here. It is a feature we hope to add in the future, will post a comment here if we release a new version with this capability.

Cheers!

MajorLift added a commit to MajorLift/react-component-tree that referenced this issue Nov 30, 2021
* test 14: Folders as modules / batch exports / barrel files
- export * from './File'
import { File } from './dir'

* test 15:
- Variable declaration with..
a) object destructuring alias assignment
b) array destructuring
- Import Decaration with...
* glob import and namespace specifier

* See: Issue oslabs-beta#85, oslabs-beta#99
MajorLift added a commit to MajorLift/react-component-tree that referenced this issue Nov 30, 2021
- passes test 14
- glob exports in general not yet supported

Fixes: Issue oslabs-beta#85
See: Issue oslabs-beta#99
MajorLift added a commit to MajorLift/react-component-tree that referenced this issue Nov 30, 2021
- passes test 14
- glob exports in general not yet supported

Fixes: Issue oslabs-beta#85
See: Issue oslabs-beta#99
@msakrejda
Copy link

My project also uses index imports. Sapling seems very cool, but I can't really use it due to this. Is this something you would accept a contribution for @PLCoster ? If so, any tips on how to get started on something like this?

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

No branches or pull requests

3 participants