Skip to content

Commit f57ecfd

Browse files
committed
update readme with dsd generation details
1 parent 2d78b30 commit f57ecfd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/web-components/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ import CEM from '@fluentui/custom-elements.json' with { type: 'json' };
8888

8989
To start the component development environment, run `yarn start`.
9090

91+
### SSR templates and stylesheets
92+
93+
Each component ships a declarative-shadow-DOM template (`*.template.html`) and an extracted stylesheet (`*.styles.css`) next to its `*.template.ts` and `*.styles.ts` sources. These files are generated from the TypeScript sources and committed to the repo so the DSD output is visible without running a build.
94+
95+
After editing a `*.template.ts` or `*.styles.ts`, regenerate the matching HTML and CSS with:
96+
97+
```sh
98+
yarn generate:ssr
99+
```
100+
101+
To check that the committed files match what the generators would produce (for example, before opening a PR), run:
102+
103+
```sh
104+
yarn check:ssr
105+
```
106+
107+
`yarn compile` does not regenerate these files; it copies them from `src/` into `dist/esm/` alongside the compiled JS.
108+
91109
### Known issue with Storybook site hot-reloading during development
92110

93111
Storybook will watch modules for changes and hot-reload the module when necessary. This is usually great but poses a problem when the module being hot-reloaded defines a custom element. A custom element name can only be defined by the `CustomElementsRegistry` once, so reloading a module that defines a custom element will attempt to re-register the custom element name, throwing an error because the name has already been defined. This error will manifest with the following message:

0 commit comments

Comments
 (0)