@tramvai/module-render 5.47.1 → 5.48.0
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/lib/client/renderer.browser.js +19 -0
- package/package.json +15 -16
|
@@ -19,6 +19,7 @@ const ExecuteRenderCallback = ({ children, callback, }) => {
|
|
|
19
19
|
return children;
|
|
20
20
|
};
|
|
21
21
|
const renderer = ({ element, container, callback, log, renderMode }) => {
|
|
22
|
+
// in case of react 19 we should always use hydrateRoot
|
|
22
23
|
if (process.env.__TRAMVAI_CONCURRENT_FEATURES && typeof hydrateRoot === 'function') {
|
|
23
24
|
const wrappedElement = createElement(ExecuteRenderCallback, { callback }, element);
|
|
24
25
|
let allErrors = new Map();
|
|
@@ -37,6 +38,24 @@ const renderer = ({ element, container, callback, log, renderMode }) => {
|
|
|
37
38
|
});
|
|
38
39
|
const hydrateRootFn = () => startTransition(() => {
|
|
39
40
|
hydrateRoot(container(), wrappedElement, {
|
|
41
|
+
onUncaughtError: (error, errorInfo) => {
|
|
42
|
+
log.error({
|
|
43
|
+
event: 'hydrate:on-uncaught-error',
|
|
44
|
+
error,
|
|
45
|
+
errorInfo: {
|
|
46
|
+
componentStack: errorInfo.componentStack,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
onCaughtError: (error, errorInfo) => {
|
|
51
|
+
log.error({
|
|
52
|
+
event: 'hydrate:on-caught-error',
|
|
53
|
+
error,
|
|
54
|
+
errorInfo: {
|
|
55
|
+
componentStack: errorInfo.componentStack,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
},
|
|
40
59
|
onRecoverableError: (error, errorInfo) => {
|
|
41
60
|
const match = (error?.message ?? '').match(reactMinifiedErrorRegex);
|
|
42
61
|
const key = match?.[1] ?? error?.message;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-render",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.48.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"@tinkoff/layout-factory": "0.6.3",
|
|
27
27
|
"@tinkoff/errors": "0.6.2",
|
|
28
28
|
"@tinkoff/url": "0.11.2",
|
|
29
|
-
"@tinkoff/user-agent": "0.7.
|
|
29
|
+
"@tinkoff/user-agent": "0.7.113",
|
|
30
30
|
"@tinkoff/request-core": "^0.10.0",
|
|
31
31
|
"@tinkoff/request-plugin-protocol-http": "^0.12.1",
|
|
32
|
-
"@tramvai/module-client-hints": "5.
|
|
33
|
-
"@tramvai/module-router": "5.
|
|
34
|
-
"@tramvai/react": "5.
|
|
32
|
+
"@tramvai/module-client-hints": "5.48.0",
|
|
33
|
+
"@tramvai/module-router": "5.48.0",
|
|
34
|
+
"@tramvai/react": "5.48.0",
|
|
35
35
|
"@tramvai/safe-strings": "0.8.4",
|
|
36
|
-
"@tramvai/tokens-render": "5.
|
|
37
|
-
"@tramvai/experiments": "5.
|
|
36
|
+
"@tramvai/tokens-render": "5.48.0",
|
|
37
|
+
"@tramvai/experiments": "5.48.0",
|
|
38
38
|
"@types/loadable__server": "^5.12.6",
|
|
39
39
|
"node-fetch": "^2.6.1"
|
|
40
40
|
},
|
|
@@ -42,16 +42,15 @@
|
|
|
42
42
|
"@tinkoff/dippy": "0.11.4",
|
|
43
43
|
"@tinkoff/utils": "^2.1.2",
|
|
44
44
|
"@tinkoff/react-hooks": "0.4.2",
|
|
45
|
-
"@tramvai/cli": "5.
|
|
46
|
-
"@tramvai/core": "5.
|
|
47
|
-
"@tramvai/module-common": "5.
|
|
48
|
-
"@tramvai/state": "5.
|
|
49
|
-
"@tramvai/test-helpers": "5.
|
|
50
|
-
"@tramvai/tokens-common": "5.
|
|
51
|
-
"@tramvai/tokens-router": "5.
|
|
52
|
-
"@tramvai/tokens-server-private": "5.
|
|
45
|
+
"@tramvai/cli": "5.48.0",
|
|
46
|
+
"@tramvai/core": "5.48.0",
|
|
47
|
+
"@tramvai/module-common": "5.48.0",
|
|
48
|
+
"@tramvai/state": "5.48.0",
|
|
49
|
+
"@tramvai/test-helpers": "5.48.0",
|
|
50
|
+
"@tramvai/tokens-common": "5.48.0",
|
|
51
|
+
"@tramvai/tokens-router": "5.48.0",
|
|
52
|
+
"@tramvai/tokens-server-private": "5.48.0",
|
|
53
53
|
"express": "^4.17.1",
|
|
54
|
-
"prop-types": "^15.6.2",
|
|
55
54
|
"react": ">=16.14.0",
|
|
56
55
|
"react-dom": ">=16.14.0",
|
|
57
56
|
"tslib": "^2.4.0"
|