Files
vercel__workflow/packages/swc-plugin-workflow/CHANGELOG.md
github-actions[bot] b93e7c3b59 Version Packages (#1921)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-22 13:34:26 -07:00

12 KiB

@workflow/swc-plugin

4.1.1

Patch Changes

  • #1944 a9cc1d5 Thanks @TooTallNate! - Fix three bugs affecting nested step functions that get hoisted out of an enclosing function (workflows in any declaration form, plus regular factory-style functions returning objects with step methods):

    1. Module-level imports referenced only by hoisted step bodies were stripped by dead-code elimination, causing a ReferenceError at runtime.
    2. The step ID generated for nested anonymous steps inside a non-exported workflow declared as const foo = async () => {} or const foo = async function() {} was not namespaced under the workflow name in step mode, so it did not match the ID looked up by the workflow-mode proxy and caused a runtime "step not found" failure. Steps inside async function foo() workflows were already namespaced correctly; this brings the const-arrow and const-fn-expression forms into agreement.
    3. The __internal_workflows manifest comment reported nested anonymous step IDs without the workflow-name prefix even though the runtime registration and proxy lookup used the prefixed form, so downstream tooling (e.g. builders consuming the manifest) saw the wrong step ID.
  • #1935 6aabd6f Thanks @TooTallNate! - Fix arguments being incorrectly captured as a closure variable in nested function-form step bodies, which previously produced invalid output.

  • #1935 6aabd6f Thanks @TooTallNate! - Support this references inside nested arrow "use step" functions. Requires the enclosing class to have custom serialization.

4.1.0

Patch Changes

4.1.0-beta.22

Patch Changes

  • #1599 5d22e61 Thanks @TooTallNate! - Fix class expression method registrations to use binding name instead of internal class name, preventing ReferenceError at runtime for pre-bundled packages

  • #1601 7c996a7 Thanks @TooTallNate! - Rewrite anonymous export default class to a const declaration so the class has an accessible binding name for serde/step registration code

4.1.0-beta.21

Patch Changes

  • #1503 77fd9ad Thanks @TooTallNate! - Inline class serialization registration instead of importing from workflow/internal/class-serialization. This eliminates the dependency on the workflow package in SWC-generated code, enabling 3rd-party packages (like @vercel/sandbox) to define serializable classes without needing workflow as a dependency.

  • #1144 992d768 Thanks @TooTallNate! - Add class registration detection for CommonJS syntax

4.1.0-beta.20

Patch Changes

  • #1368 5d95abf Thanks @TooTallNate! - Fix closure variable detection for new expressions, exclude module-level declarations from being over-captured, preserve original step function bodies in enclosing functions for direct calls, and walk into nested function/method bodies to detect deeply nested closure variable usage

4.1.0-beta.19

Patch Changes

  • #1312 d72c822 Thanks @NathanColosimo! - Fix bug where the SWC compiler bug prunes step-only imports in the client-mode transformation

4.1.0-beta.18

Patch Changes

4.1.0-beta.17

Patch Changes

4.1.0-beta.16

Patch Changes

  • #901 35a9f0c Thanks @TooTallNate! - Fix module specifier cache bug and add subpath export resolution for package IDs

  • #872 b9c782d Thanks @TooTallNate! - Fix class ID generation when class is bound to a variable

  • #874 b5296a7 Thanks @TooTallNate! - Add discovered serializable classes in all context modes

  • #777 c1d7c8d Thanks @TooTallNate! - Add support for "use step" functions in class instance methods

  • #899 73bf7be Thanks @TooTallNate! - Change compiler ID generation logic to use Node.js import specifiers

    IDs for workflows, steps, and classes now use module specifiers:

    • Local files use ./path/to/file format instead of path/to/file.ext
    • Package files use packageName@version format (e.g., workflow@4.0.1)

    This enables stable IDs across different package.json export conditions.

  • #859 8114792 Thanks @TooTallNate! - Add discovery for custom classes with workflow serialization

4.1.0-beta.15

Minor Changes

  • #621 4966b72 Thanks @pranaygp! - BREAKING: Storage interface is now read-only; all mutations go through events.create()
    • Remove cancel, pause, resume from runs
    • Remove create, update from runs, steps, hooks
    • Add run lifecycle events: run_created, run_started, run_completed, run_failed, run_cancelled
    • Add step_created event type
    • Remove fatal field from step_failed (terminal failure is now implicit)
    • Add step_retrying event with error info for retriable failures

Patch Changes

4.0.1-beta.14

Patch Changes

4.0.1-beta.13

Patch Changes

4.0.1-beta.12

Patch Changes

  • fa37d26: Set workflowId property directly after function declarations
  • f46c51e: Apply workflow transformation with export { fnName } syntax
  • af5b005: Set workflowId property in workflow mode for non-exported workflow functions
  • 43f2dec: Improved workflow registration in workflow mode
    • SWC plugin now emits globalThis.__private_workflows.set(workflowId, fn) directly after setting workflowId
    • Non-exported workflow functions are now properly registered and can be invoked
    • Removed runtime iteration over exports in the workflow bundle - registration happens at transform time
    • Simplified virtual entry generation in base-builder

4.0.1-beta.11

Patch Changes

  • ac7997b: Update to latest swc/core and preserve JSX

4.0.1-beta.10

Patch Changes

  • 555d7a6: Normalize anonymous default export workflow IDs to "default"

4.0.1-beta.9

Patch Changes

  • 5b91861: Apply workflow function transformation in "step" mode
  • 0cacb99: Support nested "use step" declarations in non-workflow functions

4.0.1-beta.8

Patch Changes

  • fb9fd0f: Add support for closure scope vars in step functions
  • 8b470f0: Apply SWC transformation on step functions returned from factory function

4.0.1-beta.7

Patch Changes

  • e5c5236: Fix default export workflow function transformation in workflow mode

4.0.1-beta.6

Patch Changes

  • 5eb588a: Remove step function identifier transform out of swc-plugin and into useStep() runtime function
  • 0b848cd: Fix compiler warnings
  • 45b7b41: Support nested anonymous step functions
  • f8e5d10: Support serializing step function references
  • 8002e0f: Add support for step functions defined as object properties
  • f07b2da: Transform step functions to single useStep() calls
  • aecdcdf: Add support for step functions nested inside of workflow functions

4.0.1-beta.5

Patch Changes

  • 4f9ae4e: Remove step transformation in client mode

4.0.1-beta.4

Patch Changes

  • e0c6618: Specify import path of start function on error in SWC plugin

4.0.1-beta.3

Patch Changes

  • 4a821fc: Fix Windows path handling by normalizing backslashes to forward slashes in workflow IDs
  • 4a821fc: Fix building SWC plugin on Windows

4.0.1-beta.2

Patch Changes

  • f973954: Update license to Apache 2.0

4.0.1-beta.1

Patch Changes

  • 1408293: Add "description" field to package.json file
  • e46294f: Add "license" and "repository" fields to package.json file

4.0.1-beta.0

Patch Changes

  • fcf63d0: Initial publish