From 88298562685867d31772ddbaf5ca8aad3a8a20ab Mon Sep 17 00:00:00 2001 From: Emil Ajdyna Date: Thu, 18 Apr 2024 18:45:22 +0200 Subject: [PATCH] Remove lodash.template from the benchmark --- benchmark/index.js | 18 ++++++---------- package-lock.json | 53 +--------------------------------------------- package.json | 1 - 3 files changed, 7 insertions(+), 65 deletions(-) diff --git a/benchmark/index.js b/benchmark/index.js index 12aee5f9..0746bc05 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -6,7 +6,6 @@ const { } = require("fs") const { Suite } = require("benchmark") const underscore = require("underscore") -const template = require("lodash.template") const handlebars = require("handlebars") const mustache = require("mustache") const { compile } = require("..") @@ -34,10 +33,9 @@ async function benchmark(dir) { path.join(__dirname, `./fixtures/${dir}/boxwood.js`) ) const fn2 = underscore.template(source2) - const fn3 = template(source3) - const fn4 = handlebars.compile(source4) - const fn5 = (data) => mustache.render(source5, data) - const fn6 = require(path.join(__dirname, `./fixtures/${dir}/vanilla.js`)) + const fn3 = handlebars.compile(source4) + const fn4 = (data) => mustache.render(source5, data) + const fn5 = require(path.join(__dirname, `./fixtures/${dir}/vanilla.js`)) mustache.parse(source5) const data = require(path.join(__dirname, `./fixtures/${dir}/data.json`)) @@ -52,12 +50,11 @@ async function benchmark(dir) { assert.deepEqual(result, normalize(fn3(data))) assert.deepEqual(result, normalize(fn4(data))) assert.deepEqual(result, normalize(fn5(data))) - assert.deepEqual(result, normalize(fn6(data))) await new Promise((resolve) => { suite .add("vanilla[js]", function () { - fn6(data) + fn5(data) }) .add("boxwood[js]", function () { fn1(data) @@ -65,14 +62,11 @@ async function benchmark(dir) { .add("underscore[ejs]", function () { fn2(data) }) - .add("lodash[ejs]", function () { - fn3(data) - }) .add("handlebars[hbs]", function () { - fn4(data) + fn3(data) }) .add("mustache[mst]", function () { - fn5(data) + fn4(data) }) .on("cycle", function (event) { console.log(`${dir}: ${String(event.target)}`) diff --git a/package-lock.json b/package-lock.json index 6a9a87e2..ce44cdf4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,12 +20,11 @@ "express": "^4.19.2", "handlebars": "^4.7.8", "jsdom": "^24.0.0", - "lodash.template": "4.5.0", "mustache": "^4.2.0", "underscore": "^1.13.6" }, "engines": { - "node": ">= 16.13.1" + "node": ">= 20.11.1" } }, "node_modules/@bcoe/v8-coverage": { @@ -2111,31 +2110,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "node_modules/lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "dependencies": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "node_modules/lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "dependencies": { - "lodash._reinterpolate": "^3.0.0" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -5371,31 +5345,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", diff --git a/package.json b/package.json index d05faa5c..65d82c97 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "express": "^4.19.2", "handlebars": "^4.7.8", "jsdom": "^24.0.0", - "lodash.template": "4.5.0", "mustache": "^4.2.0", "underscore": "^1.13.6" },