Skip to content

docs: document SSR transforms for custom directives - #3506

Open
1jackwang wants to merge 1 commit into
vuejs:mainfrom
1jackwang:docs/ssr-directive-transforms-1261
Open

1jackwang wants to merge 1 commit into
vuejs:mainfrom
1jackwang:docs/ssr-directive-transforms-1261

Conversation

@1jackwang

Copy link
Copy Markdown

Description of Problem

Custom directives that add media attributes or inline styles are ignored during SSR unless authors know about runtime getSSRProps or compiler directive transforms. The existing documentation does not explain the compiler API, its AST helpers, or how to render dynamic src, poster, and background-image values.

Proposed Solution

Expand the SSR guide's Custom Directives section to distinguish runtime SSR hooks from build-time transforms. Document the transform signature, parameters, return value, registration, client-build behavior, a runnable media/style example, SSR output verification, and common mistakes.

Additional Information

  • The example was verified with Vue 3.5.45 compiler packages and produced the documented SSR output.
  • pnpm build passes.
  • pnpm type currently fails on an unrelated existing TS2352 error in .vitepress/config.ts:795.
  • No runtime source or public API was changed.

Closes #1261.

@netlify

netlify Bot commented Nov 28, 2026

Copy link
Copy Markdown

👷 Deploy request for vuejs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit bba03a1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSR guide: add directive transforms

1 participant