@zccz14/ux 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,6 +246,20 @@ One prop, on purpose. There is no `math`, `mermaid`, `components`, `remarkPlugin
|
|
|
246
246
|
|
|
247
247
|
The component wraps its content in `.ux-markdown`, and that block is the family's typographic contract: every size is expressed in `em` off the inherited font size, and no measure is imposed. The same content therefore keeps identical proportions in a 14px chat bubble and a 16px article page. The host decides two things and only two — the font size of the container the content is dropped into, and the width of that container. Do not wrap the component in `prose` classes: the stylesheet is the single source of the look, and `scripts/check-styles.mjs` enforces it.
|
|
248
248
|
|
|
249
|
+
### Server rendering
|
|
250
|
+
|
|
251
|
+
The component renders on a server without waiting for anything: math shows as the source it was
|
|
252
|
+
written as, and diagrams as their fenced block. The client swaps them in once the on-demand chunks
|
|
253
|
+
arrive, and the server snapshot and the first client render agree, so hydration stays silent.
|
|
254
|
+
|
|
255
|
+
If the server render goes through Vite's SSR (`ssrLoadModule`, or a framework built on it), inline
|
|
256
|
+
the package — otherwise Vite externalises it and hands the KaTeX stylesheet import to Node, which
|
|
257
|
+
cannot load `.css`:
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
export default defineConfig({ ssr: { noExternal: ["@zccz14/ux"] } });
|
|
261
|
+
```
|
|
262
|
+
|
|
249
263
|
### Why the pipeline is a runtime dependency
|
|
250
264
|
|
|
251
265
|
`react-markdown`, `remark-gfm`, `remark-math-extended`, `rehype-katex`, `katex` and `mermaid` are `dependencies`, not peers, so an app wires nothing. An app that never renders Markdown tree-shakes the whole chain away, and two pieces are deliberately kept out of the main bundle even for apps that do: Mermaid (loaded by the first diagram, so a surface without one never downloads it) and the math runtime (KaTeX's ~76 KB gzipped JavaScript, loaded by the first surface whose content may contain a formula). What stays static is KaTeX's stylesheet — about 3.6 KB gzipped, with fonts the browser only fetches once a formula is on screen — because a formula must never render unstyled. `scripts/check-package.mjs` fails the build if the manifest ever claims `sideEffects: false`, which would let a bundler drop that stylesheet and render every formula as bare LaTeX with no error to notice.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zccz14/ux",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Unified app shell and Markdown renderer for the NTNL app family: one animated icon sidebar, a fixed-size logo that doubles as the page favicon, the Linkit-integrated AppHeader, and the single Markdown surface every app renders through.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|