Skip to content

Commit e5ccf0e

Browse files
authored
refactor: replaced hogan by handlebars (#1465)
* refactor: replaced hogan.js by handlebars * refactor: switched from hogan to handlebars
1 parent 470d37c commit e5ccf0e

File tree

5 files changed

+7
-34
lines changed

5 files changed

+7
-34
lines changed

packages/engine-react/lib/engine_react.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const path = require('path');
1414
const React = require('react');
1515
const ReactDOMServer = require('react-dom/server');
1616
const Babel = require('babel-core');
17-
const Hogan = require('hogan');
17+
const Handlebars = require('handlebars');
1818
const beautify = require('js-beautify');
1919
const cheerio = require('cheerio');
2020
const _require = require;
@@ -44,8 +44,8 @@ let patternLabConfig = {};
4444

4545
let enableRuntimeCode = true;
4646

47-
const outputTemplate = Hogan.compile(
48-
fs.readFileSync(path.join(__dirname, './outputTemplate.mustache'), 'utf8')
47+
const outputTemplate = Handlebars.compile(
48+
fs.readFileSync(path.join(__dirname, './outputTemplate.hbs'), 'utf8')
4949
);
5050

5151
let registeredComponents = {
@@ -106,7 +106,7 @@ var engine_react = {
106106
React.createFactory(transpiledModule)(data)
107107
);
108108

109-
renderedHTML = outputTemplate.render({
109+
renderedHTML = outputTemplate({
110110
htmlOutput: staticMarkup,
111111
});
112112

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{{htmlOutput}}}

packages/engine-react/lib/outputTemplate.mustache

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/engine-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"babel-plugin-transform-es2015-modules-commonjs": "6.16.0",
1010
"babel-preset-react": "6.16.0",
1111
"cheerio": "0.22.0",
12-
"hogan": "1.0.2",
12+
"handlebars": "4.7.7",
1313
"js-beautify": "1.13.5",
1414
"react": "15.3.2",
1515
"react-dom": "15.3.2"

yarn.lock

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7972,7 +7972,7 @@ hamljs@^0.6.2:
79727972
resolved "https://registry.yarnpkg.com/hamljs/-/hamljs-0.6.2.tgz#7b7116cf6dbe7278e42b3f6ef8725a33e177c8e3"
79737973
integrity sha1-e3EWz22+cnjkKz9u+HJaM+F3yOM=
79747974

7975-
handlebars@^4.7.6, handlebars@^4.7.7:
7975+
handlebars@4.7.7, handlebars@^4.7.6, handlebars@^4.7.7:
79767976
version "4.7.7"
79777977
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
79787978
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
@@ -8181,21 +8181,6 @@ hmac-drbg@^1.0.1:
81818181
minimalistic-assert "^1.0.0"
81828182
minimalistic-crypto-utils "^1.0.1"
81838183

8184-
hogan.js@*:
8185-
version "3.0.2"
8186-
resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd"
8187-
integrity sha512-RqGs4wavGYJWE07t35JQccByczmNUXQT0E12ZYV1VKYu5UiAU9lsos/yBAcf840+zrUQQxgVduCR5/B8nNtibg==
8188-
dependencies:
8189-
mkdirp "0.3.0"
8190-
nopt "1.0.10"
8191-
8192-
hogan@1.0.2:
8193-
version "1.0.2"
8194-
resolved "https://registry.yarnpkg.com/hogan/-/hogan-1.0.2.tgz#d8d5e57fae0e7787b3e01e14256f9d588a23d1f0"
8195-
integrity sha512-2RV7G4f+Rt9YIYDu01r6pgZvP+XhrXi/JKlXd4b+vRybXk94ui4PQjbh/lFaH8gQtxCygy/WKkqmpm0IyZysJA==
8196-
dependencies:
8197-
hogan.js "*"
8198-
81998184
home-or-tmp@^2.0.0:
82008185
version "2.0.0"
82018186
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
@@ -11072,11 +11057,6 @@ mkdirp2@^1.0.4:
1107211057
resolved "https://registry.yarnpkg.com/mkdirp2/-/mkdirp2-1.0.5.tgz#68bbe61defefafce4b48948608ec0bac942512c2"
1107311058
integrity sha512-xOE9xbICroUDmG1ye2h4bZ8WBie9EGmACaco8K8cx6RlkJJrxGIqjGqztAI+NMhexXBcdGbSEzI6N3EJPevxZw==
1107411059

11075-
mkdirp@0.3.0:
11076-
version "0.3.0"
11077-
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
11078-
integrity sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==
11079-
1108011060
mkdirp@0.5.1:
1108111061
version "0.5.1"
1108211062
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
@@ -11418,13 +11398,6 @@ noms@0.0.0:
1141811398
inherits "^2.0.1"
1141911399
readable-stream "~1.0.31"
1142011400

11421-
nopt@1.0.10:
11422-
version "1.0.10"
11423-
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
11424-
integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==
11425-
dependencies:
11426-
abbrev "1"
11427-
1142811401
nopt@^4.0.1:
1142911402
version "4.0.3"
1143011403
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"

0 commit comments

Comments
 (0)