@verajs/ssr 0.1.1 → 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/LICENSE +21 -0
- package/package.json +2 -2
- package/src/vera/index.js +12 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Brian Grider
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verajs/ssr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Vera-native server-side rendering. Node-only, plain ESM, zero dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "git+https://github.com/vera-js/vera.git",
|
|
9
9
|
"directory": "packages/ssr"
|
|
10
10
|
},
|
|
11
|
-
"author": "
|
|
11
|
+
"author": "Brian Grider <hello@verajs.com>",
|
|
12
12
|
"homepage": "https://verajs.dev",
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "./src/vera/index.js",
|
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) => {
|