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

攻めつづける FRESH! のWeb ver.新春

sutiwo
February 11, 2018

攻めつづける FRESH! のWeb ver.新春

#insideFE #insideFE_B
15:40〜 のセッションです。

Inside Frontend : https://inside-frontend.com/#seminar-b3

sutiwo

February 11, 2018
Tweet

More Decks by sutiwo

Other Decks in Technology

Transcript

  1. 1. Payment Request API ͷಋೖ 2. React v15 to v16

    Ͱ΍ͬͨ͜ͱ 3. Puppeteer Λ࢖ͬͨ E2E ςετ 4. ͦͷଞͷऔΓ૊Έ Agenda
  2. 1. Payment Request API ͷಋೖ 2. React v15 to v16

    Ͱ΍ͬͨ͜ͱ 3. Puppeteer Λ࢖ͬͨ E2E ςετ 4. ͦͷଞͷऔΓ૊Έ Agenda
  3. Payment Request API Ͱ؆୯ɾߴ଎ͳܾࡁΛ࣮ݱ͢Δ | Web | Google Developers :

    https://developers.google.com/web/updates/2016/07/payment-request?hl=ja
  4. 1. Payment Request API ͷಋೖ 2. React v15 to v16

    Ͱ΍ͬͨ͜ͱ 3. Puppeteer Λ࢖ͬͨ E2E ςετ 4. ͦͷଞͷऔΓ૊Έ Agenda
  5. v15 -> v16 Ͱ΍ͬͨ͜ͱ 1. Fluxible, ֎෦UIίϯϙʔωϯτΛΞοϓσʔτ 2. <Fragment />

    , return string ͷ࢖༻ 3. SSRͰ renderToStream ॻ͖׵͑
  6. Benchmark 0 750 1500 2250 3000 Avg Stdev Max 1.921

    179 491 2.504 465 954 v15.5.4 v16.0 ms
  7. renderToString -> renderToNodeStream -SSR ࣌ ReactElement Λॳظͷ HTML ʹඳը͢Δ -Node.js

    ͷ StreamAPI Writable Λ࢖ͬͯඇಉظॲཧ -metaλάͷ࡞੒Ͱ෭࡞༻͕ൃੜ (ޙड़)
  8. Request1 -> Request1 ͷ renderToNodeStream -> Request2 -> Request2 ͷ

    renderToNodeStream -> Request2ͷ .on(‘finish’) Metadata Λऔͬͯdispose(ΫϦΞ)͢Δ -> Request1ͷ .on(‘finish’) Metadata ͕ۭʹͳΔ ෭࡞༻ εϨουηʔϑ
  9. Request1 -> Request1 ͷ renderToNodeStream -> Request2 -> Request2 ͷ

    renderToNodeStream -> Request2ͷ .on(‘finish’) Metadata ΛऔͬͯΫϦΞ͢Δ -> Request1ͷ .on(‘finish’) Metadata ͕ۭʹͳΔ ෭࡞༻ εϨουηʔϑ metadata Λ contextɺfluxͳͲάϩʔόϧεςʔτ΁
  10. 1. Payment Request API ͷಋೖ 2. React v15 to v16

    Ͱ΍ͬͨ͜ͱ 3. Puppeteer Λ࢖ͬͨ E2E ςετ 4. ͦͷଞͷऔΓ૊Έ Agenda
  11. - Node.js =< 8 async/await ࢖͑Δ - Transpile ෆཁ -

    ςετ߲໨+αͷػೳ
 (ScreenShot, FMPͷܭଌ)
  12. 1. Payment Request API ͷಋೖ 2. React v15 to v16

    Ͱ΍ͬͨ͜ͱ 3. Puppeteer Λ࢖ͬͨ E2E ςετ 4. ͦͷଞͷऔΓ૊Έ Agenda