Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Change your source with AST

Change your source with AST

For Roppongi.js#4

Yosuke Kurami

June 26, 2018
Tweet

More Decks by Yosuke Kurami

Other Decks in Programming

Transcript

  1. ΍ͬͪ·ͬͨ w ͦ΋ͦ΋ "45ιʔείʔυ͸Մٯม׵͡Όͳ͍
 FHηϛίϩϯ Πϯσϯτ ετϦϯάϦςϥϧ FUD  w

    QSFUUJFS͔͚Ε͹͍͍΍ɺͱࢥ͍ͬͯͨ  w ۭߦ͕࡟আ͞Εͯ͠·͏݅͸Ͳ͏͠Α͏΋ͳ͍
  2. 5FYU$IBOHF w ԫ৭ͷ෦෼͸Ұ੾มߋ͕ͳ͍ ιʔείʔυͦͷ··  w มߋ͕ෳ਺ͷ৔߹͸ɺιʔείʔυͷޙΖ͔Βద༻͢Δ import { someFn

    } from "./target"; export default function main() { someFn(); } import { someFn } from “./new-target”; export default function main() { someFn(); } textChanges = [{ start: 24, end: 32, text: 'new-target' }]