-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: type improvements #7972
base: master
Are you sure you want to change the base?
Conversation
- ValueOf\n- Merge\n- ValueOf\n- MarkOptional
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Hi Alexey! Thanks for offering to help! As you have seen, we've taken some types from ts-essentials already. Some were just inspired, or share the same type/name by chance. :) As for taking on the dependency, I don't see that as a problem necessarily, but a thought to kick off the discussion: Some types we don't need to be too generic (e.g. our Will go over the changes and give more detailed notes later! |
@dwelle Thank you for taking the time to consider my suggestions! I'm happy with your approach, if I can support you (it doesn't matter with or without ts-essentials), please let me know! Performance can be easily measured with VSCode IntelliSense (i.e. inferred type or suggestions) can be also properly tested - I haven't looked at it myself, but I have seen that some projects are especially advanced. Not sure I know all the answers yet, but happy to investigate it and help if you're interested. |
Summary
ts-essentials@10
as dev dependencyValueOf
,Merge
,MarkOptional
andMarkRequired
NonOptional
as it's not usedForwardRef
(which helped removeSignatureType
andCallableType
) - inferred type is the same for my VSCodePotential benefits
Hey @dwelle and @ad1992!
I'm the maintainer of ts-essentials right now.
I've seen you're already using ts-essentials types
ValueOf
,Merge
,MarkOptional
andMarkRequired
so I thought it's worth checking if you'd like to include ts-essentials as a dev dependency.The benefits that you're getting from the library are:
ValueOf
tests - https://github.com/ts-essentials/ts-essentials/blob/master/test/value-of.tsMerge
tests - https://github.com/ts-essentials/ts-essentials/blob/master/test/merge.tsMarkOptional
tests - https://github.com/ts-essentials/ts-essentials/blob/master/test/mark-optional.tsMarkRequired
tests - https://github.com/ts-essentials/ts-essentials/blob/master/test/mark-required.tspackages/excalidraw/utility-types.ts
as far as I understand):Mutable
can be replaced withWritable
NestedKeyOf
can be replaced withPaths
MaybePromise
can be replaced withAsyncOrSync
ExtractSetType
can be potentially replaced withElementOf
(I can create an issue to extendElementOf
for sets and make it available as a patch release 10.0.1)Assert
andSameType
(usually calledIsExact
) can be introduced as a minor release 10.1.0MakeBrand
looks similar toOpaque
but I need to understand how you use it (Intellisense is mentioned in the comment, I need to confirm it with you)MarkNonNullable
can be added, similarly to other mark types, e.g.MarkRequired
I will leave it up to you, hope it's helpful!