Closed parkerziegler closed 6 years ago
Merging #269 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #269 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 28 28
Lines 362 362
=======================================
Hits 357 357
Misses 5 5
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 485cc4f...827d2b7. Read the comment docs.
@tptee @ryan-roemer I think I'll need to add in defs for the immutable
aspects of the API so the compiler won't yell about import
s, I'll make the fix and push to this PR.
@tptee @ryan-roemer Types have been added for the immutable aspects of the API. There is also a corresponding branch in the rlr-ts
repo, immutable-demo
, that verifies the types pass the compiler. webpack
is correctly resolving the pointer to the ES build as well (redux-little-router/es/immutable/index.js
). Let me know how I can help you out further!
@tptee We should be good to merge! I tightened up those definitions – they actually helped me to uncover an issue from the old typings that was over-restrictive on the data structures we could store in the routes
object. Good eye! 🎉 💯
This pull request adds TypeScript definitions for v15.0.0 of
redux-little-router
. It focuses on typing the high level aspects of the API, includingactions
, theLocation
andHistory
interfaces,routers
, and theLink
andFragment
components. There is a demo repository created here to demonstrate usingredux-little-router
with TypeScript. The demo repository copies over thedemo/client
app, successfully passing the TS compiler. To run the demo locally, follow the instructions in the README.Type definitions were also created for server-side rendering, but have not been tested against a demo app. This will be important to do before shipping a new release.
Unfortunately, the types submitted to DefinitelyTyped don't fully support the API in its current state. Running the demo repository against these types results in the following Terminal output:![screen shot 2018-02-11 at 10 12 43 am](https://user-images.githubusercontent.com/19421190/36076701-aa39003c-0f14-11e8-8f9d-353d45befbad.png)
I am concerned that folks using the API with the definitions on DefintelyTyped may run into issues where parts of our API that are supported in JS will not pass the TS compiler because of incorrect typings. Shipping our own TypeScript definitions with
redux-little-router
ensures we keep them current and consistent with the latest version of our API. I would love to have some folks review these types, critique them, and expand them if possible.