@tramvai/module-common 1.72.1 → 1.74.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/index.browser.js +7 -1
- package/lib/index.es.js +7 -1
- package/lib/index.js +8 -1
- package/package.json +15 -14
package/lib/index.browser.js
CHANGED
|
@@ -9,6 +9,7 @@ import { Hooks } from '@tinkoff/hook-runner';
|
|
|
9
9
|
import { REQUEST_MANAGER_TOKEN, REQUEST, COMBINE_REDUCERS, STORE_TOKEN, RESPONSE_MANAGER_TOKEN, RESPONSE, ACTION_EXECUTION_TOKEN, LOGGER_TOKEN, PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, ROOT_PUBSUB_TOKEN, ACTION_REGISTRY_TOKEN, ACTION_CONDITIONALS, CONTEXT_TOKEN, ACTION_PAGE_RUNNER_TOKEN, DISPATCHER_TOKEN, DISPATCHER_CONTEXT_TOKEN, STORE_MIDDLEWARE, CREATE_CACHE_TOKEN, CLEAR_CACHE_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, HOOK_TOKEN, COMPONENT_REGISTRY_TOKEN, BUNDLE_MANAGER_TOKEN, ADDITIONAL_BUNDLE_TOKEN, INITIAL_APP_STATE_TOKEN as INITIAL_APP_STATE_TOKEN$1 } from '@tramvai/tokens-common';
|
|
10
10
|
export * from '@tramvai/tokens-common';
|
|
11
11
|
import { fileSystemPagesEnabled, getAllFileSystemPages, isFileSystemPageComponent } from '@tramvai/experiments';
|
|
12
|
+
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
12
13
|
import pathOr from '@tinkoff/utils/object/pathOr';
|
|
13
14
|
import flatten from '@tinkoff/utils/array/flatten';
|
|
14
15
|
import { createEvent, createReducer, convertAction, createDispatcher, devTools, Provider } from '@tramvai/state';
|
|
@@ -77,6 +78,11 @@ class BundleManager {
|
|
|
77
78
|
const component = typeof componentOrLoader.load === 'function'
|
|
78
79
|
? (await componentOrLoader.load()).default
|
|
79
80
|
: componentOrLoader;
|
|
81
|
+
// manually hoist static properties from preloaded component to loadable wrapper,
|
|
82
|
+
// this open access to current page component static properties outside before rendering
|
|
83
|
+
if (componentOrLoader !== component) {
|
|
84
|
+
hoistNonReactStatics(componentOrLoader, component);
|
|
85
|
+
}
|
|
80
86
|
// allow page components to register any other components
|
|
81
87
|
if (component.components) {
|
|
82
88
|
eachObj((cmp, name) => {
|
|
@@ -1055,7 +1061,7 @@ const stateProviders = [
|
|
|
1055
1061
|
provide({
|
|
1056
1062
|
provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
|
|
1057
1063
|
multi: true,
|
|
1058
|
-
useValue: [DISPATCHER_TOKEN,
|
|
1064
|
+
useValue: [DISPATCHER_TOKEN, STORE_TOKEN, CONTEXT_TOKEN],
|
|
1059
1065
|
}),
|
|
1060
1066
|
];
|
|
1061
1067
|
|
package/lib/index.es.js
CHANGED
|
@@ -9,6 +9,7 @@ import { Hooks } from '@tinkoff/hook-runner';
|
|
|
9
9
|
import { REQUEST_MANAGER_TOKEN, REQUEST, COMBINE_REDUCERS, CONTEXT_TOKEN, RESPONSE_MANAGER_TOKEN, RESPONSE, ACTION_EXECUTION_TOKEN, LOGGER_TOKEN, PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, ROOT_PUBSUB_TOKEN, ACTION_REGISTRY_TOKEN, ACTION_CONDITIONALS, STORE_TOKEN, ACTION_PAGE_RUNNER_TOKEN, DISPATCHER_TOKEN, DISPATCHER_CONTEXT_TOKEN, STORE_MIDDLEWARE, CLEAR_CACHE_TOKEN, CREATE_CACHE_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, HOOK_TOKEN, COMPONENT_REGISTRY_TOKEN, BUNDLE_MANAGER_TOKEN, ADDITIONAL_BUNDLE_TOKEN } from '@tramvai/tokens-common';
|
|
10
10
|
export * from '@tramvai/tokens-common';
|
|
11
11
|
import { fileSystemPagesEnabled, getAllFileSystemPages, isFileSystemPageComponent } from '@tramvai/experiments';
|
|
12
|
+
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
12
13
|
import pathOr from '@tinkoff/utils/object/pathOr';
|
|
13
14
|
import flatten from '@tinkoff/utils/array/flatten';
|
|
14
15
|
import { createEvent, createReducer, convertAction, createDispatcher, devTools, Provider } from '@tramvai/state';
|
|
@@ -79,6 +80,11 @@ class BundleManager {
|
|
|
79
80
|
const component = typeof componentOrLoader.load === 'function'
|
|
80
81
|
? (await componentOrLoader.load()).default
|
|
81
82
|
: componentOrLoader;
|
|
83
|
+
// manually hoist static properties from preloaded component to loadable wrapper,
|
|
84
|
+
// this open access to current page component static properties outside before rendering
|
|
85
|
+
if (componentOrLoader !== component) {
|
|
86
|
+
hoistNonReactStatics(componentOrLoader, component);
|
|
87
|
+
}
|
|
82
88
|
// allow page components to register any other components
|
|
83
89
|
if (component.components) {
|
|
84
90
|
eachObj((cmp, name) => {
|
|
@@ -1077,7 +1083,7 @@ const stateProviders = [
|
|
|
1077
1083
|
provide({
|
|
1078
1084
|
provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
|
|
1079
1085
|
multi: true,
|
|
1080
|
-
useValue: [DISPATCHER_TOKEN,
|
|
1086
|
+
useValue: [DISPATCHER_TOKEN, STORE_TOKEN, CONTEXT_TOKEN],
|
|
1081
1087
|
}),
|
|
1082
1088
|
];
|
|
1083
1089
|
|
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var moduleLog = require('@tramvai/module-log');
|
|
|
11
11
|
var hookRunner = require('@tinkoff/hook-runner');
|
|
12
12
|
var tokensCommon = require('@tramvai/tokens-common');
|
|
13
13
|
var experiments = require('@tramvai/experiments');
|
|
14
|
+
var hoistNonReactStatics = require('hoist-non-react-statics');
|
|
14
15
|
var pathOr = require('@tinkoff/utils/object/pathOr');
|
|
15
16
|
var flatten = require('@tinkoff/utils/array/flatten');
|
|
16
17
|
var state = require('@tramvai/state');
|
|
@@ -37,6 +38,7 @@ var tokensChildApp = require('@tramvai/tokens-child-app');
|
|
|
37
38
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
38
39
|
|
|
39
40
|
var eachObj__default = /*#__PURE__*/_interopDefaultLegacy(eachObj);
|
|
41
|
+
var hoistNonReactStatics__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatics);
|
|
40
42
|
var pathOr__default = /*#__PURE__*/_interopDefaultLegacy(pathOr);
|
|
41
43
|
var flatten__default = /*#__PURE__*/_interopDefaultLegacy(flatten);
|
|
42
44
|
var isEmpty__default = /*#__PURE__*/_interopDefaultLegacy(isEmpty);
|
|
@@ -97,6 +99,11 @@ class BundleManager {
|
|
|
97
99
|
const component = typeof componentOrLoader.load === 'function'
|
|
98
100
|
? (await componentOrLoader.load()).default
|
|
99
101
|
: componentOrLoader;
|
|
102
|
+
// manually hoist static properties from preloaded component to loadable wrapper,
|
|
103
|
+
// this open access to current page component static properties outside before rendering
|
|
104
|
+
if (componentOrLoader !== component) {
|
|
105
|
+
hoistNonReactStatics__default["default"](componentOrLoader, component);
|
|
106
|
+
}
|
|
100
107
|
// allow page components to register any other components
|
|
101
108
|
if (component.components) {
|
|
102
109
|
eachObj__default["default"]((cmp, name) => {
|
|
@@ -1095,7 +1102,7 @@ const stateProviders = [
|
|
|
1095
1102
|
core.provide({
|
|
1096
1103
|
provide: tokensChildApp.CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
|
|
1097
1104
|
multi: true,
|
|
1098
|
-
useValue: [tokensCommon.DISPATCHER_TOKEN, tokensCommon.
|
|
1105
|
+
useValue: [tokensCommon.DISPATCHER_TOKEN, tokensCommon.STORE_TOKEN, tokensCommon.CONTEXT_TOKEN],
|
|
1099
1106
|
}),
|
|
1100
1107
|
];
|
|
1101
1108
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.74.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -31,24 +31,25 @@
|
|
|
31
31
|
"@tinkoff/errors": "0.2.18",
|
|
32
32
|
"@tinkoff/pubsub": "0.4.23",
|
|
33
33
|
"@tinkoff/url": "0.7.37",
|
|
34
|
-
"@tramvai/module-cookie": "1.
|
|
35
|
-
"@tramvai/module-environment": "1.
|
|
36
|
-
"@tramvai/module-log": "1.
|
|
37
|
-
"@tramvai/tokens-child-app": "1.
|
|
38
|
-
"@tramvai/tokens-common": "1.
|
|
39
|
-
"@tramvai/tokens-render": "1.
|
|
40
|
-
"@tramvai/experiments": "1.
|
|
34
|
+
"@tramvai/module-cookie": "1.74.0",
|
|
35
|
+
"@tramvai/module-environment": "1.74.0",
|
|
36
|
+
"@tramvai/module-log": "1.74.0",
|
|
37
|
+
"@tramvai/tokens-child-app": "1.74.0",
|
|
38
|
+
"@tramvai/tokens-common": "1.74.0",
|
|
39
|
+
"@tramvai/tokens-render": "1.74.0",
|
|
40
|
+
"@tramvai/experiments": "1.74.0",
|
|
41
41
|
"@tinkoff/hook-runner": "0.3.21",
|
|
42
|
+
"hoist-non-react-statics": "^3.3.1",
|
|
42
43
|
"lru-cache": "^6.0.0"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
46
|
"@tinkoff/utils": "^2.1.2",
|
|
46
|
-
"@tramvai/cli": "1.
|
|
47
|
-
"@tramvai/core": "1.
|
|
48
|
-
"@tramvai/papi": "1.
|
|
49
|
-
"@tramvai/state": "1.
|
|
50
|
-
"@tramvai/tokens-metrics": "1.
|
|
51
|
-
"@tramvai/tokens-server": "1.
|
|
47
|
+
"@tramvai/cli": "1.74.0",
|
|
48
|
+
"@tramvai/core": "1.74.0",
|
|
49
|
+
"@tramvai/papi": "1.74.0",
|
|
50
|
+
"@tramvai/state": "1.74.0",
|
|
51
|
+
"@tramvai/tokens-metrics": "1.74.0",
|
|
52
|
+
"@tramvai/tokens-server": "1.74.0",
|
|
52
53
|
"@tinkoff/dippy": "0.7.38",
|
|
53
54
|
"react": ">=16.8.0",
|
|
54
55
|
"tslib": "^2.0.3"
|