@tramvai/cli 5.47.1 → 5.49.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.
- package/lib/library/webpack/loaders/root-error-boundary-loader/index.js +3 -3
- package/lib/library/webpack/loaders/root-error-boundary-loader/index.js.map +1 -1
- package/lib/schema/autogeneratedSchema.json +15 -15
- package/lib/utils/shouldUseReactRoot.js +2 -2
- package/lib/utils/shouldUseReactRoot.js.map +1 -1
- package/package.json +7 -7
- package/schema.json +15 -15
- package/src/api/benchmark/__integration__/__fixtures__/app/index.tsx +2 -2
- package/src/api/build/__integration__/__fixtures__/app/index.tsx +3 -4
- package/src/api/start/__integration__/__fixtures__/app/index.tsx +2 -2
- package/src/api/start/__integration__/start.test.ts +0 -1
- package/src/library/swc/__integration__/__snapshots__/swc.build.test.ts.snap +32 -16
- package/src/library/webpack/loaders/root-error-boundary-loader/index.ts +3 -3
- package/src/schema/autogeneratedSchema.json +15 -15
- package/src/utils/shouldUseReactRoot.ts +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const shouldUseReactRoot_1 = require("../../../../utils/shouldUseReactRoot");
|
|
4
4
|
const COMPONENT_NAME = 'RootErrorBoundary';
|
|
5
|
-
const
|
|
5
|
+
const REACT_HYDRATE_ROOT_CODE = `
|
|
6
6
|
const { hydrateRoot } = require('react-dom/client')
|
|
7
7
|
|
|
8
8
|
hydrateRoot(
|
|
@@ -10,7 +10,7 @@ hydrateRoot(
|
|
|
10
10
|
<${COMPONENT_NAME} error={window.serverError} url={window.serverUrl} />,
|
|
11
11
|
);
|
|
12
12
|
`;
|
|
13
|
-
const
|
|
13
|
+
const REACT_HYDRATE_CODE = `
|
|
14
14
|
const { hydrate } = require('react-dom')
|
|
15
15
|
|
|
16
16
|
hydrate(
|
|
@@ -25,7 +25,7 @@ const rootErrorBoundaryLoader = function (content) {
|
|
|
25
25
|
// We don't need hydration code on the server
|
|
26
26
|
if (options.buildType === 'client') {
|
|
27
27
|
const IMPORT_CODE = `import ${COMPONENT_NAME} from "${options.path}"\n`;
|
|
28
|
-
const HYDRATION_CODE = (0, shouldUseReactRoot_1.shouldUseReactRoot)() ?
|
|
28
|
+
const HYDRATION_CODE = (0, shouldUseReactRoot_1.shouldUseReactRoot)() ? REACT_HYDRATE_ROOT_CODE : REACT_HYDRATE_CODE;
|
|
29
29
|
return IMPORT_CODE.concat(HYDRATION_CODE);
|
|
30
30
|
}
|
|
31
31
|
return content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/library/webpack/loaders/root-error-boundary-loader/index.ts"],"names":[],"mappings":";;AAGA,6EAA0E;AAO1E,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,uBAAuB,GAAG;;;;;KAK3B,cAAc;;CAElB,CAAC;AACF,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/library/webpack/loaders/root-error-boundary-loader/index.ts"],"names":[],"mappings":";;AAGA,6EAA0E;AAO1E,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,uBAAuB,GAAG;;;;;KAK3B,cAAc;;CAElB,CAAC;AACF,MAAM,kBAAkB,GAAG;;;;KAItB,cAAc;;;CAGlB,CAAC;AAEF,sCAAsC;AACtC,MAAM,uBAAuB,GAA8B,UAAU,OAAO;IAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAElC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEtB,6CAA6C;IAC7C,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;QAClC,MAAM,WAAW,GAAG,UAAU,cAAc,UAAU,OAAO,CAAC,IAAI,KAAK,CAAC;QACxE,MAAM,cAAc,GAAG,IAAA,uCAAkB,GAAE,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,kBAAkB,CAAC;QAE3F,OAAO,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;KAC3C;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
|
|
@@ -1236,23 +1236,23 @@
|
|
|
1236
1236
|
"dotAll": {
|
|
1237
1237
|
"type": "boolean"
|
|
1238
1238
|
},
|
|
1239
|
-
"__@match@
|
|
1239
|
+
"__@match@7844": {
|
|
1240
1240
|
"type": "object",
|
|
1241
1241
|
"additionalProperties": false
|
|
1242
1242
|
},
|
|
1243
|
-
"__@replace@
|
|
1243
|
+
"__@replace@7846": {
|
|
1244
1244
|
"type": "object",
|
|
1245
1245
|
"additionalProperties": false
|
|
1246
1246
|
},
|
|
1247
|
-
"__@search@
|
|
1247
|
+
"__@search@7849": {
|
|
1248
1248
|
"type": "object",
|
|
1249
1249
|
"additionalProperties": false
|
|
1250
1250
|
},
|
|
1251
|
-
"__@split@
|
|
1251
|
+
"__@split@7851": {
|
|
1252
1252
|
"type": "object",
|
|
1253
1253
|
"additionalProperties": false
|
|
1254
1254
|
},
|
|
1255
|
-
"__@matchAll@
|
|
1255
|
+
"__@matchAll@7853": {
|
|
1256
1256
|
"type": "object",
|
|
1257
1257
|
"additionalProperties": false
|
|
1258
1258
|
}
|
|
@@ -1987,23 +1987,23 @@
|
|
|
1987
1987
|
"dotAll": {
|
|
1988
1988
|
"type": "boolean"
|
|
1989
1989
|
},
|
|
1990
|
-
"__@match@
|
|
1990
|
+
"__@match@7844": {
|
|
1991
1991
|
"type": "object",
|
|
1992
1992
|
"additionalProperties": false
|
|
1993
1993
|
},
|
|
1994
|
-
"__@replace@
|
|
1994
|
+
"__@replace@7846": {
|
|
1995
1995
|
"type": "object",
|
|
1996
1996
|
"additionalProperties": false
|
|
1997
1997
|
},
|
|
1998
|
-
"__@search@
|
|
1998
|
+
"__@search@7849": {
|
|
1999
1999
|
"type": "object",
|
|
2000
2000
|
"additionalProperties": false
|
|
2001
2001
|
},
|
|
2002
|
-
"__@split@
|
|
2002
|
+
"__@split@7851": {
|
|
2003
2003
|
"type": "object",
|
|
2004
2004
|
"additionalProperties": false
|
|
2005
2005
|
},
|
|
2006
|
-
"__@matchAll@
|
|
2006
|
+
"__@matchAll@7853": {
|
|
2007
2007
|
"type": "object",
|
|
2008
2008
|
"additionalProperties": false
|
|
2009
2009
|
}
|
|
@@ -2738,23 +2738,23 @@
|
|
|
2738
2738
|
"dotAll": {
|
|
2739
2739
|
"type": "boolean"
|
|
2740
2740
|
},
|
|
2741
|
-
"__@match@
|
|
2741
|
+
"__@match@7844": {
|
|
2742
2742
|
"type": "object",
|
|
2743
2743
|
"additionalProperties": false
|
|
2744
2744
|
},
|
|
2745
|
-
"__@replace@
|
|
2745
|
+
"__@replace@7846": {
|
|
2746
2746
|
"type": "object",
|
|
2747
2747
|
"additionalProperties": false
|
|
2748
2748
|
},
|
|
2749
|
-
"__@search@
|
|
2749
|
+
"__@search@7849": {
|
|
2750
2750
|
"type": "object",
|
|
2751
2751
|
"additionalProperties": false
|
|
2752
2752
|
},
|
|
2753
|
-
"__@split@
|
|
2753
|
+
"__@split@7851": {
|
|
2754
2754
|
"type": "object",
|
|
2755
2755
|
"additionalProperties": false
|
|
2756
2756
|
},
|
|
2757
|
-
"__@matchAll@
|
|
2757
|
+
"__@matchAll@7853": {
|
|
2758
2758
|
"type": "object",
|
|
2759
2759
|
"additionalProperties": false
|
|
2760
2760
|
}
|
|
@@ -9,8 +9,8 @@ exports.shouldUseReactRoot = (0, once_1.default)(() => {
|
|
|
9
9
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
10
|
const reactVersion = require('react').version;
|
|
11
11
|
const isReactExperimental = reactVersion && /0\.0\.0-experimental/.test(reactVersion);
|
|
12
|
-
const
|
|
12
|
+
const hasReact18orHigher = reactVersion &&
|
|
13
13
|
(semver_1.default.gte(reactVersion, '18.0.0') || semver_1.default.coerce(reactVersion)?.version === '18.0.0');
|
|
14
|
-
return Boolean(
|
|
14
|
+
return Boolean(hasReact18orHigher || isReactExperimental);
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=shouldUseReactRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldUseReactRoot.js","sourceRoot":"","sources":["../../src/utils/shouldUseReactRoot.ts"],"names":[],"mappings":";;;;AAAA,gFAAgD;AAChD,4DAA4B;AAE5B,8FAA8F;AACjF,QAAA,kBAAkB,GAAG,IAAA,cAAI,EAAC,GAAG,EAAE;IAC1C,6DAA6D;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAC9C,MAAM,mBAAmB,GAAG,YAAY,IAAI,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtF,MAAM,
|
|
1
|
+
{"version":3,"file":"shouldUseReactRoot.js","sourceRoot":"","sources":["../../src/utils/shouldUseReactRoot.ts"],"names":[],"mappings":";;;;AAAA,gFAAgD;AAChD,4DAA4B;AAE5B,8FAA8F;AACjF,QAAA,kBAAkB,GAAG,IAAA,cAAI,EAAC,GAAG,EAAE;IAC1C,6DAA6D;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAC9C,MAAM,mBAAmB,GAAG,YAAY,IAAI,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtF,MAAM,kBAAkB,GACtB,YAAY;QACZ,CAAC,gBAAM,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,gBAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC;IAE5F,OAAO,OAAO,CAAC,kBAAkB,IAAI,mBAAmB,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.49.1",
|
|
4
4
|
"description": "Cli инструмент для сборки и запуска приложений",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@tinkoff/browserslist-config": "0.5.3",
|
|
67
67
|
"@tinkoff/dippy": "0.11.4",
|
|
68
68
|
"@tinkoff/is-modern-lib": "5.0.2",
|
|
69
|
-
"@tinkoff/logger": "0.10.
|
|
69
|
+
"@tinkoff/logger": "0.10.507",
|
|
70
70
|
"@tinkoff/minicss-class-generator": "0.5.2",
|
|
71
71
|
"@tinkoff/package-manager-wrapper": "0.4.4",
|
|
72
72
|
"@tinkoff/request-core": "^0.10.0",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"@tinkoff/utils": "^2.1.3",
|
|
76
76
|
"@tinkoff/webpack-dedupe-plugin": "4.0.3",
|
|
77
77
|
"@tramvai/build": "6.1.1",
|
|
78
|
-
"@tramvai/react": "5.
|
|
79
|
-
"@tramvai/tools-check-versions": "0.7.
|
|
80
|
-
"@tramvai/tools-migrate": "0.9.
|
|
78
|
+
"@tramvai/react": "5.49.1",
|
|
79
|
+
"@tramvai/tools-check-versions": "0.7.8",
|
|
80
|
+
"@tramvai/tools-migrate": "0.9.9",
|
|
81
81
|
"ajv": "^8.12.0",
|
|
82
82
|
"ansi-escapes": "^4.3.2",
|
|
83
83
|
"autoprefixer": "^10.4.8",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"process": "^0.11.10",
|
|
148
148
|
"promise-queue": "^2.2.5",
|
|
149
149
|
"proper-lockfile": "^4.1.2",
|
|
150
|
-
"react-refresh": "^0.
|
|
150
|
+
"react-refresh": "^0.16.0",
|
|
151
151
|
"resolve": "^1.22.4",
|
|
152
152
|
"rimraf": "^3.0.2",
|
|
153
153
|
"semver": "^7.3.7",
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
"@types/webpack-dev-middleware": "^5.0.2",
|
|
201
201
|
"@types/webpack-stats-plugin": "^0.3.2",
|
|
202
202
|
"babel-plugin-tester": "^10.1.0",
|
|
203
|
-
"react": "
|
|
203
|
+
"react": "19.0.0",
|
|
204
204
|
"sharp": "0.32.6"
|
|
205
205
|
},
|
|
206
206
|
"peerDependencies": {
|
package/schema.json
CHANGED
|
@@ -1258,23 +1258,23 @@
|
|
|
1258
1258
|
"dotAll": {
|
|
1259
1259
|
"type": "boolean"
|
|
1260
1260
|
},
|
|
1261
|
-
"__@match@
|
|
1261
|
+
"__@match@7844": {
|
|
1262
1262
|
"type": "object",
|
|
1263
1263
|
"additionalProperties": false
|
|
1264
1264
|
},
|
|
1265
|
-
"__@replace@
|
|
1265
|
+
"__@replace@7846": {
|
|
1266
1266
|
"type": "object",
|
|
1267
1267
|
"additionalProperties": false
|
|
1268
1268
|
},
|
|
1269
|
-
"__@search@
|
|
1269
|
+
"__@search@7849": {
|
|
1270
1270
|
"type": "object",
|
|
1271
1271
|
"additionalProperties": false
|
|
1272
1272
|
},
|
|
1273
|
-
"__@split@
|
|
1273
|
+
"__@split@7851": {
|
|
1274
1274
|
"type": "object",
|
|
1275
1275
|
"additionalProperties": false
|
|
1276
1276
|
},
|
|
1277
|
-
"__@matchAll@
|
|
1277
|
+
"__@matchAll@7853": {
|
|
1278
1278
|
"type": "object",
|
|
1279
1279
|
"additionalProperties": false
|
|
1280
1280
|
}
|
|
@@ -2018,23 +2018,23 @@
|
|
|
2018
2018
|
"dotAll": {
|
|
2019
2019
|
"type": "boolean"
|
|
2020
2020
|
},
|
|
2021
|
-
"__@match@
|
|
2021
|
+
"__@match@7844": {
|
|
2022
2022
|
"type": "object",
|
|
2023
2023
|
"additionalProperties": false
|
|
2024
2024
|
},
|
|
2025
|
-
"__@replace@
|
|
2025
|
+
"__@replace@7846": {
|
|
2026
2026
|
"type": "object",
|
|
2027
2027
|
"additionalProperties": false
|
|
2028
2028
|
},
|
|
2029
|
-
"__@search@
|
|
2029
|
+
"__@search@7849": {
|
|
2030
2030
|
"type": "object",
|
|
2031
2031
|
"additionalProperties": false
|
|
2032
2032
|
},
|
|
2033
|
-
"__@split@
|
|
2033
|
+
"__@split@7851": {
|
|
2034
2034
|
"type": "object",
|
|
2035
2035
|
"additionalProperties": false
|
|
2036
2036
|
},
|
|
2037
|
-
"__@matchAll@
|
|
2037
|
+
"__@matchAll@7853": {
|
|
2038
2038
|
"type": "object",
|
|
2039
2039
|
"additionalProperties": false
|
|
2040
2040
|
}
|
|
@@ -2778,23 +2778,23 @@
|
|
|
2778
2778
|
"dotAll": {
|
|
2779
2779
|
"type": "boolean"
|
|
2780
2780
|
},
|
|
2781
|
-
"__@match@
|
|
2781
|
+
"__@match@7844": {
|
|
2782
2782
|
"type": "object",
|
|
2783
2783
|
"additionalProperties": false
|
|
2784
2784
|
},
|
|
2785
|
-
"__@replace@
|
|
2785
|
+
"__@replace@7846": {
|
|
2786
2786
|
"type": "object",
|
|
2787
2787
|
"additionalProperties": false
|
|
2788
2788
|
},
|
|
2789
|
-
"__@search@
|
|
2789
|
+
"__@search@7849": {
|
|
2790
2790
|
"type": "object",
|
|
2791
2791
|
"additionalProperties": false
|
|
2792
2792
|
},
|
|
2793
|
-
"__@split@
|
|
2793
|
+
"__@split@7851": {
|
|
2794
2794
|
"type": "object",
|
|
2795
2795
|
"additionalProperties": false
|
|
2796
2796
|
},
|
|
2797
|
-
"__@matchAll@
|
|
2797
|
+
"__@matchAll@7853": {
|
|
2798
2798
|
"type": "object",
|
|
2799
2799
|
"additionalProperties": false
|
|
2800
2800
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
3
3
|
import App from './App';
|
|
4
4
|
|
|
5
5
|
const bundlesMap = {
|
|
@@ -17,4 +17,4 @@ if (url.searchParams.has('bundle')) {
|
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
hydrateRoot(document.getElementById('root')!, <App />);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
2
2
|
import App from './App';
|
|
3
3
|
|
|
4
4
|
const bundlesMap = {
|
|
@@ -9,7 +9,7 @@ const bundlesMap = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
if (typeof window === 'undefined') {
|
|
12
|
-
require('./server.tsx')
|
|
12
|
+
require('./server.tsx');
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
if (typeof window !== 'undefined') {
|
|
@@ -21,6 +21,5 @@ if (typeof window !== 'undefined') {
|
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
hydrateRoot(document.getElementById('root')!, <App />);
|
|
26
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ReactDOM from 'react-dom';
|
|
2
1
|
import App from './App';
|
|
2
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
3
3
|
|
|
4
4
|
const bundlesMap = {
|
|
5
5
|
main: () => import('./bundles/main'),
|
|
@@ -19,5 +19,5 @@ if (typeof window === 'undefined') {
|
|
|
19
19
|
]().then(({ default: name }: { default: string }) => console.log(`loaded bundle ${name}`));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
hydrateRoot(document.getElementById('root')!, <App />);
|
|
23
23
|
}
|
|
@@ -133,7 +133,6 @@ describe('@tramvai/cli start command', () => {
|
|
|
133
133
|
).toMatchInlineSnapshot(`"Cmp test: start"`);
|
|
134
134
|
|
|
135
135
|
await outputFile(REFRESH_CMP_PATH, CMP_FILE_CONTENT_UPDATE);
|
|
136
|
-
|
|
137
136
|
await page.waitForFunction(
|
|
138
137
|
() => {
|
|
139
138
|
return document.getElementById('cmp')?.innerHTML !== 'Cmp test: start';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`client-legacy: create-token-pure.ts 1`] = `
|
|
4
|
-
"
|
|
4
|
+
" "use strict";
|
|
5
|
+
__webpack_require__.r(__webpack_exports__),
|
|
5
6
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6
7
|
/* harmony export */ TEST_TOKEN: function() {
|
|
7
8
|
/* binding */ return TEST_TOKEN;
|
|
@@ -13,7 +14,8 @@ exports[`client-legacy: create-token-pure.ts 1`] = `
|
|
|
13
14
|
`;
|
|
14
15
|
|
|
15
16
|
exports[`client-legacy: images/logo.svg\\?react 1`] = `
|
|
16
|
-
"
|
|
17
|
+
" "use strict";
|
|
18
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../node_modules/@swc/helpers/esm/_object_spread.js"), _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/@swc/helpers/esm/_object_spread_props.js"), react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("webpack/sharing/consume/default/react/jsx-runtime/react/jsx-runtime");
|
|
17
19
|
/* harmony import */ __webpack_require__("webpack/sharing/consume/default/react/react"),
|
|
18
20
|
/* harmony default export */ __webpack_exports__.Z = function(props) {
|
|
19
21
|
/*#__PURE__*/
|
|
@@ -56,7 +58,8 @@ exports[`client-legacy: images/logo.svg\\?react 1`] = `
|
|
|
56
58
|
`;
|
|
57
59
|
|
|
58
60
|
exports[`client-legacy: lazy-component.tsx 1`] = `
|
|
59
|
-
"
|
|
61
|
+
" "use strict";
|
|
62
|
+
__webpack_require__.r(__webpack_exports__),
|
|
60
63
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
61
64
|
/* harmony export */ Component: function() {
|
|
62
65
|
/* binding */ return Component;
|
|
@@ -101,7 +104,8 @@ exports[`client-legacy: lazy-component.tsx 1`] = `
|
|
|
101
104
|
`;
|
|
102
105
|
|
|
103
106
|
exports[`client-legacy: node-env.ts 1`] = `
|
|
104
|
-
"
|
|
107
|
+
" "use strict";
|
|
108
|
+
__webpack_require__.r(__webpack_exports__),
|
|
105
109
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
106
110
|
/* harmony export */ func: function() {
|
|
107
111
|
/* binding */ return func;
|
|
@@ -114,7 +118,8 @@ exports[`client-legacy: node-env.ts 1`] = `
|
|
|
114
118
|
`;
|
|
115
119
|
|
|
116
120
|
exports[`client-legacy: provider-stack.ts 1`] = `
|
|
117
|
-
"
|
|
121
|
+
" "use strict";
|
|
122
|
+
__webpack_require__.r(__webpack_exports__),
|
|
118
123
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
119
124
|
/* harmony export */ providers: function() {
|
|
120
125
|
/* binding */ return providers;
|
|
@@ -130,7 +135,8 @@ exports[`client-legacy: provider-stack.ts 1`] = `
|
|
|
130
135
|
`;
|
|
131
136
|
|
|
132
137
|
exports[`client-legacy: react-svg.tsx 1`] = `
|
|
133
|
-
"
|
|
138
|
+
" "use strict";
|
|
139
|
+
__webpack_require__.r(__webpack_exports__),
|
|
134
140
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
135
141
|
/* harmony export */ Component: function() {
|
|
136
142
|
/* binding */ return Component;
|
|
@@ -147,7 +153,8 @@ exports[`client-legacy: react-svg.tsx 1`] = `
|
|
|
147
153
|
`;
|
|
148
154
|
|
|
149
155
|
exports[`client-legacy: server.inline.ts 1`] = `
|
|
150
|
-
"
|
|
156
|
+
" "use strict";
|
|
157
|
+
__webpack_require__.r(__webpack_exports__),
|
|
151
158
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
152
159
|
/* harmony export */ ForBrowser: function() {
|
|
153
160
|
/* binding */ return ForBrowser;
|
|
@@ -173,7 +180,8 @@ exports[`client-legacy: server.inline.ts 1`] = `
|
|
|
173
180
|
`;
|
|
174
181
|
|
|
175
182
|
exports[`client-legacy: typeof-window.ts 1`] = `
|
|
176
|
-
"
|
|
183
|
+
" "use strict";
|
|
184
|
+
__webpack_require__.r(__webpack_exports__),
|
|
177
185
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
178
186
|
/* harmony export */ func: function() {
|
|
179
187
|
/* binding */ return func;
|
|
@@ -186,7 +194,8 @@ exports[`client-legacy: typeof-window.ts 1`] = `
|
|
|
186
194
|
`;
|
|
187
195
|
|
|
188
196
|
exports[`client-modern: create-token-pure.ts 1`] = `
|
|
189
|
-
"
|
|
197
|
+
" "use strict";
|
|
198
|
+
__webpack_require__.r(__webpack_exports__),
|
|
190
199
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
191
200
|
/* harmony export */ TEST_TOKEN: function() {
|
|
192
201
|
/* binding */ return TEST_TOKEN;
|
|
@@ -197,7 +206,8 @@ exports[`client-modern: create-token-pure.ts 1`] = `
|
|
|
197
206
|
`;
|
|
198
207
|
|
|
199
208
|
exports[`client-modern: images/logo.svg\\?react 1`] = `
|
|
200
|
-
"
|
|
209
|
+
" "use strict";
|
|
210
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
201
211
|
/* harmony export */ Z: function() {
|
|
202
212
|
return __WEBPACK_DEFAULT_EXPORT__;
|
|
203
213
|
}
|
|
@@ -242,7 +252,8 @@ exports[`client-modern: images/logo.svg\\?react 1`] = `
|
|
|
242
252
|
`;
|
|
243
253
|
|
|
244
254
|
exports[`client-modern: lazy-component.tsx 1`] = `
|
|
245
|
-
"
|
|
255
|
+
" "use strict";
|
|
256
|
+
__webpack_require__.r(__webpack_exports__),
|
|
246
257
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
247
258
|
/* harmony export */ Component: function() {
|
|
248
259
|
/* binding */ return Component;
|
|
@@ -275,7 +286,8 @@ exports[`client-modern: lazy-component.tsx 1`] = `
|
|
|
275
286
|
`;
|
|
276
287
|
|
|
277
288
|
exports[`client-modern: node-env.ts 1`] = `
|
|
278
|
-
"
|
|
289
|
+
" "use strict";
|
|
290
|
+
let internalFunc;
|
|
279
291
|
__webpack_require__.r(__webpack_exports__),
|
|
280
292
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
281
293
|
/* harmony export */ func: function() {
|
|
@@ -287,7 +299,8 @@ exports[`client-modern: node-env.ts 1`] = `
|
|
|
287
299
|
`;
|
|
288
300
|
|
|
289
301
|
exports[`client-modern: provider-stack.ts 1`] = `
|
|
290
|
-
"
|
|
302
|
+
" "use strict";
|
|
303
|
+
__webpack_require__.r(__webpack_exports__),
|
|
291
304
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
292
305
|
/* harmony export */ providers: function() {
|
|
293
306
|
/* binding */ return providers;
|
|
@@ -302,7 +315,8 @@ exports[`client-modern: provider-stack.ts 1`] = `
|
|
|
302
315
|
`;
|
|
303
316
|
|
|
304
317
|
exports[`client-modern: react-svg.tsx 1`] = `
|
|
305
|
-
"
|
|
318
|
+
" "use strict";
|
|
319
|
+
__webpack_require__.r(__webpack_exports__),
|
|
306
320
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
307
321
|
/* harmony export */ Component: function() {
|
|
308
322
|
/* binding */ return Component;
|
|
@@ -316,7 +330,8 @@ exports[`client-modern: react-svg.tsx 1`] = `
|
|
|
316
330
|
`;
|
|
317
331
|
|
|
318
332
|
exports[`client-modern: server.inline.ts 1`] = `
|
|
319
|
-
"
|
|
333
|
+
" "use strict";
|
|
334
|
+
__webpack_require__.r(__webpack_exports__),
|
|
320
335
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
321
336
|
/* harmony export */ ForBrowser: function() {
|
|
322
337
|
/* binding */ return ForBrowser;
|
|
@@ -339,7 +354,8 @@ exports[`client-modern: server.inline.ts 1`] = `
|
|
|
339
354
|
`;
|
|
340
355
|
|
|
341
356
|
exports[`client-modern: typeof-window.ts 1`] = `
|
|
342
|
-
"
|
|
357
|
+
" "use strict";
|
|
358
|
+
let internalFunc;
|
|
343
359
|
__webpack_require__.r(__webpack_exports__),
|
|
344
360
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
345
361
|
/* harmony export */ func: function() {
|
|
@@ -9,7 +9,7 @@ interface Options {
|
|
|
9
9
|
path: string;
|
|
10
10
|
}
|
|
11
11
|
const COMPONENT_NAME = 'RootErrorBoundary';
|
|
12
|
-
const
|
|
12
|
+
const REACT_HYDRATE_ROOT_CODE = `
|
|
13
13
|
const { hydrateRoot } = require('react-dom/client')
|
|
14
14
|
|
|
15
15
|
hydrateRoot(
|
|
@@ -17,7 +17,7 @@ hydrateRoot(
|
|
|
17
17
|
<${COMPONENT_NAME} error={window.serverError} url={window.serverUrl} />,
|
|
18
18
|
);
|
|
19
19
|
`;
|
|
20
|
-
const
|
|
20
|
+
const REACT_HYDRATE_CODE = `
|
|
21
21
|
const { hydrate } = require('react-dom')
|
|
22
22
|
|
|
23
23
|
hydrate(
|
|
@@ -35,7 +35,7 @@ const rootErrorBoundaryLoader: LoaderDefinition<Options> = function (content) {
|
|
|
35
35
|
// We don't need hydration code on the server
|
|
36
36
|
if (options.buildType === 'client') {
|
|
37
37
|
const IMPORT_CODE = `import ${COMPONENT_NAME} from "${options.path}"\n`;
|
|
38
|
-
const HYDRATION_CODE = shouldUseReactRoot() ?
|
|
38
|
+
const HYDRATION_CODE = shouldUseReactRoot() ? REACT_HYDRATE_ROOT_CODE : REACT_HYDRATE_CODE;
|
|
39
39
|
|
|
40
40
|
return IMPORT_CODE.concat(HYDRATION_CODE);
|
|
41
41
|
}
|
|
@@ -1236,23 +1236,23 @@
|
|
|
1236
1236
|
"dotAll": {
|
|
1237
1237
|
"type": "boolean"
|
|
1238
1238
|
},
|
|
1239
|
-
"__@match@
|
|
1239
|
+
"__@match@7844": {
|
|
1240
1240
|
"type": "object",
|
|
1241
1241
|
"additionalProperties": false
|
|
1242
1242
|
},
|
|
1243
|
-
"__@replace@
|
|
1243
|
+
"__@replace@7846": {
|
|
1244
1244
|
"type": "object",
|
|
1245
1245
|
"additionalProperties": false
|
|
1246
1246
|
},
|
|
1247
|
-
"__@search@
|
|
1247
|
+
"__@search@7849": {
|
|
1248
1248
|
"type": "object",
|
|
1249
1249
|
"additionalProperties": false
|
|
1250
1250
|
},
|
|
1251
|
-
"__@split@
|
|
1251
|
+
"__@split@7851": {
|
|
1252
1252
|
"type": "object",
|
|
1253
1253
|
"additionalProperties": false
|
|
1254
1254
|
},
|
|
1255
|
-
"__@matchAll@
|
|
1255
|
+
"__@matchAll@7853": {
|
|
1256
1256
|
"type": "object",
|
|
1257
1257
|
"additionalProperties": false
|
|
1258
1258
|
}
|
|
@@ -1987,23 +1987,23 @@
|
|
|
1987
1987
|
"dotAll": {
|
|
1988
1988
|
"type": "boolean"
|
|
1989
1989
|
},
|
|
1990
|
-
"__@match@
|
|
1990
|
+
"__@match@7844": {
|
|
1991
1991
|
"type": "object",
|
|
1992
1992
|
"additionalProperties": false
|
|
1993
1993
|
},
|
|
1994
|
-
"__@replace@
|
|
1994
|
+
"__@replace@7846": {
|
|
1995
1995
|
"type": "object",
|
|
1996
1996
|
"additionalProperties": false
|
|
1997
1997
|
},
|
|
1998
|
-
"__@search@
|
|
1998
|
+
"__@search@7849": {
|
|
1999
1999
|
"type": "object",
|
|
2000
2000
|
"additionalProperties": false
|
|
2001
2001
|
},
|
|
2002
|
-
"__@split@
|
|
2002
|
+
"__@split@7851": {
|
|
2003
2003
|
"type": "object",
|
|
2004
2004
|
"additionalProperties": false
|
|
2005
2005
|
},
|
|
2006
|
-
"__@matchAll@
|
|
2006
|
+
"__@matchAll@7853": {
|
|
2007
2007
|
"type": "object",
|
|
2008
2008
|
"additionalProperties": false
|
|
2009
2009
|
}
|
|
@@ -2738,23 +2738,23 @@
|
|
|
2738
2738
|
"dotAll": {
|
|
2739
2739
|
"type": "boolean"
|
|
2740
2740
|
},
|
|
2741
|
-
"__@match@
|
|
2741
|
+
"__@match@7844": {
|
|
2742
2742
|
"type": "object",
|
|
2743
2743
|
"additionalProperties": false
|
|
2744
2744
|
},
|
|
2745
|
-
"__@replace@
|
|
2745
|
+
"__@replace@7846": {
|
|
2746
2746
|
"type": "object",
|
|
2747
2747
|
"additionalProperties": false
|
|
2748
2748
|
},
|
|
2749
|
-
"__@search@
|
|
2749
|
+
"__@search@7849": {
|
|
2750
2750
|
"type": "object",
|
|
2751
2751
|
"additionalProperties": false
|
|
2752
2752
|
},
|
|
2753
|
-
"__@split@
|
|
2753
|
+
"__@split@7851": {
|
|
2754
2754
|
"type": "object",
|
|
2755
2755
|
"additionalProperties": false
|
|
2756
2756
|
},
|
|
2757
|
-
"__@matchAll@
|
|
2757
|
+
"__@matchAll@7853": {
|
|
2758
2758
|
"type": "object",
|
|
2759
2759
|
"additionalProperties": false
|
|
2760
2760
|
}
|
|
@@ -6,9 +6,9 @@ export const shouldUseReactRoot = once(() => {
|
|
|
6
6
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
7
7
|
const reactVersion = require('react').version;
|
|
8
8
|
const isReactExperimental = reactVersion && /0\.0\.0-experimental/.test(reactVersion);
|
|
9
|
-
const
|
|
9
|
+
const hasReact18orHigher =
|
|
10
10
|
reactVersion &&
|
|
11
11
|
(semver.gte(reactVersion, '18.0.0') || semver.coerce(reactVersion)?.version === '18.0.0');
|
|
12
12
|
|
|
13
|
-
return Boolean(
|
|
13
|
+
return Boolean(hasReact18orHigher || isReactExperimental);
|
|
14
14
|
});
|