Skip to content

Commit

Permalink
use visitOptions.renderMode to turn on rehydration
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Mar 26, 2021
1 parent 3a8e385 commit a1d1a8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/fastboot/src/ember-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ class EmberApp {
let buildSandboxPerVisit = options.buildSandboxPerVisit || false;

let shouldRender = options.shouldRender !== undefined ? options.shouldRender : true;
let bootOptions = buildBootOptions(shouldRender);
let renderMode = process.env.EXPERIMENTAL_RENDER_MODE_SERIALIZE
? 'serialize'
: options.renderMode;
let bootOptions = buildBootOptions(shouldRender, renderMode);
let fastbootInfo = new FastBootInfo(req, res, {
hostWhitelist: this.hostWhitelist,
metadata: options.metadata,
Expand Down Expand Up @@ -355,17 +358,16 @@ class EmberApp {
* Builds an object with the options required to boot an ApplicationInstance in
* FastBoot mode.
*/
function buildBootOptions(shouldRender) {
function buildBootOptions(shouldRender, renderMode) {
let doc = new SimpleDOM.Document();
let rootElement = doc.body;
let _renderMode = process.env.EXPERIMENTAL_RENDER_MODE_SERIALIZE ? 'serialize' : undefined;

return {
isBrowser: false,
document: doc,
rootElement,
shouldRender,
_renderMode,
_renderMode: renderMode,
};
}

Expand Down

0 comments on commit a1d1a8a

Please sign in to comment.