2015å¹´ã¯CSSãæ®åãã以æ¥ã¨ãªã10å¹´ã«1度ã®ããã³ãã¨ã³ã大å¤é©æã§ãããã¾ã§ã®ãã±ãä¸æ°ã«åã£ã¦ããã¨å人çã«æãã¦ãã¾ãããç®ã¾ããããç¶æ³ãå¤åãã¦ããã¾ãããã2016å¹´ã«ãªããå人çã«ã ãã¶è½ã¡çãã¦ããã¨æãã¦ããã®ã§ããããã¸ãã§ã¾ã¨ãã¦ããããæãã¾ãã
æåã«çµè«ãæ¸ãã¦ããã¨ã
ãReact + Redux + react-router + material-ui + axios + ES2015 + Babel + webpack + ESLint + Airbnb JavaScript Style Guideã
ã¨ããçµã¿åãããããã¾åã®æ¡ç¨ãã¦ããJavaScriptã®ç°å¢ã§ãã
主è¦ã©ã¤ãã©ãªã¯ React
å»å¹´ãä¸æ°ã«æ®åããReactã¯ãä»å¹´ã«å ¥ã£ã¦ã絶好調ã§ããä»ã®ã©ã¤ãã©ãªããAngular 2ãªã©ãè²ã ã¨é¨ããã¦ãã¾ããããå»å¹´1å¹´éã§å人çã«å½é¢ã¯Reactã«å®å ¨æ±ºçããã¨æã£ã¦ãã¾ããæ°å¹´åã¯ãjQueryã使ããªãã¨ããã³ãã®ä»äºã¯é£ããã¨è¨ããã¦ãã¾ããããããããã¯Reactã使ããªãã¨ããã³ãã®ä»äºã¯é£ããã¨è¨ããããã¨ã«ãªãã§ãããã
Reactã¯ãã©ã¦ã¶ã§åä½ããã¢ããªã±ã¼ã·ã§ã³ä»¥å¤ã«ããReact Nativeã«ããã¢ãã¤ã«ã¢ããªéçºãè¡ãã¾ãã®ã§ãä»å¾ã¾ãã¾ãæé·ãã¦ããããã§ãã
ã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã¯ Redux
Reactã§æ¬æ ¼çã«ã¢ããªã±ã¼ã·ã§ã³ãéçºããå ´åã¯ãã¬ã¼ã ã¯ã¼ã¯ãå¿ è¦ã§ããReactã®æ®åã«ã¨ããªã£ã¦ãFluxããFluxxorãªã©æ§ã ãªãã¬ã¼ã ã¯ã¼ã¯ãä¹±ç«ãã¾ããããç¾å¨é¦ä½ã«ç«ã£ã¦ããã®ã¯ãReduxã ã¨æãã¦ãã¾ãã
åãæåã¯Fluxã§éçºãã¦ããã®ã§ããããã®å¾ãReduxãç»å ´ããè©å¤ãè¯ãã®ã§å ¨é¢æ¸ãæããè¡ã£ãã®ã§ããããã®ä¾¿å©ããã¨ã¦ãè¯ãåããã¾ãããFluxã§ã¯dispatch, store, actionãªã©ã®å¦çãçµæ§å°éã«å®è£ ãã¦ããå¿ è¦ããã£ãã®ã§ãããReduxã®å ´åãFluxã®ã¨ãã¨æ¯ã¹ã¦50%ãããã®ã³ã¼ãéã§åãæ©è½ãå®è£ ã§ãã¾ããã
ã¾ã ãå®å ¨æ±ºçã¨ã¯ãããªãããããã¾ããããããããéçºãããæ¹ã¯ãã¨ãããã Redux ã§å§ãã¦ã¿ãã®ãè¯ãã¨æãã¾ãã
ã«ã¼ãã£ã³ã°ã¯ react-router
React + Redux ã¢ããªã§ã«ã¼ãã£ã³ã°ãå¿ è¦ãªå ´åã¯ãRedux ã¨åãã³ãã¥ããã£ã§éçºããã¦ãã react-routerãé¸æãã¦ããã°ãã¾ãééããªãã§ããããæè¿ãv2 ããªãªã¼ã¹ãããã®ã§ãããããå©ç¨ãã¯ãããå ´åã¯ããã¡ããå©ç¨ãã¾ãããã
UIãã¬ã¼ã ã¯ã¼ã¯ã¯ material-ui
UIã¯å¥½ã¿å¿ãã¦é¸æããã°è¯ãã¨æãã¾ããããªã¹ã¹ã¡ã¯å人çã« React ãæ¬æ ¼çã«å©ç¨ããããã«ãªã£ããã£ããã¨ãªãã®ã material-ui ã§ããGoogle ã® Material Designã React ã³ã³ãã¼ãã³ãã«ãã£ã¦åç¾ãããã¬ã¼ã ã¯ã¼ã¯ã§ãããã³ãã¢ããªéçºãçéã«ãªãã¾ãã
è¦ãç®ã¨ãããããã®ã§ã¯ãªããã¨ã«ããHTMLã¨CSSãä¸åæ¸ããã«ãç¨æãããã³ã³ãã¼ãã³ããã°ãã°ãé ç½®ãã¦ããã ãã§ãã¢ããªã±ã¼ã·ã§ã³ãã§ãã¦ãããããUIè¨è¨ã«å®å ¨ã«ãã©ã¼ã«ã¹ã§ããã®ãæ大ã®å©ç¹ã ã¨æã£ã¦ãã¾ãã
HTTP Request 㯠axios
axiosãå©ç¨ããåã¯ãsuperagentãå©ç¨ãã¦ããã®ã§ãããPromise ãã¼ã¹ã®æ¹ã楽ãªã®ã§ä¹ãæãã¾ãããsuperagentã®ã¨ãã¨æ¯ã¹ã¦ãXHRã¾ããã§æ©ã¾ãããªããªãã¾ããã
è¨è¿°ã¯ ES2015ï¼ES6ï¼
JSã¯æ¸ãã«ãããã¨ããæè¦ãããCoffeeScriptãTypeScriptãªã©ã®AltJSãæ¡ç¨ããããã¸ã§ã¯ããå¤ããªãã¾ããããå»å¹´ES2015ããªãªã¼ã¹ããããé°ã§ãæ¬å®¶ã¸åç¹å帰ããæµããã§ãããããªæ°ããã¾ãã
å¾è¿°ããBabelãªã©ãã«ãç°å¢ãæ´ã£ããé°ã§ãç©æ¥µçã«ES2015ã®æ§æãå©ç¨ã§ããããã«ãªã£ãäºã大ããã®ã§ãããå®éã«ES2015ãæ¸ãã¦ã¿ãã¨ãã¨ã¦ãæ¸ãå¿å°ãè¯ãããããæ®åè¦å ã ã¨æã£ã¦ãã¾ãã
å人çã«ã¯ãããããJavaScriptãè¦ãããã¨ãã人ã¯ãæåããES2015ã§è¦ããæ¹ãè¯ãã§ãããã
ãã«ãç°å¢ã¯ Babel + webpack
ãã«ãç°å¢ã«ã¤ãã¦ããè²ã ãªåããããã¾ããããã©ã³ã¹ãã¤ã©ã¯ãBabelãReactããµãã¼ããããã¨ãªã©ããããå®å ¨ã«ä¸æ¬åããæãããã¾ããããã«ãå¦çã¯ãGruntãGulpãBrowserifyãwebpackãªã©ã®ãã¼ã«ããã©ã®çµã¿åããã§é¸æããã°è¯ãã®ããæ¬å½ã«ããåããã¾ããã§ããã
ãã ãæè¿ã¯æµ·å¤ãä¸å¿ã« webpackã«ä¸æ¬åããåããåºãã£ã¦ãã¦ãããåããã®æµãã«ä¹ã£ã¦ãã¾ããéçºãµã¼ãã¼ãwebpack-dev-serverãå©ç¨ããã°ãç°¡åã«ç¨æã§ããã¨ãããå®ã«ãã¤ã¹ã§ãã
ææ³ã»æ§æãã§ãã¯ã¯ ESLint + Airbnb JavaScript Style Guide
ES2015ãReactãå©ç¨ãã¦éçºããã¨ãããã¨ã¯ã大è¢è£ã«è¨ãã°ãå¿ è¦ã¨ãªãæ§æç¥èãåç´ãªJavaScriptã®3åã«ãªãã¨è¨ãã¾ãï¼å¤§è¢è£ï¼ããã£ããæ°ããæ§æãæ°ããã©ã¤ãã©ãªãå©ç¨ãã¦éçºããã®ã§ããã°ãæ°ããæ§æã«æ©ãæ £ããããã®ã§ããããã§å½¹ã«ç«ã¤ã®ããESLint + Airbnb JavaScript Style Guideã®çµã¿åããã§ãã
ESLintã¯ãå³ããã®æ§æãã§ãã«ã§ãè¨å®ãå¤ããã¨ã§ãæåã§ããããæè¿ã¯ãã©ã°ã¤ã³å½¢å¼ã§ç¬¬ä¸è ãä½æããè¨å®ãç°¡åã«ã¤ã³ãã¼ããããã¨ãã§ããããã«ãªããã¨ã¦ã使ãããããªãã¾ããã
ä¸ã§ããAirbnb JavaScript Style Guideã¯ãES2015ã¨Reactã®æ§æããããªãåã®ããã§ãµãã¼ãããããã«è¨å®ããã¦ãããããè¦åã«å¾ã£ã¦ä¿®æ£ãã¦ããã°ãå¤ãã¹ã¿ã¤ã«ã®è¨è¿°ãå¼·å¶çã«ã©ããã©ãæ°ãããªã£ã¦ãããéæ»ã§æ°ããæ§æãå¦ç¿ã§ãããããã¨ã¦ãå©ãããã¾ããã
Atomãå©ç¨ãã¦ããå ´åã¯ãlinter + linter-eslintã®ãã©ã°ã¤ã³ãå ¥ãã¦ããã¨è¯ãã§ãããã
ãã¹ãã¯â¦
ãã¹ãã¯ã¾ã ã©ããè¯ãã®ã決ã¾ã£ã¦ãã¾ããããªãã¨ãªããjsdom + chai + mocha ãå©ç¨ãã¦ã¿ãããã¦ãã¾ãããRubyããã¹ãã«ã¤ãã¦ã¯æºãã¦ãã¾ãã®ã§ãä¸æ¬åã¯é£ããã®ããããã¾ããã
ã¾ã¨ã
å»å¹´1å¹´ã¯ããã³ãåãã®æ¿ããæµãã«ãå¤ãã®æ¹ãç¿»å¼ãããã®ã§ã¯ãªããã¨æãã¾ãããå人çã«ã¯è½ã¡çãã¦ããããã«è¦ãã¦ãã¾ããã
å¦ç¿ã³ã¹ãã¯ä¸æ°ã«è·³ãä¸ããã¾ããããéã«è¨ãã°ãWebã®é²åãæ¿ããä¸ã10å¹´åããã»ã¼å¤ã£ã¦ããªãã£ãããã³ãåãã®æè¡ããããããæ代ã«è¿½ãä»ããªããã°ãªããªããªããå»å¹´ã¿ãããªå¤§å¤é©ãèµ·ããã¨æãã°ãã¨ã¦ãèªç¶ãªæµãã¨è¨ãã¾ãã
æµç³ã«ä»å¾ã¯ãå»å¹´ã®ãããªæ¿ããå¤åã¯èµ·ããªãã¨æãã¾ãã®ã§ãããã³ãåããé観ãã¦ããããããã¯ããã²ä»å¹´ã§ä¸æ°ã«è¿½ãä»ãã¨è¯ãã§ãããã
追è¨
ããããã®æ代ãæ¯ããã¨ã³ã¸ãã¢ãè²æãã1å¹´ã§æå 端Webã¨ã³ã¸ãã¢ã«ãªããããµã¦ã¹ãã¼ã¯å éWebã¨ã³ã¸ãã¢ãã©ã³ãå ç10åã5ææ«ã¾ã§ãã¨ããäºæ¥ããã£ã¦ã¿ããã¨ã«ãã¾ãããèå³ã®ããæ¹ã¯ãã²ãã¡ãããæ¬ãã ããã