From 0896d00c2ebd10f9b5fae99ee97620a2017ab980 Mon Sep 17 00:00:00 2001
From: Jakob Linskeseder <jakob@linskeseder.com>
Date: Sun, 2 Jan 2022 00:08:06 +0100
Subject: [PATCH] Remove outdated `eco` package from bench

The `eco`-templates (Embedded CoffeeScript templates)
had their last update over 10 years ago, so we can
remove this dependency from our benchmark.
---
 package-lock.json                      | 62 --------------------------
 package.json                           |  1 -
 tests/bench/templates/array-each.js    |  3 +-
 tests/bench/templates/complex.eco      | 14 ------
 tests/bench/templates/complex.js       |  1 -
 tests/bench/templates/depth-1.js       |  3 +-
 tests/bench/templates/depth-2.js       |  4 +-
 tests/bench/templates/object.js        |  1 -
 tests/bench/templates/paths.js         |  2 -
 tests/bench/templates/string.js        |  3 +-
 tests/bench/templates/subexpression.js |  3 +-
 tests/bench/templates/variables.js     |  3 +-
 tests/bench/throughput.js              | 25 +----------
 13 files changed, 7 insertions(+), 118 deletions(-)
 delete mode 100644 tests/bench/templates/complex.eco

diff --git a/package-lock.json b/package-lock.json
index 80b3e9e64..340373776 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -29,7 +29,6 @@
         "concurrently": "^5.0.0",
         "dirty-chai": "^2.0.1",
         "dustjs-linkedin": "^2.0.2",
-        "eco": "~1.1.0-rc-3",
         "eslint": "^6.7.2",
         "eslint-config-prettier": "^6.7.0",
         "eslint-plugin-compat": "^3.13.0",
@@ -3517,20 +3516,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/coffee-script": {
-      "version": "1.12.7",
-      "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz",
-      "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==",
-      "deprecated": "CoffeeScript on NPM has moved to \"coffeescript\" (no hyphen)",
-      "dev": true,
-      "bin": {
-        "cake": "bin/cake",
-        "coffee": "bin/coffee"
-      },
-      "engines": {
-        "node": ">=0.8.0"
-      }
-    },
     "node_modules/collection-visit": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
@@ -4731,22 +4716,6 @@
         "safer-buffer": "^2.1.0"
       }
     },
-    "node_modules/eco": {
-      "version": "1.1.0-rc-3",
-      "resolved": "https://registry.npmjs.org/eco/-/eco-1.1.0-rc-3.tgz",
-      "integrity": "sha1-dCoyxGFa9wWrPppGts5cFtvFcmI=",
-      "dev": true,
-      "dependencies": {
-        "coffee-script": ">=1.2.0",
-        "strscan": ">=1.0.1"
-      },
-      "bin": {
-        "eco": "bin/eco"
-      },
-      "engines": {
-        "node": "*"
-      }
-    },
     "node_modules/ee-first": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -14886,15 +14855,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/strscan": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/strscan/-/strscan-1.0.1.tgz",
-      "integrity": "sha1-Ry2bwAxo6QbvL8Is33Yr58YazE0=",
-      "dev": true,
-      "engines": {
-        "node": "*"
-      }
-    },
     "node_modules/supports-color": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@@ -19077,12 +19037,6 @@
       "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
       "dev": true
     },
-    "coffee-script": {
-      "version": "1.12.7",
-      "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz",
-      "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==",
-      "dev": true
-    },
     "collection-visit": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
@@ -20062,16 +20016,6 @@
         "safer-buffer": "^2.1.0"
       }
     },
-    "eco": {
-      "version": "1.1.0-rc-3",
-      "resolved": "https://registry.npmjs.org/eco/-/eco-1.1.0-rc-3.tgz",
-      "integrity": "sha1-dCoyxGFa9wWrPppGts5cFtvFcmI=",
-      "dev": true,
-      "requires": {
-        "coffee-script": ">=1.2.0",
-        "strscan": ">=1.0.1"
-      }
-    },
     "ee-first": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -28185,12 +28129,6 @@
       "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
       "dev": true
     },
-    "strscan": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/strscan/-/strscan-1.0.1.tgz",
-      "integrity": "sha1-Ry2bwAxo6QbvL8Is33Yr58YazE0=",
-      "dev": true
-    },
     "supports-color": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
diff --git a/package.json b/package.json
index 0778a2b3b..cb2ec8807 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,6 @@
     "concurrently": "^5.0.0",
     "dirty-chai": "^2.0.1",
     "dustjs-linkedin": "^2.0.2",
-    "eco": "~1.1.0-rc-3",
     "eslint": "^6.7.2",
     "eslint-config-prettier": "^6.7.0",
     "eslint-plugin-compat": "^3.13.0",
diff --git a/tests/bench/templates/array-each.js b/tests/bench/templates/array-each.js
index ddf07a6fe..bf5e36b74 100644
--- a/tests/bench/templates/array-each.js
+++ b/tests/bench/templates/array-each.js
@@ -9,6 +9,5 @@ module.exports = {
   },
   handlebars: '{{#each names}}{{name}}{{/each}}',
   dust: '{#names}{name}{/names}',
-  mustache: '{{#names}}{{name}}{{/names}}',
-  eco: '<% for item in @names: %><%= item.name %><% end %>'
+  mustache: '{{#names}}{{name}}{{/names}}'
 };
diff --git a/tests/bench/templates/complex.eco b/tests/bench/templates/complex.eco
deleted file mode 100644
index 42fb55b48..000000000
--- a/tests/bench/templates/complex.eco
+++ /dev/null
@@ -1,14 +0,0 @@
-<h1><%= @header() %></h1>
-<% if @items.length: %>
-  <ul>
-    <% for item in @items: %>
-      <% if item.current: %>
-        <li><strong><%= item.name %></strong></li>
-      <% else: %>
-        <li><a href="<%= item.url %>"><%= item.name %></a></li>
-      <% end %>
-    <% end %>
-  </ul>
-<% else: %>
-  <p>The list is empty.</p>
-<% end %>
diff --git a/tests/bench/templates/complex.js b/tests/bench/templates/complex.js
index 545a479cb..d221fdb26 100644
--- a/tests/bench/templates/complex.js
+++ b/tests/bench/templates/complex.js
@@ -15,6 +15,5 @@ module.exports = {
 
   handlebars: fs.readFileSync(__dirname + '/complex.handlebars').toString(),
   dust: fs.readFileSync(__dirname + '/complex.dust').toString(),
-  eco: fs.readFileSync(__dirname + '/complex.eco').toString(),
   mustache: fs.readFileSync(__dirname + '/complex.mustache').toString()
 };
diff --git a/tests/bench/templates/depth-1.js b/tests/bench/templates/depth-1.js
index 65cb33b71..7d41bb74c 100644
--- a/tests/bench/templates/depth-1.js
+++ b/tests/bench/templates/depth-1.js
@@ -9,6 +9,5 @@ module.exports = {
     foo: 'bar'
   },
   handlebars: '{{#each names}}{{../foo}}{{/each}}',
-  mustache: '{{#names}}{{foo}}{{/names}}',
-  eco: '<% for item in @names: %><%= @foo %><% end %>'
+  mustache: '{{#names}}{{foo}}{{/names}}'
 };
diff --git a/tests/bench/templates/depth-2.js b/tests/bench/templates/depth-2.js
index bef804d1e..62f2884c9 100644
--- a/tests/bench/templates/depth-2.js
+++ b/tests/bench/templates/depth-2.js
@@ -10,7 +10,5 @@ module.exports = {
   },
   handlebars:
     '{{#each names}}{{#each name}}{{../bat}}{{../../foo}}{{/each}}{{/each}}',
-  mustache: '{{#names}}{{#name}}{{bat}}{{foo}}{{/name}}{{/names}}',
-  eco:
-    '<% for item in @names: %><% for child in item.name: %><%= item.bat %><%= @foo %><% end %><% end %>'
+  mustache: '{{#names}}{{#name}}{{bat}}{{foo}}{{/name}}{{/names}}'
 };
diff --git a/tests/bench/templates/object.js b/tests/bench/templates/object.js
index 084c070ad..f7ffdb843 100644
--- a/tests/bench/templates/object.js
+++ b/tests/bench/templates/object.js
@@ -2,6 +2,5 @@ module.exports = {
   context: { person: { name: 'Larry', age: 45 } },
   handlebars: '{{#with person}}{{name}}{{age}}{{/with}}',
   dust: '{#person}{name}{age}{/person}',
-  eco: '<%= @person.name %><%= @person.age %>',
   mustache: '{{#person}}{{name}}{{age}}{{/person}}'
 };
