@verajs/ssr 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/vera/index.js +12 -1
package/package.json
CHANGED
package/src/vera/index.js
CHANGED
|
@@ -15,7 +15,18 @@ import { installShims, registry, hoistedStyles } from './shim.js';
|
|
|
15
15
|
import { serializeTemplate } from './serializer.js';
|
|
16
16
|
|
|
17
17
|
installShims();
|
|
18
|
-
const { setRenderer } = await import('@verajs/core');
|
|
18
|
+
const { setRenderer, insert } = await import('@verajs/core');
|
|
19
|
+
/**
|
|
20
|
+
* `static styles` moved out of core in 0.2.0 (`@verajs/styles`). Server rendering must still
|
|
21
|
+
* serialize them — the markup a browser produces includes the component's styles — and nothing on
|
|
22
|
+
* the server cares about the bytes, so SSR wires the adopter unconditionally rather than making
|
|
23
|
+
* every caller remember to.
|
|
24
|
+
*
|
|
25
|
+
* `insert` comes from core, not from `@verajs/inserts`, so the registration lands in the map core
|
|
26
|
+
* actually reads. Exactly why `setRenderer` above is taken from core too.
|
|
27
|
+
*/
|
|
28
|
+
const { adoptStyles } = await import('@verajs/styles');
|
|
29
|
+
insert('init', adoptStyles, 50);
|
|
19
30
|
|
|
20
31
|
/** The server renderer: template object in, markup into the (shadow) container shim. */
|
|
21
32
|
setRenderer((template, container) => {
|