@tramvai/module-render 2.143.1 → 2.145.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.
|
@@ -37,7 +37,7 @@ class HtmlWritable extends Writable {
|
|
|
37
37
|
styles.forEach((s) => {
|
|
38
38
|
html.push(`<link rel="stylesheet" href="${genHref(s)}" crossorigin="anonymous" data-critical="true" />`);
|
|
39
39
|
});
|
|
40
|
-
//
|
|
40
|
+
// synchronous script, we can't use async here, will lead to hydration mismatch
|
|
41
41
|
scripts.forEach((s) => {
|
|
42
42
|
html.push(`<script src="${genHref(s)}" charset="utf-8" crossorigin="anonymous" data-critical="true"></script>`);
|
|
43
43
|
});
|
|
@@ -46,11 +46,10 @@ class HtmlWritable extends Writable {
|
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
const html = chunk.toString('utf-8');
|
|
50
49
|
// delay writing HTML to response stream
|
|
51
50
|
// @todo some priorities, to prevent conflicts with deferred actions scripts?
|
|
52
51
|
this.responseTaskManager.push(async () => {
|
|
53
|
-
this.responseStream.push(
|
|
52
|
+
this.responseStream.push(chunk);
|
|
54
53
|
});
|
|
55
54
|
callback();
|
|
56
55
|
}
|
|
@@ -45,7 +45,7 @@ class HtmlWritable extends stream.Writable {
|
|
|
45
45
|
styles.forEach((s) => {
|
|
46
46
|
html.push(`<link rel="stylesheet" href="${genHref(s)}" crossorigin="anonymous" data-critical="true" />`);
|
|
47
47
|
});
|
|
48
|
-
//
|
|
48
|
+
// synchronous script, we can't use async here, will lead to hydration mismatch
|
|
49
49
|
scripts.forEach((s) => {
|
|
50
50
|
html.push(`<script src="${genHref(s)}" charset="utf-8" crossorigin="anonymous" data-critical="true"></script>`);
|
|
51
51
|
});
|
|
@@ -54,11 +54,10 @@ class HtmlWritable extends stream.Writable {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
const html = chunk.toString('utf-8');
|
|
58
57
|
// delay writing HTML to response stream
|
|
59
58
|
// @todo some priorities, to prevent conflicts with deferred actions scripts?
|
|
60
59
|
this.responseTaskManager.push(async () => {
|
|
61
|
-
this.responseStream.push(
|
|
60
|
+
this.responseStream.push(chunk);
|
|
62
61
|
});
|
|
63
62
|
callback();
|
|
64
63
|
}
|
package/lib/server.es.js
CHANGED
|
@@ -209,7 +209,7 @@ Page Error Boundary will be rendered for the client`,
|
|
|
209
209
|
customRender: { token: CUSTOM_RENDER, optional: true },
|
|
210
210
|
extendRender: { token: EXTEND_RENDER, optional: true },
|
|
211
211
|
di: DI_TOKEN,
|
|
212
|
-
renderMode:
|
|
212
|
+
renderMode: optional(REACT_SERVER_RENDER_MODE),
|
|
213
213
|
logger: LOGGER_TOKEN,
|
|
214
214
|
responseTaskManager: SERVER_RESPONSE_TASK_MANAGER,
|
|
215
215
|
responseStream: SERVER_RESPONSE_STREAM,
|
package/lib/server.js
CHANGED
|
@@ -210,7 +210,7 @@ Page Error Boundary will be rendered for the client`,
|
|
|
210
210
|
customRender: { token: tokensRender.CUSTOM_RENDER, optional: true },
|
|
211
211
|
extendRender: { token: tokensRender.EXTEND_RENDER, optional: true },
|
|
212
212
|
di: core.DI_TOKEN,
|
|
213
|
-
renderMode:
|
|
213
|
+
renderMode: dippy.optional(tokensRender.REACT_SERVER_RENDER_MODE),
|
|
214
214
|
logger: tokensCommon.LOGGER_TOKEN,
|
|
215
215
|
responseTaskManager: tokensServerPrivate.SERVER_RESPONSE_TASK_MANAGER,
|
|
216
216
|
responseStream: tokensServerPrivate.SERVER_RESPONSE_STREAM,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-render",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.145.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"@tinkoff/layout-factory": "0.3.8",
|
|
27
27
|
"@tinkoff/errors": "0.3.8",
|
|
28
28
|
"@tinkoff/url": "0.8.6",
|
|
29
|
-
"@tinkoff/user-agent": "0.4.
|
|
30
|
-
"@tramvai/module-client-hints": "2.
|
|
31
|
-
"@tramvai/module-router": "2.
|
|
32
|
-
"@tramvai/react": "2.
|
|
33
|
-
"@tramvai/safe-strings": "0.5.
|
|
34
|
-
"@tramvai/tokens-render": "2.
|
|
35
|
-
"@tramvai/experiments": "2.
|
|
29
|
+
"@tinkoff/user-agent": "0.4.423",
|
|
30
|
+
"@tramvai/module-client-hints": "2.145.1",
|
|
31
|
+
"@tramvai/module-router": "2.145.1",
|
|
32
|
+
"@tramvai/react": "2.145.1",
|
|
33
|
+
"@tramvai/safe-strings": "0.5.12",
|
|
34
|
+
"@tramvai/tokens-render": "2.145.1",
|
|
35
|
+
"@tramvai/experiments": "2.145.1",
|
|
36
36
|
"@types/loadable__server": "^5.12.6",
|
|
37
37
|
"node-fetch": "^2.6.1"
|
|
38
38
|
},
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@tinkoff/dippy": "0.8.15",
|
|
41
41
|
"@tinkoff/utils": "^2.1.2",
|
|
42
42
|
"@tinkoff/react-hooks": "0.1.6",
|
|
43
|
-
"@tramvai/cli": "2.
|
|
44
|
-
"@tramvai/core": "2.
|
|
45
|
-
"@tramvai/module-common": "2.
|
|
46
|
-
"@tramvai/state": "2.
|
|
47
|
-
"@tramvai/test-helpers": "2.
|
|
48
|
-
"@tramvai/tokens-common": "2.
|
|
49
|
-
"@tramvai/tokens-router": "2.
|
|
50
|
-
"@tramvai/tokens-server-private": "2.
|
|
43
|
+
"@tramvai/cli": "2.145.1",
|
|
44
|
+
"@tramvai/core": "2.145.1",
|
|
45
|
+
"@tramvai/module-common": "2.145.1",
|
|
46
|
+
"@tramvai/state": "2.145.1",
|
|
47
|
+
"@tramvai/test-helpers": "2.145.1",
|
|
48
|
+
"@tramvai/tokens-common": "2.145.1",
|
|
49
|
+
"@tramvai/tokens-router": "2.145.1",
|
|
50
|
+
"@tramvai/tokens-server-private": "2.145.1",
|
|
51
51
|
"express": "^4.17.1",
|
|
52
52
|
"prop-types": "^15.6.2",
|
|
53
53
|
"react": ">=16.14.0",
|