mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-03 10:37:48 +09:00
## Summary Pin `sanitize-html` to 2.17.5 so deployed server bundles continue using the CommonJS-compatible `htmlparser2@10`. ## Root cause `sanitize-html@2.17.6` is still a CommonJS package but upgraded its parser dependency to ESM-only `htmlparser2@12`. Vercel's Node function loader rejects the resulting `require("htmlparser2")` call with `ERR_REQUIRE_ESM`. ## Technical choice Downgrade one patch release instead of patching third-party code or adding a repository-wide parser override. This keeps the compatibility constraint local to the package that owns `sanitize-html` and preserves the existing sanitization API. There are no migrations or public API changes. ## Todo - [x] Pin `sanitize-html` to 2.17.5 - [x] Regenerate the pnpm lockfile - [x] Verify CommonJS loading and sanitization - [x] Run the affected package tests - [x] Run the affected package typecheck - [x] Check formatting - [x] Run a Vercel standalone build and production-start smoke test - [x] Review documentation impact — no user-facing documentation changes are required - [x] Review fixture impact — no fixture inputs or outputs are affected ## Verification - CommonJS load and sanitization smoke test - `pnpm test` in `packages/sdk-components-react`: 126 passed, 1 skipped - `pnpm typecheck` in `packages/sdk-components-react` - `pnpm exec oxfmt --check packages/sdk-components-react/package.json pnpm-lock.yaml` - Vercel CLI 58.9.3 standalone build with a forced `MarkdownEmbed` server-render path - Production SSR startup and `GET /`: HTTP 200 with the sanitized Markdown heading rendered ## Known limitations This intentionally stays on 2.17.5 until `sanitize-html` and the deployment bundler have a compatible CommonJS/ESM integration.
Webstudio SDK Components
Webstudio SDK is a TypeScript API that lets you use your Webstudio project or some components in your custom codebase or just render a complete Remix Document.
Component Registry Metadata
Webstudio component discovery uses a shadcn-compatible registry item shape with Webstudio-specific metadata stored in meta. The top-level registry fields stay compatible with shadcn conventions, while meta.runtime, meta.authoring, and meta.builder describe Webstudio component ids, props, content models, templates, insertion rules, and Builder/MCP guidance.
This package is not published as an installable shadcn registry yet; the shape is used internally by Builder and MCP discovery.