<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Okuto Oyama</title>
    <description>The latest articles on Forem by Okuto Oyama (@yamanoku).</description>
    <link>https://forem.com/yamanoku</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F41670%2F562fcbee-fdc0-4716-a277-5445f296e756.png</url>
      <title>Forem: Okuto Oyama</title>
      <link>https://forem.com/yamanoku</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yamanoku"/>
    <language>en</language>
    <item>
      <title>Thank you Webpacker, Goodbye Webpacker</title>
      <dc:creator>Okuto Oyama</dc:creator>
      <pubDate>Thu, 15 Dec 2022 03:00:00 +0000</pubDate>
      <link>https://forem.com/yamanoku/thank-you-webpacker-goodbye-webpacker-2oo8</link>
      <guid>https://forem.com/yamanoku/thank-you-webpacker-goodbye-webpacker-2oo8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Original Post (Japanese) : &lt;a href="https://engineer.crowdworks.jp/entry/thanks_webpacker_goodbye_webpacker" rel="noopener noreferrer"&gt;ありがとう Webpacker さようなら Webpacker - クラウドワークス エンジニアブログ&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hello. I'm Okuto Oyama, an engineer at &lt;a href="https://crowdworks.jp/" rel="noopener noreferrer"&gt;CrowdWorks&lt;/a&gt;. I'm on a team that leads in eliminating technical debt.&lt;/p&gt;

&lt;p&gt;This article is replace &lt;a href="https://github.com/rails/webpacker" rel="noopener noreferrer"&gt;Webpacker&lt;/a&gt; with &lt;a href="https://github.com/hokaccha/simpacker" rel="noopener noreferrer"&gt;Simpacker&lt;/a&gt; and &lt;a href="https://webpack.js.org/" rel="noopener noreferrer"&gt;webpack&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As an assumption, our products have been running on monolithic Ruby on Rails applications for over a decade. Currently, we are trying to break the tight coupling between front-end and back-end as part of our technical debt resolution.&lt;/p&gt;

&lt;p&gt;I hope this is helpful for anyone who wants to separate front-end responsibilities from Webpacker!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Webpacker?
&lt;/h2&gt;

&lt;p&gt;Webpacker is the official library for webpack front-end development in Ruby on Rails applications. The advantage of this library is that it provides a generic configuration for those who are not familiar with the webpack build system, making it easy to quickly develop modern front-ends.&lt;/p&gt;

&lt;p&gt;For more information on CrowdWorks' implementation of Webpacker, please see our previous blog posts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://engineer.crowdworks.jp/entry/2018/07/30/151813" rel="noopener noreferrer"&gt;CrowdWorks流！Webpacker活用術 - クラウドワークス エンジニアブログ&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why quitting Webpacker?
&lt;/h2&gt;

&lt;p&gt;I have decided to quit Webpacker, and I will give the reasons why I have decided to quit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Because Webpacker was declared retired in January of this year.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;There is no need to continue using Webpacker as the next RC version will not be officially released in the future.

&lt;ul&gt;
&lt;li&gt;There is an option to use &lt;a href="https://github.com/shakacode/shakapacker" rel="noopener noreferrer"&gt;Shakapacker&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;However, since we plan to move away from Rails-dependent front-end development at CrowdWorks, this is not the right choice for us.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Because the modules that depend on Webpacker are hidden.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The internal Webpacker dependencies are hidden, making it hard to see what is being used.

&lt;ul&gt;
&lt;li&gt;Babel settings were not included in CrowdWorks package.json, causing some build failures.&lt;/li&gt;
&lt;li&gt;Debugging itself is not easy.

&lt;ul&gt;
&lt;li&gt;I tried the v14 series of stylelint &lt;a href="https://github.com/stylelint/stylelint/issues/5632#issuecomment-951601124" rel="noopener noreferrer"&gt;postcss must be included&lt;/a&gt;, but even if the lint passed, the webpack build failed.

&lt;ul&gt;
&lt;li&gt;I wanted to find the cause, but at first glance I couldn't figure out what was wrong with the configuration.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;By migrating to bare webpack, we can think about the configuration ourselves.&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Because it is hard to do performance tuning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Not only webpack, but also Rails &lt;code&gt;assets:precompile&lt;/code&gt; builds are done by CI.

&lt;ul&gt;
&lt;li&gt;We are extending resource classes because CI and deployments are failing due to the long time it takes.&lt;/li&gt;
&lt;li&gt;Not enough fine-tuning of webpack.&lt;/li&gt;
&lt;li&gt;It may be possible to reduce this problem by updating Webpacker itself.

