Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
jsx2js_js2jsx
Search
Yosuke Furukawa
PRO
June 08, 2014
Programming
6.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
jsx2js_js2jsx
天下一ajtjs武闘会LT発表資料
Yosuke Furukawa
PRO
June 08, 2014
More Decks by Yosuke Furukawa
See All by Yosuke Furukawa
Webの地図
yosuke_furukawa
PRO
6
5.1k
XHTMLが残したもの
yosuke_furukawa
PRO
2
900
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
430
デザインシステムが必須の時代に
yosuke_furukawa
PRO
2
320
Node.js, Deno, Bun 最新動向とその所感について
yosuke_furukawa
PRO
10
5.4k
Welcome JSConf.jp 2024
yosuke_furukawa
PRO
1
4.9k
tc39 x jsconf.jp Panel Discussion 2024
yosuke_furukawa
PRO
0
380
Removing Corepack
yosuke_furukawa
PRO
9
2k
JavaScript Runtime とはなにか
yosuke_furukawa
PRO
15
3.2k
Other Decks in Programming
See All in Programming
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.5k
phperだってパンチカードでコーディングしたい
o0h
PRO
0
220
mrbgem 三角測量 開発
ogom
0
200
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
15k
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
130
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
230
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
310
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
110
パーソナライズPodcastを作った話
repunit11
0
120
カツオ、ご期待ください
suneo3476
0
150
AWSに止められる覚悟してますか?
morizo_1984
2
510
Featured
See All Featured
Speed Design
sergeychernyshev
33
2.1k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
440
Leo the Paperboy
mayatellez
10
2.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
It's Worth the Effort
3n
188
29k
Mobile First: as difficult as doing things right
swwweet
225
10k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
470
Navigating Weather and Climate Data
rabernat
0
550
Transcript
JS to JSX, JSX to JS @yosuke_furukawa
@yosuke_furukawa Node.jsϢʔβʔάϧʔϓද / DeNAॴଐ
ఱԼҰaltjsಆձ JSX
ఱԼҰaltjsಆձ ....
None
ଟ͜Μͳײ͡ʹἤΓ͋͏ձͱ༧
͜Μͳ෩ʹֶͼ
࠷ऴతʹ͜͏ͳͬͯؼΓ͍ͨ
ຊฤ
JS to JSX
JSXܕ͕͋ΔaltJS interface Animal {// interfaceΛఆٛͰ͖Δ function say () : void;
} ! class Duck implements Animal { // interfaceΛimplementsͰ͖Δ override function say () : void {// ࣮ log("quack!"); } } ! class Dog implements Animal { override function say () : void { log("bow!"); } }
JSXܕ͕͋ΔaltJS interface Animal {// interfaceΛఆٛͰ͖Δ function say () : void;
} ! class Duck implements Animal { // interfaceΛimplementsͰ͖Δ override function say () : void {// ࣮ log("quack!"); } } ! class Dog implements Animal { override function say () : void { log("bow!"); } } طଘͷJSΛ͏ʹbinding͕ඞཁʂʂ
JSXͱTypeScriptͷbindingͷҧ͍ ! TypeScriptܕఆٛϑΝΠϧͱJavaScriptΛ͢Δ JSXܕఆٛϑΝΠϧʹJavaScriptΛهड़͢Δ
JSXόΠϯσΟϯάͷॻ͖ํ native class JSON5 { static function parse(str:string) : variant;
static function stringify(json:variant) : string; } = "require('json5')"; ͜͜ʹ+BWB4DSJQUͰ࣮Λॻ͚Δ ܕఆٛΛॻ͘
ࢥతʹTypeScriptͷํ͕៉ྷ JSXͷํ͕ࠞಱΛ࢈Ή͕ ࠇຐज़తͳ͍ํ͕Ͱ͖Δ
JSXόΠϯσΟϯά୯ͳΔόΠϯσΟϯά͡Όͳ͍ native class JSON5 { static function parse(str:string) : variant;
static function stringify(json:variant) : string; static function strictParse (st:string) : variant; } = """ (function(){ var json5 = require(‘json5’); var json5x = { parse : json5.parse, stringify : json5.stringify, strictParse : JSON.parse }; return json5x; }()); """; ৽͍͠ػೳՃͨ͠Γɺ ΠϯλϑΣʔεม͑ͨΓɺ όΠϯσΟϯά͡Όͳ͘ ͯϥούʔʹ͍ۙ
JSX to JS
JSXίϯύΠϧޙͷJavaScriptΛ طଘͷJavaScript͔Β͑Δɻ
JSX-linker !
JSX-linkerͷػೳ ίϯύΠϧޙͷJSΛଞͷJS͔ΒಡΊΔΑ͏ʹ͢Δ ! ! Common-JS style Closure compiler style AMD
style export global Support WebWoker import
JSX-linkerΛ͏ // require͔ΒಡΊΔΑ͏ʹͳΔɻ $ jsx test.jsx | jsx-linker -t commonjs-lib
--stdin -o test.js // global͔ΒಡΊΔΑ͏ʹͳΔ $ jsx test.jsx | jsx-linker -t export-global --stdin -o test.js // amd͔ΒಡΊΔ $ jsx test.jsx | jsx-linker -t amd-lib --stdin -o test.js // closure compiler ͔Β $ jsx test.jsx | jsx-linker -t closure-lib --stdin -o test.js // webworker͔Β $ jsx test.jsx | jsx-linker -t webworker --stdin -o test.js
JSX-linkerΛ͏ // require͔ΒಡΊΔΑ͏ʹͳΔɻ $ jsx test.jsx | jsx-linker -t commonjs-lib
--stdin -o test.js // global͔ΒಡΊΔΑ͏ʹͳΔ $ jsx test.jsx | jsx-linker -t export-global --stdin -o test.js // amd͔ΒಡΊΔ $ jsx test.jsx | jsx-linker -t amd-lib --stdin -o test.js // closure compiler ͔Β $ jsx test.jsx | jsx-linker -t closure-lib --stdin -o test.js // webworker͔Β $ jsx test.jsx | jsx-linker -t webworker --stdin -o test.js cool isn’t it !? :D
JSXͱJSͷؒʹ֞ࠜͳ͍
+49 Thanks :D