Skip to content

Commit 0cb5b43

Browse files
refactor: replaced hogan.js by handlebars (#1456)
* refactor: replaced hogan.js by handlebars In an effort to keep our codebase up to date, we're replacing the much older hogan.js by handlebars * chore: regenerated yarn.lock file * chore: we don't need to pin that version * chore: let's revert those for the moment as they aren't as critical as the uikit-workshop package Co-authored-by: Josef Bredreck <13408112+JosefBredereck@users.noreply.github.com>
1 parent ef5fe8b commit 0cb5b43

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

packages/uikit-workshop/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
"express": "^4.17.1",
6464
"fg-loadjs": "^1.1.0",
6565
"fuse.js": "^6.4.6",
66+
"handlebars": "^4.7.7",
6667
"hard-source-webpack-plugin-patch": "^0.13.3",
6768
"hasha": "^5.2.2",
68-
"hogan.js": "^3.0.2",
6969
"html-loader": "^0.5.5",
7070
"html-webpack-plugin": "^4.0.0-beta.11",
7171
"lit-element": "^2.2.1",

packages/uikit-workshop/src/scripts/components/panels-viewer.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
/* eslint-disable no-param-reassign, no-unused-vars */
55

6-
import Hogan from 'hogan.js';
6+
import Handlebars from 'handlebars';
77
import pretty from 'pretty';
88
import { html, render } from 'lit-html';
99
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
@@ -175,7 +175,7 @@ export const panelsViewer = {
175175
} else {
176176
// vanilla render of pattern data
177177
template = document.getElementById(panel.templateID);
178-
templateCompiled = Hogan.compile(template.innerHTML);
178+
templateCompiled = Handlebars.compile(template.innerHTML);
179179
templateRendered = templateCompiled.render(patternData);
180180
const normalizedCode =
181181
normalizeWhitespace.normalize(templateRendered);
@@ -272,7 +272,7 @@ export const panelsViewer = {
272272
}
273273
}
274274

275-
// add *Exists attributes for Hogan templates
275+
// add *Exists attributes for Handlebars templates
276276
// figure out if the description exists
277277
patternData.patternDescExists =
278278
patternData.patternDesc.length > 0 ||
@@ -304,7 +304,7 @@ export const panelsViewer = {
304304

305305
// render all of the panels in the base panel template
306306
const template = document.querySelector('.pl-js-panel-template-base');
307-
const templateCompiled = Hogan.compile(template.innerHTML);
307+
const templateCompiled = Handlebars.compile(template.innerHTML);
308308
templateRendered = templateCompiled.render(patternData);
309309

310310
// make sure templateRendered is modified to be an HTML element

yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -8186,18 +8186,18 @@ hmac-drbg@^1.0.1:
81868186
minimalistic-assert "^1.0.0"
81878187
minimalistic-crypto-utils "^1.0.1"
81888188

8189-
hogan.js@*, hogan.js@^3.0.2:
8189+
hogan.js@*:
81908190
version "3.0.2"
81918191
resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd"
8192-
integrity sha1-TNnhq9QpQUbnZ55B14mHMrAse/0=
8192+
integrity sha512-RqGs4wavGYJWE07t35JQccByczmNUXQT0E12ZYV1VKYu5UiAU9lsos/yBAcf840+zrUQQxgVduCR5/B8nNtibg==
81938193
dependencies:
81948194
mkdirp "0.3.0"
81958195
nopt "1.0.10"
81968196

81978197
hogan@1.0.2:
81988198
version "1.0.2"
81998199
resolved "https://registry.yarnpkg.com/hogan/-/hogan-1.0.2.tgz#d8d5e57fae0e7787b3e01e14256f9d588a23d1f0"
8200-
integrity sha1-2NXlf64Od4ez4B4UJW+dWIoj0fA=
8200+
integrity sha512-2RV7G4f+Rt9YIYDu01r6pgZvP+XhrXi/JKlXd4b+vRybXk94ui4PQjbh/lFaH8gQtxCygy/WKkqmpm0IyZysJA==
82018201
dependencies:
82028202
hogan.js "*"
82038203

@@ -11080,7 +11080,7 @@ mkdirp2@^1.0.4:
1108011080
mkdirp@0.3.0:
1108111081
version "0.3.0"
1108211082
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
11083-
integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=
11083+
integrity sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==
1108411084

1108511085
mkdirp@0.5.1:
1108611086
version "0.5.1"
@@ -11426,7 +11426,7 @@ noms@0.0.0:
1142611426
nopt@1.0.10:
1142711427
version "1.0.10"
1142811428
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
11429-
integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=
11429+
integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==
1143011430
dependencies:
1143111431
abbrev "1"
1143211432

0 commit comments

Comments
 (0)