&lt;ul&gt;
&lt;li&gt;The webpack included in the stable version of Webpacker used to be v4.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;In light of the above, we decided to eliminate the use of Webpacker itself and allow the front-end responsibilities to be handled by the front-end.&lt;/p&gt;

&lt;p&gt;Incidentally, CrowdWorks would like to migrate to a front-end framework in the future, and if everything can run on that framework, the removal of Webpacker itself will be unnecessary. However, since the transition to a framework is not yet in sight, we have decided that using webpack is the right way to maintain the status quo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Organizing what to do
&lt;/h2&gt;

&lt;p&gt;First of all, when I quit Webpacker, I organized what I was going to do. There have been several articles about quitting Webpacker in the past, so I used them as a reference.&lt;/p&gt;

&lt;p&gt;I mainly referred to &lt;a href="https://inside.pixiv.blog/subal/4615" rel="noopener noreferrer"&gt;pixiv's article&lt;/a&gt; and &lt;a href="https://dev.icare.jpn.com/dev_cat/bye_bye_webpacker/" rel="noopener noreferrer"&gt;iCARE's article&lt;/a&gt;. I would like to take this opportunity to thank them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;webpack configuration

&lt;ul&gt;
&lt;li&gt;Migrate Webpacker DSL (&lt;code&gt;config/webpack&lt;/code&gt;) to &lt;code&gt;webpack.config.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Install necessary plugins and modules.&lt;/li&gt;
&lt;li&gt;Configure webpack-dev-server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Remove Webpacker

&lt;ul&gt;
&lt;li&gt;Remove from gem&lt;/li&gt;
&lt;li&gt;Make &lt;code&gt;config/webpacker.yml&lt;/code&gt; obsolete&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Implementing webpack view helpers in Rails

&lt;ul&gt;
&lt;li&gt;Create helper code&lt;/li&gt;
&lt;li&gt;Create test code&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Docker, CI configuration changes

&lt;ul&gt;
&lt;li&gt;Incorporate webpack build mechanism into CI&lt;/li&gt;
&lt;li&gt;Adding webpack processing to docker-compose configuration&lt;/li&gt;
&lt;li&gt;Staging CI checks&lt;/li&gt;
&lt;li&gt;Checking docker-compose behavior&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Checking the behavior of docker-compose in local staging

&lt;ul&gt;
&lt;li&gt;Local screen checks (webpack build-related screens only)&lt;/li&gt;
&lt;li&gt;Screen check at staging (only screens related to webpack builds)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Examine the Webpacker implementation
&lt;/h2&gt;

&lt;p&gt;The first thing I did was investigate the Webpacker implementation.&lt;/p&gt;

&lt;p&gt;First, I tried to output the Webpacker configuration to get a rough idea of how the whole thing works.&lt;/p&gt;

&lt;p&gt;The way to do this is quite simple. I put the logs in &lt;code&gt;console.dir(webpackConfig, { depth: null });&lt;/code&gt; at the end of &lt;code&gt;module.exports&lt;/code&gt; in each environment's DSL file placed in &lt;code&gt;config/webpack&lt;/code&gt;. I have tried this. I can't go into the details of the function-based code, but this gave me a rough idea of the general shape of the code.&lt;/p&gt;

&lt;p&gt;The following is the webpack configuration included in Webpacker.&lt;/p&gt;

&lt;p&gt;
  summary
  &lt;ul&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/entry-context/#entry" rel="noopener noreferrer"&gt;entry&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Configuration of files to be loaded by Webpacker.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/output/" rel="noopener noreferrer"&gt;output&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Configuration of the file to be built and exported.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/resolve/#root" rel="noopener noreferrer"&gt;resolve&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Configuration of how modules can be resolved.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/resolve/#resolveloader" rel="noopener noreferrer"&gt;resolveLoader&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Configure only name resolution for webpack loader package.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/node/#root" rel="noopener noreferrer"&gt;node&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Configures whether certain Node.js globals and modules can be polyfilled or mocked

&lt;ul&gt;
&lt;li&gt;Allows code written for the Node.js environment to run in other environments, such as browsers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/concepts/loaders/#root" rel="noopener noreferrer"&gt;loaders&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;webpack only understands JS and JSON. Therefore, the part that converts other files so that they can be deciphered.

