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

Release 5.0 #203

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
name:
- Node.js 0.8
- Node.js 0.10
- Node.js 4.x
- Node.js 6.x
Expand All @@ -21,11 +20,6 @@ jobs:
- Node.js 16.x

include:
- name: Node.js 0.8
node-version: "0.8"
npm-i: [email protected] [email protected]
npm-rm: nyc

- name: Node.js 0.10
node-version: "0.10"
npm-i: [email protected] [email protected]
Expand Down Expand Up @@ -65,14 +59,6 @@ jobs:
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
nvm install --alias=npm 0.10
npm install -g [email protected]
NPM=$(which npm)
nvm use ${{ matrix.node-version }}
ln -fs "$NPM" "$(which npm)"
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
fi
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"

- name: Configure npm
Expand Down
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
5.x
===

* Drop support for Express.js 2.x
* Drop support for Node.js 0.8
* Use `uid-safe` for async helpers tracking

4.2.0 / 2021-11-16
==================

Expand Down
15 changes: 3 additions & 12 deletions lib/async.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// provides the async helper functionality

var uid = require('uid-safe')

function Waiter() {
if (!(this instanceof Waiter)) {
return new Waiter();
Expand Down Expand Up @@ -51,17 +53,6 @@ Waiter.prototype.done = function(fn) {
}
};

var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_';

var gen_id = function() {
var res = '';
for (var i=0 ; i<8 ; ++i) {
res += alphabet[Math.floor(Math.random() * alphabet.length)];
}

return res;
};

module.exports = function() {
// baton which contains the current
// set of deferreds
Expand All @@ -86,7 +77,7 @@ module.exports = function() {
waiter = new Waiter();
}

var id = '__' + gen_id() + '__';
var id = '__' + uid.sync(10) + '__'

var cur_waiter = waiter;
waiter.wait();
Expand Down
16 changes: 0 additions & 16 deletions lib/hbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,6 @@ function middleware(filename, options, cb) {
tryReadFileAndCache(layout_filename);
}

// express 2.x template engine compliance
Instance.prototype.compile = function (str) {
if (typeof str !== 'string') {
return str;
}

var template = this.handlebars.compile(str);
return function (locals) {
return template(locals, {
helpers: locals.blockHelpers,
partials: null,
data: null
});
};
};

Instance.prototype.registerHelper = function () {
this.handlebars.registerHelper.apply(this.handlebars, arguments);
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"main": "lib/hbs.js",
"dependencies": {
"handlebars": "4.7.7",
"uid-safe": "2.1.5",
"walk": "2.3.15"
},
"devDependencies": {
Expand All @@ -28,8 +29,7 @@
"README.md"
],
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
"node": ">= 0.10"
},
"scripts": {
"lint": "eslint .",
Expand Down