temporalio / temporalio/samples-typescript
[Feature Request] ESM support as a comment maybe
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 465
- Forks
- 148
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 11
Description
Is your feature request related to a problem? Please describe.
The one thing needed in at least the simpler examples (that I noticed) is to change require.resolve('./workflows.ts') in worker.ts to new URL("./workflows.ts", import.meta.url).pathname
example line: https://github.com/temporalio/samples-typescript/blob/main/hello-world/src/worker.ts#L21
Describe the solution you'd like
Maybe a comment in the code showing the esm solution? (genuinely not sure if this is best solution or not though here)
// Workflows are registered using a path as they run in a separate JS context.
workflowsPath: require.resolve('./workflows'),
// or if using esm:
// workflowsPath: new URL("./workflows.ts", import.meta.url).pathname
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in hello-world/src/worker.ts at the workflowsPath example referenced by the issue, and compare the existing require.resolve usage with the proposed ESM form. Confirm the appropriate guidance for these samples; done means the relevant example clearly documents ESM usage without making the existing worker example invalid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100