@shuvi/platform-web 1.0.7 → 1.0.8
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.
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const doura_1 = require("doura");
|
|
4
|
-
const shared_1 = require("@shuvi/platform-shared/shared");
|
|
1
|
+
import { doura } from 'doura';
|
|
2
|
+
import { createRuntimePlugin, getPageData } from '@shuvi/platform-shared/shared';
|
|
5
3
|
let currentStore;
|
|
6
4
|
const isServer = typeof window === 'undefined';
|
|
7
5
|
// for client, singleton mode
|
|
8
6
|
// for server, return new store
|
|
9
7
|
const initStore = ({ initialState, ctx }) => {
|
|
10
8
|
const createStoreInstance = () => {
|
|
11
|
-
|
|
12
|
-
// ...ctx,
|
|
13
|
-
// isServer
|
|
14
|
-
// });
|
|
15
|
-
return (0, doura_1.doura)({
|
|
9
|
+
return doura({
|
|
16
10
|
initialState
|
|
17
11
|
});
|
|
18
12
|
};
|
|
@@ -26,11 +20,11 @@ const initStore = ({ initialState, ctx }) => {
|
|
|
26
20
|
}
|
|
27
21
|
return currentStore;
|
|
28
22
|
};
|
|
29
|
-
|
|
23
|
+
export default createRuntimePlugin({
|
|
30
24
|
appContext: ctx => {
|
|
31
25
|
let initialState = {};
|
|
32
26
|
if (!isServer) {
|
|
33
|
-
initialState =
|
|
27
|
+
initialState = getPageData('shuviInitialState', {});
|
|
34
28
|
}
|
|
35
29
|
ctx.store = initStore({
|
|
36
30
|
ctx,
|
|
@@ -23,7 +23,7 @@ const core = (0, service_1.createPlugin)({
|
|
|
23
23
|
exports.default = {
|
|
24
24
|
core,
|
|
25
25
|
runtime: {
|
|
26
|
-
plugin: (0, paths_1.resolvePkgFile)('
|
|
26
|
+
plugin: (0, paths_1.resolvePkgFile)('esm/shuvi-app/model/runtime.js')
|
|
27
27
|
},
|
|
28
28
|
server: server_1.default,
|
|
29
29
|
types: (0, paths_1.resolvePkgFile)('lib/node/features/model/shuvi-app.d.ts')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/platform-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -72,17 +72,17 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@next/react-refresh-utils": "12.1.6",
|
|
75
|
-
"@shuvi/error-overlay": "1.0.
|
|
76
|
-
"@shuvi/hook": "1.0.
|
|
77
|
-
"@shuvi/platform-shared": "1.0.
|
|
78
|
-
"doura": "0.0.
|
|
79
|
-
"react-doura": "0.0.
|
|
80
|
-
"@shuvi/router": "1.0.
|
|
81
|
-
"@shuvi/router-react": "1.0.
|
|
82
|
-
"@shuvi/runtime": "1.0.
|
|
83
|
-
"@shuvi/shared": "1.0.
|
|
84
|
-
"@shuvi/toolpack": "1.0.
|
|
85
|
-
"@shuvi/utils": "1.0.
|
|
75
|
+
"@shuvi/error-overlay": "1.0.8",
|
|
76
|
+
"@shuvi/hook": "1.0.8",
|
|
77
|
+
"@shuvi/platform-shared": "1.0.8",
|
|
78
|
+
"doura": "0.0.4",
|
|
79
|
+
"react-doura": "0.0.4",
|
|
80
|
+
"@shuvi/router": "1.0.8",
|
|
81
|
+
"@shuvi/router-react": "1.0.8",
|
|
82
|
+
"@shuvi/runtime": "1.0.8",
|
|
83
|
+
"@shuvi/shared": "1.0.8",
|
|
84
|
+
"@shuvi/toolpack": "1.0.8",
|
|
85
|
+
"@shuvi/utils": "1.0.8",
|
|
86
86
|
"content-type": "1.0.4",
|
|
87
87
|
"core-js": "3.6.5",
|
|
88
88
|
"ejs": "3.1.5",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"whatwg-fetch": "3.0.0"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@shuvi/service": "1.0.
|
|
101
|
+
"@shuvi/service": "1.0.8"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@shuvi/service": "workspace:*",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Doura } from 'doura';
|
|
2
|
-
import { IAppContext } from '@shuvi/platform-shared/shared';
|
|
3
|
-
export declare type InitDoura = (params: {
|
|
4
|
-
initialState: any;
|
|
5
|
-
ctx: IAppContext;
|
|
6
|
-
}) => Doura;
|
|
7
|
-
declare const _default: import("@shuvi/platform-shared/shared").IPluginInstance<import("@shuvi/platform-shared/shared").RuntimePluginHooks, void>;
|
|
8
|
-
export default _default;
|