Skip to content

feat(web-components): generate SSR templates and stylesheets into src/#36259

Merged
janechu merged 9 commits into
microsoft:masterfrom
radium-v:wc-include-templates-in-src
Jun 11, 2026
Merged

feat(web-components): generate SSR templates and stylesheets into src/#36259
janechu merged 9 commits into
microsoft:masterfrom
radium-v:wc-include-templates-in-src

Conversation

@radium-v

Copy link
Copy Markdown
Contributor

Previous Behavior

SSR template HTML and stylesheet CSS were generated at build time and written only to dist/. The output had no presence in src/, was never committed, and contributors had no way to inspect the DSD output without running a build.

New Behavior

SSR templates and stylesheets are now generated next to their *.template.ts / *.styles.ts siblings in src/ and committed to the repo. This makes the DSD output visible during the WC v3 alpha. yarn compile no longer regenerates them; it copies src/**/*.template.html and src/**/*.styles.css into dist/esm/.

yarn generate:ssr runs the harness's generateFTemplates and generateStylesheets with outDir: 'src' and formats the result with Prettier.

yarn check:ssr runs the generators against a staging directory and compares the result to src/ and the working tree. It reports unchanged, created, updated, stale, handEdited, and conflicts, and exits non-zero when stale, hand-edited, or conflicting files appear.

yarn compile is extended to copy src/**/*.template.html and src/**/*.styles.css into dist/esm/ after tsc, preserving subdirectory structure. The old build:ssr, build:ssr:styles, and build:ssr:templates scripts were removed.

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@radium-v radium-v force-pushed the wc-include-templates-in-src branch from a3f8c09 to f57ecfd Compare May 28, 2026 18:17
@radium-v radium-v self-assigned this May 28, 2026
Comment thread packages/web-components/scripts/generate-ssr.js
@radium-v radium-v force-pushed the wc-include-templates-in-src branch from f57ecfd to edcdf0a Compare June 9, 2026 19:34
@radium-v radium-v marked this pull request as ready for review June 9, 2026 19:35
@radium-v radium-v requested review from a team as code owners June 9, 2026 19:35
@radium-v radium-v force-pushed the wc-include-templates-in-src branch from edcdf0a to a352041 Compare June 9, 2026 20:45
Comment thread packages/web-components/src/dialog/dialog.template.html
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@janechu janechu marked this pull request as draft June 11, 2026 20:36
@janechu janechu marked this pull request as ready for review June 11, 2026 21:50
@janechu janechu merged commit 3fc293f into microsoft:master Jun 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants