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
JSXで作るDSL / jsx-dsl
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
mottox2
September 04, 2019
Technology
2.6k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JSXで作るDSL / jsx-dsl
gifteeさんで行われた『フロントエンド Night #1』のLT資料です。
https://giftee.connpass.com/event/141943/
mottox2
September 04, 2019
More Decks by mottox2
See All by mottox2
つくり方を変えていく | change-how-we-build
mottox2
2
1.5k
もう一歩進めたい OG画像の動的生成
mottox2
7
3k
なぜコピペで使うコンポーネント集を利用するのか?
mottox2
8
7.6k
UIコンポーネントライブラリをうまく使うためにできること / components-with-designer
mottox2
7
4.1k
Figma Plugin公開までの壁を乗り越える
mottox2
3
4.2k
Puppeteerでつくる画像と動画 / images and videos made with puppeteer
mottox2
0
800
手触りのよいウェブを考える / better-mobile-web
mottox2
3
2.1k
組織と権限とSlack App / slack-app-with-roles
mottox2
1
740
SSRを避けるためにやっていること / ssr-alternative
mottox2
9
3.3k
Other Decks in Technology
See All in Technology
LLM機能を自作して分かるSnowflake Cortex AIの強み
nayuts
0
330
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
120
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
510
FOSS4Gを活用した自治体業務DXの試み
470715
0
140
Loop Engineering これくらいでいい
mikanichinose
0
110
自分で立ててみるLLMサービス
y_sera15
0
150
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
160
Lambda MicroVMsが分からなすぎたので使い所を1から考えてみた
tsukuboshi
2
440
The seven pitfalls of AI (revised version)
ufried
0
300
初対面のメンバーがチームを組み、Claude Codeでゼロからサービスをリリース
mkdev10
1
110
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
320
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
7
2.4k
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
560
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Claude Code のすすめ
schroneko
67
230k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
260
Discover your Explorer Soul
emna__ayadi
2
1.3k
New Earth Scene 8
popppiees
4
2.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
4 Signs Your Business is Dying
shpigford
187
23k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Tell your own story through comics
letsgokoyo
1
1.1k
Side Projects
sachag
456
43k
Transcript
2019.09.04 フロントエンド Night #1 / @mottox2 JSXでつくるDSL
フロントエンドエンジニア(Web/iOS) Gatsby, Gridsome, Next.js, etc お仕事 Watching mottox2 @ ؿٔ٦ٓٝأ8FCؒٝآص،
⾃⼰紹介
#ϑϩϯτΤϯυNight DSL • DSL(Domain Specific Language) • ドメインに特化した⾔語 • 例:
itamae • Ruby製のプロビジョニングツール
#ϑϩϯτΤϯυNight JSX • JavaScript の構⽂の拡張 • ⾒⽅によっては『Viewを記述するためのDSL』 • BabelによってReact.createElementに変換して使っている
#ϑϩϯτΤϯυNight JSXから他形式への変換 XML, JSON, PlainText などのフォーマット output input
• 技術同⼈誌によく使われるフォーマット。ワンソースでPDFやEPUBに変 換が可能。 jsx-review: JSXをRe:VIEW形式に変換する GitHub mottox2/jsx-review
#ϑϩϯτΤϯυNight 1. コンポーネントの定義 • コンポーネントを定義、TypeScriptの型を付けておくとよい。
#ϑϩϯτΤϯυNight 2. JSXをJSONへ変換 • react-test-rendererを使うと、Reactコンポーネントをオブジェクトに変 換できる。
#ϑϩϯτΤϯυNight 3. JSONをRe:VIEWへ変換 • Reactコンポーネントから⽣成したオブジェクトをtypeごとに変換する。
#ϑϩϯτΤϯυNight 4. 表⽰するメソッドを実装 • Reactコンポーネントから⽣成したオブジェクトをtypeごとに変換する。
#ϑϩϯτΤϯυNight 利点: TS/JSDocの補完が効く
#ϑϩϯτΤϯυNight 利点: TSの型チェックが効く
#ϑϩϯτΤϯυNight まとめ • JSXをベースにHTML以外のアウトプットを想定したDSLが作れる。 • React + TypeScriptで磨かれたDXがそのまま流⽤できる。 • 補完
+ 型チェック + フォーマット + ドキュメント • VSCode(No Plugin)
技術書典7で頒布します
Thank you! 2019.09.04 フロントエンド Night #1 / @mottox2