Skip to content

Commit

Permalink
fix: subapp ssr initial load (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
divyakarippath authored Aug 14, 2020
1 parent 6c2f30e commit 5600ac0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/subapp-web/lib/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ Response: ${err || body}`

context.user.numOfSubapps = context.user.numOfSubapps || 0;


let { group = "_" } = props;
group = [].concat(group);
const ssrGroups = group.map(grp =>
Expand Down Expand Up @@ -352,10 +351,11 @@ ${stack}`,
}

if (
subAppLoadTime === 0 || // subapp has not been loaded yet, so must load once
!request.app.webpackDev ||
(request.app.webpackDev && subAppLoadTime < request.app.webpackDev.compileTime)
) {
subAppLoadTime = _.get(request, "app.webpackDev.compileTime", 0);
subAppLoadTime = _.get(request, "app.webpackDev.compileTime", Date.now());
loadSubApp();
}
const ref = {
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-app-dev/src/lib/app-dev-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AppDevMiddleware {
webpackDev: any;

constructor() {
this.webpackDev = { valid: false, hasErrors: false, hasWarnings: false };
this.webpackDev = { valid: false, hasErrors: false, hasWarnings: false, compileTime: Date.now() };
}

handleWebpackReport(data) {
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-app-dev/src/lib/dev-admin/admin-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ ${info.name} - assuming it started.</>`);
info._child.on("message", messageHandler);

if (info.options.noTimeoutCheck !== true) {
startTimeout = setTimeout(handleTimeout, 5000);
startTimeout = setTimeout(handleTimeout, 20000);
}

return defer.promise;
Expand Down

0 comments on commit 5600ac0

Please sign in to comment.