-
Notifications
You must be signed in to change notification settings - Fork 222
Conversation
7889810
to
1b0df1c
Compare
As we're now no longer depending on Can you identify these cases where a package no longer depends upon |
MaybeFunctionReturnType looks very similar to ReturnType, I wonder if that's a meaningful difference, and thus if it's worth removing MaybeFunctionReturnType?
|
That's done, but it affected some unit tests. Let me know if I handled that properly! |
Tried to do it yesterday, but I guess I was tired, but browsing reddit I found exactly what I was missing 😅 that should be done! |
@@ -11,5 +11,5 @@ | |||
"./src/**/*.tsx" | |||
], | |||
"exclude": ["**/test/**/*", "**/tests/**/*"], | |||
"references": [{"path": "../graphql-typed"}, {"path": "../useful-types"}] | |||
"references": [{"path": "../graphql-typed"}] |
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.
Gosh I feel dumb now 🤦
I've pushed a commit that reverts the typescript-project-references.test.ts changes and applies the proper fix. That test asserts that "if you use a dependency on another package in this monorepo in a package's package.json, then there should be a corresponding entry in that package's tsconfig.json reference field" (as this repo uses project references - one ts project per package) You've removed react-server's dependency on useful-types in the package.json, but you did not remove the reference to the useful-types folder in react-server's tsconfig.json. And thus the test fails, as there should be mention of a dependant package (or in this case no mention of a package that is not depended upon) in both package.json and tsconfig.json. The fix is not to modify the typescript-project-references.test.ts, but to update the tsconfig.json files, removing the references to useful-types in the packages that no longer depend upon useful-types |
Nice! I totally missed that packages had internal |
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.
Just pushed up another commit where I spotted dangling usages of FirstArgument and Arguments.
- Packages that no longer depend upon useful-types should have an entry in their CHANGELOG.md. Remember to reference this PR, like the other changelog entries
- I reckon we can revert the change in useful-types - we're due to delete these types once we update this PR anyway so I don't think there's much value in adjusting them now.
packages/useful-types/src/types.ts
Outdated
@@ -2,10 +2,13 @@ export type ThenType<T> = T extends Promise<infer U> ? U : T; | |||
|
|||
export type Arguments<T> = T extends (...args: infer U) => any ? U : never; | |||
export type ArgumentAtIndex< | |||
Func, |
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.
If the plan is to remove Argument, ArgumentAtIndex and FirstArgument imminently then do we need to make this change now?
I'd be tempted to revert this, and the change to packages/useful-types/CHANGELOG.md
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.
Agreed, just reverted it
6308400
to
554db48
Compare
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.
Code changes look good to me.
Can you add changelog entries to the packages that no longer depend upon useful-types
packages/useful-types/CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | |||
### Added | |||
|
|||
- Added `PartialSome` and `RequireSome` types to set specified fields of a property to optional or required | |||
- Use Typescript native types and pave the ground to deprecate legacy types |
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.
This can be removed, as we're no longer touching useful-types
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.
Done
554db48
to
d71578e
Compare
84cc512
to
e9b40c9
Compare
e9b40c9
to
ab170d7
Compare
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.
Updated the changelog entries to use the "changed" subheading and add the link to the PR
changelog forgot this one more apply pr comments Revert typescript-project-references.test.ts and apply proper fix remove two more usages of FirstArgument and Arguments revert ArgumentAtIndex changes update changelog files fix tests Apply suggestions from code review Apply suggestions from code review
e58e87b
to
6463ec4
Compare
Description
This PR is a first of two steps to get rid of
Omit
,Arguments
,ConstructorArguments
andThenType
in favour of their native Typescript counterpart.Fixes (issue #)
Type of change
react-async
Patch: No impactOmit
usage change (non-breaking change which fixes an issue)react-form-state
Patch: No impactOmit
usage change (non-breaking change which fixes an issue)react-graphql
Patch: No impactOmit
usage change (non-breaking change which fixes an issue)react-testing
Patch: No impactOmit
andArguments
usage change (non-breaking change which fixes an issue)useful-types
Patch: No impactArgumentAtIndex
andFirstArgument
change to acceptParameters
(non-breaking change which fixes an issue)Patch: Bug (non-breaking change which fixes an issue)
Minor: New feature (non-breaking change which adds functionality)
Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist