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

Upgrade to typescript 2.0.3 #290

Merged
merged 2 commits into from
Oct 11, 2016
Merged

Conversation

MichaReiser
Copy link
Contributor

Upgrade typescript to 2.0.2

Does not add any support for any new features. Just referencing new typescript version.

Fixes #234

@aciccarello
Copy link
Collaborator

Does this work with both TS 1.8 and 2.0?

@MichaReiser
Copy link
Contributor Author

No it's not, as this is not supported by the used architecture of typedoc.
I suggest to release a new major version, indicating the breaking change

Am 14.09.2016 20:21 schrieb "Anthony Ciccarello" notifications@github.com:

Does this work with both TS 1.8 and 2.0?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#290 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABJeqUTYNR2iXx3jgcy5jHo9wlwpMWY9ks5qqDshgaJpZM4J88xS
.

@felixfbecker
Copy link

I would be nice if this could be merged into master or a v1 branch, targeted as the next major release of TypeDoc and released as prerelease so we can use it now with TS2

@satiekue
Copy link

satiekue commented Sep 21, 2016

I'm using Path Mapping based Module resolution feature of TypeScript 2.0 and when I'm using it, it's failing on resolving the paths. (see example)

Note: I'm referencing the typedoc version which is in PR right now for 2.0.2 support.

Any pointers on how to get this path mapping and module resolution to work?

Error: Unknown option baseUrl.
Error: Unknown option paths.*.0.
Error: Unknown option paths.*.1.

@MichaReiser
Copy link
Contributor Author

as mentioned... it does not add any typescript 2.0 functionality...

@blakeembrey
Copy link
Member

I just tried doing a similar update myself (but to 2.0.3), but couldn't actually get anything to work. There's an incorrect TypeScript .d.ts file used, and which I remove it to use the official version there's 100 more compiler errors. If someone has done this update, let me know.

@aciccarello
Copy link
Collaborator

TypeScript 2.0 should support compiling projects written in 1.8 correct? My understanding is that the default configuration mainly adds stricter checks like control flow so new errors found in documented projects should be minimal.

@blakeembrey
Copy link
Member

Correct, but there are some incompatibilities. I updated around 30 projects today, around half had errors that weren't caught in 1.8. My issue is ended up being around updating this project though, since there's a custom .d.ts file in use that isn't compatible with 2.0, and when I removed it I broke a lot more broke. I'll try again later, was just surprised this PR managed to get away with a lot less changes. I'll give it another go soon though, unless someone else wants to put the legwork in to go for full 2.0 support.

@MichaReiser
Copy link
Contributor Author

The string replaces task messes up the type script definition file for the performance module. Had to fix it manually...

@jasongrout
Copy link

jasongrout commented Sep 23, 2016

This PR seems to work for me. I do need to compile the bin/typedoc module to use it, though. Can you update this PR to have the compiled typedoc 'binary' so we can try using it by installing from github?

@MichaReiser
Copy link
Contributor Author

@jasongrout I cannot include these files in this PR as they are not intended to be checked in and the consequence is a rejected PR ;)

However, I created my own branch that includes the "binaries" as well

npm install --save-dev DatenMetzgerX/typedoc#typescript-2-build

@jasongrout
Copy link

jasongrout commented Sep 23, 2016

Thanks! I just realized that it was the lib/ directory that was missing, and that was in .gitignore. I also created a branch, and updated to 2.0.3, manually fixing the issue you saw with the performance module: npm install --save-dev jasongrout/typedoc#ts2

@lelandmiller
Copy link

Hey, took a look at this and it is working for my projects. Has there been any thought on merging this in the past week?

@jasongrout
Copy link

The string replace grunt task doesn't work quite right, but we fixed it by
hand.

Jason

On Thu, Sep 29, 2016, 10:21 Leland Miller notifications@github.com wrote:

Hey, took a look at this and it is working for my projects. Has there been
any thought on merging this in the past week?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#290 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AALwZrwg7rUy53QCdJb3Db8lEaHYzsL2ks5qu_OzgaJpZM4J88xS
.

@mohammedzamakhan
Copy link

@DatenMetzgerX When can we expect a merge 😄

@aciccarello
Copy link
Collaborator

I think there are a few questions that need to be answered.

  1. Should TypeDoc be expected to work with both TS 1.8 and 2.x?
  2. Should TS 2.x support be kept in a separate branch?
  3. Should support for features like readonly be added before a TS 2.0 version is released?

