{"id":328,"date":"2016-12-22T16:29:37","date_gmt":"2016-12-22T07:29:37","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2016\/12\/22\/JavaScript"},"modified":"2016-12-22T16:29:37","modified_gmt":"2016-12-22T07:29:37","slug":"JavaScript","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2016\/12\/22\/JavaScript\/","title":{"rendered":"2017\u5e74\u3001\u65b0\u898f\u306bJavaScript\u3092\u66f8\u304f\u306a\u3089\u3069\u3093\u306a\u8a2d\u8a08\u3092\u3059\u308b\u304b"},"content":{"rendered":"

\u3053\u306e\u8a18\u4e8b\u306fJavaScript Advent Calendar 2016<\/a>\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n

\u4eca\u56de\u306f\u30012017\u5e74\u3001\u65b0\u898f\u306bJavaScript\u3092\u66f8\u304f\u306a\u3089\u3069\u3093\u306a\u8a2d\u8a08\u3092\u3059\u308b\u304b<\/code>\u3001\u3068\u3044\u3046\u30c6\u30fc\u30de\u3067\u66f8\u3044\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u30022017\u5e74\u3068\u3044\u3063\u3066\u3082\u3001\u3057\u3070\u3089\u304f\u306f\u3053\u3093\u306a\u611f\u3058\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u3084\u3063\u3066\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u3069\u3093\u306a\u69cb\u6210\u3067JavaScript\u3092\u8a2d\u8a08\u3057\u3066\u304d\u305f\u304b<\/code>\u3068\u3044\u3046\u65b9\u304c\u6b63\u3057\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u57fa\u672c\u7684\u306b\u306fSPA\u3092\u30d9\u30fc\u30b9\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n

\u307e\u305f\u3001\u6700\u65b0\u306e\u30a4\u30b1\u3066\u308b\u6280\u8853\u30d0\u30ea\u30d0\u30ea\u4f7f\u3063\u3066\u3084\u308b\u305c\u3001\u3068\u3044\u3046\u3088\u308a\u306f\u3001\u5805\u7262\u3067\u3001\u306f\u3084\u308a\u304c\u5909\u308f\u3063\u3066\u3082\u30e1\u30f3\u30c6\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u3053\u3068\u3092\u610f\u8b58\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n

DOM\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0<\/h2>\n

Virtual DOM\u3092\u4ee3\u8868\u3068\u3057\u305f\u3001DOM\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u306a\u306b\u304b\u63a1\u7528\u3057\u307e\u3059\u3002\u7279\u306b\u7406\u7531\u304c\u306a\u3051\u308c\u3070React\u3067\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002Virtual DOM\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001Angular\u3067\u3082DOM\u7ba1\u7406\u306b\u304a\u3044\u3066\u306f\u3055\u307b\u3069\u9055\u3044\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u306e2\u3064\u4ee5\u5916\u3067\u3042\u308c\u3070\u3001Vue.js\u3001\u3082\u3057\u304f\u306f\u3001preact<\/a>(\u4e00\u4f8b\u3067\u3059)\u306a\u3069\u306e\u8584\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u307e\u305f\u3001\u30eb\u30fc\u30bf\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u3053\u308c\u306b\u5408\u308f\u305b\u3066\u9078\u3076\u306e\u304c\u81ea\u7136\u304b\u3068\u8003\u3048\u307e\u3059\u304c\u3001\u4f9d\u5b58\u30d5\u30ea\u30fc\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u3042\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u63a1\u7528\u3059\u308b\u306e\u3067\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n

\u5b9f\u88c5\u30d1\u30bf\u30fc\u30f3<\/h2>\n

\u3044\u307e\u3060\u3068Redux\u304c\u591a\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30a4\u30e1\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30b7\u30f3\u30d7\u30eb\u306aObserver\u30d1\u30bf\u30fc\u30f3\u304c\u5b9f\u88c5\u3067\u304d\u308c\u3070\u306a\u3093\u3067\u3082\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u305f\u3060\u3057\u3001DOM\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u540c\u3058\u3067\u3001\u8584\u304f\u3066\u5165\u308c\u66ff\u3048\u304c\u53ef\u80fd\u306a\u3082\u306e\u306b\u3059\u308b\u306e\u304c\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002Redux\u306f\u6bd4\u8f03\u7684\u5165\u308c\u66ff\u3048\u53ef\u80fd\u306a\u70b9\u3082\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n

\u307e\u305f\u3001Angular\u3067\u3042\u308c\u3070\u3001\u7279\u306b\u4f55\u3082\u5165\u308c\u306a\u304f\u3066\u3082\u3001RxJS\u3068EventEmitter\u3067\u3042\u308b\u7a0b\u5ea6\u306f\u30ab\u30d0\u30fc\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u9759\u7684\u578b\u4ed8\u3051<\/h2>\n

\u958b\u767a\u52b9\u7387\u304c\u304b\u306a\u308a\u5909\u308f\u3063\u3066\u304f\u308b\u305f\u3081\u3001JavaScript\u306b\u9759\u7684\u578b\u4ed8\u3051\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u9078\u629e\u80a2\u3068\u3057\u3066\u306fTypeScript\u304bFlow\u3067\u3001\u6a5f\u80fd\u6027\u3067\u8a00\u3046\u306a\u3089TypeScript\u306e\u65b9\u304c\u52dd\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u305f\u3060\u3001\u65e2\u5b58\u306eJS\u304c\u3042\u308b\u74b0\u5883\u306b\u5f8c\u4ed8\u3051\u3067\u5c0e\u5165\u3059\u308b\u3001\u3082\u3057\u304f\u306f\u3001\u4eca\u5f8c\u65b0\u3057\u3044\u30c4\u30fc\u30eb\u306b\u5207\u308a\u66ff\u3048\u305f\u308a\u3059\u308b\u3053\u3068\u3092\u8003\u616e\u306b\u5165\u308c\u305f\u3044\u306e\u3067\u3042\u308c\u3070\u3001Flow\u3092\u9078\u3076\u306e\u304c\u59a5\u5f53\u3067\u3057\u3087\u3046\u3002\u305f\u3060\u666e\u901a\u306bES2015\u3067\u66f8\u304f\u304f\u3089\u3044\u306a\u3089\u3001\u9759\u7684\u578b\u4ed8\u3051\u3092\u662f\u975e\u5c0e\u5165\u3059\u3079\u304d\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u3053\u308c\u306b\u52a0\u3048\u3066\u3001lint\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u3092\u3044\u308c\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3059\u3002\u50d5\u306f\u3001TypeScript\u306a\u3089Atom\u306elinter<\/a>\u3001Flow\u306a\u3089Nuclide\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u304c\u3067\u304d\u308c\u3070\u306a\u3093\u3067\u3082\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u30c6\u30b9\u30c8\u74b0\u5883<\/h2>\n

\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u63cf\u753b\u3057\u306a\u304c\u3089\u30c6\u30b9\u30c8\u3067\u304d\u308b\u3082\u306e\u3068\u3001\u30ed\u30b8\u30c3\u30af\u3060\u3051\u306e\u30c6\u30b9\u30c8\u304c\u3067\u304d\u308b\u3082\u306e\u30012\u3064\u3092\u6e96\u5099\u3059\u308b\u3068\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3069\u3093\u306a\u69cb\u6210\u306b\u3082\u6c4e\u7528\u7684\u306b\u7528\u3044\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u306f\u3001Karma+Jasmine<\/code>\u3068mocha(+chai)<\/code>\u306e\u30bb\u30c3\u30c8\u3067\u3057\u3087\u3046\u304b\u3002\u3053\u3053\u306b\u30a2\u30b5\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u3001\u30e2\u30c3\u30af\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u4e57\u3063\u3066\u304f\u308b\u611f\u3058\u3067\u3059\u3002<\/p>\n

\u30e2\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\/\u30d3\u30eb\u30c9<\/h2>\n

\u73fe\u72b6\u3001webpack\u304c\u3084\u3080\u3092\u5f97\u305a\u6700\u3082\u7121\u96e3\u306a\u9078\u629e\u80a2\u3060\u3068\u3044\u3048\u307e\u3059\u3002<\/p>\n

\u30bf\u30b9\u30af\u30e9\u30f3\u30ca\u30fc\u306b\u95a2\u3057\u3066\u306f\u7279\u306b\u5fc5\u8981\u306a\u304f\u3001npm\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u69cb\u7bc9\u3059\u308b\u306e\u304c????\u3068\u601d\u3044\u307e\u3059\u3002\u305f\u3060\u3057\u3001gulp\u3092\u907f\u3051\u308b\u306e\u3067\u306f\u306a\u304f\u3001Stream\u3092\u63d0\u4f9b\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u306f\u7a4d\u6975\u7684\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n

\u30b9\u30bf\u30a4\u30eb<\/h2>\n

(\u6012\u3089\u308c\u305d\u3046\u3067\u3059\u304c...)\u4e3b\u8981\u306a\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u30fc\u3092\u4f7f\u3048\u3070\u306a\u3093\u3067\u3082\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002PostCSS\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u5287\u7684\u306b\u958b\u767a\u52b9\u7387\u304c\u3042\u304c\u308b\u3068\u3044\u3046\u611f\u3058\u3067\u306f\u306a\u304b\u3063\u305f\u306e\u3068\u3001\u3053\u308c\u307e\u3067\u306e\u30b9\u30bf\u30a4\u30eb\u958b\u767a\u77e5\u898b\u3092\u305d\u306e\u307e\u307e\u6d3b\u304b\u305b\u308b\u65b9\u304c\u3001\u958b\u767a\u52b9\u7387(\u958b\u767a\u901f\u5ea6\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u306a\u3069\u3002\u307e\u305f\u3001\u5b9f\u969b\u306e\u30b9\u30bf\u30a4\u30eb\u4f5c\u6210\u306b\u52a0\u3048\u3001\u753b\u50cf\u3084\u30d5\u30a9\u30f3\u30c8\u306b\u3082\u5f71\u97ff\u304c\u53ca\u3076)\u304c\u3042\u304c\u308b\u3068\u8003\u3048\u307e\u3059\u3002<\/p>\n

\u307e\u305f\u3001\u3069\u306e\u30c4\u30fc\u30eb\u3067\u3042\u3063\u3066\u3082\u3001BEM\u3084SMACSS\u306a\u3069\u3092\u5143\u306b\u3057\u305f\u8a2d\u8a08\u3092\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5b9f\u88c5\u8005\u3001\u30c7\u30b6\u30a4\u30ca\u30fc\u304c\u628a\u63e1\u3057\u306a\u304c\u3089\u7d44\u307f\u7acb\u3066\u3066\u3086\u304f\u3053\u3068\u304c\u5927\u4e8b\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u3092\u3059\u308b\u3082\u3046\u3072\u3068\u3064\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u3001\u6700\u521d\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3057\u307e\u3046\u3068\u3001\u4e00\u90e8\u30c7\u30b6\u30a4\u30f3\u3044\u3089\u305a\u3067\u65b0\u898f\u6a5f\u80fd\u3084\u30da\u30fc\u30b8\u3092\u958b\u767a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u3082\u3042\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n

\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/h2>\n

\u4e0a\u8a18\u3092\u8e0f\u307e\u3048\u308c\u3070\u3060\u3044\u305f\u3044\u81ea\u7136\u3068\u6c7a\u307e\u3063\u3066\u304f\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3088\u304f\u3042\u308a\u304c\u3061\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u3060\u3044\u305f\u3044\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5171\u901a\u3057\u3066\u3044\u308b\u304b\u306a\uff1f\u3068\u3044\u3046\u611f\u3058\u3067\u3059\u3002<\/p>\n

.\n\u251c\u2500\u2500 entries # \u30d3\u30eb\u30c9\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\n\u251c\u2500\u2500 components # \u4f7f\u3044\u307e\u308f\u3059\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\n\u251c\u2500\u2500 views # \u5404\u30da\u30fc\u30b8\u306e\u89aa\u3068\u306a\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\n\u251c\u2500\u2500 action\/dispatcher\/reducer # \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u7279\u6709\u306e\u8a2d\u8a08\u7684\u5206\u985e\n\u251c\u2500\u2500 services # \u5171\u901a\u306e\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\n\u251c\u2500\u2500 values # \u5171\u901a\u306e\u9759\u7684\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\n\u251c\u2500\u2500 style # \u30b9\u30bf\u30a4\u30eb\n\u251c\u2500\u2500 assets # \u30a2\u30a4\u30b3\u30f3\u30d5\u30a9\u30f3\u30c8\u3084\u753b\u50cf\n\u2514\u2500\u2500 test # \u30c6\u30b9\u30c8\u3002\u30d8\u30eb\u30d1\u30fc\u306a\u3069\u3082\u3053\u306e\u4e2d\u306b\u3002<\/code><\/pre>\n

\u305d\u306e\u4ed6<\/h2>\n

\u305d\u306e\u4ed6\u3001\u8a2d\u8a08\u3068\u307e\u3067\u306f\u884c\u304d\u307e\u305b\u3093\u304c\u3001\u7d30\u304b\u306a\u3053\u3068\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n

API\u901a\u4fe1<\/h3>\n

\u30ea\u30af\u30a8\u30b9\u30c8\u51e6\u7406\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001request<\/a>\u3001superagent<\/a>\u3001axios<\/a>\u3001unirest-nodejs<\/a>\u3042\u305f\u308a\u3067\u3057\u3087\u3046\u304b\u3002fetch<\/a>\u3092\u4f7f\u3046\u306e\u3082????\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u975e\u540c\u671f\u51e6\u7406<\/h3>\n

Promise\u7cfb\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u306a\u306b\u304b\u3057\u3089\u3044\u308c\u307e\u3059\u3002\u666e\u901a\u306bbluebird<\/a>\u304bq<\/a>\u3068\u304b\u3067\u3057\u3087\u3046\u304b\u3002async\/await\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n

\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea<\/h3>\n

\u3088\u304f\u4f7f\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n