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

Static definitions inside a ES2015 class cause errors #18

Closed
offtherailz opened this issue Jun 27, 2017 · 6 comments
Closed

Static definitions inside a ES2015 class cause errors #18

offtherailz opened this issue Jun 27, 2017 · 6 comments
Labels
feature-request jsdoc-issue v2 Fixed or implemented. To be released.

Comments

@offtherailz
Copy link

offtherailz commented Jun 27, 2017

This :

class FullScreenButton extends React.Component {
    static propTypes = {

Causes an error like:

ERROR: Unable to parse /......./FullScreenButton.jsx: Unexpected token =

Also this fails:

getButtonProperties = () => {
// ...
}
@offtherailz offtherailz changed the title Static definitions inside a ES6 class causes errors Static definitions inside a ES6 class cause errors Jun 27, 2017
@onury
Copy link
Owner

onury commented Jun 27, 2017

Docma currently supports JSDoc v3.4.3 (latest stable version as of Jun, 2017).

Static methods (and getters/setters) would work but static (property) fields seem a stage-1 proposal which is currently not supported by JSDoc yet.

Once JSDoc supports it, Docma will.

@offtherailz
Copy link
Author

offtherailz commented Jun 27, 2017

Thank you,
I supposed it was a jsdoc issue. Even if not supported I hope there is a solution to avoid documentation generation to crash, because it is the automatic conversion suggested by facebook to migrate to react 15 that uses that syntax to autobind functions.
We would try to find a solution to propose to acorn / acorn-jsx (the JS parser at the end of the chain) they can accept.

@onury
Copy link
Owner

onury commented Aug 17, 2017

That crash/issue (with your static property example) is fixed by JSDoc v3.5.4 which is the version Docma will run with the new release.

This will also add support for arrow methods and code with most ES2015 features.

I still have some work with the new release; but won't take too long though.

@onury onury changed the title Static definitions inside a ES6 class cause errors Static definitions inside a ES2015 class cause errors Aug 17, 2017
@jayesbe
Copy link

jayesbe commented Oct 16, 2017

@onury any idea when a new version will be released.. I thought it would be as easy as just updating the jsdoc-x dependency but its still failing for me on arrow functions

const example = () => { } 

causes an error on page load which results in a no render

Uncaught TypeError: Cannot read property 'indexOf' of undefined at app.min.js:1 at Array.reduce (<anonymous>) at app.min.js:1 at Object.dust.filter (docma-web.js:4) at Chunk.reference (docma-web.js:4) at body_0 (docma-web.js:27) at load (docma-web.js:4) at Chunk.partial (docma-web.js:4) at body_33 (docma-web.js:27) at Chunk.section (docma-web.js:4)

@onury
Copy link
Owner

onury commented Dec 9, 2017

There are other things to be updated such as jsdom which itself also has breaking changes. I'm working on v2 (actually these are implemented already), just needs some more time for template adjustments, etc..

@onury onury added the Fixed or implemented. To be released. label Dec 29, 2017
@onury
Copy link
Owner

onury commented Apr 12, 2018

Supported in Docma v2.0.0.
Thanks.

@onury onury closed this as completed Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request jsdoc-issue v2 Fixed or implemented. To be released.
Projects
None yet
Development

No branches or pull requests

3 participants