@shuvi/platform-web 1.0.15 → 1.0.17

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.
@@ -28,6 +28,6 @@ export interface IManifest {
28
28
  [file: string]: string;
29
29
  };
30
30
  loadble: {
31
- [s: string]: IModule;
31
+ [s: string]: IModule | undefined;
32
32
  };
33
33
  }
@@ -131,3 +131,6 @@ export const createApp = ({ routes, appData, appComponent }) => {
131
131
  }));
132
132
  return app;
133
133
  };
134
+ if (module.hot) {
135
+ module.hot.accept('@shuvi/app/files/page-loaders');
136
+ }
@@ -110,6 +110,11 @@ function onFastRefresh(hasUpdates) {
110
110
  const endLatency = Date.now();
111
111
  const latency = endLatency - startLatency;
112
112
  console.log(`[Fast Refresh] done in ${latency}ms`);
113
+ sendMessage(JSON.stringify({
114
+ event: 'client-hmr-latency',
115
+ startTime: startLatency,
116
+ endTime: endLatency
117
+ }));
113
118
  }
114
119
  }
115
120
  // Successful compilation.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import error from './Error';
3
- import userError from '@shuvi/app/core/error';
3
+ import userError from '@shuvi/app/user/error';
4
4
  const Error = userError || error;
5
5
  export default function ErrorPage({ code, message }) {
6
6
  return <Error errorCode={code} errorDesc={message}/>;
@@ -4,7 +4,7 @@ function generateFilesByRoutId(assetMap, routes) {
4
4
  let filesByRoutId = {};
5
5
  const loadable = assetMap.loadble;
6
6
  routes.forEach(({ id, __componentRawRequest__ }) => {
7
- if (__componentRawRequest__) {
7
+ if (__componentRawRequest__ && loadable[__componentRawRequest__]) {
8
8
  filesByRoutId[id] = loadable[__componentRawRequest__].files;
9
9
  }
10
10
  });
@@ -28,6 +28,6 @@ export interface IManifest {
28
28
  [file: string]: string;
29
29
  };
30
30
  loadble: {
31
- [s: string]: IModule;
31
+ [s: string]: IModule | undefined;
32
32
  };
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuvi/platform-web",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
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.15",
76
- "@shuvi/hook": "1.0.15",
77
- "@shuvi/platform-shared": "1.0.15",
78
- "doura": "0.0.7",
79
- "react-doura": "0.0.7",
80
- "@shuvi/router": "1.0.15",
81
- "@shuvi/router-react": "1.0.15",
82
- "@shuvi/runtime": "1.0.15",
83
- "@shuvi/shared": "1.0.15",
84
- "@shuvi/toolpack": "1.0.15",
85
- "@shuvi/utils": "1.0.15",
75
+ "@shuvi/error-overlay": "1.0.17",
76
+ "@shuvi/hook": "1.0.17",
77
+ "@shuvi/platform-shared": "1.0.17",
78
+ "doura": "0.0.8",
79
+ "react-doura": "0.0.8",
80
+ "@shuvi/router": "1.0.17",
81
+ "@shuvi/router-react": "1.0.17",
82
+ "@shuvi/runtime": "1.0.17",
83
+ "@shuvi/shared": "1.0.17",
84
+ "@shuvi/toolpack": "1.0.17",
85
+ "@shuvi/utils": "1.0.17",
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.15"
101
+ "@shuvi/service": "1.0.17"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@shuvi/service": "workspace:*",