Skip to content

Commit 5bd07aa

Browse files
refactor: replaced hogan.js by handlebars (pattern-lab#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 74535d5 commit 5bd07aa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/uikit-workshop/package.json

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

0 commit comments

Comments
 (0)