Node.js v12の気になる変更点 / #kng6

Node.js v12の気になる変更点 / #kng6

関西Node学園 6時限目でNode.js v12の変更点について話しました。
https://nodejs.connpass.com/event/126358/

5cf7e9533a457726cd51232e06c1da9a?s=128

Masashi Hirano

May 08, 2019
Tweet

Transcript

  1. Node.js v12 Notable Changes ؔ੢NodeֶԂ 6࣌ݶ໨ Masashi Hirano(@shisama)

  2. ฏ໺ ণ࢜ / Masashi Hirano ɹɹɹɹ Kyoto office @shisama_ @shisama

    Node.js Core Collaborator ؔ੢NodeֶԂOrganizer
  3. 4/23ʹ12.0.0͕ϦϦʔε͞Ε·ͨ͠

  4. https://nodejs.org/en/blog/release/v12.0.0/ ݄຤ʹ-54ʹ

  5. https://nodejs.org/en/blog/release/v12.0.0/ W͸&0-ʹ

  6. Node.js v12ͷಛʹؾʹͳͬͨ มߋ఺Λ঺հ͠·͢ʂ

  7. https://nodejs.org/en/blog/release/v12.0.0/ /PEFKTͷެࣜϖʔδ΍(JU)VCͷ3FMFBTFϖʔ δʹ͸1VMM3FRVFTU΁ͷϦϯΫ͕షͬͯ͋Δ

  8. https://github.com/nodejs/node/pull/26685

  9. V8(JSΤϯδϯ)͕7.4ʹ • Node.js v10ͷV8͸6.8 • JavaScript(ECMAScript)৽ػೳ͕௥Ճ • async / await͕ߴ଎Խ

    • async-stack-trace͕௥Ճ
 etc…
  10. https://twitter.com/mathias/status/1120700101637353473 JavaScript৽ػೳ

  11. Array#{flat,flatMap} var arr1 = [1, 2, [3, 4]]; arr1.flat(); //

    [1, 2, 3, 4] arr1.flatMap(x => [x * 2]); // [2, 4, 6, 8]
  12. Private Class Field class Counter { #count = 0; get

    value() { return this.#count; } increment() { this.#count++; } } const counter = new Counter(); counter.increment(); counter.#counter; // Error counter.value; // OK QSJWBUFʹ͍ͨ͠ϑΟʔϧυʹ͸Λ͚ͭΔ
  13. https://twitter.com/mathias/status/1120700101637353473 ଞʹ΋ͨ͘͞Μ͋Γ·͢ʂଓ͖͸WebͰʂ

  14. https://speakerdeck.com/ajido/callback-to-promise-and-beyond લճˏAjido͞Μ͕ൃදͯ͘͠Ε·ͨ͠ʂ

  15. https://blog.risingstack.com/node-js-12-new-features/ Async Stack Trace

  16. https://blog.risingstack.com/node-js-12-new-features/ Async Stack Trace v11 V12

  17. https://github.com/nodejs/node/pull/26685

  18. llhttp • HTTPύʔαͷσϑΥϧτ͕http_parser͔Βllhttpʹ • http_parserվྑΛࢼΈ͚ͨͲ೉͔ͬͨ͠ • llhttp͸TypeScriptͰॻ͔Ε͍ͯͯϝϯς͠΍͘͢ͳ͍ͬͯΔ • http_parserΑΓ࣮ߦ଎౓͕଎͍ •

    llparseͰCݴޠ΍LLVMϏοτίʔυʹม׵
  19. llhttp https://github.com/nodejs/llhttp

  20. https://github.com/nodejs/node/pull/26209 εΫϦʔϯγϣοτ 2019-05-08 02.51.41.png

  21. https://github.com/nodejs/node/pull/23814

  22. tls • TLS 1.3Λ৽͘͠αϙʔτ • TLS1.0ɺ1.1͸σϑΥϧτͰαϙʔτର৅֎ʹ • 2020/03ʹϝϯς͞Εͳ͘ͳΔ • v12͸LTSͰ2022/04ͰEOL

  23. https://github.com/nodejs/node/pull/25576

  24. σϑΥϧτͷheapͷ࠷େ஋ • ैདྷ͸700MB(32bit) / 1400MB(64bit)ݻఆͩͬͨ • v12͔Β͸࢖༻ՄೳͳϝϞϦ༰ྔʹ߹Θͤͯ૿ݮ

  25. https://github.com/nodejs/node/pull/23027 ͜ͷޙɺొஃ༧ఆʂ

  26. https://github.com/nodejs/node/pull/27361 /PEFKTWͰ͸ ྩ࿨ରԠ͞Εͨ

  27. Node.js v12ʹͳΔ͜ͱͰಈ͔ͳ͘ͳ Δύοέʔδ΋ଘࡏ͢Δ

  28. https://github.com/nodejs/node/issues/25060

  29. Node.js v12ͰյΕΔύοέʔδ͕͋Δ • uglify-js΍bcryptͳͲ༗໊ͳͱ͜Ζ͕ର৅ • طʹରԠࡁͷ΋ͷ΋͋Δ • CITGMͱ͍͏Node.js CoreͷCIδϣϒͰᖰΓग़͍ͯ͠Δ •

    Α͘࢖ΘΕΔύοέʔδͷςετ͕௨Δ͔ݕূ • https://github.com/nodejs/citgm • ੈͷதͷશͯͷnpmύοέʔδΛݕূ͍ͯ͠ΔΘ͚Ͱ͸ͳ͍
  30. npmʹύοέʔδΛެ։͍ͯ͠Δਓ͸ Node.jsͷϝδϟʔόʔδϣϯ͕ϦϦʔ ε͞ΕͨΒݕূͯ͠Έ·͠ΐ͏ʂ

  31. ·ͱΊ • V8ͷόʔδϣϯΞοϓͰJavaScriptͷ৽ػೳ͕௥Ճ͞Εͨ • Node.js Core΋಺෦తʹΞοϓσʔτ͞Ε͍ͯΔ • ϝδϟʔόʔδϣϯ͸npmύοέʔδ͕յΕͨΓ͢ΔͷͰݕূ ͕ඞཁ

  32. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ @shisama_ @shisama