Skip to content

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

Draft
radium-v wants to merge 5 commits into
microsoft:masterfrom
radium-v:wc-include-templates-in-src
Draft

feat(web-components): generate SSR templates and stylesheets into src/#36259
radium-v wants to merge 5 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
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

📊 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
* - `stale` — TS and HTML both at HEAD, but regen disagrees with disk
* (committed state is out of sync — CI failure signal)
* - `handEdited` — HTML differs from HEAD with no TS change; regen would clobber
* - `conflicts` — both TS and HTML differ from HEAD, and regen disagrees with disk
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the resolution process for situations where edits would be clobbered? Do we have that documented somehwere?

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.

2 participants