@common-stack/client-react 0.5.28 → 0.5.30
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/__tests__/fill-register-test.js +6 -31
- package/lib/__tests__/fill-register-test.js.map +1 -1
- package/lib/__tests__/helpers/sample-menu.js +1 -4
- package/lib/__tests__/helpers/sample-menu.js.map +1 -1
- package/lib/__tests__/integrated-routes.test.js +12 -40
- package/lib/__tests__/integrated-routes.test.js.map +1 -1
- package/lib/__tests__/router-render.test.js +14 -57
- package/lib/__tests__/router-render.test.js.map +1 -1
- package/lib/connector/base-connector.js +24 -48
- package/lib/connector/base-connector.js.map +1 -1
- package/lib/connector/connector.js +9 -13
- package/lib/connector/connector.js.map +1 -1
- package/lib/connector/connector.native.js +10 -17
- package/lib/connector/connector.native.js.map +1 -1
- package/lib/connector/connector.test.js +5 -30
- package/lib/connector/connector.test.js.map +1 -1
- package/lib/connector/index.js +1 -17
- package/lib/connector/index.js.map +1 -1
- package/lib/index.js +10 -28
- package/lib/index.js.map +1 -1
- package/lib/index.native.js +10 -28
- package/lib/index.native.js.map +1 -1
- package/lib/interfaces/extended-feature.js +1 -2
- package/lib/interfaces/feature.js +1 -2
- package/lib/interfaces/index.js +5 -21
- package/lib/interfaces/index.js.map +1 -1
- package/lib/interfaces/menu.js +2 -5
- package/lib/interfaces/menu.js.map +1 -1
- package/lib/interfaces/new-router.js +1 -2
- package/lib/interfaces/router.js +1 -2
- package/lib/inversify/InversifyContext.js +6 -34
- package/lib/inversify/InversifyContext.js.map +1 -1
- package/lib/inversify/index.js +1 -17
- package/lib/inversify/index.js.map +1 -1
- package/lib/plugin-area/__tests__/higher-order-component-util.test.js +12 -37
- package/lib/plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
- package/lib/plugin-area/__tests__/plugin-api.test.js +11 -13
- package/lib/plugin-area/__tests__/plugin-api.test.js.map +1 -1
- package/lib/plugin-area/base-plugin-area.js +12 -39
- package/lib/plugin-area/base-plugin-area.js.map +1 -1
- package/lib/plugin-area/higher-order-component-util.js +3 -7
- package/lib/plugin-area/higher-order-component-util.js.map +1 -1
- package/lib/plugin-area/index.js +5 -35
- package/lib/plugin-area/index.js.map +1 -1
- package/lib/plugin-area/index.native.js +7 -37
- package/lib/plugin-area/index.native.js.map +1 -1
- package/lib/plugin-area/plugin-api.js +15 -18
- package/lib/plugin-area/plugin-api.js.map +1 -1
- package/lib/plugin-area/plugin-context.js +5 -32
- package/lib/plugin-area/plugin-context.js.map +1 -1
- package/lib/route/__tests__/admin-new-routes.test.js +11 -45
- package/lib/route/__tests__/admin-new-routes.test.js.map +1 -1
- package/lib/route/__tests__/getFlatMenus.test.js +4 -6
- package/lib/route/__tests__/getFlatMenus.test.js.map +1 -1
- package/lib/route/__tests__/render-routes-config.test.js +6 -18
- package/lib/route/__tests__/render-routes-config.test.js.map +1 -1
- package/lib/route/__tests__/route-type.test.js +1 -2
- package/lib/route/__tests__/route-type.test.js.map +1 -1
- package/lib/route/get-routes.js +22 -29
- package/lib/route/get-routes.js.map +1 -1
- package/lib/route/get-routes.test.js +6 -17
- package/lib/route/get-routes.test.js.map +1 -1
- package/lib/route/index.js +2 -18
- package/lib/route/index.js.map +1 -1
- package/lib/route/index.native.js +1 -17
- package/lib/route/index.native.js.map +1 -1
- package/lib/route/old/__tests__/config-sidebar-menu.test.js +17 -15
- package/lib/route/old/__tests__/config-sidebar-menu.test.js.map +1 -1
- package/lib/route/old/get-menus.js +14 -21
- package/lib/route/old/get-menus.js.map +1 -1
- package/lib/route/old/get-routes-notused.js +14 -12
- package/lib/route/old/get-routes-notused.js.map +1 -1
- package/lib/route/old/render.js +4 -31
- package/lib/route/old/render.js.map +1 -1
- package/lib/route/react-navigation/get-navigation-utils.js +35 -40
- package/lib/route/react-navigation/get-navigation-utils.js.map +1 -1
- package/lib/route/react-navigation/get-navigation-utils.test.js +14 -16
- package/lib/route/react-navigation/get-navigation-utils.test.js.map +1 -1
- package/lib/route/react-navigation/index.js +2 -18
- package/lib/route/react-navigation/index.js.map +1 -1
- package/lib/route/react-navigation/react-native.sample.test.js +8 -22
- package/lib/route/react-navigation/react-native.sample.test.js.map +1 -1
- package/lib/route/react-navigation/react-native.sample1.test.js +14 -48
- package/lib/route/react-navigation/react-native.sample1.test.js.map +1 -1
- package/lib/route/react-navigation/react-navigation-render.js +16 -31
- package/lib/route/react-navigation/react-navigation-render.js.map +1 -1
- package/lib/route/react-navigation/react-navigation-render.test.js +23 -37
- package/lib/route/react-navigation/react-navigation-render.test.js.map +1 -1
- package/lib/route/react-navigation/root-navigation.js +5 -9
- package/lib/route/react-navigation/root-navigation.js.map +1 -1
- package/lib/route/react-navigation/routes.js +1 -2
- package/lib/route/react-navigation/types.js +1 -5
- package/lib/route/react-navigation/types.js.map +1 -1
- package/lib/route/render-routes.js +33 -66
- package/lib/route/render-routes.js.map +1 -1
- package/lib/route/render-routes.native.js +33 -66
- package/lib/route/render-routes.native.js.map +1 -1
- package/lib/route/render-routes.test.js +112 -126
- package/lib/route/render-routes.test.js.map +1 -1
- package/lib/route/root-navigation.js +3 -7
- package/lib/route/root-navigation.js.map +1 -1
- package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js +12 -37
- package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
- package/lib/route-based-plugin-area/__tests__/plugin-api.test.js +11 -13
- package/lib/route-based-plugin-area/__tests__/plugin-api.test.js.map +1 -1
- package/lib/route-based-plugin-area/higher-order-component-util.js +3 -7
- package/lib/route-based-plugin-area/higher-order-component-util.js.map +1 -1
- package/lib/route-based-plugin-area/index.js +2 -18
- package/lib/route-based-plugin-area/index.js.map +1 -1
- package/lib/route-based-plugin-area/plugin-api.js +15 -18
- package/lib/route-based-plugin-area/plugin-api.js.map +1 -1
- package/lib/route-based-plugin-area/plugin-context.js +5 -32
- package/lib/route-based-plugin-area/plugin-context.js.map +1 -1
- package/lib/route-based-plugin-area/route-based-plugin-area.js +12 -39
- package/lib/route-based-plugin-area/route-based-plugin-area.js.map +1 -1
- package/lib/router-factory/index.js +5 -31
- package/lib/router-factory/index.js.map +1 -1
- package/lib/router-factory/index.native.js +5 -31
- package/lib/router-factory/index.native.js.map +1 -1
- package/lib/utils/before-ssr.js +6 -19
- package/lib/utils/before-ssr.js.map +1 -1
- package/lib/utils/combine.js +2 -6
- package/lib/utils/combine.js.map +1 -1
- package/lib/utils/hydrate.js +3 -7
- package/lib/utils/hydrate.js.map +1 -1
- package/lib/utils/index.js +5 -21
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/sort-keys.js +3 -10
- package/lib/utils/sort-keys.js.map +1 -1
- package/lib/utils/sort-keys.test.js +2 -4
- package/lib/utils/sort-keys.test.js.map +1 -1
- package/lib/utils/utils.js +1 -5
- package/lib/utils/utils.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,68 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
35
|
-
var t = {};
|
|
36
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37
|
-
t[p] = s[p];
|
|
38
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
39
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
41
|
-
t[p[i]] = s[p[i]];
|
|
42
|
-
}
|
|
43
|
-
return t;
|
|
44
|
-
};
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.renderRoutes = void 0;
|
|
47
|
-
const React = __importStar(require("react"));
|
|
48
|
-
const react_1 = require("react");
|
|
49
|
-
const react_router_native_1 = require("react-router-native");
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useEffect, useState, createElement } from 'react';
|
|
3
|
+
import { Switch, Route, Redirect } from 'react-router-native';
|
|
50
4
|
function wrapInitialPropsFetch(route, opts) {
|
|
51
|
-
const { component
|
|
5
|
+
const { component, ...restRouteParams } = route;
|
|
52
6
|
let Component = route.component;
|
|
53
7
|
function ComponentWithInitialPropsFetch(props) {
|
|
54
|
-
const [initialProps, setInitialProps] =
|
|
55
|
-
|
|
8
|
+
const [initialProps, setInitialProps] = useState(() => window.g_initialProps);
|
|
9
|
+
useEffect(() => {
|
|
56
10
|
/**
|
|
57
11
|
* 1. 首次渲染时,此时 window.g_initialProps 变量存在,不需要再走一次 getInitialProps,这样一次 SSR 就走了 2 次 getInitialProps
|
|
58
12
|
* 2. 但是路由切换时,window.getInitialProps 会被赋为 null,这时候就走 getInitialProps 逻辑
|
|
59
13
|
* 3. 如果任何时候都走 2 次,配置 forceInitial: true,这个场景用于静态站点的首屏加载希望走最新数据
|
|
60
14
|
* 4. 开启动态加载后,会在执行 getInitialProps 前预加载下
|
|
61
15
|
*/
|
|
62
|
-
const handleGetInitialProps = () =>
|
|
16
|
+
const handleGetInitialProps = async () => {
|
|
63
17
|
// preload when enalbe dynamicImport
|
|
64
18
|
if (Component.preload) {
|
|
65
|
-
const preloadComponent =
|
|
19
|
+
const preloadComponent = await Component.preload();
|
|
66
20
|
// for test case, really use .default
|
|
67
21
|
Component = preloadComponent.default || preloadComponent;
|
|
68
22
|
}
|
|
@@ -87,13 +41,13 @@ function wrapInitialPropsFetch(route, opts) {
|
|
|
87
41
|
// );
|
|
88
42
|
// setInitialProps(initialProps);
|
|
89
43
|
// }
|
|
90
|
-
}
|
|
44
|
+
};
|
|
91
45
|
// null 时,一定会触发 getInitialProps 执行
|
|
92
46
|
if (!window.g_initialProps) {
|
|
93
47
|
handleGetInitialProps();
|
|
94
48
|
}
|
|
95
49
|
}, [window.location.pathname, window.location.search]);
|
|
96
|
-
return React.createElement(Component,
|
|
50
|
+
return React.createElement(Component, { ...props, ...initialProps });
|
|
97
51
|
}
|
|
98
52
|
// flag for having wrappered
|
|
99
53
|
ComponentWithInitialPropsFetch.wrapInitialPropsLoaded = true;
|
|
@@ -101,18 +55,28 @@ function wrapInitialPropsFetch(route, opts) {
|
|
|
101
55
|
return ComponentWithInitialPropsFetch;
|
|
102
56
|
}
|
|
103
57
|
function render({ route, opts, props }) {
|
|
104
|
-
const routes = renderRoutes(
|
|
58
|
+
const routes = renderRoutes({
|
|
59
|
+
...opts,
|
|
60
|
+
routes: route.routes || [],
|
|
61
|
+
rootRoutes: opts.rootRoutes,
|
|
62
|
+
});
|
|
105
63
|
const { component: Component, wrappers } = route;
|
|
106
64
|
if (Component) {
|
|
107
65
|
const defaultPageInitialProps = opts.isServer ? {} : window.g_initialProps;
|
|
108
|
-
const newProps =
|
|
66
|
+
const newProps = {
|
|
67
|
+
...props,
|
|
68
|
+
...opts.extraProps,
|
|
69
|
+
...(opts.pageInitialProps || defaultPageInitialProps),
|
|
70
|
+
route,
|
|
71
|
+
routes: opts.rootRoutes,
|
|
72
|
+
};
|
|
109
73
|
// @ts-ignore
|
|
110
|
-
let ret = React.createElement(Component,
|
|
74
|
+
let ret = React.createElement(Component, { ...newProps }, routes);
|
|
111
75
|
// route.wrappers
|
|
112
76
|
if (wrappers) {
|
|
113
77
|
let len = wrappers.length - 1;
|
|
114
78
|
while (len >= 0) {
|
|
115
|
-
ret =
|
|
79
|
+
ret = createElement(wrappers[len], newProps, ret);
|
|
116
80
|
len -= 1;
|
|
117
81
|
}
|
|
118
82
|
}
|
|
@@ -129,7 +93,7 @@ function getRouteElement({ route, index, opts }) {
|
|
|
129
93
|
path: route.path,
|
|
130
94
|
};
|
|
131
95
|
if (route.redirect) {
|
|
132
|
-
return React.createElement(
|
|
96
|
+
return React.createElement(Redirect, { ...routeProps, from: route.path, to: route.redirect });
|
|
133
97
|
}
|
|
134
98
|
// avoid mount and unmount with url hash change
|
|
135
99
|
// @sri not supproted yet
|
|
@@ -144,19 +108,22 @@ function getRouteElement({ route, index, opts }) {
|
|
|
144
108
|
// // client Render for enable ssr, but not sure SSR success
|
|
145
109
|
// route.component = wrapInitialPropsFetch(route, opts);
|
|
146
110
|
// }
|
|
147
|
-
return (React.createElement(
|
|
111
|
+
return (React.createElement(Route, { ...routeProps, render: (props) => {
|
|
148
112
|
return render({ route, opts, props });
|
|
149
|
-
} }))
|
|
113
|
+
} }));
|
|
150
114
|
}
|
|
151
115
|
function renderRoutes(opts) {
|
|
152
|
-
return opts.routes ? (React.createElement(
|
|
116
|
+
return opts.routes ? (React.createElement(Switch, null, opts.routes.map((route, index) => {
|
|
153
117
|
const renderedR = getRouteElement({
|
|
154
118
|
route,
|
|
155
119
|
index,
|
|
156
|
-
opts:
|
|
120
|
+
opts: {
|
|
121
|
+
...opts,
|
|
122
|
+
rootRoutes: opts.rootRoutes || opts.routes,
|
|
123
|
+
},
|
|
157
124
|
});
|
|
158
125
|
return renderedR;
|
|
159
126
|
}))) : null;
|
|
160
127
|
}
|
|
161
|
-
|
|
128
|
+
export { renderRoutes };
|
|
162
129
|
//# sourceMappingURL=render-routes.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-routes.native.js","sourceRoot":"","sources":["../../src/route/render-routes.native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-routes.native.js","sourceRoot":"","sources":["../../src/route/render-routes.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE9D,SAAS,qBAAqB,CAAC,KAAa,EAAE,IAAyB;IACrE,MAAM,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,GAAG,KAAK,CAAC;IAChD,IAAI,SAAS,GAAQ,KAAK,CAAC,SAAS,CAAC;IACrC,SAAS,8BAA8B,CAAC,KAAU;QAChD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAE,MAAc,CAAC,cAAc,CAAC,CAAC;QAEvF,SAAS,CAAC,GAAG,EAA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AAE,EAAE,EAAE,KAAK,CAAC,QAAQ,GAAI,CAAC;KAC3E;IACD,+CAA+C;IAC/C,yBAAyB;IACzB,OAAO;IACP,mCAAmC;IACnC,qBAAqB;IACrB,sBAAsB;IACtB,6BAA6B;IAC7B,yDAAyD;IACzD,mEAAmE;IACnE,MAAM;IACN,8DAA8D;IAC9D,0DAA0D;IAC1D,IAAI;IACJ,OAAO,CACL,oBAAC,KAAK,OACA,UAAU,EACd,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YACxB,OAAO,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACxC,CAAC,GACD,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,IAAyB;IAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACnB,oBAAC,MAAM,QACJ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAChC,MAAM,SAAS,GAAG,eAAe,CAAC;YAChC,KAAK;YACL,KAAK;YACL,IAAI,EAAE;gBACJ,GAAG,IAAI;gBACP,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM;aAC3C;SACF,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CACK,CACV,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,46 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const react_1 = require("@testing-library/react");
|
|
16
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
17
|
-
const react_2 = __importDefault(require("react"));
|
|
18
|
-
const render_routes_1 = require("./render-routes");
|
|
1
|
+
import { cleanup, getByText, render, screen, waitFor, } from '@testing-library/react';
|
|
2
|
+
import { Link, MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { renderRoutes2 as renderRoutes } from './render-routes';
|
|
19
5
|
function TestInitialProps({ foo }) {
|
|
20
|
-
return
|
|
6
|
+
return React.createElement("h1", { "data-testid": "test" }, foo);
|
|
21
7
|
}
|
|
22
8
|
let mountCount = 0;
|
|
23
9
|
let renderCount = 0;
|
|
24
10
|
function TestInitialPropsWithoutUnmount({ foo }) {
|
|
25
|
-
|
|
11
|
+
React.useEffect(() => {
|
|
26
12
|
return () => {
|
|
27
13
|
mountCount++;
|
|
28
14
|
};
|
|
29
15
|
}, []);
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
return (React.createElement("div", null,
|
|
17
|
+
React.createElement("h1", { "data-testid": "test2" }, foo),
|
|
18
|
+
React.createElement("a", { href: "#bar" }, "link-bar"),
|
|
19
|
+
React.createElement(Link, { to: "/get-initial-props" }, "change-route"),
|
|
20
|
+
React.createElement("h2", { id: "bar" }, "h2-bar")));
|
|
35
21
|
}
|
|
36
22
|
function TestInitialPropsWithMount({ foo }) {
|
|
37
|
-
|
|
23
|
+
React.useEffect(() => {
|
|
38
24
|
mountCount++;
|
|
39
25
|
}, []);
|
|
40
26
|
renderCount++;
|
|
41
|
-
return
|
|
27
|
+
return React.createElement("h1", { "data-testid": "test" }, foo);
|
|
42
28
|
}
|
|
43
|
-
const getInitialProps = () =>
|
|
29
|
+
const getInitialProps = async () => {
|
|
44
30
|
return new Promise((resolve) => {
|
|
45
31
|
setTimeout(() => {
|
|
46
32
|
resolve({
|
|
@@ -48,16 +34,16 @@ const getInitialProps = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
48
34
|
});
|
|
49
35
|
}, 100);
|
|
50
36
|
});
|
|
51
|
-
}
|
|
37
|
+
};
|
|
52
38
|
TestInitialProps.getInitialProps = getInitialProps;
|
|
53
39
|
TestInitialPropsWithoutUnmount.getInitialProps = getInitialProps;
|
|
54
40
|
TestInitialPropsWithMount.getInitialProps = getInitialProps;
|
|
55
41
|
function TestInitialPropsParent({ foo, children, }) {
|
|
56
|
-
return (
|
|
57
|
-
|
|
42
|
+
return (React.createElement(React.Fragment, null,
|
|
43
|
+
React.createElement("h1", { "data-testid": "test-parent" }, foo),
|
|
58
44
|
children));
|
|
59
45
|
}
|
|
60
|
-
TestInitialPropsParent.getInitialProps = () =>
|
|
46
|
+
TestInitialPropsParent.getInitialProps = async () => {
|
|
61
47
|
return new Promise((resolve) => {
|
|
62
48
|
setTimeout(() => {
|
|
63
49
|
resolve({
|
|
@@ -65,22 +51,22 @@ TestInitialPropsParent.getInitialProps = () => __awaiter(void 0, void 0, void 0,
|
|
|
65
51
|
});
|
|
66
52
|
}, 100);
|
|
67
53
|
});
|
|
68
|
-
}
|
|
54
|
+
};
|
|
69
55
|
const routerConfig = {
|
|
70
56
|
ssrProps: {},
|
|
71
57
|
routes: [
|
|
72
58
|
{
|
|
73
59
|
path: '/layout',
|
|
74
|
-
component: (props) => (
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
component: (props) => (React.createElement(React.Fragment, null,
|
|
61
|
+
React.createElement("h1", { "data-testid": "layout" }, "Layout"),
|
|
62
|
+
React.createElement("h2", { "data-testid": "routes" }, props.routes.map((r) => r.path).join(',')),
|
|
77
63
|
props.children)),
|
|
78
64
|
routes: [
|
|
79
65
|
{
|
|
80
66
|
path: '/layout',
|
|
81
|
-
component: (props) => (
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
component: (props) => (React.createElement(React.Fragment, null,
|
|
68
|
+
React.createElement("h1", { "data-testid": "test" }, "Foo"),
|
|
69
|
+
React.createElement("h2", { "data-testid": "routes-embed" }, props.routes.map((r) => r.path).join(',')))),
|
|
84
70
|
},
|
|
85
71
|
],
|
|
86
72
|
},
|
|
@@ -89,34 +75,34 @@ const routerConfig = {
|
|
|
89
75
|
routes: [
|
|
90
76
|
{
|
|
91
77
|
path: '/layout-without-component/foo',
|
|
92
|
-
component: () =>
|
|
78
|
+
component: () => React.createElement("h1", { "data-testid": "test" }, "Foo"),
|
|
93
79
|
},
|
|
94
80
|
],
|
|
95
81
|
},
|
|
96
82
|
{
|
|
97
83
|
path: '/users/:id',
|
|
98
84
|
component: (props) => {
|
|
99
|
-
return
|
|
85
|
+
return React.createElement("h1", { "data-testid": "test" }, props.match.params.id);
|
|
100
86
|
},
|
|
101
87
|
},
|
|
102
|
-
{ path: '/bar', component: () =>
|
|
88
|
+
{ path: '/bar', component: () => React.createElement("h1", { "data-testid": "test" }, "Bar") },
|
|
103
89
|
{
|
|
104
90
|
path: '/bar-exact',
|
|
105
91
|
exact: true,
|
|
106
|
-
component: () =>
|
|
92
|
+
component: () => React.createElement("h1", { "data-testid": "test" }, "Bar Exact"),
|
|
107
93
|
},
|
|
108
94
|
{
|
|
109
95
|
path: '/bar-strict/',
|
|
110
96
|
strict: true,
|
|
111
|
-
component: () =>
|
|
97
|
+
component: () => React.createElement("h1", { "data-testid": "test" }, "Bar Strict"),
|
|
112
98
|
},
|
|
113
99
|
{
|
|
114
100
|
path: '/bar-sensitive',
|
|
115
101
|
sensitive: true,
|
|
116
|
-
component: () =>
|
|
102
|
+
component: () => React.createElement("h1", { "data-testid": "test" }, "Bar Sensitive"),
|
|
117
103
|
},
|
|
118
104
|
{ path: '/redirect', redirect: '/d' },
|
|
119
|
-
{ path: '/d', component: () =>
|
|
105
|
+
{ path: '/d', component: () => React.createElement("h1", { "data-testid": "test" }, "Redirect") },
|
|
120
106
|
{ path: '/get-initial-props', component: TestInitialProps },
|
|
121
107
|
{
|
|
122
108
|
path: '/get-initial-props-without-unmount',
|
|
@@ -139,124 +125,124 @@ const routerConfig = {
|
|
|
139
125
|
{
|
|
140
126
|
path: '/props-route',
|
|
141
127
|
foo: 'bar',
|
|
142
|
-
component: (props) => (
|
|
128
|
+
component: (props) => (React.createElement("h1", { "data-testid": "test" }, `${props.route.path} ${props.route.foo}`)),
|
|
143
129
|
},
|
|
144
130
|
{
|
|
145
131
|
path: '/pass-props',
|
|
146
132
|
component: (props) => {
|
|
147
|
-
return
|
|
148
|
-
return
|
|
133
|
+
return React.Children.map(props.children, (child) => {
|
|
134
|
+
return React.cloneElement(child, { foo: 'bar' });
|
|
149
135
|
});
|
|
150
136
|
},
|
|
151
137
|
routes: [
|
|
152
138
|
{
|
|
153
139
|
path: '/pass-props',
|
|
154
|
-
component: (props) =>
|
|
140
|
+
component: (props) => React.createElement("h1", { "data-testid": "test" }, props.foo),
|
|
155
141
|
},
|
|
156
142
|
],
|
|
157
143
|
},
|
|
158
144
|
{
|
|
159
145
|
path: '/wrappers',
|
|
160
|
-
component: () =>
|
|
146
|
+
component: () => React.createElement("h1", null, "foo"),
|
|
161
147
|
wrappers: [
|
|
162
|
-
(props) => (
|
|
163
|
-
|
|
148
|
+
(props) => (React.createElement(React.Fragment, null,
|
|
149
|
+
React.createElement("h1", null,
|
|
164
150
|
"wrapper 1 ",
|
|
165
151
|
props.route.path),
|
|
166
152
|
props.children)),
|
|
167
|
-
(props) => (
|
|
168
|
-
|
|
153
|
+
(props) => (React.createElement(React.Fragment, null,
|
|
154
|
+
React.createElement("h1", null, "wrapper 2"),
|
|
169
155
|
props.children)),
|
|
170
156
|
],
|
|
171
157
|
},
|
|
172
|
-
{ component: () =>
|
|
158
|
+
{ component: () => React.createElement("h1", { "data-testid": "test" }, "Fallback") },
|
|
173
159
|
],
|
|
174
160
|
// plugin: new Plugin(),
|
|
175
161
|
};
|
|
176
|
-
let routes = (
|
|
162
|
+
let routes = renderRoutes(routerConfig);
|
|
177
163
|
beforeEach(() => {
|
|
178
164
|
window.g_useSSR = true;
|
|
179
165
|
window.g_initialProps = null;
|
|
180
166
|
mountCount = 0;
|
|
181
167
|
renderCount = 0;
|
|
182
168
|
});
|
|
183
|
-
afterEach(() =>
|
|
169
|
+
afterEach(async () => {
|
|
184
170
|
delete window.g_useSSR;
|
|
185
171
|
delete window.g_initialProps;
|
|
186
|
-
|
|
187
|
-
})
|
|
188
|
-
test('/layout', () =>
|
|
189
|
-
const { container } =
|
|
172
|
+
await cleanup();
|
|
173
|
+
});
|
|
174
|
+
test('/layout', async () => {
|
|
175
|
+
const { container } = render(React.createElement(MemoryRouter, { initialEntries: ['/layout'] }, routes));
|
|
190
176
|
expect(container).toMatchSnapshot();
|
|
191
|
-
expect((
|
|
192
|
-
expect((
|
|
193
|
-
expect((
|
|
194
|
-
expect((
|
|
195
|
-
})
|
|
196
|
-
test('/layout-without-component', () =>
|
|
197
|
-
|
|
198
|
-
expect((
|
|
199
|
-
})
|
|
200
|
-
test('/bar', () =>
|
|
201
|
-
|
|
202
|
-
expect((
|
|
203
|
-
})
|
|
204
|
-
test('/BAR', () =>
|
|
205
|
-
|
|
206
|
-
expect((
|
|
207
|
-
})
|
|
208
|
-
test('/bar-exact/foo', () =>
|
|
209
|
-
|
|
210
|
-
expect((
|
|
211
|
-
})
|
|
212
|
-
test('/bar-strict', () =>
|
|
213
|
-
|
|
214
|
-
expect((
|
|
215
|
-
})
|
|
216
|
-
test('/BAR-sensitive', () =>
|
|
217
|
-
|
|
218
|
-
expect((
|
|
219
|
-
})
|
|
220
|
-
test('/users/123', () =>
|
|
221
|
-
|
|
222
|
-
expect((
|
|
223
|
-
})
|
|
224
|
-
test('/redirect', () =>
|
|
225
|
-
|
|
226
|
-
expect((
|
|
227
|
-
})
|
|
228
|
-
test('/props-route', () =>
|
|
229
|
-
|
|
230
|
-
expect((
|
|
231
|
-
})
|
|
232
|
-
test('/pass-props', () =>
|
|
233
|
-
const { container } =
|
|
234
|
-
|
|
235
|
-
expect((
|
|
236
|
-
})
|
|
237
|
-
test('/get-initial-props-with-mount', () =>
|
|
238
|
-
const newRoutes = (
|
|
177
|
+
expect((await screen.findByTestId('layout')).innerHTML).toEqual('Layout');
|
|
178
|
+
expect((await screen.findByTestId('routes')).innerHTML).toContain('/layout,/layout-without-component,/users/:id');
|
|
179
|
+
expect((await screen.findByTestId('routes-embed')).innerHTML).toContain('/layout,/layout-without-component,/users/:id');
|
|
180
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Foo');
|
|
181
|
+
});
|
|
182
|
+
test('/layout-without-component', async () => {
|
|
183
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/layout-without-component/foo'] }, routes));
|
|
184
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Foo');
|
|
185
|
+
});
|
|
186
|
+
test('/bar', async () => {
|
|
187
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/bar'] }, routes));
|
|
188
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Bar');
|
|
189
|
+
});
|
|
190
|
+
test('/BAR', async () => {
|
|
191
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/BAR'] }, routes));
|
|
192
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Bar');
|
|
193
|
+
});
|
|
194
|
+
test('/bar-exact/foo', async () => {
|
|
195
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/bar-exact/foo'] }, routes));
|
|
196
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Fallback');
|
|
197
|
+
});
|
|
198
|
+
test('/bar-strict', async () => {
|
|
199
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/bar-strict'] }, routes));
|
|
200
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Fallback');
|
|
201
|
+
});
|
|
202
|
+
test('/BAR-sensitive', async () => {
|
|
203
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/BAR-sensitive'] }, routes));
|
|
204
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Fallback');
|
|
205
|
+
});
|
|
206
|
+
test('/users/123', async () => {
|
|
207
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/users/123'] }, routes));
|
|
208
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('123');
|
|
209
|
+
});
|
|
210
|
+
test('/redirect', async () => {
|
|
211
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/redirect'] }, routes));
|
|
212
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Redirect');
|
|
213
|
+
});
|
|
214
|
+
test('/props-route', async () => {
|
|
215
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/props-route'] }, routes));
|
|
216
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('/props-route bar');
|
|
217
|
+
});
|
|
218
|
+
test('/pass-props', async () => {
|
|
219
|
+
const { container } = render(React.createElement(MemoryRouter, { initialEntries: ['/pass-props'] }, routes));
|
|
220
|
+
await waitFor(() => getByText(container, 'bar'));
|
|
221
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('bar');
|
|
222
|
+
});
|
|
223
|
+
test('/get-initial-props-with-mount', async () => {
|
|
224
|
+
const newRoutes = renderRoutes(routerConfig);
|
|
239
225
|
expect(mountCount).toEqual(0);
|
|
240
226
|
expect(renderCount).toEqual(0);
|
|
241
|
-
const { container } =
|
|
242
|
-
|
|
227
|
+
const { container } = render(React.createElement(MemoryRouter, { initialEntries: ['/get-initial-props-with-mount'] }, newRoutes));
|
|
228
|
+
await waitFor(() => getByText(container, 'bar'));
|
|
243
229
|
expect(mountCount).toEqual(1);
|
|
244
230
|
expect(renderCount).toEqual(2);
|
|
245
|
-
})
|
|
246
|
-
test('/get-initial-props-embed', () =>
|
|
247
|
-
const newRoutes = (
|
|
248
|
-
const { container } =
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
expect((
|
|
252
|
-
expect((
|
|
253
|
-
})
|
|
231
|
+
});
|
|
232
|
+
test('/get-initial-props-embed', async () => {
|
|
233
|
+
const newRoutes = renderRoutes(routerConfig);
|
|
234
|
+
const { container } = render(React.createElement(MemoryRouter, { initialEntries: ['/get-initial-props-embed'] }, newRoutes));
|
|
235
|
+
await waitFor(() => getByText(container, 'bar'));
|
|
236
|
+
await waitFor(() => getByText(container, 'parent'));
|
|
237
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('bar');
|
|
238
|
+
expect((await screen.findByTestId('test-parent')).innerHTML).toEqual('parent');
|
|
239
|
+
});
|
|
254
240
|
test('/wrappers', () => {
|
|
255
|
-
const { container } =
|
|
241
|
+
const { container } = render(React.createElement(MemoryRouter, { initialEntries: ['/wrappers'] }, routes));
|
|
256
242
|
expect(container.innerHTML).toEqual('<h1>wrapper 1 /wrappers</h1><h1>wrapper 2</h1><h1>foo</h1>');
|
|
257
243
|
});
|
|
258
|
-
test('/fallback-20140924', () =>
|
|
259
|
-
|
|
260
|
-
expect((
|
|
261
|
-
})
|
|
244
|
+
test('/fallback-20140924', async () => {
|
|
245
|
+
render(React.createElement(MemoryRouter, { initialEntries: ['/fallback-20140924'] }, routes));
|
|
246
|
+
expect((await screen.findByTestId('test')).innerHTML).toEqual('Fallback');
|
|
247
|
+
});
|
|
262
248
|
//# sourceMappingURL=render-routes.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-routes.test.js","sourceRoot":"","sources":["../../src/route/render-routes.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-routes.test.js","sourceRoot":"","sources":["../../src/route/render-routes.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,GACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CA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navigationRef = (0, react_1.createRef)();
|
|
6
|
-
function navigate(name, params) {
|
|
1
|
+
import { createRef } from 'react';
|
|
2
|
+
export const navigationRef = createRef();
|
|
3
|
+
export function navigate(name, params) {
|
|
7
4
|
}
|
|
8
|
-
exports.navigate = navigate;
|
|
9
5
|
//# sourceMappingURL=root-navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-navigation.js","sourceRoot":"","sources":["../../src/route/root-navigation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"root-navigation.js","sourceRoot":"","sources":["../../src/route/root-navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,CAAC,MAAM,aAAa,GAAQ,SAAS,EAAE,CAAA;AAE7C,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,MAAa;AAEpD,CAAC"}
|