-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix: Better error messages, and more #1126
Conversation
const packageName = `@tsconfig/node${currentNodeVersion}`; | ||
// For some reason, the @tsconfig/node20 package exists, but is currently unusable because it | ||
// refers to a --lib value that isn't supported in latest release of TypeScript. | ||
// FIXME: Update this once @tsconfig/node20 is fixed. |
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.
I'd go as far as linking the issue where there's a bit more information for future reference.
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 is not actually a bug from their perspective. @tsconfig/node20
require TypeScript 5.x.
Updated comment accordingly.
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.
Let’s upgrade to ts 5 in samples
packages/workflow/src/workflow.ts
Outdated
export function scheduleActivity<R>(activityType: string, args: any[], options: ActivityOptions): Promise<R> { | ||
assertInWorkflowContext('Workflow.scheduleActivity(...) may only be used from a Workflow Execution'); |
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.
These functions should have never been exported...
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.
Which function? scheduleActivity
? I personally think it's a good thing that they are. There are situations where proxyActivities()
is not a good fit, eg. when activity name is dynamic, or when users want to add their own wrappers around some activity calls... It's still possible to use proxies
in those cases (eg. proxy[activityName](...)
), but calling scheduleActivity
directly makes things much more understandable.
What changed
executeWorkflow()
and similar are given a workflowFunction fucntion that is anonymous (fix [Feature Request] Provide better errors when user passes a nameless function to infer workflow name #367)create
, do not use@tsconfig/node20
because it require TypeScript 5.x (fix [Bug] tsc in a project created withnpx @temporalio/create
fails on Node 20 #1125)