diff --git a/tests/bench/templates/paths.js b/tests/bench/templates/paths.js
index 3725e471c..b9c5c745f 100644
--- a/tests/bench/templates/paths.js
+++ b/tests/bench/templates/paths.js
@@ -3,7 +3,5 @@ module.exports = {
   handlebars:
     '{{person.name.bar.baz}}{{person.age}}{{person.foo}}{{animal.age}}',
   dust: '{person.name.bar.baz}{person.age}{person.foo}{animal.age}',
-  eco:
-    '<%= @person.name.bar.baz %><%= @person.age %><%= @person.foo %><% if @animal: %><%= @animal.age %><% end %>',
   mustache: '{{person.name.bar.baz}}{{person.age}}{{person.foo}}{{animal.age}}'
 };
diff --git a/tests/bench/templates/string.js b/tests/bench/templates/string.js
index 6b0e94a74..03e74765b 100644
--- a/tests/bench/templates/string.js
+++ b/tests/bench/templates/string.js
@@ -2,6 +2,5 @@ module.exports = {
   context: {},
   handlebars: 'Hello world',
   dust: 'Hello world',
-  mustache: 'Hello world',
-  eco: 'Hello world'
+  mustache: 'Hello world'
 };
diff --git a/tests/bench/templates/subexpression.js b/tests/bench/templates/subexpression.js
index 659b53041..cd83a1ae2 100644
--- a/tests/bench/templates/subexpression.js
+++ b/tests/bench/templates/subexpression.js
@@ -7,8 +7,7 @@ module.exports = {
       return 'Colors';
     }
   },
-  handlebars: '{{echo (header)}}',
-  eco: '<%= @echo(@header()) %>'
+  handlebars: '{{echo (header)}}'
 };
 
 module.exports.context = module.exports.helpers;
diff --git a/tests/bench/templates/variables.js b/tests/bench/templates/variables.js
index fddece1bc..913adf12d 100644
--- a/tests/bench/templates/variables.js
+++ b/tests/bench/templates/variables.js
@@ -2,6 +2,5 @@ module.exports = {
   context: { name: 'Mick', count: 30 },
   handlebars: 'Hello {{name}}! You have {{count}} new messages.',
   dust: 'Hello {name}! You have {count} new messages.',
-  mustache: 'Hello {{name}}! You have {{count}} new messages.',
-  eco: 'Hello <%= @name %>! You have <%= @count %> new messages.'
+  mustache: 'Hello {{name}}! You have {{count}} new messages.'
 };
diff --git a/tests/bench/throughput.js b/tests/bench/throughput.js
index cd0f88b0f..ee5dd8018 100644
--- a/tests/bench/throughput.js
+++ b/tests/bench/throughput.js
@@ -1,6 +1,5 @@
 var _ = require('underscore'),
   runner = require('./util/template-runner'),
-  eco,
   dust,
   Handlebars,
   Mustache;
@@ -17,12 +16,6 @@ try {
   /* NOP */
 }
 
-try {
-  eco = require('eco');
-} catch (err) {
-  /* NOP */
-}
-
 function error() {
   throw new Error('EWOT');
 }
@@ -35,7 +28,6 @@ function makeSuite(bench, name, template, handlebarsOnly) {
     handlebarsOut,
     compatOut,
     dustOut,
-    ecoOut,
     mustacheOut;
 
   var handlebar = Handlebars.compile(template.handlebars, { data: false }),
@@ -85,20 +77,6 @@ function makeSuite(bench, name, template, handlebarsOnly) {
     }
   }
 
-  if (eco) {
-    if (template.eco) {
-      var ecoTemplate = eco.compile(template.eco);
-
-      ecoOut = ecoTemplate(context);
-
-      bench('eco', function() {
-        ecoTemplate(context);
-      });
-    } else {
-      bench('eco', error);
-    }
-  }
-
   if (Mustache) {
     var mustacheSource = template.mustache,
       mustachePartials = partials && partials.mustache;
@@ -139,12 +117,11 @@ function makeSuite(bench, name, template, handlebarsOnly) {
 
   compare(compatOut, 'compat');
   compare(dustOut, 'dust');
-  compare(ecoOut, 'eco');
   compare(mustacheOut, 'mustache');
 }
 
 module.exports = function(grunt, callback) {
-  // Deferring load incase we are being run inline with the grunt build
+  // Deferring load in case we are being run inline with the grunt build
   Handlebars = require('../../lib');
 
   console.log('Execution Throughput');
