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

まちにまった Vue.js 3

kazupon
August 25, 2020

まちにまった Vue.js 3

kazupon

August 25, 2020
Tweet

More Decks by kazupon

Other Decks in Programming

Transcript

  1. PLAID, inc. Vue.js Core Team Member Vue.js Japan User Group

    Organizer Creator of Vue I18n & Intlify WebAssembly Love ❤ @kazu_pon kazupon kazupon
  2. ެࣜϓϥάΠϯɾπʔϧ΄΅४උ͕੔͍ͭͭ͋Δ • vue-router v4.0.0-beta6 • vuex v4.0.0-beta4 • vue-cli v4.5.0

    (vue 3 preset) • vue-devtools v6.0.0-beta.1 • eslint-plugin-vue v7.0.0-beta.2 • @vue/test-utils v2.0.0-beta.2 • vue-class-component v8.0.0-alpha.6 • vue-loader v16.0.0-beta.5 • rollup-plugin-vue v6.0.0-beta.8
  3. SFC

  4. ౤Լͨ͠ RFC ͸ 3ͭ • 1. ίϯϙʔωϯτͷΠϯϙʔτ౶ҥߏจ • 2. Composition

    API ͷ DX վળ • 3. CSS ม਺ΠϯδΣΫγϣϯ https://github.com/vuejs/rfcs/pull/182
  5. TypeScript ͸ʁ • declare Λ࢖ͬͯܕఆٛ declare Ͱ props Λ͢Δͱɺ SFCίϯύΠϥ͕

    props ࣮ࡍͷఆٛίʔυͱ TS ͷܕਪ࿦͞ΕΔΑ͏ʹίϯύΠϧ͢Δ
  6. ͜ΕΒRFCͷ࠾୒ʹ͍ͭͯ • <script setup>, <style vars> ʹͭ ͍ͯ͸ RC ʹ࣮૷ࡁΈ

    • <script setup> ͸೉ͳ͘࢖͑Δ • <style vars> ͸CSS ม਺͕࢖͑ΔϞ μϯͳϒϥ΢βͰར༻Ͱ͖Δ
  7. ͱ͍͏Θ͚ͰɺVue 3.0 Ͱ͸… • ·ͩ RFC Ͱ͍Ζ͍Ζͱٞ࿦ɺϑΟʔυόο Ϋ͕͋ΔͨΊ SFC ͷਖ਼ࣜػೳͰ͸ͳ͍

    • ͜ͷ SFC վળ ͸ Experimental (࣮ݧత) ͳ ػೳͱͯ͠ఏڙ͞ΕΔ • ໰୊ͳ͚Ε͹ɺv3.1 ? Ͱ࠾୒͞ΕΔ༧ఆ
  8. Vite ͷಛ௃ • ES Modules ϕʔεͷ։ൃαʔόΛඋ͑ͨϞμϯͳ Ϗϧυπʔϧ • dev server

    ͸ߴ଎ • ىಈ࣌ʹ͢΂ͯόϯυϧ͠ͳ͍ • ߴ଎ͳ ESbuild ʹΑΔ on the fly ίϯύΠϧ • Hot Module Replacement (HMR) ΋γϯϓϧͳ ͨΊ଎͍
  9. ػೳ • Bare Module Resolving • Hot Module Replacement •

    TypeScript • CSS / JSON Importing • Asset URL Handling • PostCSS • CSS Modules https://github.com/vitejs/vite#features • CSS Pre-processors • JSX • Custom Blocks • Config File • Dev Server Proxy • Production Build • Modes and Environment Variables
  10. ػೳ • Web Assembly • Inline Web Workers • HTTPS/2

    https://github.com/vitejs/vite#features
  11. ੜ·Εͨഎܠ • VuePress ͷىಈ͕஗ͯ͘ΠϥΠϥͨ͠ • SFC Λ ES Modules Ͱಈ͔͍ͨ͠ͱ͍͏Ξ

    ΠσΞ͕ੲ͔Β͋ͬͨ • Snowpack ͳͲͷ৽͍͠ ES Modules ϕʔ εͷόϯυϥ͕ग़ݱ͖ͯͨ͠
  12. Vite ͷݱঢ় • v1.0.0 RC ͱͯ͠ϦϦʔε͞Ε͍ͯΔͷ Ͱɺۙʑਖ਼ࣜ v1.0 ͕ϦϦʔε͞ΕΔݟࠐ Έ

    • ϓϩμΫγϣϯ޲͚ͷϏϧυ͸ɺ࣮࣭ rollup ͰϏϧυ͢ΔͷͰ࢖͑Δ͸ͣʂ...
  13. Vue ͱ Vite ͱͷؔ܎ • Vue 3 ޲͚ͷެࣜυΩϡϝϯτͰ Vite Λ

    ࢖ͬͨΠϯετʔϧʹ͍ͭͯॻ͍ͯ͋Δ • ͳͷͰɺVue ޲͚ʹ͸αϙʔτ͞Ε͍ͯ͘ ͷ͸ؒҧ͍ͳ͍
  14. Vue developer experience • Vue ͷ DX ΛΑ͘͢Δ ͨΊͷπʔϧ •

    ίΞνʔϜͷ Rahul ࢯ (znck) ͕࡞੒த • ·ͩ Experimental https://twitter.com/znck0
  15. ༨ஊ: ͪͳΈʹ Rahul ࢯ͸ 2018 ೥೔ຊʹདྷ͍ͯΔ • Vue Fes Japan

    2018 • ίϯύΠϥपΓ͕ಘ ҙ • rollup-plugin-vue ͷ ։ൃऀ https://vuefes.jp/2018/speakers/znck/
  16. Ҏલͷ2݄ͷൃදͷͱ͖͸ • reactive • computed • watch • readonly •

    ref • isRef • toRefs ্هͷΑ͏ͳجຊతͳAPI͔͠ͳ͔͕ͬͨ…
  17. ͞ΒʹҎԼͷAPI͕૿͑ͨ • shallowReactive • shallowRef • markRaw • triggerRef •

    isReactive • isProxy • toRaw ओʹύϑΥʔϚϯεͷ࠷దԽɺߴ౓ͳ͜ͱ ͍ͨ͠ਓ޲͚ʹެ։͞Εͨ
  18. ෼͔Γ΍͍͢ Reactivity API ʹ͍ͭͯͷࢿྉ • Ref ͱ Reactive Λ࢖͍෼͚͕೔ຊޠͰ෼͔ Γ΍͘͢ॻ͍ͯΔ

    https://speakerdeck.com/kawamataryo/ref-vs-reactive-vue-composition-api-deep-in
  19. v1.0.0 ͕ϦϦʔε͞Εͨ • δϣΠϯͨ͠ Anthony ࢯ΍ Carlos ࢯʹΑͬͯ։ൃ͕ਐ Μͩ •

    vue-next ͔Β଍Γͳ ͍API͕όοΫϙʔ τ͞Ε͍ͯΔ Anthony ࢯ Carlos ࢯ
  20. ͭ·Γɺຊ൪؀ڥͰ࢖͑Δ͜ͱΛҙຯ͠·͢ • Vue 3 ͸ RC ϑΣʔζ • Vue 2

    ͱ Vue 3 Λ ޓ׵ΛอͭϥΠϒ ϥͳͲ࡞͍ͬͯΔ ࡞ऀʹΑ࣮ͬͯূ ͞Ε͍ͯΔ Anthony ࢯ Carlos ࢯ
  21. • Ҏલࣗ෼͕ൃද͔ΒɺVue 3 RC ͕ϦϦʔε͞ΕΔ·Ͱʹ͍Ζ ͍Ζͱਐల͕͋ͬͨ • SFC վળ RFC

    • Vite ര஀ • @vuedex ͷ։ൃ • @vue/composition-api 1.0 ϦϦʔε • ࠓޙ΋ਖ਼ࣜϦϦʔε·Ͱʹਐల͕͋Δͱࢥ͏ͷͰɺ৘ใ ΩϟονΞοϓ͍͚ͯͨͩ͠Ε͹ɻ ·ͱΊ