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

babel7とTC39のproposalをゴチャマゼで!

 babel7とTC39のproposalをゴチャマゼで!

Kyousuke Abe

October 28, 2018
Tweet

More Decks by Kyousuke Abe

Other Decks in Programming

Transcript

  1. 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E

    Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba a 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53 camp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22 53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Na 2.0"N 136°53’14.7"E Basecamp Nagoya 35°10'22.0"N 136°53’14.7"E Ba Nagoya 35°10'22.0"N 136°53’14.7"E Basecamp Nagoya CBCFMͱ5$ͷ QSPQPTBMΛΰνϟϚθͰʂ  !/BHPZBKT
  2. Θͨ͘͠ʹ͍ͭͯ { "@context": "http://schema.org", "@type": "Person", "name": "Kyousuke Abe", "alternateName":

    "安部亨佑", "birthPlace": "Iwata, Shizuoka", "birthDate": "1982.9.24", "height": "181 cm", "weight": "68 kg", "gender": "male", "worksFor": "FRAME LUNCH Inc.", "workLocation": "Ohsu, Nagoya-shi”, "jobTitle": "Web engineer", "nationality": "Japanese", "url": "https://kaave.github.io", "sameAs": [ "https://twitter.com/junkjunctions", "https://github.com/kaave" ] } { "likes": [ "Vim-style key binding", "Emacs-style key binding", "ErgoDox", "Macbook Pro", "TypeScript", "React", "PostCSS", "fish shell", "Twitter", "Music", "Football", "Casual cycling”, "Bodyweight Workout", "Spicy foods", "Dried fruit", "American coffee" ] }
  3. ઴͕͘ग़ͨ  ओͳʜͱ͍͏͔
 ๻͕ோΊͯ΄ʔΜͱࢥͬͨมߋ఺  4DPQFENPEVMF ໊લۭؒ Խ  es20XX͕ऴྃ

    preset-envʹू໿   stage-X͕ऴྃ  5ZQF4DSJQU ҰԠ ରԠ  zbabel.config.jszͰ΋ઃఆͰ͖ΔΑ͏ʹ ˠৄࡉ͸ϚΠάϨʔγϣϯΨΠυ͓͢͢Ί
  4. ৽نҊ݅ -1 Ͱૣ଎  ͬ͟ͱશ෦ʹͨ͠  ઃఆϑΝΠϧΛzbabel.config.jsz΁  process.env.NODE_ENV ===

    ‘production`͕ͱ ΕΔ  preset-env + polyfillͷઃఆมߋ  useBuiltIns: ‘usage’ʜ͸࢒೦ϋϚͬͨͷ Ͱ‘entry`΁
  5. ͍·͞Β͚ͩͲ
 TUBHF9ͱ͸ ࠓޙͷ+4ʹೖΔ ͔΋͠Εͳ͍ ػೳͷάϨʔυ
 TUBHF͸ͷஈ֊  4UBHFΞΠσΞ  4UBHFఏҊ

     4UBHF࢓༷ॻυϥϑτ࡞੒ࡁ  4UBHF΄΅׬੒'#ٻΊͯΔ  4UBHFܾ·Γཌ೥ͷ&499ೖ
  6. v.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 v.3 Lv.3

    Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 v.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 v.3 Lv.3 Lv.3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 Lv.3 Lv.3 Lv.3 v.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 v.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 Lv.3 <<TUBHF>>
  7. !CBCFMQMVHJOTZOUBYEZOBNJDJNQPSU *NQPSU999GSPNʜͱ͕ͪͬͯɺ
 ֘౰ίʔυͷҐஔ·Ͱ౸ୡͨ͠ΒίʔυΛಡΈࠐΉ async function initializeDevServer(expressApp: Express) { const {

    default: webpack } = await import('webpack'); const { default: webpackHotMiddleware } = await import('webpack-hot-middleware'); const { default: webpackDevMiddleware } = await import('webpack-dev-middleware'); const { default: webpackClientConfig } = await import('../../tools/webpack/client/ development'); const compiler = webpack(webpackClientConfig as any); expressApp.use(webpackHotMiddleware(compiler)); expressApp.use( webpackDevMiddleware(compiler, { noInfo: true, publicPath: webpackClientConfig.output.publicPath, }), ); } ˠEFW͚࣌ͩ͜ͷؔ਺ΛಡΉΑ͏ʹͯ͠ɺແବʹ XFCQBDLࠐΈͷCVOEMF࡞Βͳ͍Α͏ʹͯ͠·͢
  8. !CBCFMQMVHJOQSPQPTBMDMBTT QSPQFSUJFT DMBTTͷϝϯόม਺Λఆٛଈ୅ೖ class User { name = 'Kyousuke Abe'

    gender = 'man'; birthday = new Date(1982, 9 - 1, 24); getAge = () => Math.floor((new Date() - new Date(1982, 9 - 1, 24)) / 1000 / 60 / 60 / 24 / 365); } class User { constructor() { this.name = 'Kyousuke Abe' this.gender = 'man'; this.birthday = new Date(1982, 9 - 1, 24); this.getAge = this.getAge.bind(this); } getAge() { return Math.floor((new Date() - new Date(1982, 9 - 1, 24)) / 1000 / 60 / 60 / 24 / 365); } }
  9. !CBCFMQMVHJOQSPQPTBMKTPOTUSJOHT AaVaVAͱ͍͏ϒϥ΢βࡴ͠ͷ
 ΍͹͍஋ΛΤεέʔ ϓ // before const ex = "before

    after"; // after const ex = "before\u2028after"; ˠೖΕͱ͍ͯࠔΔ͜ͱ͸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2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 v.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 Lv.2 <<TUBHF>>
  11. !CBCFMQMVHJOQSPQPTBMGVODUJPOTFOU δΣωϨʔλͷதͰ
 ௚ۙʹૹΒΕͨ஋ΛಘΒΕΔωλ function* generator() { console.log("Sent", function.sent); console.log("Yield", yield);

    } const iterator = generator(); iterator.next(1); // Logs "Sent 1" iterator.next(2); // Logs "Yield 2" ˠ࿩ඈͿΜͰ͕͢δΣωϨʔλͬͯॻ͍ͯ·͢ʁ
 SFEVYTBHBҎ֎Ͱ࢖ͬͯΔͷ஌Βͳ͍ʜɻ
  12. !CBCFMQMVHJOQSPQPTBMUISPX FYQSFTTJPOT ྫ֎ΛࣜͷதͰ౤͛ΕΔ function save(filename = throw new TypeError("Argument required"))

    { } function getEncoder(encoding) { const encoder = encoding === "utf8" ? new UTF8Encoder() : encoding === "utf16le" ? new UTF16Encoder(false) : encoding === "utf16be" ? new UTF16Encoder(true) : throw new Error("Unsupported encoding"); } ˠ͋Μ·௚ײత͡Όͳ͍ؾ͕͢Δ
  13. v.1 LV.1 Lv.1 LV.1 Lv.1 LV.1 Lv.1 LV.1 v.1 LV.1

    Lv.1 LV.1 Lv.1 LV.1 Lv.1 LV.1 v.1 LV.1 Lv.1 LV.1 Lv.1 LV.1 Lv.1 LV.1 v.1 LV.1 Lv.1 LV.1 Lv.1 LV.1 Lv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>
  14. ͕͢͞ʹ ઑͬͨͷ͕ଟ͍  !CBCFMQMVHJOQSPQPTBMFYQPSUEFGBVMUGSPN  !CBCFMQMVHJOQSPQPTBMMPHJDBMBTTJHONFOU PQFSBUPST  !CBCFMQMVHJOQSPQPTBMPQUJPOBMDIBJOJOH 

    !CBCFMQMVHJOQSPQPTBMQJQFMJOFPQFSBUPS  !CBCFMQMVHJOQSPQPTBMOVMMJTIDPBMFTDJOH PQFSBUPS  !CBCFMQMVHJOQSPQPTBMEPFYQSFTTJPOT
  15. !CBCFMQMVHJOQSPQPTBMFYQPSU EFGBVMUGSPN EFGBVMUFYQPSU͞Εͨ΍ͭΛ
 ໊લ͚ͭͯ଎߈FYQPSU w w w w w export

    someIdentifier from "someModule"; export someIdentifier, { namedIdentifier } from "someModule"; ˠͦ΋ͦ΋EFGBVMUFYQPSUࣗମ࠷ۙ͸Ξϯνύλʔϯʁ ͨ·ʹͦ͏͍͏هࣄݟ·͢ΑͶ๻΋΍Ί·ͨ͠
  16. !CBCFMQMVHJOQSPQPTBMMPHJDBM BTTJHONFOUPQFSBUPST Ͳ͔ͬͰݟͨ୅ೖʹศརͳԋࢉࢠ
 ๻͸φϯ೥લ1FSMͰݟ͕֮ͨ͑ʜ
 ࠨล͕cc ͩͬͨΒӈลΛ୅ೖ a ||= b; //

    a || a = b a &&= b; // a && a = b a ??= b; // a ?? a = b ˠ࠶୅ೖ༻ͷԋࢉࢠ͕͸ͨͯ͠GMVYޙͷ+4γʔϯ ʹඞཁ͔ͳ͊ʁ
  17. !CBCFMQMVHJOQSPQPTBMPQUJPOBM DIBJOJOH /VMM VOEFGJOFE νΣοΫ͕֨ஈʹָʹͳΔΞϨ
 TXJGU LPUMJO΍Δͱྑ͕͞Θ͔Γ·͢ΑͶʜ const obj =

    { foo: { bar: { baz: 42, }, }, }; const baz = obj?.foo?.bar?.baz; // 42 const safe = obj?.qux?.baz; // undefined const err = obj.qux.baz; // Error!!! ˠ͸΍͍ͱ͜͸͍Μͳ͍͔ͳʜɻ
  18. !CBCFMQMVHJOQSPQPTBMQJQFMJOF PQFSBUPS 'ͱ͔&MJYJSͱ͔ʹ͋ΔΞϨγΣϧͬΆ͍ͱ΋ function add(a, b) { return a +

    b; } function pow(a, b) { return a ** b; } pow(add(1, 2), 3); // 27 1 |> add(2) |> pow(3) // 27 ˠ͖ͨͬʂ͜Ε΋ͥͻͥͻདྷͯ΄͍͠ʜ
 ͚Ͳɺʮྑ͍ίʔυʯͷఆ͕ٛมΘΓ͗͢Δ͔Β
 ৻ॏʹͳΔΑͶʜɻ
  19. !CBCFMQMVHJOQSPQPTBMOVMMJTI DPBMFTDJOHPQFSBUPS ͜Ε΋Αͦͷݴޠʹ͋Δ΍ͭ
 OVMMPSVOEFGJOFEͩͬͨΒ͜ͷ஋Ͷɺͬͯԋࢉࢠ
 ๻͸$Ͱॻ͍ͯ·ͨ͠ const foo = object.foo ??

    'default'; const foo = object.foo !== null && object.foo !== undefined ? object.foo : 'default'; ˠ"1*͍ͨͨͨͱ͖ͷ໭Γ஋Λύʔε͢Δͱ͖ͱ ͔ʹ࢖͑ͦ͏ͳΜͰೖͬͯ΄͍͠ʜ
  20. !CBCFMQMVHJOQSPQPTBMEP FYQSFTTJPOT )BTLFMMͰݟͨ͜ͱ͋Δ΍ͭ
 EPͰϒϩοΫείʔ ϓ࡞Δͱ࠷ޙͷ஋͕໭Γ஋ʹ let a = do {

    if(x > 10) { 'big'; } else { 'small'; } }; // is equivalent to: let a = x > 10 ? 'big' : 'small'; ˠࠓߋ҉໧తͳφχΨγ૿΍͢ͷͲ͏͔ͳʔͱ ࢥ͏
  21. Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero

    Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero Lv.zero <<TUBHF>>
  22. !CBCFMQMVHJOQSPQPTBMGVODUJPOCJOE ஌ͬͯΔਓ͸ଟ͍͚ͲʜͳΞϨԆʑͷ·· import { map, takeWhile, forEach } from "iterlib";

    getPlayers() ::map(x => x.character()) ::takeWhile(x => x.strength > 100) ::forEach(x => console.log(x)); ˠͥΜͥΜਐΜͰͳ͍ཧ༝͸͜ͷล Ͳ͏ͳΔ CJOEPQFSBUPSQSPQPTBM ʹৄ͍͠
  23. 1BUUFSO.BUDIJOH 4UBHF &MJYJSͱ͔ʹ͋Δ΍ͭ
 ৚݅෼ذ৽ύλʔϯͱ͍͏͔
 TXJUDIͷѥछͬΆ͍ͱ͍͏͔ const res = await fetch(jsonService)

    case (res) { when {status: 200, headers: {'Content-Length': s}} -> { console.log(`size is ${s}`) } when {status: 404} -> { console.log('JSON not found') } when {status} if (status >= 400) -> { throw new RequestError(res) } }
  24. 4MJDFOPUBUJPO 4UBHF 1ZUIPOͱ͔ͷ഑ྻൣғࢦఆͷύΫϦ ͋ͬͯ΋͑͑Μ͡Όͳ͍͔ͳ͋ʜ
 ͳͯ͘΋ͦΜͳ͜·Μͳ͍͚Ͳʜ const arr = ['a', 'b',

    'c', 'd']; arr[1:3]; // ['b', 'c'] arr.slice(1, 3); // ['b', 'c'] const str = 'hello world'; str[6:]; // 'world' str.slice(6); // ‘world'
  25. 3FH&YQ/BNFE$BQUVSF (SPVQT Ϛονཁૉʹ໊લΛ͚ͭͯࢀর͠΍͘͢
 ྫʹΑͬͯଞͷݴޠͰݟ·͢ const regex = /(?<year>[0-9]{4})-(?<month>[0-9]{1,2})-(? <date>[0-9]{1,2})/; const

    matcher = '2018-10-28'.match(regex); console.log(`${matcher.groups.year}年$ {matcher.groups.month}月${matcher.groups.date}日`); ˠ!CBCFM഑ԼͰ͸͋Γ·ͤ͵͕ɺϓϥάΠϯ͋ Γ·͢
  26. 3FH&YQMPPLCFIJOE BTTFSUJPOT ޙํࢀর
 ͦͷલ·Ͱ͕ϗχϟϥϥͩͬͨΒɺͱ͍͏৚݅ 'abcdef'.match(/(?<=abc)def/) // 'def' 'foodef'.match(/(?<=abc)def/) // null

    'abcdef'.match(/(?<!abc)def/) // null 'foodef'.match(/(?<!abc)def/) // 'def' ˠϓϥάΠϯ͸ݟ͚ͭΒΕͳ͔ͬͨͰ͢·͊ɺ ࣮૷೉ͦ͠͏Ͱ͢΋ΜͶ