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
AST a la vista baby
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Leonardo Garcia Crespo
October 27, 2017
Technology
320
0
Share
AST a la vista baby
Slides for the talk given at NodeConf Argentina 2017
Leonardo Garcia Crespo
October 27, 2017
More Decks by Leonardo Garcia Crespo
See All by Leonardo Garcia Crespo
AST: Awesome Super Tool
leoasis
0
280
Hi Fiber!
leoasis
0
60
Other Decks in Technology
See All in Technology
管理アカウント単一運用からAWS Organizationsに移行するの大変で滅
hiramax
0
270
大学生が本気でDatabricksを活用してDiscordサークルをデータ駆動させてみた
phantomjuju
0
220
AI時代から振り返るTerraform drift運用の歴史 / AI Age Reflections on the History of Terraform Drift Operations
aeonpeople
0
540
ビジュアルプログラミングIoTLT vol.23
1ftseabass
PRO
0
150
組織の中で自分を経営する技術
shoota
0
190
AIガバナンス実践 - 生成AIコネクタのデータ漏洩リスクと実務対策
knishioka
0
110
イベントで大活躍する電子ペーパー名札 〜その3〜 / ビジュアルプログラミングIoTLT vol.23
you
PRO
0
160
権限管理設計を完全に理解した
rsugi
2
220
さきさん文庫の書籍ができるまで
sakiengineer
0
270
APIテストとは?
nagix
0
120
AI時代に改めて考える、ドメイン駆動設計 - モデリングが「AIへの共通言語」になる
littlehands
8
2.6k
『家族アルバム みてね』における インシデント対応との向き合い方 / Approach incident response in Family Album
kohbis
2
230
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
140
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
580
Balancing Empowerment & Direction
lara
6
1.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Technical Leadership for Architectural Decision Making
baasie
3
380
Fireside Chat
paigeccino
42
3.9k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
AI: The stuff that nobody shows you
jnunemaker
PRO
7
660
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Transcript
AST a la vista, baby
Lenny meetupjs.com.ar leogcrespo leoasis
None
ESLint
None
ES2015 ES5 ES2016 ES2017 ESNext ES2015 ES2016 ES2017
ES2015 ES5 ES2016 ES2017 ESNext ES2015 ES2016 ES2017 … …
… … … …
None
None
None
None
ESLint
ESLint ES2015 ES2016 ES2017 ESNext Estilo JS gotchas Variables Node.js
CommonJS …
ESLint ES2015 ES2016 ES2017 ESNext Estilo JS gotchas Variables Node.js
CommonJS … … … …
None
None
Cómo funcionan?
None
PARSERS
hacer un parser Escribir en un archivo function parse(code) {}
Escribir el resto del parser
https://github.com/thejameskyle/the-super-tiny-compiler
None
None
Abstract Syntax Tree (AST)
Abstract Syntax Tree (AST)
None
None
None
None
None
None
None
None
None
AST
AST
AST Plugins Código Código
AST ⚠ Reglas Warnings/Errores ESLint Código
None
None
None
None
None
None
None
None
None
None
None
None
astexplorer.net
None
ESLint GraphQL Prettier PostCSS JSCodeShift Syntax Highlighting Flow Typescript TSLint
None
Usá ESLint para validar que no se use una version
deprecada de un componente interno de tu empresa.
Usá un plugin de Babel para agregar parámetros contextuales de
debug en las llamadas a tu API en desarrollo
Parseá con Babylon (parser de Babel) los archivos de tu
aplicación y extraé los mensajes de i18n de tu código a un archivo para enviar a un servicio de traduccion.
None
⚡
None
⚙ ☠
4
https://kentcdodds.com/talks/#writing-custom-babel-and-eslint- plugins-with-asts https://blog.kentcdodds.com/how-writing-custom-babel-and-eslint- plugins-can-increase-your-productivity-and-improve-user- fd6dd8076e26 https://kentcdodds.com/workshops/#code-transformation-and-linting Kent C. Dodds James
Kyle https://github.com/thejameskyle/babel-handbook https://github.com/thejameskyle/the-super-tiny-compiler Henry Zhu http://henryzoo.com/babel-plugin-slides/assets/player/ KeynoteDHTMLPlayer.html#0
It’s AST, I know this!
leogcrespo leoasis