-
Notifications
You must be signed in to change notification settings - Fork 516
chore(typescript): Upgrade to 2.0 & Types #258
Conversation
|
Thanks for this! I'll merge it as soon as TypeScript 2.0 ships. It will be great to get all those |
|
Glad to help 😄 |
# Conflicts: # templates/Angular2Spa/package.json # templates/KnockoutSpa/tsd.json # templates/KnockoutSpa/typings/tsd.d.ts # templates/ReactReduxSpa/package.json # templates/ReactSpa/tsd.json # templates/ReactSpa/typings/tsd.d.ts
|
Just fixed the merged conflicts, @SteveSandersonMS |
|
"(12,39): error TS2346: Supplied parameters do not match any signature of call target" can be fixed by changing |
|
Thank you @stephtr I'll take a look! I wasn't sure if we would want to use typescript@next since it cold e very unstable though? The supplied parameters one is because compose is using a very old type definition from tsd, when upgrading to types it's using the newest redux, so we need to reconfigure the API :( Other than that, I was able to get all the other projects running without errors luckily. |
|
Maybe you can take a look at @types if you're updating to Typescript 2 :) On Sun, Sep 18, 2016, 12:56 Mark Pieszak notifications@github.com wrote:
|
|
Course! Already have them in here 😃 |
|
One change made in Redux 3.6 is Improve typings for Using only a few changes ReactReduxSpa runs using TypeScript 2.0 (typescript@next not necessary) and @types. While experimenting I noticed that TypeScript seems to use the typing included in the redux-package and not from @types/redux. types/custom-types.d.ts is not needed when including node_modules/@types/webpack/webpack-env.d.ts in tsconfig.json (see DefinitelyTyped #10578). |
|
Hoping to get back to this one later today so we can get this merged in there since TS2 finally shipped :) |
antmdvs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments for ReactReduxSpa
|
|
||
| export default function configureStore(initialState?: Store.ApplicationState) { | ||
| // Build middleware. These are functions that can process the actions before they reach the store. | ||
| const thunk = (thunkModule as any).default; // Workaround for TypeScript not importing thunk module as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this workaround is needed anymore and I believe you can just:
import thunk from 'redux-thunk';
| "name": "WebApplicationBasic", | ||
| "name": "react-redux-spa", | ||
| "version": "0.0.0", | ||
| "dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I can't comment on line 40 (it's grayed out), but bump typescript to v2.
"typescript": "^2.0.3",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! Let me add that in there.
|
Which issues are still left (except redux-typed)? Because in my fork it is working (stephtr/JavaScriptServices). |
|
Closed in favor of #362 |
! Work in progress !
Upgraded all Project Templates to TS2.0beta,
@types, removed all remnants oftsd,typingsfolders, etc.Left Universal specific custom types in
types/custom-types.d.tsfor the ng2 template.Tested & Working:
WIP Issues :
ReactReduxSpa
it looks like the project needs to be updated to the latest API,
@typeshere cause many errors, since its based on an older API.certain react @types / Store / Dispatch)(16,16): error TS2314: Generic type 'Dispatch<S>' requires 1 type argument(s).(can be fixed with PR Update aspnet-webpack-react to React 15 #256 )