From 1529a7e99cf172ff915477a30a414d054d66edbf Mon Sep 17 00:00:00 2001 From: Christian Lent Date: Thu, 13 Feb 2020 17:29:38 -0500 Subject: [PATCH] New pbundle option "packReduxData" for SSR redux state --- packages/subapp-pbundle/lib/framework-lib.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/subapp-pbundle/lib/framework-lib.js b/packages/subapp-pbundle/lib/framework-lib.js index f0f313feb..b53129ea1 100644 --- a/packages/subapp-pbundle/lib/framework-lib.js +++ b/packages/subapp-pbundle/lib/framework-lib.js @@ -37,6 +37,12 @@ class FrameworkLib { await this.realizeReduxStore(); } + const packReduxData = + this.ref.subAppServer.packReduxData || this.ref.subApp.packReduxData; + if (packReduxData) { + this.initialStateStr = JSON.stringify(packReduxData(this.store)); + } + return this.handleSSRSync(); }