Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replaced hogan.js by handlebars #1456

Merged
merged 9 commits into from
Dec 28, 2022
2 changes: 1 addition & 1 deletion packages/uikit-workshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
"express": "^4.17.1",
"fg-loadjs": "^1.1.0",
"fuse.js": "^6.4.6",
"handlebars": "^4.7.7",
"hard-source-webpack-plugin-patch": "^0.13.3",
"hasha": "^5.2.2",
"hogan.js": "^3.0.2",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^4.0.0-beta.11",
"lit-element": "^2.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
/* eslint-disable no-param-reassign, no-unused-vars */

import Hogan from 'hogan.js';
import Handlebars from 'handlebars';
import pretty from 'pretty';
import { html, render } from 'lit-html';
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
Expand Down Expand Up @@ -175,7 +175,7 @@ export const panelsViewer = {
} else {
// vanilla render of pattern data
template = document.getElementById(panel.templateID);
templateCompiled = Hogan.compile(template.innerHTML);
templateCompiled = Handlebars.compile(template.innerHTML);
templateRendered = templateCompiled.render(patternData);
const normalizedCode =
normalizeWhitespace.normalize(templateRendered);
Expand Down Expand Up @@ -272,7 +272,7 @@ export const panelsViewer = {
}
}

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

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

// make sure templateRendered is modified to be an HTML element
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8181,18 +8181,18 @@ hmac-drbg@^1.0.1:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"

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

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/hogan/-/hogan-1.0.2.tgz#d8d5e57fae0e7787b3e01e14256f9d588a23d1f0"
integrity sha1-2NXlf64Od4ez4B4UJW+dWIoj0fA=
integrity sha512-2RV7G4f+Rt9YIYDu01r6pgZvP+XhrXi/JKlXd4b+vRybXk94ui4PQjbh/lFaH8gQtxCygy/WKkqmpm0IyZysJA==
dependencies:
hogan.js "*"

Expand Down Expand Up @@ -11064,7 +11064,7 @@ mkdirp2@^1.0.4:
[email protected]:
version "0.3.0"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=
integrity sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==

[email protected]:
version "0.5.1"
Expand Down Expand Up @@ -11410,7 +11410,7 @@ [email protected]:
[email protected]:
version "1.0.10"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=
integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==
dependencies:
abbrev "1"

Expand Down