-
Notifications
You must be signed in to change notification settings - Fork 109
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
*ActivityOptions: make either timeout required #1523
base: main
Are you sure you want to change the base?
Conversation
@mjameswh can take a look? |
FTR I considered defining the types this way initially but decided against it because it's harder to understand and doesn't render well in the generated documentation. |
I can't trigger Build Docs, but trusting that's still the case we can close this PR. |
Let's keep this PR open for now. This "stricter type definition vs generated API docs readability" thing is already a problem, and will continue to grows over time. Both are important for DX. I would really want to look at how we can get the former without compromising too much on the latter. One possibility might be to look at more readable ways to express the same type constraints. For example, in the specific case highlighted by @ikonst, a definition such as Also, TypeDoc is actively working on various optimizations to how complex types get displayed in generated documentation. Some of these optimizations are automatic, but most must be turned on explicitly, e.g. by adding some doc annotation to the type. The |
My 2c is the build time error is way more important than marginally prettier docs. One of them stops you from making a mistake without you having to think, and the other is maybe slightly... distracting? |
What was changed
*ActivityOptions
typesWhy?
We do this check in runtime:
sdk-typescript/packages/workflow/src/workflow.ts
Lines 134 to 138 in 6990b19
It can be easily expressed in TypeScript.
Checklist