Add documentation for custom class serialization#810
Conversation
🦋 Changeset detectedLatest commit: 9830710 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (56 failed)mongodb (3 failed):
redis (2 failed):
turso (51 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
cbe3550 to
9020264
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation for the custom class serialization feature using the new @workflow/serde package. The documentation explains how developers can make their custom classes serializable in workflows by implementing WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE symbols.
Changes:
- Added a new "Custom Class Serialization" section to the serialization documentation with examples showing basic and complex usage patterns
- Updated the docs-typecheck extractor to support MDX-style comments for
@expect-errorannotations in addition to HTML comments - Added the
@workflow/serdepackage to the API reference navigation and index
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/docs-typecheck/src/extractor.ts |
Enhanced regex to support both HTML and MDX comment formats for @expect-error annotations |
docs/content/docs/foundations/serialization.mdx |
Added comprehensive documentation section explaining custom class serialization with code examples |
docs/content/docs/api-reference/meta.json |
Added workflow-serde to the API reference pages list |
docs/content/docs/api-reference/index.mdx |
Added Card component linking to the @workflow/serde package documentation |
.changeset/smooth-nails-do.md |
Empty changeset file (acceptable for documentation-only changes) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
199d665 to
feb442f
Compare
…mentation_for_custom_class_serialization
…tance methods - Add custom classes to Supported Serializable Types with anchor link - Replace verbose parenthetical in Requirements with back-link - Add [!code highlight] to Basic Example serde methods - Simplify geometry.ts to import Point instead of redefining it - Rewrite Complex Example to demonstrate 'use step' on instance methods with realistic APIs (database, HTTP) and contrast with workflow-context methods - Add pass-by-value note for 'this' context with return-and-reassign pattern
Add @skip-typecheck to bare static method signatures that aren't valid standalone TypeScript.
| const CODE_BLOCK_REGEX = | ||
| /```(typescript|ts|javascript|js)(?:[^\S\n]+[^\n]*)?\n([\s\S]*?)```/g; | ||
| const EXPECT_ERROR_REGEX = /<!--\s*@expect-error:([0-9,\s]+)\s*-->/; | ||
| // Support both HTML comments (<!-- @expect-error:2351 -->) and MDX comments ({/* @expect-error:2351 */}) |
There was a problem hiding this comment.
what is this change for?
There was a problem hiding this comment.
The @expect-error marker only supported HTML comment syntax (<!-- @expect-error:2351 -->), which was sufficient since the only prior usage was in a .md file (the docs-typecheck README). However, MDX files do not support HTML comments — the MDX parser rejects <!-- with "Unexpected character !". Since the serialization docs are .mdx files and need @expect-error markers, this adds support for the MDX comment syntax ({/* @expect-error:2351 */}) as an alternative. The @skip-typecheck marker already supported both formats.
The docs typecheck extractor only supports HTML comment syntax for
@expect-error on main. Use <!-- @expect-error:XXXX --> instead of
{/* @expect-error:XXXX */} to match the existing convention.
…extractor
MDX files don't support HTML comments (<!-- -->). The extractor's
@expect-error regex only supported HTML syntax, but @skip-typecheck
already supported both. This aligns @expect-error to also support
the MDX comment syntax ({/* @expect-error:XXXX */}).

Added documentation for custom class serialization in workflows with new
@workflow/serdepackage.What changed?
@workflow/serdepackage that provides serialization symbols for custom class serialization@workflow/serdepackage to the API reference navigationWhy make this change?
Custom class serialization is an important feature for workflows that need to work with complex data structures. This documentation explains how developers can make their own classes serializable using the
WORKFLOW_SERIALIZEandWORKFLOW_DESERIALIZEsymbols from the new@workflow/serdepackage, enabling seamless passing of class instances between workflow and step functions.