Skip to content

Updated TypeScript version into 2.4.1 #549

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

Merged
merged 12 commits into from Jul 27, 2017
Merged

Updated TypeScript version into 2.4.1 #549

merged 12 commits into from Jul 27, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jul 8, 2017

set noStrictGenericChecks typescript compiler option to true due to Generic Error

Aleix Morgadas added 3 commits July 8, 2017 21:01
@ghost
Copy link
Author

ghost commented Jul 8, 2017

The fix implied more changes than expected:

  • Upgraded TypeScript version into 2.4.1
  • Upgraded TypeScript lib from es5 to es6 due type errors
  • Added @types/core-js dependency
  • Modify all imports to pass the tslint
  • string-literals.ts convertType function, replace type.text by type.value

CHANGED decorators.ts for bad property used
CHANGED react.d.ts to solve a known issue
@ghost
Copy link
Author

ghost commented Jul 8, 2017

  • Update gruntfile.js to add the compiler options
  • Change react.d.ts for known FIX link

@ghost
Copy link
Author

ghost commented Jul 8, 2017

Finally, the build compiles and run the tests with

  • 61 passing (44s)
  • 52 failing

I need to do a lot of changes and fixes, so I think that I've done something wrong in some stage, could a core developer help me to fix this? Thanks

I leave the pull request at this stage to have a changes track

@aciccarello aciccarello self-assigned this Jul 10, 2017
@drewwyatt
Copy link

drewwyatt commented Jul 13, 2017

Any idea when this will get released? (This is working in my repo)

Copy link
Collaborator

@aciccarello aciccarello left a comment

Choose a reason for hiding this comment

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

@aleixmorgadas First of all, thank you for your work and sorry I took so long to review. I know you had to go through a few iterations to get this working. I made a few inline comments but here is a summary.

tslint

I'm not sure why the tslint issues are coming up now but I'd prefer for them to be done in a separate PR. The whitespacing on imports isn't consistent either. Not sure how others feel about this.

tsconfig.json changes

The tsconfig does to define the typeRoots because TypeScript handles the default well enough. The noStrictGenericChecks flag is the simplest fix to the new compilation errors but I would like to fix the type checking.

TS 2.4 specific features

This isn't really the responsibility of this PR but I wanted to note that we should review how new features like string Enums and dynamic imports are handled.

package.json Outdated
@@ -1,7 +1,7 @@
{
"name": "typedoc",
"description": "Create api documentations for typescript projects.",
"version": "0.7.1",
"version": "0.7.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is normally updated on release. Also need to think about whether this is a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

If this can be undone, I'll do a release.

Copy link
Author

Choose a reason for hiding this comment

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

Done 😁

src/index.ts Outdated
export {Application} from './lib/application';
export {CliApplication} from './lib/cli';
export {Application } from './lib/application';
export {CliApplication } from './lib/cli';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why no space in front?

Copy link
Author

Choose a reason for hiding this comment

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

I missed the file, strange that tslint didn't notice it

tsconfig.json Outdated
@@ -16,7 +16,10 @@
"outDir": "dist/",
"rootDir": "src/",
"experimentalDecorators": true,
"noStrictGenericChecks": true
"noStrictGenericChecks": true,
"typeRoots": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should not be necessary. TypeScript defaults to this.

@@ -43,6 +43,6 @@ function decoratorWithParam(value:boolean):MethodDecorator {
*/
function decoratorWithOptions(options:{name:string}):ClassDecorator {
return function (target) {
target.options = options;
target.arguments = target;
Copy link
Collaborator

Choose a reason for hiding this comment

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

So there error here is caused by a lib.es5.d.ts definition. Granted, this is only an example being documented but I'd prefer to update the definition of the target function to include this property.

@ghost
Copy link
Author

ghost commented Jul 15, 2017

The major changes made are to support TS 2.4 as soon as possible, and then remove the parches to apply the best practices. I'm OK with your decision to first apply the best procedure and then release the new version.

So, I will make a new PR for the tslint issue in the next days. How do you want to procedure with the ts version upgrade?

@ghost
Copy link
Author

ghost commented Jul 16, 2017

👍

@abergs
Copy link

abergs commented Jul 17, 2017

We're really looking forward to the release of this!

@aciccarello
Copy link
Collaborator

@aleixmorgadas Thanks for doing the whitespace changes in a separate PR. I made some changes to this PR to tighten the generics type definitions and avoid some of the CI timeouts.

@blakeembrey Can you take a quick look and create a release for this? The version number was already bumped.

@CosminIonascu
Copy link

Hi, I also need this update, when will be merged?

@abergs
Copy link

abergs commented Jul 18, 2017

@CosminIonascu In the meantime you can install this pull request by running:

yarn add -D #549/head
or
npm install --save-dev #549/head

@CosminIonascu
Copy link

Ok, thank's!

@abergs
Copy link

abergs commented Jul 18, 2017

Also @CosminIonascu, you will ned to build the dist folder in order be able to run the node script:
https://github.com/TypeStrong/typedoc/blob/master/UPDATING.md

tsconfig.json Outdated
"es5",
"es2015.collection",
"es2015.iterable"
"es2016"
Copy link
Member

Choose a reason for hiding this comment

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

es2016? Is there something from es2016 we're using or should this just be es2015?

Copy link
Author

Choose a reason for hiding this comment

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

there was some issues with the types due to the last typescript version, it was solved using the es2016 lib

Copy link
Member

Choose a reason for hiding this comment

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

Which issues?

@ghost
Copy link
Author

ghost commented Jul 26, 2017

@blakeembrey I've undone the change in the tsconfig.json file, and it works.

There was a lot of errors at the beginning, so they guided me to that change. View all thread to find the reason.

@blakeembrey
Copy link
Member

blakeembrey commented Jul 27, 2017

@aleixmorgadas The changes you made were invalid JSON. I'll try to check it out for myself.

Edit: Actually, it passes with no changes to the tsconfig.json currently. I'm going to merge.

@blakeembrey blakeembrey merged commit 3bbf940 into TypeStrong:master Jul 27, 2017
@ghost
Copy link
Author

ghost commented Jul 27, 2017

@blakeembrey Yes the commit d3d4d42 had an invalid JSON, but the first errors weren't.

@blakeembrey
Copy link
Member

@aleixmorgadas As far as I can see, there's no changes to tsconfig.json in the PR I merged. It looks like you undid the changes making it es2016 and it passed. Let me know if I'm not looking at the right thing.

@blakeembrey
Copy link
Member

Oh, I see what you meant now too. I thought you were undoing the change to demonstrate it failing. The order of the conversation confused me, sorry. I saw your TravisCI link first and I thought that was you showing it fails using the es2015 config. Now I understand that you undid the changes all together (not to es2015 as a demo, then back to es2016).

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.

5 participants