react-router Make Route autocomplete its props#36765
react-router Make Route autocomplete its props#36765TedDriggs wants to merge 1 commit intoDefinitelyTyped:masterfrom
Conversation
The `T extends RouteProps = RouteProps` only provides property autocompletion on the first property entered, after which it forgets what type we're using. Adding `& RouteProps` to the `extends React.Component` declaration fixes this issue.
|
@TedDriggs Thank you for submitting this PR! 🔔 @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @huy-nguyen @Grmiade @DaIgeb @egorshulga @rraina @pret-a-porter @t49tran @8enSmith @wezleytsai @eps1lon @HipsterBrown - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
|
@TedDriggs The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
|
👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. If you have any questions or comments about me, you can ping |
|
@TedDriggs I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues. |
|
@johnnyreilly I'm struggling to figure out how this change caused the redux test to fail; any chance I could ask for your help on understanding how those two relate? |
|
@TedDriggs I'm really sorry but I'm kinda maxed out right now and so can't help I'm afraid. My guess is that there's a test in redux which is affected by your changes; though that seems surprising. |
|
Actually I had a quick look at the error in the logs: My guess is you're being bitten by new strictness in the TypeScript compiler. You may want to ask one of the TypeScript team to advise... @andrewbranch any thoughts? |
|
@TedDriggs To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you! |
|
I haven’t looked at this super closely nor microsoft/TypeScript#32100 super closely yet, but I wonder if they might be related? In general, I would probably recommend against type hacks that make the editing experience nicer in favor of opening TypeScript bugs when the editing experience isn’t good. (That’s not to say we can never accept a clever workaround that makes the experience better, but hopefully if there’s an experience bug, we can just fix it for everyone.) If you’re determined to keep working on this, I would recommend you give that PR a try in the process ☝️ |
|
I’m looking at the failed build logs now, though, and while my point still stands, I think the build failures are probably completely unrelated to this, as @johnnyreilly posited. |
The
T extends RouteProps = RoutePropsonly provides property autocompletion on the first property entered, after which it forgets what type we're using. Adding& RoutePropsto theextends React.Componentdeclaration fixes this issue.Please fill in this template.
npm test.)npm run lint package-name(ortscif notslint.jsonis present).Select one of these and delete the others:
If changing an existing definition:
tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.