2020幎12æ1é± Weekly Report
ð° Topics
ã€ã³ããããšå
±ã«ã¢ãŠããããã圢ã«åºããäžé±éã§ããã
åŠãã ããš
è©Šããããš
調ã¹ãããš
ã®é
ã æžããããš
ã«ç§»ãã®ã¯è¯ãããšð
Table of Contents
æžããããš
ãããã°ãNuxtã§PWAãæŽæ°ãããªãåé¡ã®èª¿æ»
Togowlã®ãããã€ãããã®ã«ã ãªããŒãããŠãææ°ã«ãªããªããã©ãã«ã«ééããŸããã
é¢é£èšäºãæ¢ããŠããããŒãžã§ã³ãäžãããšãã£ãæ¶æ¥µçãªæ¹æ³ãããªãã£ãã®ã§æžããŸããã
çµè«ããèšããšãçŸæç¹ã§äŸåé¢ä¿ãææ°ã«ããã°æãã解決ããŸãã
ãã ãããŸããããªã£ãçç±ãPWAã®åºç€ç¥èã¯ç¥ã£ãŠãããŠãæã¯ãªããšæããŸãã
ãTypeScriptããªãªãŒã¹ããŒã v3.5
TypeScript v3.5ã®ãªãªãŒã¹ããŒãããŸãšãçµãããŸããã
psql
ããŸã«PostgreSQLãã¿ãŒããã«ã§æäœããã®ã§ãããæ¯åpsqlã³ãã³ãå¿ããã®ã§æžããŸããã
Vueã®ã€ãã³ã修食åã§äŒæãåæ¢ããã
ã¯ãªãã¯ã芪ã«äŒæãããããªããšãã<div @click.stop="onClick">hoge</div>
ã®ããã«æžããŸãã
ä»ãŸã§stopPropagation
ãçé¢ç®ã«å®è£
ããŠããŸãã..ã
åŠãã ããš
ãªã.. ãšããããã¯åŠã³ããã¹ãŠã¢ãŠããããããŠããŸã£ãæãã§ãã
èªãã ããš/èŽããããš
ä»äºãžã®åãåãæ¹ãèããããžã§ãã»ã¯ã©ããã£ã³ã°ãšã¯ïŒ
åœäºè æèãããŒã¹ã«ãJobããCareerããCallingãã®ä»äºèŠ³ãæã€ã話ã
èŠæ¹ã«ãã£ãŠå€ãããŸãããæŠãCallingã§ä»äºãããŠããã£ãŠããããªãšæã£ãŠããŸãã
ç§ãæäŸããã䟡å€ã¯Efficiencyã§ãã
é¢ãã£ãŠãããµãŒãã¹ã¯ãã®éãã§ãããŸãããã瀟å ã§ãµãŒãã¹ãã€ãã£ãŠãã人éããµããŒãããããŒã«ãæäŸ/éçºãããŠããã£ãŠããã®ã§ã
ãGolangãå®çš Generics: Python ã® itertools ã Go 2 ã«ç§»æ€ããŠã¿ã
Go2ã®ãžã§ããªã¯ã¹ã䜿ã£ãŠPythonã®itertoolsãå®è£
ããŠã¿ãèšäºã§ãã
ãžã§ããªã¯ã¹ã«ã¯ããªãæåŸ
ããŠããã®ã§èªãã§ã¿ãŸããã
ãããã»ããšãã®äžæã«å°œããŸããã
ç§ã絶察ã«interface{}
ã䜿ããããããŸãã..ã
Go ã«ãããŠã¯ãã³ãŒãã®åå©çšæ§ãçãã®ããã« interface{} ã䜿ã£ãåŠçãæžãããšã¯äžè¬çã«æªæãšããã2ãå®éã®å (underlying type) ã int ã ã£ãã string ã ã£ãããã interface{} ãå å·¥ããã«ã¯ã type assertion ãªãæŠå¿µã§äºåã«å ·äœçãªåãã䞻匵ãããããšã«ãªãã®ã ããã¡ãã£ãšãã¹ããšå³ panic ãããã極ããŠå±éºã 3ãæåŸã®æ段ãšã㊠reflection ã䜿ã£ããšããŠããåæ§ãããã¯ãã以äžã®å°çãåŸ ã¡æ§ããŠããããšã ãã*4ã
go2goãªããŠãã®ãããã®ã§ãã..!!
dev.go2go
ãã©ã³ãã§éçºãããŠããããã§ãã
ãžã§ããªã¯ã¹ãè©ŠããŠã¿ãããªãããã䜿ãã°ããããã
æå°è ã¯èªåãæ£ã«ãããã¹ãçç±
èªåãã§ããŠããªãããèšããªã..ã§ã¯ãã¡ã ããšãã話ã
ç§ãæ®æ®µããæ£ã«äžãã€ã€ãææããããèªåãæ°ãä»ããªããšãšå¥®ãç«ãããŠããŸãã
çžæã§ã¯ãªãèªåã«ãã¡ãªããã®ãã話ã
- ä»äººãžã®æå°ãéããŠãèªåèªèº«ãæ°ä»ããªãã£ãèªåèªèº«ãžã®FBã«ãªã
- ä»äººã«æå°ããããšã§ãä»åŸèªåããã®äºæããã£ããè¡ãããã«ãªã
ä¿¡é Œé¢ä¿ããªããšé¢åæ¯ãå¢ãããªã¹ã¯ããããããé¿ããããªãæ°æã¡ã¯åãããŸããã©ãã
ãGitHubãThe State of the Octoverse
GitHubã®å¹Žæ¬¡ã¬ããŒãã§ãã
3幎åã«ã¯ãããŠ10äœã«ã©ã³ã¯ã€ã³ããTypeScriptãã4äœãŸã§æµ®äžããŠããŠå¬ããã£ãã§ãâº
TypeScriptãã¯ãããã®ã¯2016幎é ãäŒç€Ÿã§å°å
¥(æããå)ããã®ãåãé ã§ãã
åœæã¯æ°ãããããã¯ããåœããåã®ããã«JavaScriptã§æžãããŠããŠã¢ã€ã¢ã€ããŠããŸããããæè¿ã§ã¯å€§æµã®ã±ãŒã¹ã§ãTypeScriptã䜿ãã?ãã®æ€èšãè¡ãããŠããããšãè£ä»ãã«ãªããŸããã
5以äžã®ç€Ÿå
ãããã¯ãã§äœ¿ã£ãŠããéãã§ã¯åŸæããããšã¯ãããŸããã
æè¬ã¯æã®æ°ã»ã©ð ð
TypeScript㯠ãæ¬æ¥ãªãã¯ãã®åããããšæã蟌ãŸããŠããäžéå端ãªèšèªã ã ãšããæ¹ãããŸãããå®è£ ã®æ段ãšããŠãã身ããããã°ååã§ãã
Understanding Memory Leaks in Nodejs
Node.jsã®ã¡ã¢ãªãªãŒã¯ã«ã€ããŠããšãŠãåããããã説æãããèšäºã
ãã¡ããJavaScriptã«ã眮ãæããããŸãã
ä»ãŸã§èŠãèšäºã®äžã§ã¯äžçªåãããããããããŠå¿
èŠãªãšãããŸã§ã¯èžã¿èŸŒãã§ãããšæããŸããã
æ°ãã€ããã»ããè¯ããããªé
ç®ã®ã¿ããã¯ã¢ããããŸãã
globalå€æ°ã¯GCãããªã
ãµã€ãºã®å€§ããglobalå€æ°ã䜿ãæã¯æ³šæãå¿
èŠã§ãã
ã©ãããŠãå¿
èŠãªå Žåã¯GCããããããäžèŠã«ãªã£ãæç¹ã§undefined
ã代å
¥ããŸãããã
DOMãžã®åç §ãæ®ã£ãŠãããšDOMãæ¶ããŠãGCãããªã
const ref = document.getElementById("...")
ã§ååŸããåç
§ref
ãæå¹ãªããååŸå
ã®DOMãdocument.body.removeChild(...)
ãªã©ã§åé€ããŠãã¡ã¢ãªã«ã¯æ®ãç¶ããŸãã
åç
§ãä¿åããå€æ°ã«undefined
ã代å
¥ããŸãããã
Listenerã§äœ¿ã£ãŠããå€æ°ã¯Listenerãåé€ããªããšGCãããªã
element.addEventListener
ã§è¿œå ããListenerãäžèŠã«ãªã£ãããelement.removeEventListener
ã§åé€ããŸãããã
Closureã®äžã§å®çŸ©ããå€æ°ã¯æªäœ¿çšã§ãGCãããªã
Closureãè¿åŽããFunctionå
ã§äœ¿ãããŠãã/ããªãã«é¢ãããã代å
¥ããå€æ°ãæå¹ãªå
ã¯GCãããŸããã
äžèŠãªå€æ°ã¯åé€ããå¿
èŠãªå Žåã¯Closureã®è¿åŽå€ããªãŒã¯ããªãããã«æ°ãä»ããŸãããã
timerã¯ã¯ãªã¢ããªããã°GCãããªã
setInterval
ã«ã¯clearInterval
ãsetTimeout
ã«ã¯clearTimeout
ãããããå¿
èŠã§ãã
ç¹ã«setTimeout
ã¯äžåºŠããã®åŠçã§ãããããclearãå¿ããã¡ã§ãã
setTimeoutã¯æ¬åœã«ã¡ã¢ãªãªãŒã¯ããã®ã?
ãã°ããããã°GCãåŒã°ãããšããå 容ãå€ãç®ã«ããã®ã§åé¡ãªãã®ãããããŸãã..ã
è©Šããããš
ãªãã
調ã¹ãããš
ãªãã
æŽåããããš
IntelliJ IDEA 2020.3
StableããªãªãŒã¹ãããŸããã®ã§ããŒãžã§ã³ã¢ããããŸããã
æ°ã«ãªã£ãæ©èœãããã¯ã¢ããããŸãã
IntelliJ IDEA ããã¡ã€ã«ãéãããã®ããã©ã«ãã¢ããªã±ãŒã·ã§ã³ã«èšå®
ããã«ã¯ãªãã¯ã§IntelliJ IDEAããéããããã«ã§ããã¢ã¬ã§ãã
ã¿ãŒããã«ããããã¡ã€ã«åãæå®ããã ãã§éããã®ã¯äŸ¿å©ã§ãð
Gitã¹ããŒãžã®ãµããŒã
ä»ãŸã§ã¯ç¬èªã®changelistã§ç®¡çãããŠããŸããããããããGitæšæºã®ã¹ããŒãžãå
¥ããŸããã
ãã ããåæèšå®ã¯ç¡å¹ãªã®ã§Settings / Preferences | Version Control | Git
ã«ç§»åããŠEnable staging area
ããã§ãã¯ããå¿
èŠããããŸãã
æ £ããŠããªãããããããä»ã¯ãã¡ãªããã ããç®ã«ä»ããŠããŸããŸãã
- æåã§Stageããã®ãé¢åããã (
Ctrl+Alt+a
ã䜿ã£ãŠã) - æ¯å
Staged
ãšUnstaged
ãæããããŸãã
æ¢ãã°èšå®ããããããããŸãããäžæŠæ§åèŠã§ã
Code With Me EAP
ãªã¢ã«ã¿ã€ã ã«å
±åç·šéã§ãããã©ã°ã€ã³ã®EAPçã
VSCodeã§ã¯1幎以äžåããããæ©èœã§ãããæ¬æ Œçãªéçºã«VSCodeã ãšå¿èš±ãªãããšãããJetBrains IDEã䜿ãç¶ããŠããã®ã§ä»åŸã«æåŸ
ããŠããŸãã
JetBrainsãµãŒãã«ãœãŒã¹ã³ãŒããã¢ããããŒãããªããã°ãããªããšèããŠãããããæ¥åå©çšã¯å³ãããšæã£ãŠããã®ã§ããããã€ã®éã«ããªã³ãã¬å¯Ÿå¿ãããŠãŸããã
Node.jsãv14.15.1ã«ããŒãžã§ã³ã¢ãã
Node.jsã®LTSãå°ãåã«v12ããv14ã«å€ãã£ãããããŒãžã§ã³ã¢ããããŸããã
éçºãããã¯ããé 次v14ã«ããŠããäºå®ã§ãã
Windows
scoop update nodejs-lts
Ubuntu
$ n lts
ä»é±ã®ãªãªãŒã¹
Togowl v2.19.1 ïœ v2.22.1
ä»æ¥ããåã®ã¿ã¹ã¯ãäžçªäžã«è¡šç€º
ããæ®ããã¿ã¹ã¯ãäžç®çç¶ã«ãªããŸããã
ãŸã..æ¥ãå€ããåã«ãã¹ãŠçµããããšããªã¹ã¹ã¡ããŸããð
ã¿ã¹ã¯æ€çŽ¢ã¿ããéãããšãå ¥åæ¬ã«ãã©ãŒã«ã¹ã移ã
ãã©ãŒã«ã¹ããããæéãçããŸãã
ç¹°ãè¿ãã¿ã¹ã¯ã®ã¢ã€ã³ã³è¡šç€º
PCã¯ãããŒãã¹ããã®å Žåã¯ã¯ãªãã¯ã§è¡šç€ºãããŸãã
ã¿ã¹ã¯æ€çŽ¢ãªã¹ãã«èšæž¬éå§ãã¿ã³ãè¿œå
ãã¿ã¹ã¯ã¯å¿
ãæ¬æ¥ã®ãªã¹ãã«ç»é²ããŠããèšæž¬ãã¹ãããšããæ¹éã®ããå€ããæ©èœã§ãã
ãããã以äžã®ã±ãŒã¹ã¯âã®ã¡ãªããããæéãäžåãããè¿œå ããŸããã
- æ°åïœåæ°åã®ééæéãã§ãã
- ééæéå ã ãå®æœããå®äºããªãã£ããåœåã®äºå®éãé²ãã
æ¬æ¥ã®èšç»ãç«ãŠãªããŸãŸã¿ã¹ã¯ã«åãçµãããã®æ©èœã§ã¯ãããŸãããã..ã
Time Dividerã®ãã¶ã€ã³å€æŽ
Schedulerã¿ããšåæ§ãTimerã¿ãã§ãTime Dividerã®ã¬ã€ã¢ãŠããå€ããŸããã
衚瀺ã¯å€ãããŸããããä»ãŸã§ãšåæ§ã«Todoistã®1ã¿ã¹ã¯ãšããŠæ±ããŸãã
ãã®ä»
Quizletã®åèªæ°
æ¬æ¥æç¹ã§ã®åèªæ°ã¯123(+18)ã§ãã
æ¯æ¥ãã¹ãŠã®åèªãåèªåž³åŠç¿ããŠããŸããã100ãè¶
ããŠãã倧å€ã«ãªã£ãŠããŸããð