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

Missing optional properties indication in Comment entity #1267

Open
skyiea opened this issue Jul 25, 2019 · 3 comments
Open

Missing optional properties indication in Comment entity #1267

skyiea opened this issue Jul 25, 2019 · 3 comments

Comments

@skyiea
Copy link

skyiea commented Jul 25, 2019

I'm using documentation.build() method (NodeJS API) to generate "comments", which I use to build custom HTML.
After the update from 10.0.0 -> 10.1.0 (which adds "TypeScript support & inference") documentation.build started to yield different structure of Comment entity for Typescript interface properties - properties field became empty while members.instance started to contain information about interface properties.
(BTW, isn't it breaking change? Why major wasn't bumped? Here is doc that suggests to use returned object to build documentation of any kind: https://github.com/documentationjs/documentation/blob/master/docs/NODE_API.md#examples-1).

So now I'm trying to adapt to the new structure (switch from properties to members.instance). The problem is that after above-mentioned update there is no indication in the yielded Comment object about optional nature of property. Example of such interface:

/** Some interface */
interface SomeInterface {
  /** property description */
  a?: string;
}

Prior to the update Property entity provided type.type === 'OptionalType'.
Same problem in latest version (12.0.3).

@tmcw
Copy link
Member

tmcw commented Jul 25, 2019

BTW, isn't it breaking change? Why major wasn't bumped?

TypeScript pre-10.1.0 was undefined behavior: we supported its small overlap with Flow, but not TS-as-such, and never documented the ability to use TypeScript in any way. So it was a minor change instead of a major change in that it added a feature.

@skyiea
Copy link
Author

skyiea commented Jul 25, 2019

BTW, isn't it breaking change? Why major wasn't bumped?

TypeScript pre-10.1.0 was undefined behavior: we supported its small overlap with Flow, but not TS-as-such, and never documented the ability to use TypeScript in any way. So it was a minor change instead of a major change in that it added a feature.

Right. But for those who used Flow and relied on certain Comments structure it was a breaking change, isn't it?

@tmcw
Copy link
Member

tmcw commented Jul 25, 2019

I suppose so, and if so, I'm sorry. semver is kind of impossible to do right all the time.

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

2 participants