@dr.pogodin/react-utils 1.43.26 → 1.43.28
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/build/development/index.js +14 -0
- package/build/development/index.js.map +1 -1
- package/build/development/shared/utils/index.js +6 -0
- package/build/development/shared/utils/index.js.map +1 -1
- package/build/development/web.bundle.js +2 -2
- package/build/production/index.js +1 -1
- package/build/production/index.js.map +1 -1
- package/build/production/shared/utils/index.js +1 -1
- package/build/production/shared/utils/index.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/index.d.ts +1 -1
- package/build/types-code/shared/utils/index.d.ts +1 -1
- package/config/webpack/app-base.js +24 -8
- package/package.json +7 -7
- package/src/index.ts +5 -2
- package/src/shared/utils/index.ts +2 -0
|
@@ -6,5 +6,5 @@ declare const client: typeof ClientM.default | undefined;
|
|
|
6
6
|
export { type AsyncCollectionT, type AsyncCollectionLoaderT, type AsyncDataEnvelopeT, type AsyncDataLoaderT, type ForceT, type UseAsyncDataOptionsT, type UseAsyncDataResT, type UseGlobalStateResT, type ValueOrInitializerT, getGlobalState, GlobalStateProvider, newAsyncDataEnvelope, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType, } from '@dr.pogodin/react-global-state';
|
|
7
7
|
export * from './shared/components';
|
|
8
8
|
export { type BeforeRenderResT, type BeforeRenderT, type ConfigT, type ServerSsrContext, type ServerT, } from './server';
|
|
9
|
-
export {
|
|
9
|
+
export { assertEmptyObject, config, Barrier, Cached, Emitter, isomorphy, getSsrContext, type Listener, type ObjectKey, Semaphore, splitComponent, type Theme, themed, ThemeProvider, time, webpack, withRetries, } from './shared/utils';
|
|
10
10
|
export { client, server };
|
|
@@ -3,7 +3,7 @@ import config from './config';
|
|
|
3
3
|
import * as isomorphy from './isomorphy';
|
|
4
4
|
import time from './time';
|
|
5
5
|
import * as webpack from './webpack';
|
|
6
|
-
export { type Listener, Barrier, Cached, Emitter, Semaphore, withRetries, } from '@dr.pogodin/js-utils';
|
|
6
|
+
export { assertEmptyObject, type Listener, type ObjectKey, Barrier, Cached, Emitter, Semaphore, withRetries, } from '@dr.pogodin/js-utils';
|
|
7
7
|
export { getSsrContext } from './globalState';
|
|
8
8
|
export { default as splitComponent } from './splitComponent';
|
|
9
9
|
type ThemedT = typeof themedImpl & {
|
|
@@ -125,7 +125,7 @@ const utils_1 = require("@dr.pogodin/babel-plugin-react-css-modules/utils");
|
|
|
125
125
|
* - **`timestamp`** — The value set for `BUILD_TIMESTAMP`.
|
|
126
126
|
*/
|
|
127
127
|
function configFactory(ops) {
|
|
128
|
-
var _a, _b;
|
|
128
|
+
var _a, _b, _c;
|
|
129
129
|
const o = (0, lodash_1.defaults)((0, lodash_1.clone)(ops), {
|
|
130
130
|
babelLoaderOptions: {},
|
|
131
131
|
cssLocalIdent: '[hash:base64:6]',
|
|
@@ -211,7 +211,7 @@ function configFactory(ops) {
|
|
|
211
211
|
o.workbox = {};
|
|
212
212
|
plugins.push(new workbox_webpack_plugin_1.default.InjectManifest(Object.assign(Object.assign({ swSrc: node_path_1.default.resolve(__dirname, '../workbox/default.js') }, o.workbox), { swDest: '__service-worker.js' })));
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
const res = {
|
|
215
215
|
context: o.context,
|
|
216
216
|
entry,
|
|
217
217
|
mode: o.mode,
|
|
@@ -302,12 +302,6 @@ function configFactory(ops) {
|
|
|
302
302
|
plugins,
|
|
303
303
|
resolve: {
|
|
304
304
|
alias: {
|
|
305
|
-
// NOTE: The "conditionNames" workaround below messes up the loading of
|
|
306
|
-
// Babel's runtime helper for require of CJS and ES styles of modules
|
|
307
|
-
// (without this alias it is resolved to
|
|
308
|
-
// @babel/runtime/helpers/esm/interopRequireDefault, which has
|
|
309
|
-
// the hepler function attached to "default" export).
|
|
310
|
-
'@babel/runtime/helpers/interopRequireDefault': node_path_1.default.resolve(o.context, 'node_modules/@babel/runtime/helpers/interopRequireDefault'),
|
|
311
305
|
// Aliases to JS an JSX files are handled by Babel.
|
|
312
306
|
assets: node_path_1.default.resolve(o.context, 'src/assets'),
|
|
313
307
|
components: node_path_1.default.resolve(o.context, 'src/shared/components'),
|
|
@@ -333,4 +327,26 @@ function configFactory(ops) {
|
|
|
333
327
|
symlinks: false,
|
|
334
328
|
},
|
|
335
329
|
};
|
|
330
|
+
// TODO: Can we do anything better about it? Otherwise, we potentially
|
|
331
|
+
// have to alias all Babel's runtime helpers, otherwise if it tries to
|
|
332
|
+
// use a new helper it breaks (probably only production) build in a very
|
|
333
|
+
// confusing, hard to debug way. Not sure what to do, as the problem with
|
|
334
|
+
// RR exports is still there, and we still can't fully move to ES modules
|
|
335
|
+
// because Jest and other tools. Also such aliases easily break E2E tests
|
|
336
|
+
// with Jest (with our setup), that's why they are avoided when NODE_ENV
|
|
337
|
+
// is test (but it might be not the solution that always helps).
|
|
338
|
+
//
|
|
339
|
+
// NOTE: The "conditionNames" workaround below messes up the loading of
|
|
340
|
+
// Babel's runtime helper for require of CJS and ES styles of modules
|
|
341
|
+
// (without this alias it is resolved to
|
|
342
|
+
// @babel/runtime/helpers/esm/interopRequireDefault, which has
|
|
343
|
+
// the hepler function attached to "default" export).
|
|
344
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
345
|
+
const aliases = (_c = res.resolve) === null || _c === void 0 ? void 0 : _c.alias;
|
|
346
|
+
aliases['@babel/runtime/helpers/defineProperty']
|
|
347
|
+
= node_path_1.default.resolve(o.context, 'node_modules/@babel/runtime/helpers/defineProperty');
|
|
348
|
+
aliases['@babel/runtime/helpers/interopRequireDefault']
|
|
349
|
+
= node_path_1.default.resolve(o.context, 'node_modules/@babel/runtime/helpers/interopRequireDefault');
|
|
350
|
+
}
|
|
351
|
+
return res;
|
|
336
352
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.43.
|
|
2
|
+
"version": "1.43.28",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"@babel/runtime": "^7.27.4",
|
|
12
12
|
"@dr.pogodin/babel-plugin-react-css-modules": "^6.13.6",
|
|
13
13
|
"@dr.pogodin/csurf": "^1.16.5",
|
|
14
|
-
"@dr.pogodin/js-utils": "^0.1.
|
|
14
|
+
"@dr.pogodin/js-utils": "^0.1.3",
|
|
15
15
|
"@dr.pogodin/react-global-state": "^0.19.3",
|
|
16
16
|
"@dr.pogodin/react-helmet": "^3.0.2",
|
|
17
17
|
"@dr.pogodin/react-themes": "^1.9.2",
|
|
18
|
-
"@jest/environment": "^30.0.
|
|
18
|
+
"@jest/environment": "^30.0.5",
|
|
19
19
|
"axios": "^1.10.0",
|
|
20
20
|
"commander": "^14.0.0",
|
|
21
21
|
"compression": "^1.8.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@babel/preset-typescript": "^7.27.1",
|
|
56
56
|
"@babel/register": "^7.27.1",
|
|
57
57
|
"@dr.pogodin/babel-plugin-transform-assets": "^1.2.5",
|
|
58
|
-
"@dr.pogodin/babel-preset-svgr": "^1.9.
|
|
58
|
+
"@dr.pogodin/babel-preset-svgr": "^1.9.2",
|
|
59
59
|
"@dr.pogodin/eslint-configs": "^0.0.9",
|
|
60
60
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
|
|
61
61
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
"@types/webpack": "^5.28.5",
|
|
82
82
|
"@types/webpack-hot-middleware": "^2.25.9",
|
|
83
83
|
"autoprefixer": "^10.4.21",
|
|
84
|
-
"babel-jest": "^30.0.
|
|
84
|
+
"babel-jest": "^30.0.5",
|
|
85
85
|
"babel-loader": "^10.0.0",
|
|
86
86
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
87
87
|
"core-js": "^3.44.0",
|
|
88
88
|
"css-loader": "^7.1.2",
|
|
89
89
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
90
90
|
"identity-obj-proxy": "^3.0.0",
|
|
91
|
-
"jest": "^30.0.
|
|
92
|
-
"jest-environment-jsdom": "^30.0.
|
|
91
|
+
"jest": "^30.0.5",
|
|
92
|
+
"jest-environment-jsdom": "^30.0.5",
|
|
93
93
|
"memfs": "^4.17.2",
|
|
94
94
|
"mini-css-extract-plugin": "^2.9.2",
|
|
95
95
|
"mockdate": "^3.0.5",
|
package/src/index.ts
CHANGED
|
@@ -51,15 +51,18 @@ export {
|
|
|
51
51
|
} from './server';
|
|
52
52
|
|
|
53
53
|
export {
|
|
54
|
-
|
|
55
|
-
type Theme,
|
|
54
|
+
assertEmptyObject,
|
|
56
55
|
config,
|
|
57
56
|
Barrier,
|
|
57
|
+
Cached,
|
|
58
58
|
Emitter,
|
|
59
59
|
isomorphy,
|
|
60
60
|
getSsrContext,
|
|
61
|
+
type Listener,
|
|
62
|
+
type ObjectKey,
|
|
61
63
|
Semaphore,
|
|
62
64
|
splitComponent,
|
|
65
|
+
type Theme,
|
|
63
66
|
themed,
|
|
64
67
|
ThemeProvider,
|
|
65
68
|
time,
|