&lt;ul&gt;
&lt;li&gt;Things like &lt;code&gt;xxxx-loader&lt;/code&gt; are the equivalent.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/concepts/plugins/" rel="noopener noreferrer"&gt;plugins&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;webpack plugin settings&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/mode/#root" rel="noopener noreferrer"&gt;mode&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Development environment settings&lt;/li&gt;
&lt;li&gt;You can specify &lt;code&gt;production&lt;/code&gt;, &lt;code&gt;development&lt;/code&gt;, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/devtool/#root" rel="noopener noreferrer"&gt;devtool&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Source map generation and how it is generated.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/stats/#root" rel="noopener noreferrer"&gt;stats&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Settings to control bundle information displayed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/other-options/#bail" rel="noopener noreferrer"&gt;bail&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Settings to fail when an error occurs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://v4.webpack.js.org/configuration/optimization/" rel="noopener noreferrer"&gt;optimization&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Settings related to optimization execution
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;






&lt;/p&gt;
&lt;p&gt;The next step is to investigate the detailed Webpacker implementation based on the results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/rails/webpacker/tree/5-x-stable" rel="noopener noreferrer"&gt;https://github.com/rails/webpacker/tree/5-x-stable&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The version of Webpacker used at CrowdWorks was version 5, so we checked the 5-x-stable branch. The part I was interested in was &lt;code&gt;webpack.config.js&lt;/code&gt;, so I just looked at its source.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;webpacker/package/environments/&lt;/code&gt; ... Environment settings. It contains basic webpack settings.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;webpacker/package/rules/&lt;/code&gt; ... List of rules for loaders. Only refer to the ones you use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should also check the required &lt;a href="https://github.com/rails/webpacker/blob/5-x-stable/package.json" rel="noopener noreferrer"&gt;package.json&lt;/a&gt;, &lt;a href="https://github.com/rails/webpacker/blob/5-x-stable/lib/install/config/babel.config.js" rel="noopener noreferrer"&gt;babel.config.js&lt;/a&gt;, &lt;a href="https://github.com/rails/webpacker/blob/5-x-stable/lib/install/config/postcss.config.js" rel="noopener noreferrer"&gt;postcss.config.js&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Compare build results between Webpacker and webpack alone
&lt;/h2&gt;

&lt;p&gt;I experimented to see if Webpacker can be built by itself while referring to the internal implementation.&lt;/p&gt;

&lt;p&gt;In CrowdWorks, the front-end tools (such as Storybook) are in a separate hierarchy of directories, so I installed a new one there and set up webpack to reference the front-end code in the application.&lt;/p&gt;

&lt;p&gt;After confirming that the build went through, I compared the differences between the results built in the staging environment and the results built with webpack alone.&lt;/p&gt;

&lt;p&gt;Since CrowdWorks uses CircleCI for our application build pipeline, we saved the built files in &lt;code&gt;artifacts&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Compress Artifacts&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tar -cvzf assets-precompile.tar public/packs&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;store_artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uploading artifacts - store results of assets:precompile&lt;/span&gt;
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;assets-precompile.tar&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We reviewed the missing configuration, the number of files, and the differences in the contents of the files, and finally, we were able to get the files to almost match &lt;sup id="fnref1"&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Incorporate webpack build results into your Rails application
&lt;/h2&gt;

&lt;p&gt;After confirming that the build results are OK, the next step is to incorporate them into the Rails application.&lt;/p&gt;

&lt;p&gt;Webpacker uses &lt;a href="https://github.com/shellscape/webpack-manifest-plugin" rel="noopener noreferrer"&gt;webpack-assets-manifest&lt;/a&gt; to create &lt;code&gt;manifest.json&lt;/code&gt;, which is then delivered to View helper in Rails.&lt;/p&gt;

&lt;p&gt;I needed to create an alternative View helper to replace Webpacker, but decided to use the &lt;a href="https://github.com/hokaccha/simpacker" rel="noopener noreferrer"&gt;Simpacker&lt;/a&gt; gem rather than implement the helper on my own.&lt;/p&gt;

&lt;p&gt;Unlike Webpacker, Simpacker does not manage any configuration on the webpack side and is only involved with the path to the output manifest.json. The responsibilities are nicely divided, and the configuration itself is very simple.&lt;/p&gt;

&lt;p&gt;I have been using Split Chunks since I was using Webpacker, so I decided to replace it by introducing the following helper.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;javascript_packs_with_chunks_tag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flat_map&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;simpacker_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lookup!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"entrypoints"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"js"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;uniq&lt;/span&gt;
  &lt;span class="n"&gt;javascript_include_tag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;stylesheet_packs_with_chunks_tag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flat_map&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;simpacker_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lookup!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"entrypoints"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"css"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;uniq&lt;/span&gt;
  &lt;span class="n"&gt;stylesheet_link_tag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;rescue&lt;/span&gt; &lt;span class="no"&gt;Simpacker&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Manifest&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;MissingEntryError&lt;/span&gt;
  &lt;span class="c1"&gt;# If you don't extract css, you get an error, but don't return anything&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make webpack-dev-server work
