Handle ES6 module exports, with class reference (Feature Request) #19

Closed
mmoss opened this Issue Jun 29, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@mmoss

mmoss commented Jun 29, 2015

I was hoping to be able to encapsulate modules which are made up of a file which only export a single instance of a class (without the class being exported). Any chance of adding @module support for better ES6 module export handling? JSDoc handles it this way or this way. I'd love to chip in, just let me know if you'd be willing to accept a pull request if I added a test case for the new tag (and if I'd also need to file a PR for updating the documentation/website). ありがとう!

Example use case:

class Foo {}

/**
 * @type Foo
 * @module fooSingletonInstance
 */
export const fooSingletonInstance = new Foo();
@h13i32maru

This comment has been minimized.

Show comment
Hide comment
@h13i32maru

h13i32maru Jun 30, 2015

Member

ESDoc head revision supports the following pattern.

// default export
class Foo {}
export default new Foo();

// named export
class Bar{}
let bar = new Bar();
export {bar};

And I plan to support the following pattern without any tag.

class Foo {}
export const foo = new Foo();

Documentation of this pattern shows Foo class and caution

Member

h13i32maru commented Jun 30, 2015

ESDoc head revision supports the following pattern.

// default export
class Foo {}
export default new Foo();

// named export
class Bar{}
let bar = new Bar();
export {bar};

And I plan to support the following pattern without any tag.

class Foo {}
export const foo = new Foo();

Documentation of this pattern shows Foo class and caution

@mmoss

This comment has been minimized.

Show comment
Hide comment
@mmoss

mmoss Jun 30, 2015

Awesome! Looks great.

mmoss commented Jun 30, 2015

Awesome! Looks great.

@mmoss mmoss closed this Jun 30, 2015

h13i32maru added a commit that referenced this issue Jul 4, 2015

h13i32maru added a commit that referenced this issue Jul 4, 2015

@h13i32maru

This comment has been minimized.

Show comment
Hide comment
@h13i32maru

h13i32maru Jul 4, 2015

Member

@mmoss ESDoc supports instance exporting. I will release it in next version.

Member

h13i32maru commented Jul 4, 2015

@mmoss ESDoc supports instance exporting. I will release it in next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment