Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Meta PR] Convert to TypeScript #3536
* scaffolding for typescript * add jest types so tests will compile * remove rollup-plugin-typescript2, probably don't need it * add missing eslint-import * fix linting errors
* fix replaceReducer type * remove extraneous type * Update the JSDoc so IDEs don't complain. * new test for replaceReducers Co-authored-by: Tim Dorr <firstname.lastname@example.org>
* Fix linter configuration for test files * Add separate ESLint config to test/typescript * Also lint TypeScript files in examples
* convert applyMiddleware.js to typescript * vastly improve the definition of middleware types
Deploy preview for redux-docs ready!
Built with commit d8417e8
* fix replaceReducer with a store enhancer * remove erroneous restriction on StateExt * remove the other extension - our store enhancer might add array functionality, for instance * add reasonable defaults for Ext and StateExt * fix state, add a test for non-object-based state * add verification that store extension is also passed to replaceReducer * better fix: set state default based on what base type it is * fix array test * fix typing of StateExt * add mhelmerson example * fix replaceReducer, so that it infers types, fix example test * fix the weird type hacks in the test * add final working example * update based on PR type changes * fix type * update tests to reflect complete examples * merge the changes from index.d.ts into types/store.ts * extend store type * much better approach: only extend the state when we have an extension * fix typing issues not caught before * add link to the place I learned about this
* fully move away from index.d.ts * build types into the types/ directory * remove autogenerated types dir * ignore auto-generated types * better type building, also clean old definitions * use types instead of typings Co-Authored-By: Jed Mao <email@example.com> * Don't build declaration maps
* Defer to rollup TS plugin to build types * index.ts -> redux.js, redux.d.ts * Only output one copy of the types. This also puts them back into the types path. However, I don't know how to have them output as a single file bundle to match our other outputs. * Remove the move Co-authored-by: Tim Dorr <firstname.lastname@example.org>
One thing though:
While I see you are already aware of the "single bundle", I just wanted to chime in on how important that can be - please don't do a release before having the single type bundle:
@babel/preset-typescript has severe problems with type re-exports ( babel/babel#8361 or babel/babel-loader#603 among dozens of others) that sometimes make libraries with multiple typings files & re-exports almost impossible to use with a webpack+babel-typescript setup.