File tree Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 2
2
/dist
3
3
.pnpm-debug.log
4
4
/coverage
5
- .DS_Store
5
+ .DS_Store
6
+
7
+ example.html
Original file line number Diff line number Diff line change 1
1
{
2
+ "dist/index.d.ts" : {
3
+ "size" : " 79B" ,
4
+ "brotli" : " 57B" ,
5
+ "gzip" : " 82B"
6
+ },
2
7
"dist/index.js" : {
3
- "size" : " 3.039KB " ,
4
- "brotli" : " 955B " ,
5
- "gzip" : " 1.081KB "
8
+ "size" : " 2.811KB " ,
9
+ "brotli" : " 898B " ,
10
+ "gzip" : " 1.031KB "
6
11
},
7
12
"dist/index.mjs" : {
8
- "size" : " 2.041KB " ,
9
- "brotli" : " 599B " ,
10
- "gzip" : " 703B "
13
+ "size" : " 1.813KB " ,
14
+ "brotli" : " 563B " ,
15
+ "gzip" : " 653B "
11
16
}
12
17
}
Original file line number Diff line number Diff line change 3
3
const { renderToString } = require ( '../dist/index.js' )
4
4
const fs = require ( 'fs' )
5
5
6
- let html , reactive , pretty
6
+ let html , reactive
7
7
8
8
async function importArrow ( ) {
9
9
const mod = await import ( '@arrow-js/core' )
10
- const pmod = await import ( 'pretty-bytes' )
11
10
html = mod . html
12
11
reactive = mod . reactive
13
- pretty = pmod . default
14
12
return
15
13
}
16
14
@@ -35,15 +33,15 @@ importArrow().then(_ => {
35
33
36
34
const links = Array . from ( new Array ( 10000 ) . fill ( 0 ) ) . map ( ( x , ind ) => ind )
37
35
const outerLinks = Array . from ( new Array ( 100 ) . fill ( 0 ) ) . map ( ( x , ind ) => ind )
36
+ const outerLinkComponents = outerLinks . map (
37
+ _ => html `< li > ${ links . map ( y => html `< p > ${ y } </ p > ` ) } </ li > `
38
+ )
38
39
const NavBar = ( ) =>
39
40
html `
40
41
< header >
41
42
< nav >
42
43
< ul >
43
- ${ ( ) =>
44
- outerLinks . map (
45
- _ => html `< li > ${ links . map ( y => html `< p > ${ y } </ p > ` ) } </ li > `
46
- ) }
44
+ ${ outerLinkComponents }
47
45
</ ul >
48
46
</ nav >
49
47
</ header >
@@ -58,8 +56,8 @@ importArrow().then(_ => {
58
56
< button @click ="${ ( ) => ( state . count += 1 ) } "> ${ ( ) => state . count } </ button >
59
57
`
60
58
}
61
-
62
- const out = renderToString ( NavBar ( ) )
59
+ const template = NavBar ( )
60
+ const out = renderToString ( template )
63
61
const str = fs . createWriteStream ( 'example.html' , 'utf8' )
64
62
str . write ( out )
65
63
str . end ( )
You can’t perform that action at this time.
0 commit comments