Bundle serde only files#876
Closed
TooTallNate wants to merge 7 commits into01-13-add_support_for_use_step_functions_in_class_instance_methodsfrom
Closed
Bundle serde only files#876TooTallNate wants to merge 7 commits into01-13-add_support_for_use_step_functions_in_class_instance_methodsfrom
TooTallNate wants to merge 7 commits into01-13-add_support_for_use_step_functions_in_class_instance_methodsfrom
Conversation
🦋 Changeset detectedLatest commit: 549c928 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
🧪 E2E Test Results✅ All tests passed Summary
Details by Category✅ ▲ Vercel Production
❌ Some E2E test jobs failed:
Check the workflow run for details. |
Contributor
This was referenced Jan 28, 2026
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
The SWC transform adds imports like 'workflow/internal/class-serialization' to files for class registration. When these files are inside node_modules packages that don't directly depend on 'workflow', the import fails to resolve. This fix adds an onResolve hook that catches workflow/internal/* imports and resolves them from the project's working directory where 'workflow' is installed, rather than from the file's location in node_modules.
Use import specifiers instead of file paths for class IDs, ensuring consistent serialization across different export conditions (import vs workflow). Package imports like 'just-bash' now generate IDs in the format 'class//just-bash//ClassName' regardless of which file the condition resolves to. - Add packagePath parameter to SWC plugin transform - Track package imports in esbuild plugin to determine specifier - Add 'workflow' condition to enhanced-resolve for optimal entry points - Skip serde-only transforms for external packages in rollup - Add just-bash to workbench for testing workflow export conditions
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add a new fixture test that demonstrates all ID types (workflow, step, class) using package paths instead of file paths when package_path is provided. - Add package-based-ids fixture with test input and expected outputs - Update fixture.rs to pass package_path='my-package' for this specific test - Update spec.md to document that all IDs (not just classes) use package names
Two issues fixed for the Vite dev server:
1. Steps not found: The step bundle had its own 'registeredSteps' Map, but
stepEntrypoint was imported externally and used a different Map. Fixed by
using a global registry via Symbol.for('workflow-step-registry') so both
the bundled code and external stepEntrypoint share the same registry.
2. Class serialization missing classId: When a package like 'just-bash' has
serde patterns, its import was kept external while the serde file was
bundled separately, creating two different class instances. Fixed by:
- Tracking which packages have serde patterns during discovery
- Not externalizing imports from packages with serde patterns
- This ensures the class used in user code is the same one that gets
registered for serialization
The first step (createBash) now succeeds and properly serializes the Bash
instance. A remaining issue exists where the workflow bundle uses a lightweight
Bash class without the exec() method - this is expected behavior for production
but causes issues in dev mode. This will be addressed in a separate change.
This was referenced Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Bundle serde-only files in workflow builds to ensure proper serialization/deserialization.
What changed?
Modified the builder to include serde-only files in the bundle instead of externalizing them. This change affects three different build configurations:
How to test?
Why make this change?
When serde files were externalized, node_modules serde classes weren't properly bundled, which could cause serialization/deserialization issues. This change ensures that all necessary serde classes are included in the bundle, maintaining proper data handling across workflow executions.