Slide 1

Slide 1 text

Node.js v13 Notable Changes ؔ੢NodeֶԂ 8࣌ݶ໨ Masashi Hirano(@shisama)

Slide 2

Slide 2 text

ฏ໺ ণ࢜ / Masashi Hirano @shisama_ shisama Node.js Core Collaborator ؔ੢NodeֶԂOrganizer

Slide 3

Slide 3 text

https://twitter.com/nodejs/status/1186695960753266689

Slide 4

Slide 4 text

https://github.com/nodejs/Release 2019/10/21 2020/10 2022/4 2019/10/22 2020/6

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

https://nodejs.org/en/blog/release/v12.0.0/

Slide 7

Slide 7 text

V8

Slide 8

Slide 8 text

https://github.com/nodejs/node/pull/29694

Slide 9

Slide 9 text

V8 7.8 • Objectͷ෼ׂ୅ೖ (`const {id, name} = user;`)ͳͲͷύϑΥʔϚϯεվ ળ • ϝϞϦ࢖༻ྔͷ࡟ݮ • WebAssembly (WASM) ͷC/C++ͷAPIΛެࣜαϙʔτɺWASMͷى ಈ࣌ؒվળ • …etc

Slide 10

Slide 10 text

https://v8.dev/blog/v8-release-78 More details… => v8.dev

Slide 11

Slide 11 text

Internationalization

Slide 12

Slide 12 text

https://github.com/nodejs/node/pull/29522

Slide 13

Slide 13 text

Internationalization • i18nΛϑϧαϙʔτ
 ɾv12·Ͱ͸Intlܥͷؔ਺ͷҰ෦΍NumberͷtoLocaleString()ͳͲ͸ӳޠͷΈ࢖͑ͨ • ͜Ε·Ͱ͸͢΂ͯͷݴޠαϙʔτΛ͠ͳ͍Α͏ʹNode.jsΛϏϧυ͍ͯͨ͠
 ɾNode.jsͷόΠφϦͷαΠζ͕૿͑ΔͨΊආ͚ΒΕ͍ͯͨ
 ɾϑϧαϙʔτ͢ΔϏϧυʹΑΓ~40%αΠζ͕૿͑Δ
 ɾe.g. macOSͩͱ35MB͔Β49MBʹͳΔ • v12·Ͱ΋ —with-intl=full-icu ϑϥάΛ෇͚ͯNode.jsΛϏϧυ͢Δ͜ͱͰϑϧαϙʔτͰ͖ ͍ͯͨ

Slide 14

Slide 14 text

https://nodejs.org/api/intl.html

Slide 15

Slide 15 text

Intl.DateTimeFormatͷεϖΠϯޠͰͷྫ const january = new Date(9e8); const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); console.log(spanish.format(january)); // 'M01' v12 // 'enero` v13 WҎલ TNBMMJDV Ͱ͸`.`ɺ WҎ߱ GVMMJDV Ͱ͸`FOFSP`

Slide 16

Slide 16 text

http

Slide 17

Slide 17 text

https://github.com/nodejs/node/pull/29522

Slide 18

Slide 18 text

http parser • ॳظ͔Β͋ͬͨHTTPύʔαʔͷhttp_parserϞδϡʔϧΛ࡟আ • v12͔Βllhttp͕σϑΥϧτ͕ͩɺ—http-parser=legacy Φϓ γϣϯΛ෇͚Δ͜ͱͰhttp_parser͕࢖͑ͯͨ • v13͔Β—http-parser Φϓγϣϯ΋࡟আ͞Εͨ

Slide 19

Slide 19 text

https://llhttp.org

Slide 20

Slide 20 text

llhttp • http_parserͷอक͕ࠔ೉ͩͬͨͷͰҰ͔Βॻ͖௚͞Εͨ • llhttp͸TypeScriptͰॻ͔Ε͍ͯͯϝϯς͠΍͘͢ͳ͍ͬͯΔ • http_parserΑΓ࣮ߦ଎౓͕଎͍ • llparseͰTS͔ΒCݴޠ΍LLVMϏοτίʔυʹม׵͍ͯ͠Δ

Slide 21

Slide 21 text

llhttp https://github.com/nodejs/llhttp

Slide 22

Slide 22 text

More details… => JSConf EU 2019 https://2019.jsconf.eu/fedor-indutny/llhttp-new-http-11-parser-for-nodejs.html

Slide 23

Slide 23 text

http, http2

Slide 24

Slide 24 text

https://github.com/nodejs/node/pull/27558

Slide 25

Slide 25 text

αʔόʔλΠϜΞ΢τͷ࣌ؒ • ͜Ε·Ͱ͸σϑΥϧτ2෼ͰλΠϜΞ΢τ͍ͯͨ͠ • αʔόʔͰ2෼Λ௒͑ΔॲཧΛ͢Δͱιέοτ͕ด͡ΒΕۭͷϨεϙϯε ͕ฦ͖ͬͯͨ • v13͔Β͸αʔόʔλΠϜΞ΢τ͕ແޮʹͳͬͨ • ͜Ε·Ͱ௨Γserver.setTimeoutͳͲͰλΠϜΞ΢τ·Ͱͷ࣌ؒΛઃఆ͢ Δ͜ͱ͸Մೳ

Slide 26

Slide 26 text

ES Modules

Slide 27

Slide 27 text

https://github.com/nodejs/node/pull/29866

Slide 28

Slide 28 text

ES Modules • ·ͩϦϦʔεʹؚ·Ε͍ͯͳ͍͕ɺv13ͰೖΓͦ͏ • ES Modules(import / export)͕ϑϥάͳ͠Ͱ࢖͑ΔΑ͏ʹ
 ɾ—experimental-module ͕ඞཁͩͬͨ • v12ʹ΋ϚΠφʔόʔδϣϯͷߋ৽ͰόοΫϙʔτ͢Δ͔΋
 ɾ12݄͕3݄ࠒʹ͸v12Ͱ΋ϑϥάͳ͠Ͱ࢖͑Δ͔΋

Slide 29

Slide 29 text

https://github.com/nodejs/module/issue/400

Slide 30

Slide 30 text

https://shisama.hatenablog.com/entry/2019/10/23/190842 ͦͷଞͷมߋ఺

Slide 31

Slide 31 text

·ͱΊ • V8ͷߋ৽ͰύϑΥʔϚϯεվળͳͲ͕͞Εͨ • i18n͕ϑϧαϙʔτ͞Εͨ • http͸ݹ͍ύʔαʔΛ࡟আ͠ɺσϑΥϧτͰλΠϜΞ΢τແޮʹ • ES Modules͕ϑϥάͳ͠Ͱ࢖͑Δ༧ఆ

Slide 32

Slide 32 text

એ఻ 11/30(Sat), 12/1(Sun) 11/2(Sat)

Slide 33

Slide 33 text

Thanks. @shisama_ shisama