I think we should have a branch for a TS 2.0 compatible version. Then we could iterate on supporting the new features while figuring out how question 1 should be dealt with.

@MichaReiser
Copy link
Contributor Author

MichaReiser commented Oct 10, 2016

@mohammedzamakhan
I'm no contributor of this project and therefore not capable to merge the changes myself...

@aciccarello
I suggest that version two is merged into master but as major release. TypeScript 1.8 is no longer supported by the new version but the old one can still be used.

Support for new typescript features can be added. It could make sense to open issues for the missing features and hope for contributors...

@jasongrout
Copy link

Personally, I think:

Should TypeDoc be expected to work with both TS 1.8 and 2.x?

No, not in the same version. It's not designed to do that (even between 1.x releases).

Should TS 2.x support be kept in a separate branch?

No, I think a working 2.x should be merged and released as a new version of typedoc.

Should support for features like readonly be added before a TS 2.0 version is released?

No, I don't think that should hold things up (obviously if someone does it, that would be great!).

@@ -31,7 +31,7 @@ export class ModuleConverter extends ConverterNodeComponent<ts.ModuleDeclaration
context.withScope(reflection, () => {
var opt = context.getCompilerOptions();
if (parent instanceof ProjectReflection && !context.isDeclaration &&
(!opt.module || opt.module == ts.ModuleKind.None)) {
(!opt.module || (opt.module as any) === ts.ModuleKind.None)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't cast to any.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems somehow to be needed....

src/lib/converter/nodes/module.ts(34,33): error TS2365: Operator '===' cannot be applied to types 'ModuleKind.CommonJS | ModuleKind.AMD | ModuleKind.UMD | ModuleKind.System | ModuleKind.ES6' and 'ModuleKind.None'.

@@ -179,6 +179,10 @@ export abstract class AbstractComponent<O extends IComponentHost> extends EventD
return this._componentName;
}

set componentName(name: string) {
this._componentName = name;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just turn this into a property instead of a getter and setter that does the same thing?

@MichaReiser
Copy link
Contributor Author

I fixed both of your comments (however, enum comparison is still hacky) and upgraded to 2.0.3 as this is the latest stable release.

@MichaReiser MichaReiser changed the title Upgrade to typescript 2.0.2 Upgrade to typescript 2.0.3 Oct 11, 2016
@blakeembrey blakeembrey merged commit eb1cc7b into TypeStrong:master Oct 11, 2016
@mohammedzamakhan
Copy link

Yayyyyyy!! waiting to use in my project. Let us know when the next version is pushed.

Thanks @blakeembrey

@blakeembrey
Copy link
Member

It is 0.5.0. See https://github.com/TypeStrong/typedoc/releases.

@jasonswearingen
Copy link

jasonswearingen commented Oct 11, 2016

@blakeembrey um, correct me if I'm wrong, but as per the original push message from @DatenMetzgerX

Does not add any support for any new features. Just referencing new typescript version.

This doesn't actually address the #234 issue, which is to generate docs for code written in TS2 syntax.

@blakeembrey
Copy link
Member

It should compile 2.0 projects, but I understood that to be that it won't render new features (E.g. that is what constitutes support in typedoc). I'd love if someone else wants to help out, I don't have the time myself to maintain this project so I'm relying on community support and PRs. Enough people here seemed to think it was enough from the discussion.

In terms of adding the features, it should be easy enough to get in if someone wants to. Doing things like rendering readonly, null, undefined, etc. Making sure tests for these exist.

@mohammedzamakhan
Copy link

I am still getting error in my project

Error: Unknown option `baseUrl`.
Error: Unknown option `lib.0`.
Error: Unknown option `lib.1`.
Error: Unknown option `typeRoots.0`.

@blakeembrey
Copy link
Member

Then it looks like there's more work to be done. You can always help out by submitting PRs patching issues you run into 😄

@MichaReiser
Copy link
Contributor Author

Thx... As mentioned... no support for new typescript versions and all these options have been added with typescript 2.0. But you are free to create a pull request that adds support for these new options

@BurtHarris
Copy link

BurtHarris commented Oct 19, 2016

Oh darn, 0.5.0 doesn't work for my project either. Like above, it generates Errors for new typescript 2.0 options in the tsconfig.json file. While I don't understand much about how this tool works, it seems odd to me to have it complain about new options it doesn't understand go against the principles of extensible data formats. In fact, it might never need need to understand all the options that might occur in tsconfig.json about all the options, right?

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

Successfully merging this pull request may close these issues.

10 participants