-
Notifications
You must be signed in to change notification settings - Fork 6k
[TS][Angular2] Updated npm configuration to use new typescript2 typings system #5966
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
Conversation
This also removes the dependency to the typings project. Issue #4761
…ger-codegen into wing328-ts_angular2_typings
I got the following errors when running
In master and 2.3.0, I also got errors running We'll need to setup CI (travis) to cover TS Angular2 Petstore moving forward. |
Ahh. I have never directly run npm build on the client due to it not
needing to be done unless I suppose you would want to directly develop on
the client itself ( after generating ) or you want to prebuild before
sharing with a team. In my process we actually directly share the TS files
as that is immediately compatible with aot compilation ( as long as other
conditions are met.
From reading the errors ( on my phone ) it looks like there are some
incompatible libs being used for the build for core js
The last error definitely suggests that angular ( V4 or higher) is not
being installed as injection token only exists in 4 or higher .
…On Sun, Jul 2, 2017, 1:40 PM wing328 ***@***.***> wrote:
I got the following errors when running npm install (which runs npm run
build in post-install)
node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
Types of property 'lift' are incompatible.
Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
Type 'Observable<T>' is not assignable to type 'Observable<R>'.
Type 'T' is not assignable to type 'R'.
node_modules/typescript/lib/lib.es2015.collection.d.ts(45,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
node_modules/typescript/lib/lib.es2015.core.d.ts(21,14): error TS2300: Duplicate identifier 'PropertyKey'.
node_modules/typescript/lib/lib.es2015.iterable.d.ts(157,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(133,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
typings/globals/core-js/index.d.ts(3,14): error TS2300: Duplicate identifier 'PropertyKey'.
typings/globals/core-js/index.d.ts(67,5): error TS2687: All declarations of 'name' must have identical modifiers.
typings/globals/core-js/index.d.ts(127,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.unscopables]' must be of type '{ copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but here has type 'any'.
typings/globals/core-js/index.d.ts(244,5): error TS2687: All declarations of 'flags' must have identical modifiers.
typings/globals/core-js/index.d.ts(258,5): error TS2687: All declarations of 'EPSILON' must have identical modifiers.
typings/globals/core-js/index.d.ts(293,5): error TS2687: All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers.
typings/globals/core-js/index.d.ts(300,5): error TS2687: All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.
typings/globals/core-js/index.d.ts(439,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Symbol"', but here has type 'string'.
typings/globals/core-js/index.d.ts(439,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers.
typings/globals/core-js/index.d.ts(446,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
typings/globals/core-js/index.d.ts(474,5): error TS2687: All declarations of 'hasInstance' must have identical modifiers.
typings/globals/core-js/index.d.ts(480,5): error TS2687: All declarations of 'isConcatSpreadable' must have identical modifiers.
typings/globals/core-js/index.d.ts(486,5): error TS2687: All declarations of 'iterator' must have identical modifiers.
typings/globals/core-js/index.d.ts(492,5): error TS2687: All declarations of 'match' must have identical modifiers.
typings/globals/core-js/index.d.ts(498,5): error TS2687: All declarations of 'replace' must have identical modifiers.
typings/globals/core-js/index.d.ts(504,5): error TS2687: All declarations of 'search' must have identical modifiers.
typings/globals/core-js/index.d.ts(510,5): error TS2687: All declarations of 'species' must have identical modifiers.
typings/globals/core-js/index.d.ts(516,5): error TS2687: All declarations of 'split' must have identical modifiers.
typings/globals/core-js/index.d.ts(522,5): error TS2687: All declarations of 'toPrimitive' must have identical modifiers.
typings/globals/core-js/index.d.ts(528,5): error TS2687: All declarations of 'toStringTag' must have identical modifiers.
typings/globals/core-js/index.d.ts(534,5): error TS2687: All declarations of 'unscopables' must have identical modifiers.
typings/globals/core-js/index.d.ts(591,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Math"', but here has type 'string'.
typings/globals/core-js/index.d.ts(591,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers.
typings/globals/core-js/index.d.ts(595,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"JSON"', but here has type 'string'.
typings/globals/core-js/index.d.ts(595,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers.
typings/globals/core-js/index.d.ts(610,5): error TS2687: All declarations of 'size' must have identical modifiers.
typings/globals/core-js/index.d.ts(616,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
typings/globals/core-js/index.d.ts(627,5): error TS2687: All declarations of 'size' must have identical modifiers.
typings/globals/core-js/index.d.ts(633,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
typings/globals/core-js/index.d.ts(638,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
typings/globals/core-js/index.d.ts(646,27): error TS2344: Type 'K' does not satisfy the constraint 'object'.
typings/globals/core-js/index.d.ts(647,53): error TS2344: Type 'K' does not satisfy the constraint 'object'.
typings/globals/core-js/index.d.ts(648,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'prototype' must be of type 'WeakMap<object, any>', but here has type 'WeakMap<any, any>'.
typings/globals/core-js/index.d.ts(648,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
typings/globals/core-js/index.d.ts(662,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'prototype' must be of type 'WeakSet<object>', but here has type 'WeakSet<any>'.
typings/globals/core-js/index.d.ts(662,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
typings/globals/core-js/index.d.ts(674,5): error TS2687: All declarations of 'value' must have identical modifiers.
typings/globals/core-js/index.d.ts(786,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
variables.ts(1,10): error TS2305: Module ***@***.***/core/index"' has no exported member 'InjectionToken'.
In master and 2.3.0, I also got errors running npm run build but the
error messages are not the same. (I'm using Node v8.1.3)
We'll need to setup CI (travis) to cover TS Angular2 Petstore moving
forward.
cc @Vrolijkx <https://github.com/vrolijkx> @taxpon
<https://github.com/taxpon> @sebastianhaas
<https://github.com/sebastianhaas> @kenisteward
<https://github.com/kenisteward>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5966 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMPLtYx3QfxAuwrXx5yTSZw3TBCV-Q4hks5sJ9YCgaJpZM4OLl08>
.
|
@kenisteward thanks for looking into it.
I think we need to roll back that change to make the output work with Angular V2 and later add support for V4 or higher via the |
That seems reasonable.
…On Mon, Jul 3, 2017, 9:59 AM wing328 ***@***.***> wrote:
@kenisteward <https://github.com/kenisteward> thanks for looking into it.
The last error definitely suggests that angular ( V4 or higher) is not
being installed as injection token only exists in 4 or higher .
I think we need to roll back that change to make the output work with
Angular V2 and later add support for V4 or higher via the --ngVersion
option.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5966 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMPLtbBbm3bPq-v9ixY3jpHbUOfn2E3wks5sKPOzgaJpZM4OLl08>
.
|
I agree it probably wasn't the best choice to implement If someone decides to use an outdated Angular version, they have to use the injection token flag to get an API client with the old |
As a starting point, I'll add the |
Added Feel free to submit PRs to this branch for enhancements/bug fixes and I'll merge accordingly. |
@wing328 this is correct. We can simply make sure that ngVersion 2 correctly complies with all that versions best practices and ngVersion 4 complies with all the newest ones. This being a change between the two. |
UPDATE: just pushed a commit to update rxjs version and now the TS Angular 4 client does not throw any error for
|
UPDATE: TS Angular2.x, 4.x do not report any error when running If no further feedback, I'll merge this PR over the coming weekend. |
@wing328 angular and rx are peer dependencies right? I haven't had a chance to look back at the generated package.json |
@wing328 Thanks! |
Note: Angular 4 is now the default |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0
branch for breaking (non-backward compatible) changes.Description of the PR
Resolved merge conflicts for #5965