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

RailsエンジニアがStimulus + 生JSだけで約半年のプロジェクトを終えた今思うこと

RailsエンジニアがStimulus + 生JSだけで約半年のプロジェクトを終えた今思うこと

Masayoshi Tokumoto

February 21, 2019
Tweet

More Decks by Masayoshi Tokumoto

Other Decks in Technology

Transcript

  1. ϓϩδΣΫτͰ΍ͬͨ͜ͱʢҰ෦ʣ w +4ͷϑϨʔϜϫʔΫͱ+4ͷςεςΟϯάϑϨʔϜϫʔΫͷબఆɾಋ ೖ w ෳ਺ຕͷը૾ΛඇಉظͰ"84ͷ4΁μΠϨΫτΞοϓϩʔυ w ॺ໊͖ͭ63-ͷऔಘ w σʔλͷૹ৴

    w αϜωΠϧͷදࣔ w ࣜ৔໊ͷαδΣετػೳͷ࣮૷ w Ϣʔβʔͷॻ͖ࠐΈ಺༰ͷࣗಈอଘػೳͷ࣮૷ ࠓ೔͸͜ͷ̎ͭʹ͍ͭͯ৮Εͳ͕Β 4UJNVMVT΍+4ʹ͍ͭͯ࿩͠·͢
  2. ͖͔͚ͬ͸ʮK2VFSZ୤٫ʯ w K2VFSZ͸ศར͗͢Δ w Πϕϯτͱͷόϯυϧɺ%0.ૢ࡞ɺΞχϝʔγϣϯɺ"KBYʜ w ຕͷϑΝΠϧͰશ෦Ͱ͖ͯ͠·͏ w +4ʹৄ͍͠Θ͚Ͱ͸ͳ͍αʔόʔαΠυΤϯδχΞ͕ॻ͘ w

    Ԛ͍ίʔυͰॻ͔Εͯ͠·͏ʢແ๏஍ଳʣ w K2VFSZ͸ݹ͍ϑϨʔϜϫʔΫ w ϒϥ΢βؒͷ͕ࠩॖ·Γͭͭ͋Δ w ৽͍͠ϓϩδΣΫτͰΘ͟Θ͟࢖͏ʁ w ৽ଔ͸͔ΒֶͿ΂͖ʁ
  3. 4UJNVMVTͱ͸ <div data-controller="hello"> <input data-target="hello.name" type="text"> <button data-action="click->hello#greet">Greet</button> <span data-target="hello.output"></span>

    </div> // hello_controller.js import { Controller } from "stimulus" export default class extends Controller { static targets = [ "name", "output" ] greet() { this.outputTarget.textContent = `Hello, ${this.nameTarget.value}!` } }
  4. %0.ͷੜ੒͕ਏ͍ @DSFBUF5IVNCOBJM'JFME EBUB \ DPOTUUIVNCOBJM'JFME-JTUEPDVNFOURVFSZ4FMFDUPS AKT@\UIJTDBUFHPSZ^UIVNCOBJMpFMEMJTUA  DPOTUUIVNCOBJM'JFME8SBQQFSEPDVNFOUDSFBUF&MFNFOU EJW 

    UIVNCOBJM'JFME8SBQQFSEBUBTFUDPOUSPMMFSTUSJOHDPVOUFS UIVNCOBJM'JFME8SBQQFSEBUBTFUUBSHFUUIVNCOBJMpFMEJUFN UIVNCOBJM'JFME8SBQQFSEBUBTFUTUSJOH$PVOUFS.BY UIVNCOBJM'JFME8SBQQFSDMBTT/BNFQPTUQJDUVSFTBUUBDINFOUT DPOTUUIVNCOBJM'JFME#BDLHSPVOEEPDVNFOUDSFBUF&MFNFOU EJW  UIVNCOBJM'JFME#BDLHSPVOEDMBTT/BNFPTDPOUBJOFSCBDLHSPVOE UIVNCOBJM'JFME#BDLHSPVOEDMBTT-JTUBEE CBDLHSPVOEDPMPSHPME  UIVNCOBJM'JFME#BDLHSPVOEDMBTT-JTUBEE NBSHJOCPUUPN.  DPOTUIJEEFO0CKFDU,FZUIJTDSFBUF)JEEFO0CKFDU,FZ EBUBPCKFDU,FZ  DPOTUIJEEFO$BUFHPSZUIJTDSFBUF)JEEFO$BUFHPSZ  DPOTUIJEEFO$POUFOU5ZQFUIJTDSFBUF)JEEFO$POUFOU5ZQF SFWJFX  UIJT@DSFBUF3FWJFX5IVNCOBJM'JFME \ EBUB  UIVNCOBJM'JFME#BDLHSPVOE  IJEEFO0CKFDU,FZ  IJEEFO$POUFOU5ZQF  IJEEFO$BUFHPSZ  ^  UIVNCOBJM'JFME8SBQQFSBQQFOE$IJME UIVNCOBJM'JFME#BDLHSPVOE  UIVNCOBJM'JFME-JTUBQQFOE$IJME UIVNCOBJM'JFME8SBQQFS  ^ ͜ͷதͰͭͭͷཁૉΛ ಉ͡ཁྖͰҰੜݒ໋࡞ͬͯΔ