From 8406291fb8d641b96158d87c0b9c37297dbf328b Mon Sep 17 00:00:00 2001 From: Louie Long Date: Mon, 16 Dec 2019 16:19:22 +0800 Subject: [PATCH] large json parsing optimization There's a chance that the initial state of the page may contain very large json object. The evaluation of large json object is slow compared to calling JSON.parse function. Pls see https://www.bram.us/2019/11/25/faster-javascript-apps-with-json-parse/ --- lib/resource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resource.js b/lib/resource.js index 0139d73..49f2f7c 100644 --- a/lib/resource.js +++ b/lib/resource.js @@ -141,7 +141,7 @@ class Resource { bodyInject.push(this.createScriptSrcTag(url)); }); if (this.isInjectInlineResouce() && !/window.__INITIAL_STATE__/.test(html)) { - bodyInject.unshift(``); + bodyInject.unshift(``); } } this.injectHead(headInject);