{"id":408,"date":"2023-08-09T18:00:00","date_gmt":"2023-08-09T09:00:00","guid":{"rendered":"https:\/\/blog.fundely.co.jp\/tech\/?p=408"},"modified":"2023-08-09T14:55:29","modified_gmt":"2023-08-09T05:55:29","slug":"%e7%88%86%e9%80%9f%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92%e7%9b%ae%e6%8c%87%e3%81%97%e3%81%a6%e3%82%b3%e3%83%bc%e3%83%89%e5%88%86%e5%89%b2%e3%81%ab%e3%82%88%e3%82%8b%e9%80%9f%e5%ba%a6%e6%94%b9%e5%96%84","status":"publish","type":"post","link":"https:\/\/blog.fundely.co.jp\/tech\/2023\/08\/09\/%e7%88%86%e9%80%9f%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92%e7%9b%ae%e6%8c%87%e3%81%97%e3%81%a6%e3%82%b3%e3%83%bc%e3%83%89%e5%88%86%e5%89%b2%e3%81%ab%e3%82%88%e3%82%8b%e9%80%9f%e5%ba%a6%e6%94%b9%e5%96%84\/","title":{"rendered":"\u7206\u901f\u30a2\u30d7\u30ea\u3092\u76ee\u6307\u3057\u3066~\u30b3\u30fc\u30c9\u5206\u5272\u306b\u3088\u308b\u901f\u5ea6\u6539\u5584~"},"content":{"rendered":"\n<p>\u3053\u3093\u306b\u3061\u306f\u3002\u300c\u65ec\u3092\u3059\u3050\u306b\u300d\u306e\u30b5\u30fc\u30d3\u30b9\u958b\u767a\u3092\u62c5\u5f53\u3057\u3066\u3044\u308b\u5927\u5d8b\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u65ec\u3092\u3059\u3050\u306b\uff08\u4ee5\u4e0b\u3001\u65ec\u3059\u3050\uff09\u3067\u306f\u3001\u304a\u5ba2\u69d8\u306eUX\u5411\u4e0a\u306e\u305f\u3081\u65e5\u3005\u6539\u5584\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br>\u305d\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u76f4\u8fd1\u3067\u306fweb\u30a2\u30d7\u30ea\u306e\u8868\u793a\u30b9\u30d4\u30fc\u30c9\u6539\u5584\u306b\u53d6\u308a\u7d44\u3080\u6a5f\u4f1a\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br>\u5fc5\u8981\u306a\u6280\u8853\u3068\u3057\u3066\u300c\u30b3\u30fc\u30c9\u5206\u5272\uff08Code Splitting\uff09\u300d\u306b\u3064\u3044\u3066\u8abf\u3079\u305f\u306e\u3067\u3001<br>\u4eca\u56de\u306f\u3001\u305d\u306e\u6280\u8853\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b3\u30fc\u30c9\u5206\u5272\uff08Code Splitting\uff09\u3068\u306f<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u30b3\u30fc\u30c9\u5206\u5272\uff08Code Splitting\uff09\u3068\u306f\u3001\u30b3\u30fc\u30c9\u3092\u3055\u307e\u3056\u307e\u306a\u30d0\u30f3\u30c9\u30eb\u307e\u305f\u306f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u5206\u5272\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u305d\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u7279\u5b9a\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u307f\u3092\u8aad\u307f\u8fbc\u3093\u3060\u308a\u3001\u4e26\u5217\u3067\u8aad\u307f\u8fbc\u3093\u3060\u308a\u3059\u308b\u3053\u3068\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/p>\n<cite><a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Glossary\/Code_splitting\" target=\"_blank\" rel=\"noopener nofollow\" title=\"MDN Web Docs \u7528\u8a9e\u96c6\">MDN Web Docs \u7528\u8a9e\u96c6<\/a><\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b3\u30fc\u30c9\u5206\u5272\u304c\u5fc5\u8981\u306a\u7406\u7531<\/h2>\n\n\n\n<p>SPA\u3067\u306f\u57fa\u672c\u7684\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u30921\u3064\u306b\u30d0\u30f3\u30c9\u30eb\u3057\u307e\u3059\u3002\u3053\u306e\u30d0\u30f3\u30c9\u30eb\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092Web \u30da\u30fc\u30b8\u5185\u306b\u7f6e\u304f\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u30a2\u30d7\u30ea\u5168\u4f53\u3092\u4e00\u5ea6\u306b\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u5927\u304d\u304f\u306a\u308b\u307b\u3069\u30d0\u30f3\u30c9\u30eb\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u5927\u304d\u304f\u306a\u308a\u3001\u30d0\u30f3\u30c9\u30eb\u306b\u8981\u3059\u308b\u51e6\u7406\u6642\u9593\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u6642\u9593\u304c\u5897\u3048\u307e\u3059\u3002\u3059\u306a\u308f\u3061\u3001\u4f55\u3082\u5bfe\u7b56\u3092\u8b1b\u3058\u306a\u3044\u307e\u307e\u958b\u767a\u3092\u7d9a\u3051\u3066\u3044\u308b\u3068\u5927\u304d\u306a\u30d0\u30f3\u30c9\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3057\u307e\u3044\u3001\u7d50\u679c\u3068\u3057\u3066\u30a2\u30d7\u30ea\u306e\u8aad\u307f\u8fbc\u307f\u306b\u591a\u304f\u306e\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3046\u4e8b\u614b\u306b\u9665\u3063\u3066\u3057\u307e\u3046\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001<strong>\u30b3\u30fc\u30c9\u5206\u5272\uff08Code Splitting\uff09<\/strong>\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b3\u30fc\u30c9\u5206\u5272\u3092\u5229\u7528\u3057\u305f\u5834\u5408\u3001\u3059\u3050\u306b\u5fc5\u8981\u306a\u30b3\u30fc\u30c9\u4ee5\u5916\u306f\u5f8c\u304b\u3089\u8aad\u307f\u8fbc\u307e\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u521d\u671f\u8868\u793a\u306b\u304b\u304b\u308b\u6642\u9593\u306e\u524a\u6e1b\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002\uff08\u3053\u308c\u3092\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u3068\u3044\u3044\u307e\u3059\u3002\uff09<br>\u3064\u307e\u308a\u3001\u30d0\u30f3\u30c9\u30eb\u3067\u4e00\u5ea6\u306b\u8aad\u307f\u8fbc\u3080\u30c7\u30fc\u30bf\u91cf\u3092\u8abf\u6574\u3057\u3001\u521d\u671f\u8868\u793a\u6642\u9593\u306e\u77ed\u7e2e\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3069\u306e\u3088\u3046\u306a\u90e8\u5206\u3092\u30b3\u30fc\u30c9\u5206\u5272\u3059\u308b\u3079\u304d\u304b<\/h2>\n\n\n\n<p>\u3044\u3056\u30b3\u30fc\u30c9\u5206\u5272\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u3001\u3069\u3046\u5206\u5272\u3059\u308c\u3070\u3044\u3044\u306e\u304b\u5224\u65ad\u304c\u96e3\u3057\u3044\u5834\u5408\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306e\u5224\u65ad\u57fa\u6e96\u3068\u3057\u3066\u3001\u30ea\u30ed\u30fc\u30c9\u6642\u306b\u521d\u671f\u8868\u793a\u3055\u308c\u308b\u753b\u9762\u306a\u3069\u306f\u512a\u5148\u7684\u306b\u8aad\u307f\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308b\u60c5\u5831\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u884c\u52d5\u3059\u308b\u3053\u3068\u3067\u306f\u3058\u3081\u3066\u8868\u793a\u3055\u308c\u308b\u60c5\u5831\u306a\u3069\u306f\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u3055\u305b\u308b\u60c5\u5831\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u7c21\u5358\u306b\u30b3\u30fc\u30c9\u5206\u5272\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u30b3\u30fc\u30c9\u5206\u5272\u3057\u305f\u969b\u306e\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u51e6\u7406\u306b\u3064\u3044\u3066\u3001\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u65b9\u6cd5\u3092\u8a18\u8f09\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">React.lazy\u95a2\u6570<\/h2>\n\n\n\n<p>React\u3067\u306f\u3001React.lazy\u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>React.lazy\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u521d\u3081\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u308b\u307e\u3067\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u8fbc\u307f\u3092\u5ef6\u671f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\/\u5229\u7528\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3059\u308b\u3060\u3051\u3067\u7c21\u5358\u306b\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>const ComponentA = React.lazy(() =&gt; import(&#39;.\/ComponentA&#39;));<\/code><\/pre><\/div>\n\n\n\n<p>\u307e\u305f\u3001<code>&lt;Suspense&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5185\u3067\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>import React, { Suspense } from &#39;react&#39;;\n\nconst ComponentA = React.lazy(() =&gt; import(&#39;.\/ComponentA&#39;));\n\nfunction SampleComponent() {\n  return (\n    &lt;div&gt;\n      &lt;Suspense fallback={&lt;div&gt;Loading...&lt;\/div&gt;}&gt;\n        &lt;ComponentA \/&gt;\n      &lt;\/Suspense&gt;\n    &lt;\/div&gt;\n  );\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Loadable Components<\/h2>\n\n\n\n<p>React.lazy\u95a2\u6570\u4ee5\u5916\u306b\u3082\u3001\u8272\u3005\u306a\u65b9\u6cd5\u3067\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u65ec\u3059\u3050\u3067\u306f\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u306e<strong>Loadable Components\uff08<a href=\"https:\/\/loadable-components.com\/\" title=\"\u516c\u5f0f\u30b5\u30a4\u30c8\">\u516c\u5f0f\u30b5\u30a4\u30c8<\/a>\uff09<\/strong>\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Loadable Components\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u4e3b\u306b3\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;Suspense&gt;<\/code>\u306e\u5229\u7528\u304c\u4efb\u610f\u3002<\/li>\n\n\n\n<li>SSR\u3067\u3082\u5229\u7528\u3067\u304d\u308b\u3002<\/li>\n\n\n\n<li>import\u6587\u306bprops\u3092\u4ee3\u5165\u3067\u304d\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\/\u5229\u7528\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u2460 \u958b\u767a\u74b0\u5883\u306b\u3066\u3001Loadable Components\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>npm install @loadable\/component\n\nyarn add @loadable\/component<\/code><\/pre><\/div>\n\n\n\n<p>\u2461 \u5229\u7528\u3057\u305f\u3044\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067Loadable Components\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>import loadable from &#39;@loadable\/component&#39;\n\nconst ComponentA = loadable(() =&gt; import(&#39;.\/ComponentA&#39;))\n\nconst SampleComponent = () =&gt; {\n  return (\n    &lt;div&gt;\n      &lt;ComponentA \/&gt;\n    &lt;\/div&gt;\n  );\n};\n\nexport default SampleComponent;<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3059\u308b\u3060\u3051\u3067\u3001\u7c21\u5358\u306b\u7279\u5b9a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u307f\u3092\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u30b3\u30fc\u30c9\u5206\u5272\uff08Code Splitting\uff09\u306b\u3064\u3044\u3066\u8a18\u8ff0\u3044\u305f\u3057\u307e\u3057\u305f\u3002\u305f\u3068\u3048\u3070\u3001\u30da\u30fc\u30b8\u306e\u521d\u671f\u8868\u793a\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3060\u3051\u3092\u8aad\u307f\u8fbc\u3093\u3067\u304a\u304d\u3001\u60c5\u5831\u304c\u5c55\u958b\u3059\u308b\u5ea6\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u8aad\u307f\u8fbc\u3081\u3070\u3001\u30da\u30fc\u30b8\u306e\u521d\u671f\u8868\u793a\u6642\u306e\u51e6\u7406\u8ca0\u8377\u304c\u8efd\u6e1b\u3067\u304d\u307e\u3059\u3002\u8868\u793a\u30b9\u30d4\u30fc\u30c9\u304c\u5909\u308f\u308b\u3060\u3051\u3067\u5229\u7528\u30e6\u30fc\u30b6\u30fc\u306e\u5fc3\u7684\u8ca0\u62c5\u306f\u5927\u304d\u304f\u5909\u308f\u308a\u307e\u3059\u3002\u305c\u3072\u3001\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3059\u308b\u969b\u306b\u610f\u8b58\u3057\u3066\u53d6\u308a\u7d44\u307e\u308c\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button aligncenter is-style-fill\"><a class=\"wp-block-button__link has-vivid-green-cyan-background-color has-background wp-element-button\" href=\"https:\/\/blog.fundely.co.jp\/tech\/?page_id=82&amp;preview=true\" style=\"border-radius:12px\">\u52df\u96c6\u8981\u9805\u304a\u3088\u3073\u30a8\u30f3\u30c8\u30ea\u30fc\u30d5\u30a9\u30fc\u30e0<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002\u300c\u65ec\u3092\u3059\u3050\u306b\u300d\u306e\u30b5\u30fc\u30d3\u30b9\u958b\u767a\u3092\u62c5\u5f53\u3057\u3066\u3044\u308b\u5927\u5d8b\u3067\u3059\u3002 \u65ec\u3092\u3059\u3050\u306b\uff08\u4ee5\u4e0b\u3001\u65ec\u3059\u3050\uff09\u3067\u306f\u3001\u304a\u5ba2\u69d8\u306eUX\u5411\u4e0a\u306e\u305f\u3081\u65e5\u3005\u6539\u5584\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u76f4\u8fd1\u3067\u306fweb\u30a2\u30d7\u30ea\u306e\u8868\u793a\u30b9\u30d4\u30fc\u30c9\u6539\u5584\u306b\u53d6\u308a\u7d44\u3080\u6a5f\u4f1a\u304c\u3042\u308a\u307e [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,14,1],"tags":[18,5],"class_list":["post-408","post","type-post","status-publish","format-standard","hentry","category-react","category-14","category-uncategorized","tag-code-splitting","tag-react"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts\/408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/comments?post=408"}],"version-history":[{"count":46,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":456,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/posts\/408\/revisions\/456"}],"wp:attachment":[{"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/media?parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/categories?post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fundely.co.jp\/tech\/wp-json\/wp\/v2\/tags?post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}