node ninjas sydney (rvagg) april 2016: node core update

25
April 8, 2016 Node Core Update Rod Vagg @rvagg

Upload: rvagg

Post on 20-Feb-2017

60 views

Category:

Software


0 download

TRANSCRIPT

April 8, 2016

Node Core UpdateRod Vagg

@rvagg

© 2016 NodeSource

Node.js v6

2

© 2016 NodeSource Confidential

Page Title

3

© 2016 NodeSource Confidential

Page Title

4

© 2016 NodeSource Confidential

Page Title

5

© 2016 NodeSource Confidential

Page Title

6

© 2016 NodeSource

Node.js v6

7

Node.js v6 doesn’t deliver many new goodies aside from V8

because server-minor changes ship all the time!

© 2016 NodeSource

Node.js v5: features, features, features!

8

v5.10: new Buffer API, fs.mkdtemp(), --no-browser-globals build flag

v5.9: timers rewrite, -e and -i at the same time, big memory fix in vm.runInNewContext()

v5.8: child_process#send() accepts keepOpen option, repl#start() doesn’t need options, massive util.format() perf increase

v5.7: Improvements to Buffer#fill() and Buffer#indexOf(), child_process#spawn() can do ‘shell’, dgram#send() accepts array as first arg, net and http servers have listening property, node::MakeCallback() now reentrant, tlsSocket.getProtocol() gets negotiated protocol, vm.Script() produces and consumes cached data

v5.6: Security update, major OpenSSL fixes

v5.5: fs.createWriteStream() takes autoClose option, allow preload modules when using -i, v8.getHeapSpaceStatistics(),

v5.4: Status code 451

v5.3: Buffer#includes(), https supports disabling session caching, libuv 1.8.0

v5.2: Improve ECDH config in crypto, update root certificates, multiple CA certificates can be passed with ‘ca’ param on crypto stream creation

v5.1: child.send() properly returns boolean indicating backpressure, LINK, UNLINK, BIND, REBIND, UNBIND methods added to http_parser

Follow http://nodejs.org/en/blog/

© 2016 NodeSource

Node.js v6 Breaking Changes

9

Node.js v6 Notable Breaking Changes • Improved and more consistent error messages

• New 'warning' event and process.emitWarning() and --no-warnings flag

• Some formatting from util.inspect() improved / changed (Date, Error)

• Dropped support for Windows Vista and earlier

• Improvements to zlib / gzip handling

© 2016 NodeSource

Buffer changes

10

Buffer changes Not exclusive to Node.js v6 but get used to it

• new Buffer() being “soft deprecated”

• Use Buffer.alloc(), Buffer.allocUnsafe(), Buffer.from()

• --zero-fill-buffers argument

© 2016 NodeSource

Node.js & V8

11

© 2016 NodeSource

V8

12

Node.js & V8 • Google’s increasing reliance on Node.js has boosted

cooperation and synchronisation

• V8 draft schedule now posted publicly

• Fewer breaking C++ API and ABI changes (yay!)

• V8 test infrastructure now tests against Node.js

• V8 test infrastructure now able to test old versions of V8

© 2016 NodeSource

V8

13

V8 for Node.js v6 • Node.js v4 uses V8 4.6, supporting 48% of ES6

• Node.js v5 uses V8 4.7, supporting 58% of ES6

• Current stable V8, 4.9, supports ~88% of ES6

• Timeline for Node.js v6, “April”, should line up with stable Chromium 50, i.e. V8 5.0, supporting ~90% of ES6

• http://node.green — doesn’t show latest V8

• Performance … well … you said you wanted features!!

© 2016 NodeSource

ES6 in Node.js v6.0

14

ES6 in Node.js v6.0 • Default function parameters

• Rest parameters

• Destructuring (declarations, assignment, parameters)

• RegExp y flag (sticky) and u flag (Unicode, V8 5.0 only)

• Finalised const and let support (properly block scoped, iteration scoped in for loops)

• Complete Proxy and Reflect support

• Symbol.toStringTag to modify String coercion output, e.g. [object foobar]

• Lots more Symbol stuff

• Array.prototype.includes() (beyond ES6)

© 2016 NodeSource

ES6 in Node.js v6.0

15

ES6 in Node.js v6.0 • Finalised const and let support (properly block scoped, iteration scoped in for loops)

• ES6 constructs and semantics available in sloppy mode

• let available in sloppy mode

• const and function in sloppy mode brought up to ES6 block scoping semantics

• Complete class and super() support available in sloppy mode

• Array, RegExp, Function, Promise, Boolean, Number, String, Map, Set all properly sub-classable in sloppy mode

© 2016 NodeSource

Future V8 updates

16

Future V8 updates • io.js proved that upgrading V8 too frequently was too

painful for the ecosystem because of ABI breakage for addons

• Policy since Node.js v4 was to pin Node.js major version to V8 version to avoid ABI breakage

• Node.js v4 will always use V8 4.6

• Node.js v5 will always use V8 4.7 (maybe)

© 2016 NodeSource

Future V8 updates

17

Future V8 updates New policy for Node.js for v6+:

• Upgrade V8 during Stable where it can be done without breaking ABI

• V8 upgrades will cease ~2 months prior to a switch to LTS

• Node.js v6 starts with V8 5.0 (or 4.9), may hit V8 5.2 prior to LTS in October, (5.3 due in September)

© 2016 NodeSource

Entering the Beast

18

© 2016 NodeSource

Node.js Foundation Structure

19

Executive

Community managerEducation coordinator

Marketing Events

Commercial relationships and strategy

Assistance fromLinux Foundation

BoardMember company

representation

TSCTechnicalSteering

Committee

Technicaladministration byopen governance

Technical Team

HTTP WGStreams

WGAPI WGBechmarking

WG

InclusivityWG

Node.js Core Project CollaboratorsCTC

Build WG

LegalCommittee

FinanceCommittee

MarketingCommitteeEducation

AdvisoryGroup

© 2016 NodeSource

Node.js Foundation Structure: Core

20

TSCTechnicalSteering

Committee

Technicaladministration byopen governance

Technical Team

HTTP WGStreams

WGAPI WGBechmarking

WG

InclusivityWG

Node.js Core Project CollaboratorsCTC

Build WG

© 2016 NodeSource

Core working groups

21

Working groups • Streams • Benchmarking • Build / infrastructure • HTTP • LTS • Documentation • Evangelism • Docker • Post-mortem • Intl and internationalisation • Testing • Website • Addon API

© 2016 NodeSource

Contributing

22

Contributing • Start small: lurk, watch for easy things to contribute to

• Obvious entry points: documentation, tests, benchmarks

• Hints:

• look for work around the outside—find a working group

• big changes are hard work—keep it simple

• be prepared for discussion—be constructive, collaborate and prepare for compromise

• ask for help!

© 2016 NodeSource

CampJS

23

© 2016 NodeSource

CampJS VII

24

CampJS VII • 3 - 6 June, 2016

• Broken Bay, Sydney

• http://campjs.com

• Use code NODE6 to get $105 OFF (limited availability & time)

Thank you.Rod Vagg

[email protected]

@rvagg