Show notes
JSJ 267 Node 8 with Mikeal Rogers, Arunesh Chandra, and Anna HenningsenOn today’s episode of JavaScript Jabber we have panelists Joe Eames, AJ O’Neil, Amiee Knight and Charles Max Wood and we are talking about Node 8. To help us we have special guests Mikeal Rodgers, Arunesh Chandra, and Anna Henningsen. It’s going to be a great show. Tune in.[More than just an updateTwo main points:Improved Prana supportNative APINative APIs are helpful for Native Add-ons. For both the consumer and the developer side.Prior to update these Node Native modules ran in C++ and bound to specific to Node 8 APIs.Causes these modules to be updated or reconciled every time these modules are rereleased.Creates burden for module maintainers.Creates friction in upgrading Node versions in production departments.If you have a deployment depending on a certain Native module, some of the modules may not get updated in time when updating your Node versions. Keeping people from updating Node.Creates compatibility issues with Node users not using Node 8Experimental support for a Native layer in Node 8 to eliminate these issues as much as possible.Important milestone for the module ecosystem.You can write extensions for Node in C++ and it decouples V8 so you can use something else on the front.Modules takes dependency on V8 API specific to a particular version. So if V8 changes your module will be extracted from that.As a side benefit, you can have another VM to take advantage of that.Major version upgrades mean updating Native modules and usually some of those modules haven’t updated to the newest version of Node and be complicated.Deep dependency wise, about 30% depends on a Native module somewhereIn the future, with the Native API, you’ll be able to update Node without breaking modules.[Most of the work was in C++First thing that was done was, they looked at the top dependent Native modules in the ecosystem.Looked for what kind of V8 exposure they had and cataloged itLooked at how these APIs and what their purposes wereLooked for a way to extract them so that they are part of Node CoreCreated neutral APIs, now part of the Node core.All C APIsAlso has a C++ wrapper to improves usability of the API.[Native modules allows for tighter integration and better module performanceSpecific APIs that you can use in V8 that isn’t available through JavaScriptIf you have a C++ variable code and you want to expose a variable into JavaScript, that is V8 API note a Node 8 APIHaving it bound directly to the VM was something they wanted for a long timeGoogle controls V8 and they bind to V8Created a better relationship with Google starting in IOJSAlso worked with Microsoft with their Node Shocker work.Same with SpiderMonkeySpiderNode is in the works[Some. There is a performance working group.There is a need to stay on top of V8V8 team has focused on new language featuresMany features have been added over the yearsMany didn’t come in optimizedThe performance profile has changed with these featuresIf you’re using new language features, you will see a performance boostIn core, still tracking down code that was specific to the old optimizer and rewriting i to work the new optimizerTurbo C compiler hasn’t landed yet, but is to come.Will have a completely different performance profileIn most real world applications it will be fasterWaiting on the release to take a version of V8 to make it easier to upgrade features in the future[It’s all in V8Better longterm supportPromises are made better in Node as a platformAdded new method called util.promisify()Implementation comes from V8Allows for more optimization for promises in Node corePromise support for the one-deprecated domains module.[First off, delete your NMP cache.It’s in your home directory usually with a .npm extension[14:09] What are the new features in V8?Unlimited heap sizes, previously had a 4gb limit. No fixed limit.[14:09] Will you see things like chakra come out tuned for servers?Profiles of a server for application process are getting smallerGetting cut into containers and VMs and micro servicesVms that have cold boot time and run quickly in a strained environment is looking more like what we will see in the futureYes, especially if you’re using cloud functionsV8 is optimized for phones, but Chakra is even more soLooking for opportunities for VMs can be solely optimized for a device targetNode take advantage of that VMVM neutrality is an interesting conceptVM Vendors trying to optimize it based on workloads of a serverOpens opportunities for NodeNode Chakra has been proved to iOS. You can cut off jitting off which was a requirement to be able to be in the Apple App StoreNode is not just for servers anymoreNode doesn’t take a long time configuring itWhen a developer runs code on an IoT or a mobile app they don’t control the VM that is bundled, they run it on top of Node and it just works.VM neutrality gives a new vector, so you can swam a whole different VM[What it comes down to is if it’s eventive programmingThe browser is an eventive environment, is very efficient waiting for things to happen before it does somethingThe way that we program servers and nodes are the same as wellthe basics are the same generallyenvironmental differences exist but the programming model is usually the sameWhat does impact it is memory and processor and hardware and things like thatThat is where tuning the VM comes into play[Node has been lacking for automated inspection of Async HookNo way for Node to tell you when scheduling and beginning of an Async operation. Hook helps with thatit’s a way for developers to write debugging featuresNode tells the application that it’s working with Asynchronous way.The embedded inspector has been embedded since Node 6Now has a JavaScript API to use itYou can use things like Chrome debugger inside the running node processOld debugging protocol has been removedVM.run is still there but in the process of being deprecated[Marked as experimental because it’s the first time in the openHopefully out of experimental soonSoon can port API to the existing LTSLooking for more people to participate with the new API and give feedbackFix any concerns before it goes to LTSSome other experimental things are in the works like ASync Hooks and how it interacts with promisesRenaming some featuresAnother new feature - serializer and deserializer that comes with V8experimental but will most likely stay[Major releases every 6 monthsNext Oct Node 9 will come out and then Node 8 will be LTSDocumentation, updates, additions etc will be ready thenPlan to do it for 2.5 yearsEvery even releases come out to LTS as the odd release comes outHelps keeps a current line while having something new in the release lineNode 6 is the current LTS version[Use the word deprecate sparinglyIf many people use features, it’s hard to get rid ofSecurity issue with Buffer, constructor argument was ambiguousHad added APIs that were more explicit over time and pushed thoseNow it will be deprecated[Someone online updated their React app to Node 8 and found an 21% - 33% increaseBenchmarking group tests to make sure things are getting fasterV8 is always getting faster as wellCode changes fast and so there is a chance performance slows down so they have people to checkBenchmark test are all automated by a team[For front-end, yesclear your NPM cacheBack use cases will usually wait until LTS[The API work took about a yearIt was a collaboration which made it interestingIBM, Intel, Google were involvedThe collaboration took a whileAlso Async hooks took at least a year.Async hooks used to be called async wraps and has been in the work for almost 3 yearsmany of the changes were the accumulation of small chances[Letting people get small changes in accumulate into a big differencethe product gets much better that way[Current releases of Node 8 for a half of yearNode 6 is LTSAdditional year of maintenance of previous LTSs.Schedule is at http://github.com/node8js/lts in a chartSupport for Node 4 with only critical updates, Node 6 minor updates, and Node 8Node 7 doesn’t get much support unless it’s vital security supports.If you’re running 0.10 or 0.12 stop. Those do not get security fixes anymore[Mostly still working out Async hooksMaybe add some web worker or worker support for Node JSES module supportWorking to make promises betterWorking on the performance profile and internal systems[Node team gets better at getting people to adopt quicklybut about 5% - 6% will not upgradecommunity doubles each year at 8 million users right nowHere is a graph on Twitter posted by NPMLimiting breaks and softly deprecating things makes it’s easier to upgrade[NodeToDo.org shows how to make contributionOccasionally major conferences have information on how to contributeTest it out and help make it stronger[If it’s an NPM problem check with themclear cache!install newest version with: npm install -g npm@latestReport problems to either NPM or NodeIf you’re not sure where the problem is, check github.com/nodejs/helpLinksNode8 Node’s Twitter Node’s Medium Node Evangelism GroupMikael on Twitter and GitHub Arunesh on Twitter Anna on TwitterPicksAJOverclocked Remix Super Mario RPG Window to The StarsAmieeBlogpost RisingStack on Node 8 2 Frugal DudesCharlesHomeland House of CardsJoeShimmer LakeMikaelBlake2b-wasmAremeshCurrent Nightly NewsSpecial Guests: Anna Henningsen, Arunesh Chandra, and Mikeal Rogers.Support this podcast at — https://redcircle.com/javascript-jabber/donationsPrivacy & Opt-Out: https://redcircle.com/privacy