&lt;/h2&gt;

&lt;p&gt;Webpacker also includes &lt;a href="https://github.com/webpack/webpack-dev-server" rel="noopener noreferrer"&gt;webpack-dev-server&lt;/a&gt;, so we made it work as well. Since I had Simpacker installed, I only had to change the &lt;code&gt;devServer&lt;/code&gt; part in &lt;code&gt;webpack.config.js&lt;/code&gt; to make it work with npm scripts.&lt;/p&gt;

&lt;p&gt;The problem with getting webpack-dev-server to work was that the included version was a 3 series that didn't work well with the same settings as Webpacker.&lt;/p&gt;

&lt;p&gt;Rather than investigating the cause in detail, I thought that if it was for development only and didn't affect production, I should just update it to the latest version, so I updated to the latest 4 series and migrated the part about devServer settings.&lt;/p&gt;

&lt;p&gt;It works with this as a result. If you're looking to move on from the Webpacker 5, here's what you need to know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the behavior on CI
&lt;/h2&gt;

&lt;p&gt;As mentioned above, deployment of CrowdWorks is managed by CircleCI. Because it's a monolithic application, the front-end build mechanism is built into it, and we'll review the settings when we switch to webpack to make sure it doesn't fail.&lt;/p&gt;

&lt;p&gt;Webpacker used to build webpack at &lt;code&gt;assets:precompile&lt;/code&gt; time, but since it no longer does so, we need to add our webpack build commands.&lt;/p&gt;

&lt;p&gt;While reviewing the configuration, I also included a workflow &lt;a href="https://engineer.crowdworks.jp/entry/2020/06/24/130000" rel="noopener noreferrer"&gt;uploading source map files to Rollbar&lt;/a&gt; for the front-end error monitoring system. However, for some reason, I caught an event that prevented the uploading of the files.&lt;/p&gt;

&lt;p&gt;After investigating the cause, I found that it was due to the &lt;code&gt;--ignore-optional&lt;/code&gt; option that I had added when doing the &lt;code&gt;yarn install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This was because the source map files generated by webpack depended on optional dependencies, and thus were not generated properly without the required modules. Therefore, we decided to remove this option and let it install.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask engineers to check if it works in their local environment
&lt;/h2&gt;

&lt;p&gt;Since CrowdWorks uses Docker in its development, we asked our engineers to check if it works with Simpacker + webpack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp33rm9042jwjc08vucm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp33rm9042jwjc08vucm4.png" alt="Screenshot: communicating on a Slack channel for engineers outside of the mobile apps team about the Docker runtime process, and what to check based on that."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docker startup and build results were fine, but we found that Hot Module Reloads in webpack-dev-server were not working properly. After that, we fixed it while checking the operation with my team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conduct a mob review session
&lt;/h2&gt;

&lt;p&gt;Since the changes made to the PR were very significant this time, we conducted a mob review session to reduce the prerequisite knowledge and cognitive load among my team.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ylcdyrquk48jxw0yf26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ylcdyrquk48jxw0yf26.png" alt="Screenshot: Notion article titled "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since I had been working on this project for a long time, I was able to look back on what I had done, and the causes of some parts that were unclear as to their operation were clarified. Some of the omissions found in this review have also been corrected to reflect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Formulate Architecture Decision Records
&lt;/h2&gt;

&lt;p&gt;We have been keeping Architecture Decision Records (ADR) since September of this year to keep the reasons for architecture selection.&lt;/p&gt;

&lt;p&gt;This initiative was not in place when we discontinued Webpacker, but since we were going to adopt Simpacker in this transition, we decided to develop an ADR for it and have it reviewed by our engineers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgoylbq92eu5gvvqm5a1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgoylbq92eu5gvvqm5a1y.png" alt="Screenshot: Migrating from Webpacker to Simpacker (+ webpack) ADR Documentation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Incidentally, this is the first document after the ADR initiative was introduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  Release
&lt;/h2&gt;

&lt;p&gt;It's been a long process, but now that we have all the necessary responses, we're finally releasing it. Even in the staging environment, I had verified it many times and thought there would be no problem with the release, but I had shared it with all the engineers beforehand just in case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdi40i02kur02i8htg2wb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdi40i02kur02i8htg2wb.png" alt="Screenshot: communicating on the Slack channel about the release of the work to quit Webpacker"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was very nervous about the release because it was a very big change, but after the release was completed, we determined that there were no problems with operation and no alerts and that users would not be affected, so we reported the completion and shared the operating procedures again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00zs7uctzyx3c3vpbvep.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00zs7uctzyx3c3vpbvep.png" alt="Screenshot: After the release was completed, we are communicating on our Slack channel on how to reflect the new Simpacker + webpack environment."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was in a daze for a while, maybe glad that I released it successfully...&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;We look back on our efforts to quit Webpacker this time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Good
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I was able to complete the migration to Simpacker + webpack itself.&lt;/li&gt;
&lt;li&gt;We were able to split webpack management and build responsibilities from Rails.&lt;/li&gt;
&lt;li&gt;We were able to resolve the EOL situation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Problem
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;adding their own npm packages that were included with Webpacker

&lt;ul&gt;
&lt;li&gt;Try ⇒ &lt;em&gt;We will update and prune it&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;As the npm packages were being updated at the same time, there were many conflicts in package.json, making it difficult to rebase

&lt;ul&gt;
&lt;li&gt;We should have verified the module with the module itself added and released it first&lt;/li&gt;
&lt;li&gt;Try ⇒ &lt;em&gt;Make a mechanism to verify build diffs (to build psychological safety for future updates)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Migration work was being handled by &lt;a href="https://twitter.com/okuto_oyama" rel="noopener noreferrer"&gt;@okuto_oyama&lt;/a&gt; alone

&lt;ul&gt;
&lt;li&gt;The work was being done by one person, &lt;a href=""&gt;@okutoyama&lt;/a&gt;, who had been doing the research singlehandedly, and was also fixing the problem

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://qiita.com/bugfire" rel="noopener noreferrer"&gt;@bugfire&lt;/a&gt; also helped me with some of the stuck areas&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;The work could have been divided among the team since it was related to the development of the entire engineering team&lt;/li&gt;

&lt;li&gt;Try ⇒ &lt;em&gt;After investigating, you don't start as is, but set tasks one by one after you get a general perspective&lt;/em&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We started our research in April of this year, and although there was a period during which we had to stop due to other work within the team, we were finally able to migrate and release it on November 24. We are very happy that we were able to finish it before the end of the year.&lt;/p&gt;

&lt;p&gt;I've had a few struggles with Webpacker, but it's also the fact that it's been a mainstay of CrowdWorks' modern front-end development for a long time. Thank you for fighting with us so far.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Webpacker脱却記事も多いので、フロントエンド人材が育ったら引き剥がすことがそこまで難しくなさそうなのもポイントです。&lt;/p&gt;

&lt;p&gt;Webpackerをフロントエンド環境の補助輪と考えて、将来存在が足かせになったタイミングでWebpackerのレイヤは剥がしてもらえばよいと考えています。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://engineer.crowdworks.jp/entry/2019/05/28/114806" rel="noopener noreferrer"&gt;メンテ不能になったフロントエンド環境を立て直す話 - クラウドワークス エンジニアブログ&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After rereading articles about rebuilding the front-end environment that had existed in the past, I personally felt a lingering sense of joy that we had reached a point where it was OK to eliminate this layer.&lt;/p&gt;

&lt;p&gt;Although I was able to quit Webpacker, I hope to continue working on improving the build flow without compromising the developer experience, including upgrading webpack.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://inside.pixiv.blog/subal/4615" rel="noopener noreferrer"&gt;今日から簡単！Webpacker 完全脱出ガイド - pixiv inside&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hakozaru.com/posts/purge-webpacker-3" rel="noopener noreferrer"&gt;RailsからWebpackerを外してpureなwebpack構成にしてみる その3 | Mission-Street.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://studist.tech/goodbye-webpacker-183155a942f6" rel="noopener noreferrer"&gt;フロントエンド原理主義者が目論んだ脱webpacker. webpacker+vueのプロジェクトをwebpack+vueにする | by Tomoya Komiyama | スタディスト開発ブログ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://numb86-tech.hatenablog.com/entry/2019/01/10/211416" rel="noopener noreferrer"&gt;Steb by Step で剥がす Webpacker - 30歳からのプログラミング&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tech.raksul.com/2018/10/18/rails-webpack-without-webpacker/" rel="noopener noreferrer"&gt;WebpackerをやめるならWebpackManifestというgemが便利、という話 | Raksul ENGINEERING&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://techracho.bpsinc.jp/hachi8833/2022_02_03/115289" rel="noopener noreferrer"&gt;Rails: Webpacker→jsbundling-rails+webpackアップグレード手順（翻訳）｜TechRacho by BPS株式会社&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.icare.jpn.com/dev_cat/bye_bye_webpacker/" rel="noopener noreferrer"&gt;モノリシックな Ruby on Rails サービスからの Webpacker の剥がし方 | 働くひとと組織の健康を創る iCARE&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Where there were differences in some of the build results, we decided to allow them because we were able to confirm and determine that there were no problems with the display and operation. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>webpacker</category>
      <category>webpack</category>
      <category>circleci</category>
      <category>2022</category>
    </item>
    <item>
      <title>I want everyone to know about the design system.</title>
      <dc:creator>Okuto Oyama</dc:creator>
      <pubDate>Fri, 03 Jan 2020 06:19:15 +0000</pubDate>
      <link>https://forem.com/yamanoku/i-want-everyone-to-know-about-the-design-system-370k</link>
      <guid>https://forem.com/yamanoku/i-want-everyone-to-know-about-the-design-system-370k</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This article is an English translation of &lt;a href="https://note.com/yamanoku/n/n8acc38df2902"&gt;みんなに知ってもらいたいデザインシステムのこと&lt;/a&gt; written in December 2019.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hello everyone. My name is &lt;a href="https://twitter.com/yamanoku"&gt;@yamanoku&lt;/a&gt; and I have been working at &lt;a href="https://crowdworks.co.jp/"&gt;CrowdWorks, Inc&lt;/a&gt; since October 2019.&lt;/p&gt;

&lt;p&gt;I usually go to study meetings and conferences, wander around the Internet, drink alcohol, and take care of my father. He is currently a front end engineer joining the design system team.&lt;/p&gt;

&lt;p&gt;In this article, I would like to introduce you to the design system, where you need it, what engineers and designers need to know, and what you need to know.&lt;/p&gt;

&lt;h2&gt;
  
  
  About the Design System
&lt;/h2&gt;

&lt;p&gt;design system. If you work on the web as well as the front end, you may have heard this word recently. Here's what it's all about.&lt;/p&gt;

&lt;p&gt;The design system is defined in the following article.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A design system offers a library of visual style, components, and other concerns documented and released by an individual, team or community as code and design tools so that adopting products can be more efficient and cohesive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/eightshapes-llc/defining-design-systems-6dd4b03e0ff6"&gt;Defining Design Systems&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you say "Documentation" or "Library" you might think of it as a style guide that contains the rules for UI color and shape, or a pattern library that allows components to be deployed in different ways.&lt;/p&gt;

&lt;p&gt;However, the difference in the design system is "The ability to extend the product" that style guides and pattern libraries cannot.&lt;/p&gt;

&lt;p&gt;Style guides and pattern libraries were nothing more than list-oriented guides, and they were not designed to be complete or to keep up with product growth.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ILh3YuRi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/gz4xppo7apiv8mm6wy4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ILh3YuRi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/gz4xppo7apiv8mm6wy4y.png" alt="Illustration of the design system including style guides and pattern libraries"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The design system encompasses these and defines design principles, information design, infrastructure, and accessibility. They also embody the identity of the product, not just the guides and libraries, but what they can do and what they can solve.&lt;/p&gt;

&lt;p&gt;The principles and principles will also be documented, making it easier to understand "On what basis should I do it?" when creating new functions or modifying products.&lt;/p&gt;

&lt;p&gt;In addition to the UI components that define a product's identity, Adobe's Spectrum design system, which was announced earlier this year, also has a system for broader design, with words like "Voice and Tone" and "Grammar and Mechanics" and style guidelines for writing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j0m0SSuU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ewfzz2bowykxxuay7ikm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j0m0SSuU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ewfzz2bowykxxuay7ikm.png" alt="Spectrum's voice and tone page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://spectrum.adobe.com/page/voice-and-tone/"&gt;https://spectrum.adobe.com/page/voice-and-tone/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://spectrum.adobe.com/page/grammar-and-mechanics/"&gt;https://spectrum.adobe.com/page/grammar-and-mechanics/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In 2017, the United States announced its &lt;strong&gt;national design system&lt;/strong&gt; , and efforts are under way to create a consistent website for each country.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://designsystem.digital.gov/"&gt;https://designsystem.digital.gov/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also in Japan, various companies are starting to give examples of their use. The following is an example. (Only Japanese text)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://corp.rakuten.co.jp/careers/topics/creative1/"&gt;ReX: Rakuten Experience：キャリア採用｜楽天株式会社&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.freee.co.jp/entry/designsystems-tokyo"&gt;デザインシステムの勉強会『designsystems.tokyo』を開催しました - freee Developers Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eureka.design/articles/our-little-design-system/"&gt;Our little design system | 僕たちの小さなデザインシステム - eureka design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tech.mercari.com/entry/2019/08/26/090000"&gt;Design Systemへの取り組み 〜Frontend編〜 - Mercari Engineering Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tech.smarthr.jp/entry/2019/08/01/151100"&gt;プロダクト間共通の React コンポーネントライブラリを運用する話 - SmartHR Tech Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In March of this year, a voluntary community called &lt;a href="https://designsystems.tokyo/"&gt;designsystems.tokyo&lt;/a&gt;, which is working on design systems at an operating company, started to discuss and discuss how to introduce the system. CrowdWorks is also a member of this community and participated in each study group.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://designsystems.connpass.com/"&gt;designsystems.tokyo - connpass&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When is a design system needed?
&lt;/h2&gt;

&lt;p&gt;Here's when you'll need it.&lt;/p&gt;

&lt;p&gt;It's a waste of time to say this, but if you don't feel the need to build it (and communication and so on.), you don't have to force it. It's not just a design system, there's nothing more scary than something that just starts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://yasuhisa.com/could/article/what-is-design-system/"&gt;結局デザインシステムは何なのか : could&lt;/a&gt; (Only Japanese text)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, if you are asked to define advanced requirements and need to release them quickly, it seems difficult to tackle them without a design system. This is because we can make the collaboration between designers and engineers more smooth, and we can develop products with consistent quality even if the service expands.&lt;/p&gt;

&lt;p&gt;I don't know if a new UI can be properly evaluated when starting a new business. However, the design system has developed components that provide a consistent experience.&lt;br&gt;
By combining them properly, even a small team can efficiently develop products while maintaining quality.&lt;/p&gt;

&lt;p&gt;Furthermore, by preventing the mixing of components and ensuring uniformity, it is possible to reduce the wasteful process called wheel redevelopment.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you have 25 teams in your company and each team makes a button, it costs $1 million to make a good button.&lt;/p&gt;

&lt;p&gt;ー Nathan Curtis&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Previously &lt;strong&gt;a $1 million conference&lt;/strong&gt; was held in our company to develop a functional and visual relationship between these components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://designer.crowdworks.co.jp/entry/designsystem_discussion"&gt;デザインシステムの基本の基を考えていくお仕事をしています。 - CrowdWorks Designer Blog | クラウドワークス デザイナーブログ&lt;/a&gt; (Only Japanese text)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With that in mind, here are some things that need to be considered from the perspective of engineers and designers.&lt;/p&gt;
&lt;h2&gt;
  
  
  What we want our engineers to know
&lt;/h2&gt;

&lt;p&gt;What we need to communicate with designers is &lt;strong&gt;representation of the state&lt;/strong&gt; in words.&lt;/p&gt;

&lt;p&gt;Consider a component called a button.&lt;br&gt;
There are various states, whether it is default, in focus, active, or disabled, even with just one button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q98t8bR9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/pl8ih5h6pis81jdbw2bf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q98t8bR9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/pl8ih5h6pis81jdbw2bf.png" alt="Operation status of the button. Default, in focus, active, and disabled pictures"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if the button itself is a link (a tag), you have to define it differently (Disabled not allowed etc.).&lt;/p&gt;

&lt;p&gt;These may be easy to imagine for implementors, but if you don't specify what the component is in, you can leak it when designing, so you need to make it clear.&lt;/p&gt;

&lt;p&gt;There is also a design system called &lt;strong&gt;Design Tokens&lt;/strong&gt; . This allows you to replace these values in bulk using the defined tokens.&lt;br&gt;
The design system can guarantee a single source of truth (Only reliable source of information).&lt;br&gt;
You can think of it as something like &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/--*"&gt;CSS Custom Properties&lt;/a&gt; or Sass variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nv"&gt;$brand-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;21&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;137&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;238&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$brand-primary-active&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;122&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;221&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$brand-primary-transparent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;21&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;137&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;238&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="mi"&gt;.1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When defining tokens, you should also consider the term itself &lt;strong&gt;What kind of state does it show?&lt;/strong&gt;, &lt;strong&gt;How much responsibility do you have?&lt;/strong&gt; when creating your design system.&lt;br&gt;
Confusion in the definition of words can lead to design breakdowns in the future.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapbox.io/yamanoku/Design_Tokens%E3%82%92%E8%80%83%E3%81%88%E3%82%8B%E5%89%8D%E3%81%AB%E4%BF%BA%E3%81%9F%E3%81%A1%E3%81%AF%E5%A4%89%E6%95%B0%E5%90%8D%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E8%80%83%E3%81%88%E7%9B%B4%E3%81%99%E3%81%93%E3%81%A8%E3%81%8C%E3%81%82%E3%82%8B%E3%81%AE%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%84%E3%81%8B"&gt;Design Tokensを考える前に俺たちは変数名について考え直すことがあるのではないか - yamaScrapbox&lt;/a&gt;  (Only Japanese text)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  What I want designers to know
&lt;/h2&gt;

&lt;p&gt;Designers are often responsible for visual representation, but they need to make sure that the "Why does it express that?" is understood by others.&lt;/p&gt;

&lt;p&gt;An example of Shopify's design system "Polaris" is to capture cultural differences in internationalization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pE6aJr8h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hno0bfk8bdf23p297dfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pE6aJr8h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hno0bfk8bdf23p297dfw.png" alt="Polaris, Shopify's design system, explains the right and wrong UI for internationalization"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, in Japan, we have added the input items of the prefecture after the country, and we have not set up the name input form in North American style. These examples will help you better understand why this design works.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://polaris.shopify.com/foundations/internationalization#section-plan-for-cultural-differences"&gt;https://polaris.shopify.com/foundations/internationalization#section-plan-for-cultural-differences&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The design also requires that the tools used be carefully selected.&lt;br&gt;
Sketch, Figma, Invision, Storybook, and other tools are available to help designers collaborate with other industries. However, there is no clear answer, such as "You can do it with this.". I think it's better to use them based on the idea of what kind of world they are trying to realize.&lt;/p&gt;

&lt;p&gt;Figma's ability to build a design system isn't just about cross-linking, it's also about making it more practical, with analytics visualizations and limited onboarding and other design data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.figma.com/design-systems/"&gt;Design, manage, and deploy your design systems with Figma&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As for collaboration, Sketch also announced simultaneous editing. It's a good idea to keep an eye on tool updates.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ltWFMvlylM0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  What I want everyone to know
&lt;/h2&gt;

&lt;p&gt;In the end, I want to make it more comprehensive and make it known to everyone involved in a non-executive design system.&lt;/p&gt;

&lt;p&gt;As you build a design system from a single product, is there something called a completion? That's the question. The answer is "NO".&lt;/p&gt;

&lt;p&gt;As I mentioned earlier, the design system will be expanded, and it is assumed that everyone can design with the maintained quality.&lt;br&gt;
Therefore, it is necessary to operate to be able to expand on the assumption that there is no clear answer such as 0 or 1.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The design system is a living thing. Let's raise them little by little.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're building a design system, you want to make it more perfect for every pattern. But I realized that the design system is not perfect.&lt;br&gt;
As products and organizations grow and change, so does the design system. The design system is a living thing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://designer.crowdworks.co.jp/entry/designsystem_knowhow"&gt;デザインシステムのプロジェクトの実践で学んだ3つの大切なノウハウ - CrowdWorks Designer Blog | クラウドワークス デザイナーブログ&lt;/a&gt; (Only Japanese text)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the design system is a product, it can fail.&lt;br&gt;
In the article explaining the failures, there are examples such as lack of organizational support and communication, lack of initial investment, and lack of use.&lt;br&gt;
Even though the article was written in 2017, it is still well understood.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://24ways.org/2017/why-design-systems-fail/"&gt;Why Design Systems Fail ◆ 24 ways&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sustainability and development are essential, and failure to do so can lead to a vicious cycle of design. It is desirable to have a solid acceptance system.&lt;/p&gt;

&lt;p&gt;If the design system goes in the wrong direction, it can result in bad things. Depending on the design, you can hurt people or remove certain layers, &lt;strong&gt;so what is the purpose of your product?&lt;/strong&gt; &lt;strong&gt;What kind of future are you trying to paint?&lt;/strong&gt; We should not forget to have such a viewpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That's all I wanted you to know about the design system.&lt;/p&gt;

&lt;p&gt;Using a design system allows you to be creative flexibly while maintaining a certain level of quality. However, if you proceed without a clear sense of purpose or understanding what you should not do, you may spread incorrect designs.&lt;/p&gt;

&lt;p&gt;The frontend team, which started last year, is working on a design system for CrowdWorks by trial and error.&lt;br&gt;
It is still closed inside, but I hope to show it to everyone in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  References （Only Japanese text）
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://yory.design/note/dmm-designsystems/"&gt;「Atomic Design &amp;amp; Design Systems」をお話させて頂きました&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://yory.design/note/designsystems-link-collection/"&gt;デザインシステムの資料を作る時に参考にしたリンク集&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://circl.co.jp/jp/views/design/what-is-design-system/"&gt;デザインシステムとは？&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>designsystem</category>
      <category>2019</category>
    </item>
  </channel>
</rss>
