temporalio / temporalio/sdk-typescript

[Feature Request] Create a separate "core" library for workflows that does not include bundler deps.

Open
#933 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
917
Forks
224
Avg merge
3d 16h
Merged PRs (30d)
43

Description

Is your feature request related to a problem? Please describe.

Dependencies are structured in @temporalio/worker's package.json such that there is no way to not include webpack + @swc/core in a runtime build, because @temporalio/worker includes them in dependencies regardless of whether runtime bundling is required or not.

@swc/core is around ~150MB, so it adds a lot of bloat to distroless images and goes completely unused if workflow bundling has already happened in a separate build step, which is common in containerized build processes.

Describe the solution you'd like

It would be great if we had a runtime package (e.g. @temporalio/worker-core) which just contained minimal deps for running a worker and excluded bundler components. It could itself be a dependency of the full @temporalio/worker for compatibility.

Additional context

I added an example build with a step to manually strip out bundler dependencies here:
https://github.com/psigen/temporal-ts-example/blob/main/Dockerfile#L77

This reduced runtime images by almost 200MB, to a pretty manageable <300MB overall size for a distroless image.

Original idea from this slack thread

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting @temporalio/worker's package.json and the example Dockerfile at line 77 to understand the current dependency layout and runtime stripping approach. Define the package boundary and compatibility relationship so a runtime package excludes webpack and @swc/core while the full worker package remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
backend, build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.