chore(typescript): Upgrade to 2.0 & Types #1438

Closed
opened 2025-08-09 17:20:08 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @MarkPieszak on 8/12/2016

! Work in progress !

Upgraded all Project Templates to TS2.0beta, @types, removed all remnants of tsd, typings folders, etc.
Left Universal specific custom types in types/custom-types.d.ts for the ng2 template.

Note: TypeScript2 is still in beta, Visual Studio / VSCode / etc need to be setup to realize they're using a beta/nightly build of TypeScript to take advantage of 2.0 features.

Tested & Working:

  • Angular2Spa
  • KnockoutSpa
  • ReactSpa
  • WebApplicationBasic

WIP Issues :

ReactReduxSpa

it looks like the project needs to be updated to the latest API, @types here cause many errors, since its based on an older API.

  • (Issues remaining with certain react @types / Store / Dispatch)
    • node_modules/redux-typed/StrongActions.d.ts (16,16): error TS2314: Generic type 'Dispatch<S>' requires 1 type argument(s). (can be fixed with PR #256 )
    • @types/react-router-redux/index.d.ts error TS2305: Module '"history"' has no exported member 'LocationDescriptor'. (possible Type definition issue? Opened here)
    • ./ClientApp/boot-client.tsx error TS2322: Type 'ReactRouterReduxHistory' is not assignable to type 'History'. Property 'listenBefore' is missing in type 'ReactRouterReduxHistory'.

ERROR in C:\Users\mark.pieszak\Documents\GitHub\JavaScriptServices\templates\ReactReduxSpa\node_modules\redux-typed\StrongActions.d.ts
(16,16): error TS2314: Generic type 'Dispatch' requires 1 type argument(s).

ERROR in C:\Users\mark.pieszak\Documents\GitHub\JavaScriptServices\templates\ReactReduxSpa\types\custom-types.d.ts
(7,1): error TS2688: Cannot find type definition file for 'react-router/history.d.ts'.

ERROR in ./ClientApp/configureStore.ts
(12,39): error TS2346: Supplied parameters do not match any signature of call target.

ERROR in ./ClientApp/configureStore.ts
(19,75): error TS2686: Identifier 'Redux' must be imported from a module

ERROR in ./ClientApp/configureStore.ts
(19,75): error TS2314: Generic type 'Store' requires 1 type argument(s).

ERROR in ./ClientApp/configureStore.ts
(33,91): error TS2686: Identifier 'Redux' must be imported from a module

*Originally created by @MarkPieszak on 8/12/2016* ### ! Work in progress ! Upgraded all Project Templates to TS2.0beta, `@types`, removed all remnants of `tsd`, `typings` folders, etc. Left Universal specific custom types in `types/custom-types.d.ts` for the ng2 template. > Note: TypeScript2 is still in `beta`, Visual Studio / VSCode / etc need to be setup to realize they're using a beta/nightly build of TypeScript to take advantage of 2.0 features. ### Tested & Working: - [x] Angular2Spa - [x] KnockoutSpa - [x] ReactSpa - [x] WebApplicationBasic ### WIP Issues : ## ReactReduxSpa it looks like the project needs to be updated to the latest API, `@types` here cause many errors, since its based on an older API. - [ ](*Issues remaining with `certain react @types / Store / Dispatch`*) - node_modules/**redux-typed/StrongActions.d.ts** `(16,16): error TS2314: Generic type 'Dispatch<S>' requires 1 type argument(s).` (can be fixed with PR #256 ) - **@types/react-router-redux/index.d.ts** error TS2305: Module '"history"' has no exported member 'LocationDescriptor'. (possible Type definition issue? [Opened here](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10686)) - **./ClientApp/boot-client.tsx** error TS2322: Type 'ReactRouterReduxHistory' is not assignable to type 'History'. Property 'listenBefore' is missing in type 'ReactRouterReduxHistory'. > ERROR in C:\Users\mark.pieszak\Documents\GitHub\JavaScriptServices\templates\ReactReduxSpa\node_modules\redux-typed\StrongActions.d.ts > (16,16): error TS2314: Generic type 'Dispatch<S>' requires 1 type argument(s). > > ERROR in C:\Users\mark.pieszak\Documents\GitHub\JavaScriptServices\templates\ReactReduxSpa\types\custom-types.d.ts > (7,1): error TS2688: Cannot find type definition file for 'react-router/history.d.ts'. > > ERROR in ./ClientApp/configureStore.ts > (12,39): error TS2346: Supplied parameters do not match any signature of call target. > > ERROR in ./ClientApp/configureStore.ts > (19,75): error TS2686: Identifier 'Redux' must be imported from a module > > ERROR in ./ClientApp/configureStore.ts > (19,75): error TS2314: Generic type 'Store<S>' requires 1 type argument(s). > > ERROR in ./ClientApp/configureStore.ts > (33,91): error TS2686: Identifier 'Redux' must be imported from a module
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1438
No description provided.