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

[Feature request] Import untranspiled components #25

Open
siddharthkp opened this issue Nov 28, 2017 · 3 comments
Open

[Feature request] Import untranspiled components #25

siddharthkp opened this issue Nov 28, 2017 · 3 comments
Labels

Comments

@siddharthkp
Copy link

Importing the source file does not work right now, I simple get a syntax error because of import statements and jsx

This also open another feature request which is to resolve component dependencies in the case of composite components. (the import/require statement depicts the relative path)

@jxnblk
Copy link
Member

jxnblk commented Dec 17, 2017

Would you mind clarifying what source file you are importing? Is this a Lab component that's been exported and used in another React app, or is this a component that you're importing into Lab? If it's the latter, Lab should handle ES imports and JSX, so this might be a bug...

@siddharthkp
Copy link
Author

The latter, tried to import this component:

import React from 'react'

export default () => <div>hi</div>

Bonus: Would be cool if you can also import tokens from theme. I imagine this will work:

import { colors } from './theme.json'

@jxnblk jxnblk added the bug label Dec 20, 2017
@jxnblk
Copy link
Member

jxnblk commented Dec 20, 2017

This is definitely a bug, Lab should be able to import that syntax. Is the imported file in the same folder or a subdirectory of where the lab.json file is located? Also if you can include a snippet from the lab.json file where this import is located that could be helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants