File tree Expand file tree Collapse file tree 8 files changed +844
-588
lines changed Expand file tree Collapse file tree 8 files changed +844
-588
lines changed Original file line number Diff line number Diff line change 6
6
jobs :
7
7
Build-and-Publish :
8
8
runs-on : ubuntu-latest
9
+ permissions :
10
+ contents : write
11
+ id-token : write
9
12
steps :
10
- - uses : actions/checkout@v3
13
+ - uses : actions/checkout@v4
11
14
12
- - uses : pnpm/action-setup@v2
15
+ - uses : pnpm/action-setup@v4
13
16
with :
14
17
version : 9
15
- - uses : actions/setup-node@v3
18
+
19
+ - uses : actions/setup-node@v4
16
20
with :
17
- node-version : 18
21
+ node-version : 20
18
22
registry-url : https://registry.npmjs.org
19
23
cache : pnpm
24
+
20
25
- name : Install Dependencies
21
26
run : pnpm i --frozen-lockfile
22
27
23
28
- name : Build & Publish
24
- run : npm publish
29
+ run : npm publish --access public --provenance
25
30
env :
26
31
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
27
32
28
33
- name : Update document
29
- uses : peaceiris/actions-gh-pages@v3
34
+ uses : peaceiris/actions-gh-pages@v4
30
35
with :
31
36
publish_dir : ./docs
32
37
personal_token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -68,17 +68,29 @@ console.log(newVNode);
68
68
69
69
### Node.js & Bun
70
70
71
- ``` jsx
72
- import { Readable } from ' stream ' ;
73
- import { createServer } from ' http ' ;
71
+ #### ` view.tsx `
72
+
73
+ ``` tsx
74
74
import { DOMRenderer } from ' dom-renderer' ;
75
75
76
76
const renderer = new DOMRenderer ();
77
77
78
78
const Hello = () => <h1 >Hello, JSX SSR!</h1 >;
79
79
80
+ export const generateStream = () => renderer .renderToReadableStream (<Hello />);
81
+ ```
82
+
83
+ #### ` index.ts `
84
+
85
+ ``` js
86
+ import { Readable } from ' stream' ;
87
+ import { createServer } from ' http' ;
88
+ import ' dom-renderer/polyfill' ;
89
+
90
+ import { generateStream } from ' ./view' ;
91
+
80
92
createServer ((request , response ) => {
81
- const stream = renderer . renderToReadableStream ( < Hello / > );
93
+ const stream = generateStream ( );
82
94
83
95
Readable .fromWeb (stream).pipe (response);
84
96
}).listen (8080 );
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " dom-renderer" ,
3
- "version" : " 2.3.0 " ,
3
+ "version" : " 2.3.1 " ,
4
4
"license" : " LGPL-3.0-or-later" ,
5
5
6
6
"description" : " A light-weight DOM Renderer supports Web components standard & TypeScript language" ,
25
25
"main" : " dist/index.js" ,
26
26
"dependencies" : {
27
27
"declarative-shadow-dom-polyfill" : " ^0.4.0" ,
28
- "tslib" : " ^2.6.3 " ,
28
+ "tslib" : " ^2.8.0 " ,
29
29
"web-streams-polyfill" : " ^4.0.0" ,
30
- "web-utility" : " ^4.4.0"
30
+ "web-utility" : " ^4.4.1"
31
+ },
32
+ "peerDependencies" : {
33
+ "happy-dom" : " ^14"
31
34
},
32
35
"devDependencies" : {
33
36
"@happy-dom/jest-environment" : " ^14.12.3" ,
34
- "@types/jest" : " ^29.5.12" ,
35
- "@types/node" : " ^18.19.42" ,
36
- "husky" : " ^9.1.2" ,
37
+ "@types/jest" : " ^29.5.14" ,
38
+ "@types/node" : " ^20.17.1" ,
39
+ "happy-dom" : " ^14.12.3" ,
40
+ "husky" : " ^9.1.6" ,
37
41
"jest" : " ^29.7.0" ,
38
- "lint-staged" : " ^15.2.7 " ,
42
+ "lint-staged" : " ^15.2.10 " ,
39
43
"open-cli" : " ^8.0.0" ,
40
44
"prettier" : " ^3.3.3" ,
41
- "ts-jest" : " ^29.2.3 " ,
42
- "typedoc" : " ^0.26.5 " ,
43
- "typedoc-plugin-mdn-links" : " ^3.2.5 " ,
44
- "typescript" : " ~5.5.4 "
45
+ "ts-jest" : " ^29.2.5 " ,
46
+ "typedoc" : " ^0.26.10 " ,
47
+ "typedoc-plugin-mdn-links" : " ^3.3.4 " ,
48
+ "typescript" : " ~5.6.3 "
45
49
},
46
50
"prettier" : {
47
51
"singleQuote" : true ,
You can’t perform that action at this time.
0 commit comments