୭
w Ԟݡଠ!PLVOPLFOUBSP
w ΫϨεΣΞגࣜձࣾ
w 5ZQF4DSJQUྺ
w ϑϩϯ
τΤϯ
υ
ɾ
όοΫΤϯ
υ
Slide 3
Slide 3 text
3FDPJMΛੵۃతʹΘͳ͍Λ͠·͢
Slide 4
Slide 4 text
ΈΜͳঢ়ଶΛཧ͍ͨ͠
ʁ
w ঢ়ଶͷଟ͞ݕূΛࠔʹ͢Δ
w Έ߹Θͤͷֻ͚ࢉͰݕূ߲͕૿͑Δͱ
w ݕূ࿙ΕͷϦ
εΫ
ˠ࣭ҡ࣋ͷ໘Ͱෆར
w ঢ়ଶۃྗཧͨ͘͠ͳ͍
w ϒϥβใΛදࣔ͢ΔͷΈɺ
ঢ়ଶθϩ
ʂ
ˡ͜
͏͋Εγϯϓϧ
Slide 5
Slide 5 text
ঢ়ଶͱ
w ϢʔβͷϩάΠϯ
ɾ
ηογϣϯͳͲೝূใ
w ϑ
ΥʔϜͷೖྗ
w (6*ͷදࣔঢ়گ
w දࣔඇදࣔΛΓସ͑Δ
τάϧɺ
ΞίʔσΟ
ΦϯͳͲ
w ϒϥβ͝ͱʹهԱ͞ΕΔ
ʮ࠷ۙදࣔͨ͠ϖʔδҰཡʯ
ͳΜؚ͔·ΕΔ͔͠Εͳ͍ʜ
Slide 6
Slide 6 text
ঢ়ଶͲ͜Ͱཧ͢Δ
ʁ
w LocalStorage, SessionStorageɹ
w URLSearchParams
ʢ63-ΫΤϦจࣈྻʣ
ɹ
w IndexedDBɹ
w ঢ়ଶཧ͚"1*ϥΠ
ϒϥ
Ϧ
ʢ3FBDU$POUFYU
3FEVY
3FDPJMͳͲʣ
w useState(), useRef()
w άϩʔόϧม
Slide 7
Slide 7 text
ঢ়ଶͷଟ͞ΞϓϦέʔγϣϯͷෳࡶ͞
w ঢ়ଶͷଟ͍ΞϓϦέʔγϣϯෳࡶͰ͋Δ
w ͜͜Ͱʜ
w ঢ়ଶͷଟ͞දࣔཁૉͷଟ͞
Ͱͳ͍
ʂ
w ͦΕ͕%#ʹͯӬଓԽ͞Εͨͷʹ༝དྷ͢ΔͷͰ͋Ε
ͦΕ
ʢϑϩϯ
τΤϯυจ຺ʹ͓͍ͯʣ
ঢ়ଶͰͳ͍
w αʔόʔ͔Βऔಘ͠ϒϥβ্Ͱදࣔ͢Δ
ʮݹయత8FCʯ
ͦͷͷͰ͋Δ
Slide 8
Slide 8 text
ঢ়ଶཧΩϟογϡཧͰͳ͍
w ঢ়ଶཧͷ֓೦ͱΩϟογϡͷ֓೦Λࠞͥͳ͍
w ঢ়ଶཧϥΠ
ϒϥ
Ϧɺ
GFUDIͨ͠ใͷஔ͖Ͱͳ͍
w ͳ͔ͥGFUDIͨ͠Βɺ
·ͣϨεϙϯεΛঢ়ଶཧϥΠ
ϒϥ
Ϧʹε
τΞ͕ͪ͠
Slide 9
Slide 9 text
IUUQTTXSWFSDFMBQQ
Slide 10
Slide 10 text
483Λ͏
w όοΫΤϯ
υʹͯɺ
Ϩεϙϯε
ɾ
ϔομʹ
Cache-Control max-age=300, stale-while-revalidate=300
Λ༩͓ͯ͘͠
w ඵؒΩϟογϡΛ͏
w ඵҎ্ܦա͍ͯͨ͠Βɺ
͔ͦ͜ΒඵؒطଘͷΩϟογϡΛ͍
όοΫΤϯ
υ৽نΩϟογϡΛੜ
w ࣍ͷGFUDIͰ࠷৽ͷͷΛಘΔ
w
ඵҎ্ܦա͍ͯͨ͠ΒΩϟογϡΛΘͣ࠷৽ͷͷΛಘΔ
Slide 11
Slide 11 text
ࢥߟఀࢭͰΦϨΦϨΩϟογϡΛ࣮͠ͳ͍
w GFUDIͨ݁͠ՌΛ
ʮͱ
Γ͋͑ͣ3FEVY3FDPJMʹೖΕΔʯ
ΛΊΔ
w ࢥߟఀࢭͰཧ͖͢ঢ়ଶΛ૿͞ͳ͍
w Ͳ͏ͤࢥߟఀࢭ͢ΔͳΒ
ʮࢥߟఀࢭͯ͠ϒϥβͷΩϟογϡʹΛҕͶΔʯ
΄͏͕Ϛγ
w ͦͦࢥߟఀࢭ͠ͳ͍
Slide 12
Slide 12 text
ঢ়ଶཧͱΩϟογϡઓུҟͳΔ֓೦
w Ωϟογϡઓུ
ʮදࣔͷߴԽʯ
ʮϦΫΤε
τͷݮʹΑΔίε
τݮʯ
w ঢ়ଶཧ
ʮӬଓԽ͞Ε͍ͯͳ͍ϒϥβ্ͷมͷهԱͱૢ࡞ʯ
w Ωϟογϡͷ༗ޮੑΛͲ͏ͬͯݕূ͢Δ͔ͱ
ঢ়ଶͷΈ߹ΘͤΛͲ͏ͬͯݕূ͢Δ͔ผ֓೦
w ޮ͖ݕূํ๏ҟͳΔ֓೦ͳͷͰࠞͥͳ͍
Slide 13
Slide 13 text
ΦϨΦϨ࣮ਓΛஔ͖ڈΓʹ͢Δ
w ͔ͭͯ3FEVY5PPMLJUΦϨΦϨϥούʔ࣮ͰେͳϦϙδτ
ϦΛ࣮ͨ͠ਓ͕͍ͨ
w ޙܧऀ͕શવಡΈղ͚ͣɺ
ղফػೳՃʹେۤઓ
w ࣮ऀνʔϜ͔Βڈ͓ͬͯΓɺ
ίϛο
τϩάͳͲ͔Βಡղ
w Ωϟογϡͱͯ͠ͷ্ޮՌ͞΄Ͳແ͠
ʢόοΫΤϯ
υଆͷΩϟογϡߟྀ͕͔ͬͨͨΊʣ
w ͨͩෳࡶͳ3FEVYϞϊ
Ϧ
ε͕ͦ͜ʹ͋Δʜ
˞ࣄ࣮ʹج͍ͮͨϑΟ
ΫγϣϯͰ͢˞3FEVY5PPMLJUࣗମͷੋඇʹݴٴ͠·ͤΜ
Slide 14
Slide 14 text
Έͮ͘
ΓΦϯϘʔσΟ
ϯάίε
τ͔Β
w ԿνʔϜϝϯόʔ͕มΘΒͳ͍ͳΒɺ
ࣗ༝ʹ᛭ୖຏ͍͚ͯ͠Α͍
w ͦΜͳอূͳ͍
w νʔϜϝϯόʔͷग़ೖΓ͕ى͜ΔͷͰ͋Ε
ΦϯϘʔσΟ
ϯάίε
τΛແҋʹ্͛Δͷಘࡦͱ͍͑ͳ͍
ʢචऀडୗઐͷͨΊɺ
։ൃνʔϜશһ͕ಉ྅ͷΈͱ͍͏ঢ়گ͕ͳ͍ಛघੑʹΑΔʣ
w νʔϜՃೖޙ͔Βߴੜ࢈ੑΛൃشͤ͞ΒΕΔ͔
ʁ
w લऀͷҎ߱ϝϯςφϯεΛҡ࣋Ͱ͖Δ͔
ʁ
Slide 15
Slide 15 text
ΩϟογϡҎલʹGFUDIΛݮΒ͢
w GFUDIͨͦ͠ͷ··ίϯϙʔωϯ
τͷඞཁՕॴʹόΠϯσΟ
ϯάͯ͠ඳը͢Εे
w ίϯϙʔωϯ
τ࠶ඳըͰൃੜ͢Δ௨৴ϒϥβΛ৴ͯ͡ΨϯΨϯ࣮ߦ
w ͦͦ3FBDUࣗମΛΑ
ֶ͘श͠ɺ
ͳίϯϙʔωϯ
τ࠶ඳըΛݮΒ͢ྗΛ͢Δ
w ςε
τʹ.48Λ࠾༻
IUUQTNTXKTJP
Slide 16
Slide 16 text
3FDPJM͍ͭ͏ͷ͔
w ·ͩग़൪͡Όͳ͍
w (6*ͷද੍ࣔޚuseState()Ͱे
w ϑ
ΥʔϜʹؔͯ͠SFBDUIPPLGPSNΛಋೖ
IUUQTSFBDUIPPLGPSNDPN
w ෳͷϖʔδΛ·͍ͨͰ༻͢Δঢ়ଶURLSearchParamsΛݕ౼͢Δ
w ΤϯυϢʔβʹΑͬͯϒοΫϚʔΫ͞Ε͏
Δϖʔδ͔
ʁ
w -*/&ͷΑ
͏ͳϝ
οηʔδΞϓϦͰڞ༗͞ΕΔ͔
ʁ
w ϒϥβͷΔػೳΛซ༻͞Εͨͱ͖ͷ࠶ݱੑΛ༏ઌ͍͔ͨ͠
ʁ
Slide 17
Slide 17 text
ͦΕͰͲ͏
ͯ͠3FDPJMΛ͏ͷ͔
Slide 18
Slide 18 text
3FDPJM͕ग़൪ͱͳΔͱ͖
w 1SPQTόέπ
Ϧ
Ϩʔ͕͋·
ΓʹසൟͰੜ࢈ੑ
ɾ
ՄಡੑͱʹԼΛ࣮ײ͢Δͱ͖
w ଟ͘ͷࢠίϯϙʔωϯ
τ͕ͲΕڊେͳ1SPQTΛ͍࣋ͬͯͯ
ίϯϙʔωϯ
τʹେྔͷuseState()͕ฒΜͰ͠·
͏
Α
͏ͳঢ়گ
w 3FBDU$POUFYUͷग़൪ʹͳΓͦ͏ͳશϖʔδશίϯϙʔωϯ
τͰڞ༗͢Δใ͕͋Δͱ͖
w શϖʔδͰຖճಉ͡༰ΛGFUDI͢Δͷ
͕͢͞ʹաͰͳ͍͔
ʢओ؍ʣ
ͱஅͰ͖Δͱ͖
w ྫ
ɿ
ϢʔβʔʹΑΔΧϥʔςʔϚઃఆͳͲɺ
$44JO+4্Ͱڞ༗ར༻͍ͨ͠ͷऔಘ
Slide 19
Slide 19 text
$POUFYUͷͭΒ͍
w 1SPWJEFSλϫʔ͕ੜ͢Δ
ग़యIUUQT[FOOEFWVIZPBSUJDMFTQSPWJEFSUPXFSUPSFDPJM
Slide 20
Slide 20 text
Ͳ͏
ͯͭ͠Β͍͔
w ୯७ʹՄಡੑ͕Լ͕Δ
w 4UPSZCPPLଆͷϝϯςφϯε͕ࡶʹͳΔ
w ૿͑Ε૿͑Δ΄ͲґଘॱΛѲ͢Δඞཁ͕͋Δ
ˠޓ͍ʹૄͰ͋Γɺ
͔ͭ1SPQTόέπϦ
ϨʔΛ؆ུԽ͢Δঢ়ଶऔಘͷखஈ͕ཉ͘͠ͳΔ
Slide 21
Slide 21 text
Α
͏͘3FDPJM
w $POUFYUΑ
Γང͔ʹखܰ
w චऀ3FDPJMΛ$POUFYUͷ༻ͱଊ͍͑ͯΔ
Slide 22
Slide 22 text
3FDPJM4FMFDUPS͏ͷ͔
w ࠷ޙ·ͰΘͳ͍
w $POUFYUͷ༻ͱ͍͏ཱͪҐஔͳͷͰ$POUFYUͷ༻Ҏ֎ͷ͜ͱ͠ͳ͍
wʮ։ൃऀͷग़ೖΓ͕ܹ͍͠νʔϜʯ
ͱ͍͏৫ߏʹ͓͍ͯ
3FDPJM4FMFDUPSΛ
ʮ͍ͭ͏͖Ͱɺ
͍ͭͬͯͳΒͳ͍͔ʯ
ͷ
ϧʔϧप͕ࠔͱஅ
w useCallback(), useMemo()Ұൠతͳ3FBDUεΩϧͱ͍͏ѻ͍Ͱ
पͤͣʹڞ௨ೝࣝΛಘ͍͢
w ςε
τʹ3FBDU5FTUJOH-JCSBSZΛ࠾༻
IUUQTUFTUJOHMJCSBSZDPN
Slide 23
Slide 23 text
VTF3FDPJM4UBUF
ͷѻ͍ํ
w ίϯϙʔωϯ
τͰ͍͖ͳΓuseRecoilState()Λݺͳ͍نʹ͓ͯ͘͠
w useRecoilState()ඞͣ͏ҰͭͷuseSomething()Ͱϥοϓ͔ͯ͠Βѻ͏
w ཧ༝
w useRecoilState()ͷΛѻ͏ॲཧͷςε
τΛίϯϙʔωϯ
τແ͠ʹ࣮ࢪ͢ΔͨΊ
w ίϯϙʔωϯ
τͷςε
τʹ͓͚ΔϞοΫೖʹ3FDPJMͷґଘΛؚΊͳ͍ͨΊ
w Ͳ͔͜ΒͰݺͳ͍Α
͏ʹ@packageΛ͚Δ
IUUQTHJUIVCDPNVIZPFTMJOUQMVHJOJNQPSUBDDFTT
Slide 24
Slide 24 text
ੵۃత3FDPJMফۃత3FDPJMΞϦ
w චऀɺ
3FDPJM͕උ͑Δ͋ΒΏΔ"1*Λ׆༻͖ͬͯ͠
3FDPJMલఏͷ࣮ΛੵΈॏͶΔελΠϧΛ൱ఆ͠ͳ͍
w ͨͩ͠ຊߨͰ࣮ྫΛհ͢Δ্Ͱɺ
ੵۃతಋೖ͍ͯ͠ͳ͍ͨΊ
$POUFYUͷ༻ࢭ·
Γ
ͱ͍͏ফۃతಋೖͷհͱͳͬͨ
w 3FDPJM3FBDUͷᙱ͍ͱ͜ΖΛ͔͚ΔϥΠ
ϒϥ
ϦͰ͋Δ͜ͱʹҧ͍ͳ͍