Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node.js / Deno 徹底討論の時のスライド
Search
Yosuke Furukawa
PRO
March 31, 2022
Programming
3
7.2k
Node.js / Deno 徹底討論の時のスライド
2022/3/17 Node学園38時限目のスライドです。
Yosuke Furukawa
PRO
March 31, 2022
Tweet
Share
More Decks by Yosuke Furukawa
See All by Yosuke Furukawa
tc39 x jsconf.jp Panel Discussion 2024
yosuke_furukawa
PRO
0
150
Removing Corepack
yosuke_furukawa
PRO
9
1.3k
JavaScript Runtime とはなにか
yosuke_furukawa
PRO
15
2.5k
Strip Types と Storage
yosuke_furukawa
PRO
4
340
Module Harmony について
yosuke_furukawa
PRO
3
1.5k
LTのやり方
yosuke_furukawa
PRO
16
2.2k
AppRouter Panel Talk
yosuke_furukawa
PRO
3
700
Node.js v22 で変わること
yosuke_furukawa
PRO
13
5.3k
リアーキテクトと開発生産性について
yosuke_furukawa
PRO
25
9.6k
Other Decks in Programming
See All in Programming
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Arm移行タイムアタック
qnighy
0
320
EventSourcingの理想と現実
wenas
6
2.3k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
900
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
距離関数を極める! / SESSIONS 2024
gam0022
0
280
cmp.Or に感動した
otakakot
2
140
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Scaling GitHub
holman
458
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
A Tale of Four Properties
chriscoyier
156
23k
A better future with KSS
kneath
238
17k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
BBQ
matthewcrist
85
9.3k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Building Adaptive Systems
keathley
38
2.3k
Transcript
None
͜ͷରஊͷૂ͍ • ʮΒͳ͍͠ɺͲͬͪΛબΜͩΒྑ͍͔Θ͔Βͳ͍ʯ ͱ͍͏ঢ়گΛݮΒ͢ɻ ্ͬͨͰ/PEFKTΛ͏ ্ͬͨͰٕज़બͱͯ͠ਖ਼ ͍͠ํΛέʔεʹ߹Θͤͯऔ ࣺબͰ͖Δ Βͳ͍͠ɺͲͪΒΛબΜͩ Βྑ͍͔Θ͔Βͳ͍
্ͬͨͰ%FOPΛ͏
Node.js ͷྑ͍ͱ͜Ζ deno ͷྑ͍ͱ͜Ζ
Α͍ͱ͜Ζ • Node.js: αϙʔτମ੍ɺಛʹLTS͕͋Γɺ2ؒαϙʔτ͞ΕΔ • deno: πʔϧ͕ຊମʹϏϧτΠϯͰؚ·Ε͍ͯͯɺೖΕͨ͋ͱ͍͖ͳ Γ։ൃ͕ਐΊΒΕΔ • ಛʹܕඇৗʹڧ͍
Node.js ͷѱ͍ͱ͜Ζ deno ͷѱ͍ͱ͜Ζ
ΘΔ͍ͱ͜Ζ • deno: αϙʔτମ੍͕ऑ͍ • deno: ࠷৽ʹ্͛ͯ͘Εͱ͍͏ݴ͍ํʹͳΔ • ͪΐͬͱલͷϚΠφʔόʔδϣϯΛαϙʔτͯ͠΄͍͠ͱ͍͏ʹͳΓ͕ͪ •
࠷৽ʹ͍ͭͯདྷΕΔମྗ͕ඞཁʹͳΔ • Node.js: ܕͷαϙʔτ • Node.js: ϞδϡʔϧγεςϜ͕ΰλΰλ • CJS / ESM ͷରԠʹ͍ͭͯ
Node.js ͷվળ deno ͷվળ
վળ • Node.js => Deno : Deno ͬͯ npm ϞδϡʔϧΛαϙʔτ͢Δͬͯݴ͚ͬͯͨͲɺΰλΰλ
Ͳ͏͢Δͷ͔ʁ • Deno: ΰλΰλ͝ͱड͚ೖΕͯΔ • Node.js: ͦͨ͠ΒͲͬͪΰλΰλʹͳΔͷͰɾɾɾʁ • import fs from "node:fs"; ͜Μͳײ͡ʁ • import fs from "https://deno.land/std/fs/mod.ts"; • Deno: ίϛϡχςΟଆ npm ϞδϡʔϧͷޓੑʹରҙݟͩͬͨɻͰϦʔμʔޓ ੑΛਪਐͨ͠ɻͻͷ͞Θ͞Μͷҙݟ͖ͬΓ۠ผ͢ΔϥΠϯ͕͋Εྑ͍ͱࢥ͍ͬͯΔ
Web Standard ͷऔΓΈ ํ
Web Standard ͷऔΓΈํ • Deno: Web Standard ΛੵۃతʹऔΓೖΕΑ͏ͱ͢Δɻ • ੵۃతʹऔΓೖΕա͗ͳͷͰʁ
• ·ͩWICGͷϨϕϧͰऔΓೖΕΔͷ͍ͩͿૣ͗͢Δؾ͕͢Δ •
Tooling ʹ͍ͭͯ
tooling • deno: deno task ͱ͍͏ͷ͕ೖͬͨ (npm run Έ͍ͨͳͭ) •
deno.json ʹίϚϯυΛॻ͘ͱ࣮ߦ͞ΕΔ
Permission ʹ͍ͭͯ
Permission ʹ͍ͭͯ • mizchi: ࠷ॳؤு͚ͬͯͭͯΔɺͰ import ͨ͠ઌͰଞͷϝϯόʔ͔Β permission ͕ଞʹඞཁʹͳͬͯ͘Δɻ •
ѱҙͷ͋Δϝϯόʔ͕ͦΕΛݴ͖ͬͯͨΒ࣮ࡍ͙ͷ͍͠ • kt3k: mizchi ͞ΜʢίʔυΦʔφʔʣ͕ඞཁͱࢥͬͨ permission ͚ͩ༩͢Εྑ͍ͷͰɺͦΕΛڧݻʹकΔ͖ • mizchi: ͦΕΘ͔Δ͕ɺαϓϥΠνΣʔϯΞλοΫΛकΔʹ࡞Δଆͱ͏ଆͷ྆ํͰͷέΞ͕ඞཁͳͷͰͳ͍͔ͱࢥ͍ͬͯ Δ • ݖݶ͕ංେԽ͢ΔͷΤίγεςϜͷதͰΑ͋͘Δͷɺ Android ͱ͔ΞϓϦΛΠϯετʔϧ͢Δͱ͖ʹશͯͷݖݶΛཁ ٻ͖ͯͨ͠Γ͢Δ • martin: Node.js policy ػೳ͕͋ΔɻηΩϡϦςΟίϛϡχςΟͷͰ͋ͬͯҰͭͷςʔϚͰ͋Δ • policy.json ͰΞϐʔϧͰ͖ΔͷͰ͋ΕͦΕΛίϯτϦϏϡʔτͯ͠ଞͷਓʹͪΌΜͱηΩϡϦςΟͷྀΛΞϐʔϧͨ͠ ͍ • ͨͩ೦ͳ͕Βࠓ policy ͷػೳͦ͜·Ͱͳ͍ͬͯͳ͍ɻ
Node.js ͷਪ͠৽ػೳ deno ͷਪ͠৽ػೳ
ਪ͠ػೳ • ݹ: Single Executable Application • Martin: webcrypto ͕࣮͞ΕͨΑʂ
• kt3k: Deno task ͕࣮͞ΕͨΑʂ • mizchi: deno fetch ͕ϩʔΧϧʹରͯ͠Ͱ͖Δ wasmpack Λͦͷ·· ಡΈࠐΊͨ
Governance ʹ͍ͭͯ
Governance ʹ͍ͭͯ • deno: BDFL ϞσϧɺϦʔμʔ͕ܾఆΛ͢Δ • node.js: Open Governance
ϞσϧɺϦʔμʔෆࡏɺεςΞϦϯάίϛοςΟʔ͕ ܾΊΔɻ • martin: deno inc Ͱɺձࣾʹͳ͍ͬͯΔɺϦʔμʔ͕ܾΊΔ͚ͩͰͳ͓ͯۚ͘ ʹΑͬͯࠨӈ͞ΕΔ • kt3k: ͦΕ͔ͨ͠ʹͦ͏ɻϢʔβʔΛ্͛ΔΑ͏ʹͯ͠ɺ͓ۚΛՔ͙ඞཁ͕͋Δ • node ͷϞδϡʔϧΛαϙʔτ͢ΔͷϢʔβʔΛ্͛Δඞཁ͕͋ΔͨΊ
Node.js ͷࠓޙ deno ͷࠓޙ
ࠓޙ • mizchi: ͓ޓ͍Ճ͢Δػೳ͕ࣅ͍ͯΔɺӨڹΛड͚͍͋ͬͯΔɺ͖ͳํΛબΑ͍ͱ͍͏ະདྷʹͳΔɻ • ઈରަΘΒͳ͍ϥΠϯΛMicrosoft͕ʹ͗ͬͯΔɻ • ֦ுࢠͷলུՄ൱ϥΠϯ • kt3k:
Node.jsޓ͕Ͱ͖ΔΑ͏ʹͳΓɺϢʔβʔ͕denoʹ૿͑Δɺདྷͬͱ፰߅͢Δɻ • martin: Node.js ͷະདྷ Web Standard ͷػೳ͕ͬͱ૿͍͑ͯ͘ɻfetch ͷଞʹ Event Emitter ͱ͔৭ʑ૿ ͍͑ͯ͘ɻͬͱϒϥβϓϥοτϑΥʔϜؒͷޓੑ͕ߴ͘ͳΔͣɻ • test runner ͕ Node.js ʹೖΔ • deno ͷ࡞ઓ => deno inc ͕ microsoft ʹങΘΕΔ • furukawa: