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

Support ES6 export declarations #6

Closed
fkling opened this issue Mar 18, 2015 · 7 comments
Closed

Support ES6 export declarations #6

fkling opened this issue Mar 18, 2015 · 7 comments

Comments

@fkling
Copy link
Member

fkling commented Mar 18, 2015

Make the default resolvers understand export declarations, i.e.

import React from 'react';
export default React.createClass(...);
// or
export var Component = React.createClass(...);
// etc
@banderson
Copy link

@fkling Is this something that's already underway? I can lend a hand if needed, this would be huge for me.

@fkling
Copy link
Member Author

fkling commented Mar 29, 2015

I haven't started yet. If you want to take a stab on it, I'd appreciate it!

@banderson
Copy link

Ok, great, I'll see what I can do.

For those who need this ASAP and want a clue of where to start, I spiked out the minimal functionality I needed here. This just covers allowing ES6 style imports and default exports. Hopefully I can eventually flesh out the remaining details and get it merged in here.

@fkling
Copy link
Member Author

fkling commented Apr 17, 2015

@banderson: Did you make any progress with this? What's the status?

@banderson
Copy link

@fkling I got React.createClass recognition for ES6 default exports and ID'ing React in ES6 import statements in just that small change linked above. This works well for my use cases. Now I'm working on PropTypes recognition for using named imports (e.g. import React, {PropTypes} from 'React';) and in restructured assignment (let {PropTypes} = React;).

Before this is done, we'd need to ensure all import export cases are covered, and tests for all the existing cases :/ Glad to help out as much as I can, would welcome help from anyone else that knows more use cases if they exist :)

@fkling
Copy link
Member Author

fkling commented Apr 18, 2015

Great, thanks! Feel free to make a PR for the things that are working. The destructuring assignment case should already be covered with 2539959.

@fkling
Copy link
Member Author

fkling commented May 18, 2015

This should work as of 623c192, release with v1.3.0

@fkling fkling closed this as completed May 18, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants