Welcome! Log In Create A New Profile

Advanced

njs-0.3.8

Dmitry Volyntsev
January 21, 2020 11:52AM
Hello,

I'm glad to announce a new release of NGINX JavaScript module (njs).

This release proceeds to extend the coverage of ECMAScript
specifications. This release adds Promise object support and
typed-arrays from ES6.

Notable new features:
- Promise support in r.subrequest():
: r.subrequest(r, '/auth')
: .then(reply => JSON.parse(reply.responseBody))
: .then(response => {
: if (!response['token']) {
: throw new Error("token is not available");
: }
: return token;
: })
: .then(token => {
: r.subrequest('/backend', `token=${token}`)
: .then(reply => r.return(reply.status, reply.responseBody));
: })
: .catch(_ => r.return(500));

You can learn more about njs:

- Overview and introduction: http://nginx.org/en/docs/njs/
- Presentation: https://youtu.be/Jc_L6UffFOs
- Using node modules with njs:
http://nginx.org/en/docs/njs/node_modules.html

Feel free to try it and give us feedback on:

- Github: https://github.com/nginx/njs/issues
- Mailing list: http://mailman.nginx.org/mailman/listinfo/nginx-devel


Changes with njs 0.3.8 21 Jan 2020

nginx modules:

*) Feature: added Promise support for r.subrequest(). If callback
is not provided r.subrequest() returns an ordinary Promise object
that resolves to subrequest response object.

*) Change: r.parent property handler now returns "undefined"
instead of throwing exception if parent object is not available.

Core:

*) Feature: added Promise support. Implemented according to
the specification without: Promise.all(), Promise.allSettled(),
Promise.race().

*) Feature: added initial Typed-arrays support.
Thanks to Tiago Natel de Moura.

*) Feature: added ArrayBuffer support.
Thanks to Tiago Natel de Moura.

*) Feature: added initial Symbol support.
Thanks to Artem S. Povalyukhin.

*) Feature: added externals supopor for JSON.stringify().

*) Feature: added Object.is().
Thanks to Artem S. Povalyukhin.

*) Feature: added Object.setPrototypeOf().
Thanks to Artem S. Povalyukhin.

*) Feature: introduced nullish coalescing operator.
Thanks to Valentin Bartenev.

*) Bugfix: fixed Object.getPrototypeOf() according to the
specification.

*) Bugfix: fixed Object.prototype.valueOf() according to the
specification.

*) Bugfix: fixed JSON.stringify() with unprintable values and
replacer function.

*) Bugfix: fixed operator "in" according to the specification.

*) Bugfix: fixed Object.defineProperties() according to the
specification.

*) Bugfix: fixed Object.create() according to the specification.
Thanks to Artem S. Povalyukhin.

*) Bugfix: fixed Number.prototype.toString(radix) when
fast-math is enabled.

*) Bugfix: fixed RegExp() instance properties.

*) Bugfix: fixed import segfault.
Thanks to 洪志道 (Hong Zhi Dao).
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

njs-0.3.8

Dmitry Volyntsev January 21, 2020 11:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 138
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready