<?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: ΛGΣΣK</title>
    <description>The latest articles on Forem by ΛGΣΣK (@ageekdev).</description>
    <link>https://forem.com/ageekdev</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%2F817366%2F85355df3-183e-47b1-bd9e-fb6096eed5c3.jpeg</url>
      <title>Forem: ΛGΣΣK</title>
      <link>https://forem.com/ageekdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ageekdev"/>
    <language>en</language>
    <item>
      <title>Latest Updates on React 18</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Mon, 14 Mar 2022 02:20:48 +0000</pubDate>
      <link>https://forem.com/ageekdev/latest-updates-on-react-18-34pb</link>
      <guid>https://forem.com/ageekdev/latest-updates-on-react-18-34pb</guid>
      <description>&lt;p&gt;This post is intended to summarize &lt;a href="https://github.com/reactwg/react-18/discussions"&gt;React 18 discussions on GitHub&lt;/a&gt;. At the time of writing React 18 has hit &lt;a href="https://www.npmjs.com/package/react/v/18.0.0-rc.2"&gt;release candidate&lt;/a&gt; version. To try React 18 you need to update to the latest React 18 release with the additional step of switching from &lt;code&gt;ReactDOM.render&lt;/code&gt; to &lt;code&gt;ReactDOM.createRoot&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react@rc react-dom@rc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMClient&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React 18 includes out-of-the-box improvements to existing features. It is also the first React release to add support for &lt;strong&gt;Concurrent Features&lt;/strong&gt;, which let you improve the user experience in ways that React didn't allow before.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/reactwg/react-18/discussions/5"&gt;New Root API&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In React, a root is a pointer to the top-level data structure that React uses to track a tree to render. When using legacy &lt;code&gt;ReactDOM.render&lt;/code&gt;, the root was opaque to the user because we attached it to the DOM element, and accessed it through the DOM node, never exposing it to the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Initial render.&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="na"&gt;tab&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"home"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;,&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// During an update, React would access&lt;/span&gt;
&lt;span class="c1"&gt;// the root of the DOM element.&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="na"&gt;tab&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"profile"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;,&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React 18 introduces new Root API is called with &lt;code&gt;ReactDOM.createRoot&lt;/code&gt; which adds all of the improvements of React 18 and allows you to use concurrent features.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMClient&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Create a root.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Initial render: Render an element to the root.&lt;/span&gt;
&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="na"&gt;tab&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"home"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// During an update, there's no need to pass the container again.&lt;/span&gt;
&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="na"&gt;tab&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"profile"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This change allows React to remove the &lt;code&gt;hydrate&lt;/code&gt; method and replace with with an option on the root; and remove the render callback, which does not make sense in a world with partial hydration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMClient&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Create *and* render a root with hydration.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hydrateRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="na"&gt;tab&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"home"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// Unlike with createRoot, you don't need a separate root.render() call here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="https://github.com/reactwg/react-18/discussions/21"&gt;Automatic Batching&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Batching is when React groups multiple state updates into a single re-render for better performance because it avoids unnecessary re-renders.&lt;/p&gt;

&lt;p&gt;However, React hasn't been consistent about when it batches updates. React only batched updates during React event handlers. Updates inside of promises, setTimeout, native event handlers, or any other event were not batched in React by default.&lt;/p&gt;

&lt;p&gt;React 18 does more batching by default, all updates will be automatically batched, no matter where they originate from.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But remember React only batches updates when it’s generally safe to do. For example, React ensures that for each user-initiated event like a click or a key press, the DOM is fully updated before the next event. This ensures, for example, that a form that disables on submit can’t be submitted twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/reactwg/react-18/discussions/4"&gt;Concurrent Features&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;React 18 will add new features such as startTransition, useDeferredValue, concurrent Suspense semantics, SuspenseList, and more. To power these features, React added concepts such as cooperative multitasking, priority-based rendering, scheduling, and interruptions.&lt;/p&gt;

&lt;p&gt;These features unlock new performance and user experience gains by more intelligently deciding when to render (or stop rendering) subtrees in an app.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/reactwg/react-18/discussions/41"&gt;startTransition&lt;/a&gt;: lets you keep the UI responsive during an expensive state transition.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;useDeferredValue&lt;/code&gt;: lets you defer updating the less important parts of the screen.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;SuspenseList&amp;gt;&lt;/code&gt;: lets you coordinate the order in which the loading indicators appear.&lt;/li&gt;
&lt;li&gt;Streaming SSR with selective hydration: lets your app load and become interactive faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/reactwg/react-18/discussions/37"&gt;Support Suspense in SSR&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://reactjs.org/docs/concurrent-mode-suspense.html"&gt;Suspense&lt;/a&gt; component lets you wait for some code to load and declaratively specify a loading state (like a spinner) while we’re waiting, but not available on the server.&lt;/p&gt;

&lt;p&gt;One problem with SSR today is that it does not allow components to wait for data. With the current API, by the time you render to HTML, you must already have all the data ready for your components on the server.&lt;/p&gt;

&lt;p&gt;React 18 offers two major features for SSR by using Suspense component. The improvements themselves are automatic inside React and we expect them to work with the majority of existing React code. This also means that &lt;code&gt;React.lazy&lt;/code&gt; just works with SSR now.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Streaming HTML&lt;/strong&gt;: lets you start emitting HTML as early as you’d like, streaming HTML for additional content together with the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags that put them in the right places.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selective Hydration&lt;/strong&gt;: lets you start hydrating your app as early as possible, before the rest of the HTML and the JavaScript code are fully downloaded. It also prioritizes hydrating the parts the user is interacting with, creating an illusion of instant hydration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are different levels of support depending on which API you use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;renderToString&lt;/code&gt;: Keeps working (with limited Suspense support).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;renderToNodeStream&lt;/code&gt;: Deprecated (with full Suspense support, but without streaming).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;renderToPipeableStream&lt;/code&gt;: New and recommended (with full Suspense support and streaming).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/reactwg/react-18/discussions/7"&gt;Behavioral Changes to Suspense&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;React added basic support for Suspense since version 16 but it has been limited — it doesn’t support delayed transitions, placeholder throttling, SuspenseList.&lt;/p&gt;

&lt;p&gt;Suspense works slightly differently in React 18 than in previous versions. Technically, this is a breaking change, but it won’t impose a significant migration burden on authors migrating their apps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt; &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Loading&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ComponentThatSuspends&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Sibling&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is how a suspended components affects the rendering behavior of its siblings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Previously, the Sibling component is immediately mounted to the DOM and its effects/lifecycles are fired. Then React hides it.&lt;/li&gt;
&lt;li&gt;In React 18, the Sibling component is not mounted to the DOM. Its effects/lifecycles are also NOT fired until ComponentThatSuspends resolves, too.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In previous versions of React, there was an implied guarantee that a component that starts rendering will always finish rendering.&lt;/p&gt;

&lt;p&gt;In React 18, what React does instead is interrupt the siblings and prevent them from committing. React waits to commit everything inside the Suspense boundary — the suspended component and all its siblings — until the suspended data has resolved.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>news</category>
    </item>
    <item>
      <title>On Decision of Embracing Utility-First CSS</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Sun, 27 Feb 2022 04:20:37 +0000</pubDate>
      <link>https://forem.com/ageekdev/on-decision-of-embracing-utility-first-css-2kdi</link>
      <guid>https://forem.com/ageekdev/on-decision-of-embracing-utility-first-css-2kdi</guid>
      <description>&lt;p&gt;&lt;strong&gt;Utility-First CSS is trending in 2022&lt;/strong&gt;. If you hate it, you will feel annoyed seeing people promoting it. If you love it, you'll question why people hate it. If you're still skeptical then there's a high chance you've already read all following articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://adamwathan.me/css-utility-classes-and-separation-of-concerns/"&gt;CSS Utility Classes and "Separation of Concerns"&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://frontstuff.io/in-defense-of-utility-first-css"&gt;In Defense of Utility-First CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/lets-define-exactly-atomic-css/"&gt;Let’s Define Exactly What Atomic CSS is&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mrmrs.io/writing/2016/03/24/scalable-css/"&gt;CSS and Scalability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.zeldman.com/2017/01/03/kiss-my-classname/"&gt;Kiss My Classname&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can't ignore it anymore when it's gaining so much attention and potentially becomes something big that you and your team don't want to miss. Same thing happens to Svelte. It's moving in an unpopular direction, it pushes you to make decision at this point — ignore it, embrace it, or question your current direction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is it worth the learning?&lt;/li&gt;
&lt;li&gt;Is it considered harmful in long term?&lt;/li&gt;
&lt;li&gt;Will it scale well in my team or company?&lt;/li&gt;
&lt;li&gt;Does it have same abstraction as web frameworks (React, Vue, Angular)?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you still couldn't pick a side, then I'm here to help you. This post focuses on the decision of embracing &lt;strong&gt;utility-first CSS&lt;/strong&gt; in general and &lt;a href="https://tailwindcss.com/"&gt;Tailwind&lt;/a&gt; in more specific.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you really care about
&lt;/h2&gt;

&lt;p&gt;All CSS technologies like &lt;a href="https://ageek.dev/css-frameworks"&gt;CSS frameworks&lt;/a&gt;, &lt;a href="https://ageek.dev/css-methodologies"&gt;CSS methodologies&lt;/a&gt;, or &lt;a href="https://ageek.dev/css-in-js"&gt;CSS-in-JS libraries&lt;/a&gt; try to fix &lt;a href="https://ageek.dev/css-problems"&gt;problems of CSS at scale&lt;/a&gt; one way or another. Following are major deciding factors before picking a CSS solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Naming classnames&lt;/strong&gt;: Short, scoped, and collision-free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output bundle sizes&lt;/strong&gt;: The smaller the better, even better if modular&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimization chances&lt;/strong&gt;: Removing unused styles, caching extracted CSS files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer experience&lt;/strong&gt;: Fast development, easy refactoring, linting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learning investment&lt;/strong&gt;: fast to learn, works well between tech stacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Different years of experience and project sizes have different expectations on above factors like beginners care more about &lt;strong&gt;learning investment&lt;/strong&gt; and big projects care more about &lt;strong&gt;optimization chances&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Be aware of learning something backwards, modern developers often stumbled into trending CSS-like, JavaScript-like, HTML-like and find themselves never actually learn vanilla HTML, CSS, JavaScript which considered harmful picking up new web technologies.&lt;/p&gt;

&lt;h2&gt;
  
  
  The ideas behind utility-first CSS
&lt;/h2&gt;

&lt;p&gt;The main idea behind utility-first CSS movement is to style everything based on predefined utility classes — developed by yourself or frameworks.&lt;/p&gt;

&lt;p&gt;People love it because it promotes &lt;strong&gt;rapid prototyping&lt;/strong&gt; by reusing tons of &lt;strong&gt;useful ready-to-use CSS classes&lt;/strong&gt; at a &lt;strong&gt;very strict manner&lt;/strong&gt;. People hate it because it produces &lt;strong&gt;ugly HTML markup with long string of classes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/"&gt;Tailwind&lt;/a&gt; comes prepacked with a lot of options and styles for users to choose from, and it packs all these variations to reduce the tendency to write your own CSS.&lt;/p&gt;

&lt;p&gt;Majority of time you don't do that much of customization as you expected, there is a chance that you'll never create any custom CSS in small projects, that's why Tailwind has been gaining so much momentum.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decision on utility-first CSS
&lt;/h2&gt;

&lt;p&gt;I have a background on mobile development where I always styled components programmatically. When I moved to web development, component-based CSS-in-JS seemed so obvious and future-proof. The transition was right and pleasant in the beginning.&lt;/p&gt;

&lt;p&gt;I already experienced &lt;strong&gt;utmost dynamic component-based architecture&lt;/strong&gt; when writing styles, layouts, and logics in one file using general-purpose programming languages. I resist all technologies go against my principles, I may try them, but not going to embrace any of them!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I don't like Angular because it uses HTML templates.&lt;/li&gt;
&lt;li&gt;I don't like Vue because it uses template structures in &lt;code&gt;.vue&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;I don't like Svelte because it uses template structures in &lt;code&gt;.svelte&lt;/code&gt; files and ugly template APIs.&lt;/li&gt;
&lt;li&gt;I don't like utility-first CSS because it promotes heavy uses of predefined classes instead of well-known CSS properties, and obviously ugly classnames in HTML.&lt;/li&gt;
&lt;li&gt;I like React and &lt;code&gt;styled-components&lt;/code&gt; when it translates very well to mobile apps and desktop apps, I prefer reusable fully-functional components than reusable CSS or HTML alone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You see the point here, it's not about right or wrong decision. It's all about define principles in your developer career and technologies will fall into the right bucket for you and only you.&lt;/p&gt;

</description>
      <category>css</category>
      <category>tailwindcss</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Data Structures Used in Competitive Programming</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Wed, 23 Feb 2022 01:41:53 +0000</pubDate>
      <link>https://forem.com/ageekdev/data-structures-used-in-competitive-programming-48e</link>
      <guid>https://forem.com/ageekdev/data-structures-used-in-competitive-programming-48e</guid>
      <description>&lt;p&gt;Understanding data structures is integral to participate in competitive programming, as you will be faced with making decisions on what data structure to utilize to most efficiently solve the problem you are given.&lt;/p&gt;

&lt;p&gt;It's important to learn basic data structures inside out, otherwise understanding higher level structures will be difficult.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beginner
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Array&lt;/strong&gt;: A collection of items of the same variable type that are stored sequentially in memory. It’s one of the most popular and simple data structures and often used to implement other data structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linked List&lt;/strong&gt;: A linear sequence of nodes that are linked together. Each node contains a value and a pointer to the next node in the list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stack&lt;/strong&gt;: A linear data structure that follows the principle of Last In First Out (LIFO).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Queue&lt;/strong&gt;: Similar to Stack in that they both are linear data structures with dynamic size. However, queues are FIFO (first-in, first-out) data structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deque (Double Ended Queue)&lt;/strong&gt;: An extension of Queue, elements can be added to or removed from either the front (head) or back (tail).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Priority Queue&lt;/strong&gt;: An extension of queue, each element is associated with a priority value, element with high priority is served before an element with low priority.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set&lt;/strong&gt;: An abstract data type that can store unique values, without any particular order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hash Table&lt;/strong&gt;: A data structure that can map keys to values, uses a hash function to compute an index into an array of buckets from which the desired value can be found.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Intermediate
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Heap&lt;/strong&gt;: A specialized tree-based data structure that has largest root node in Max-Heap or smallest root node in Min-Heap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Huffman Tree (Huffman Coding Tree)&lt;/strong&gt;: A full binary tree in which each leaf of the tree corresponds to a letter in the given alphabet. The goal is to construct a tree with the minimum external path weight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disjoint Set (Union Find)&lt;/strong&gt;: A data structure that stores a collection of disjoint sets, supports union and find operation on subsets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trie&lt;/strong&gt;: A tree data structure used for locating specific keys from within a set. These keys are most often strings, with links between nodes defined not by the entire key, but by individual characters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary Search Tree&lt;/strong&gt;: A rooted binary tree data structure whose internal nodes each store a key greater than all the keys in the node’s left subtree and less than those in its right subtree.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Proficient
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Segment Tree&lt;/strong&gt;: A data structure that allows answering range queries over an array effectively, while still being flexible enough to allow modifying the array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fenwick Tree (Binary Indexed Tree)&lt;/strong&gt;: A data structure that can efficiently update elements and calculate prefix sums in a table of numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Suffix Array&lt;/strong&gt;: A sorted array of all suffixes of a string, used in full text indices, data compression algorithms, and the field of bibliometrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sparse Table&lt;/strong&gt;: A data structure that allows answering range queries, especialy range minimum queries in an array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Range Tree&lt;/strong&gt;: An ordered tree data structure to hold a list of points. It permits all points within a given range to be efficiently retrieved, and is typically implemented in two or higher dimensions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Expert
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AVL Tree&lt;/strong&gt;: A self-balancing binary search tree in which each node maintains extra information called a balance factor whose value is either -1, 0 or +1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Suffix Automaton&lt;/strong&gt;: A powerful data structure that allows solving many string-related problems like searching for all occurrences of one string in another or counting the amount of different substrings of a given string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Suffix Tree&lt;/strong&gt;: A compressed trie containing all the suffixes of the given text as their keys and positions in the text as their values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treap (Cartesian Tree)&lt;/strong&gt;: A data structure which combines binary tree and binary heap (hence the name: Tree + Heap = Treap).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;K-d Tree&lt;/strong&gt;: A space-partitioning data structure for organizing points in a k-dimensional space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forest&lt;/strong&gt;: An undirected graph in which any two vertices are connected by at most one path. Equivalently, a forest is an undirected acyclic graph, all of whose connected components are trees; in other words, the graph consists of a disjoint union of trees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Splay Tree&lt;/strong&gt;: An efficient implementation of a balanced binary search tree that takes advantage of locality in the keys used in incoming lookup requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Palindromic Tree&lt;/strong&gt;: A tree based data structure that is specifically used to tackle problems involving palindromes of a string and its substrings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rope&lt;/strong&gt;: A data structure composed of smaller strings that is used to efficiently store and manipulate a very long string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Radix Tree&lt;/strong&gt;: A data structure that represents a space-optimized trie (prefix tree) in which each node that is the only child is merged with its parent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Red Black Tree&lt;/strong&gt;: A self-balancing binary search tree. Each node stores an extra bit representing "color", used to ensure that the tree remains balanced during insertions and deletions.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>algorithms</category>
      <category>career</category>
    </item>
    <item>
      <title>My First Impressions of Dev Community</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Tue, 22 Feb 2022 01:28:41 +0000</pubDate>
      <link>https://forem.com/ageekdev/my-first-impressions-of-dev-community-31ng</link>
      <guid>https://forem.com/ageekdev/my-first-impressions-of-dev-community-31ng</guid>
      <description>&lt;p&gt;As a fresh user of dev.to for couple of days, I saw some posts about current status of dev.to or is it a victim of its own success? People complained about repetitive cheap curated content ranked at top all the time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actually dev.to works as intended&lt;/strong&gt;, most user-generated content community has a perceived quality driven by hot trending topics. &lt;/p&gt;

&lt;p&gt;Same things happens to Twitter and Reddit but they are too big and you just don't see it, they have enough content to build personalized feed. Eventually you'll get sick of people keep tweeting about HTML, CSS, JS but you have the option to follow other topics/people.&lt;/p&gt;

&lt;p&gt;Same thing doesn't apply to dev.to because this is a niche community with less than 1M users. If you have worked in software development long enough you'll realize that there're not much new or deep things to write about when mostly already covered in official documents.&lt;/p&gt;

&lt;p&gt;High quality articles are expensive to produce, rock-star developers write a handful of them in 10 years, professional bloggers or book writers might cross-post a piece of their work here. &lt;/p&gt;

&lt;p&gt;Forget about beginner/intermediate developers writing high quality posts because they don't have enough insights and experiences to elaborate difficult concepts to recognized as quality content. The only good thing they can do are curating content and copy+modify what they know. If they don't do that then dev.to just dead already!&lt;/p&gt;

&lt;p&gt;Css-tricks.com has around 10k reasonable good long-form articles and has traffic similar to dev.to. How can dev.to make a break though from here.&lt;/p&gt;

&lt;p&gt;The big problem with dev.to is they want to build a &lt;strong&gt;highly-interactive&lt;/strong&gt; with &lt;strong&gt;long-form content&lt;/strong&gt;  community. Why is that?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Long form content are limited and hard to mass produce, even with a big userbase.&lt;/li&gt;
&lt;li&gt;Highly interactive site is also impossible when number of posts and users are limited.&lt;/li&gt;
&lt;li&gt;Showing sorted content is harmful, it creates illusion of the whole site quality, visitors feel like that the only good thing they can find at dev.to. Personalized feed doesn't work because of limited content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix above problem dev.to needs to separate discussions with articles, make it looks like a discussion centric community like Github discussions but also maintain a section of curated topic-wise quality articles as a learning source. Dev.to also should hire more technical writers to write less popular topics.&lt;/p&gt;

&lt;p&gt;In the end it's all about perceived impression. What if dev.to wants to keep everything the same? I think it's fine if dev.to team happy with current status and want to pivot new products before dev.to declines. This site already reached its peek.&lt;/p&gt;

&lt;p&gt;Each site serves it own unique purpose. Combine geeksforgeeks.org content with dev.to comment section will be dope!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>writing</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Writing Conventional Git Commit Messages</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Tue, 22 Feb 2022 01:07:29 +0000</pubDate>
      <link>https://forem.com/ageekdev/writing-conventional-git-commit-messages-49m8</link>
      <guid>https://forem.com/ageekdev/writing-conventional-git-commit-messages-49m8</guid>
      <description>&lt;p&gt;When working on personal projects, you can commit with random messy short meaningless messages like &lt;code&gt;wip&lt;/code&gt;, &lt;code&gt;done&lt;/code&gt;, &lt;code&gt;ok&lt;/code&gt;, &lt;code&gt;working&lt;/code&gt;, &lt;code&gt;still working on it&lt;/code&gt;, &lt;code&gt;really done this time&lt;/code&gt;, or &lt;code&gt;i dont care&lt;/code&gt;. You're not the only one who has poorly named commits, weird branch merges, or one branch for everything. No one cares about git history of your private repositories!&lt;/p&gt;

&lt;p&gt;But public and corporate projects often have very precise rules over how git commit messages should be formatted. This leads to more readable messages that are easy to follow when looking through the project history. Also, we can use the git commit messages to generate the changelog, determine a semantic version bump, or trigger publishing process.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.conventionalcommits.org/en/v1.0.0/"&gt;The Conventional Commits&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;type&amp;gt;(&amp;lt;optional scope&amp;gt;): &amp;lt;subject&amp;gt;
&amp;lt;BLANK LINE&amp;gt;
&amp;lt;optional body&amp;gt;
&amp;lt;BLANK LINE&amp;gt;
&amp;lt;optional footer&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A full long commit message will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fix(middleware): ensure Range headers adhere more closely to RFC 2616

Add one new dependency, use `range-parser` (Express dependency) to compute
range. It is more well-tested in the wild.

Fixes #2310
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most tools only show the first line of the commit message, which is usually enough to know what it is about.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;*&lt;/span&gt; 8decde6 - &lt;span class="o"&gt;(&lt;/span&gt;1 months ago&lt;span class="o"&gt;)&lt;/span&gt; docs&lt;span class="o"&gt;(&lt;/span&gt;server&lt;span class="o"&gt;)&lt;/span&gt;: update file uploading api
&lt;span class="k"&gt;*&lt;/span&gt; bee23f9 - &lt;span class="o"&gt;(&lt;/span&gt;2 months ago&lt;span class="o"&gt;)&lt;/span&gt; feat&lt;span class="o"&gt;(&lt;/span&gt;client&lt;span class="o"&gt;)&lt;/span&gt;: add Apple login button
&lt;span class="k"&gt;*&lt;/span&gt; a8ecd9d - &lt;span class="o"&gt;(&lt;/span&gt;3 months ago&lt;span class="o"&gt;)&lt;/span&gt; fix&lt;span class="o"&gt;(&lt;/span&gt;client&lt;span class="o"&gt;)&lt;/span&gt;: brokenn header &lt;span class="k"&gt;in &lt;/span&gt;safari
&lt;span class="k"&gt;*&lt;/span&gt; 7a0f17e - &lt;span class="o"&gt;(&lt;/span&gt;4 months ago&lt;span class="o"&gt;)&lt;/span&gt; feat&lt;span class="o"&gt;(&lt;/span&gt;server&lt;span class="o"&gt;)&lt;/span&gt;: add crud apis
&lt;span class="k"&gt;*&lt;/span&gt; af61aec - &lt;span class="o"&gt;(&lt;/span&gt;5 months ago&lt;span class="o"&gt;)&lt;/span&gt; docs&lt;span class="o"&gt;(&lt;/span&gt;changelog&lt;span class="o"&gt;)&lt;/span&gt;: update changelog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Type
&lt;/h3&gt;

&lt;p&gt;This spec suggests following types, you can always add more if that suits your projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;feat&lt;/strong&gt;: A new feature&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fix&lt;/strong&gt;: A bug fix&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;docs&lt;/strong&gt;: Documentation only changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;build&lt;/strong&gt;: Changes that affect the build system or external dependencies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ci&lt;/strong&gt;: Changes to our CI configuration files and scripts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;perf&lt;/strong&gt;: A code change that improves performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;refactor&lt;/strong&gt;: A code change that neither fixes a bug nor adds a feature&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;style&lt;/strong&gt;: Changes that do not affect the meaning of the code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;test&lt;/strong&gt;: Adding missing tests or correcting existing tests&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scope
&lt;/h3&gt;

&lt;p&gt;The scope should be the name of the package/module affected (as perceived by the person reading the changelog generated from commit messages. It can be empty (e.g. if the change is a global or difficult to assign to a single component), in which case the parentheses are omitted.&lt;/p&gt;

&lt;p&gt;Common scopes are &lt;em&gt;client&lt;/em&gt;, &lt;em&gt;server&lt;/em&gt;, &lt;em&gt;mobile&lt;/em&gt;, &lt;em&gt;core&lt;/em&gt;, &lt;em&gt;worker&lt;/em&gt;, &lt;em&gt;shared&lt;/em&gt;, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Subject
&lt;/h3&gt;

&lt;p&gt;The first line of the commit message should be a short description (50 characters is the soft limit), and should skip the full stop. Its first word is not capitalized unless there is a reason to capitalize it other than because it is the first word in the sentence.&lt;/p&gt;

&lt;p&gt;Describe your changes in imperative mood, as if you are giving orders to the codebase to change its behavior (“change” not “changed” or “changes”). Try to make sure your explanation can be understood without external resources. Instead of giving a URL to a mailing list archive, summarize the relevant points of the discussion.&lt;/p&gt;

&lt;p&gt;Rather than writing messages that say what you’ve done; consider these messages as the instructions for what applying the commit will do. It feels strange at first but it does make sense and eventually becomes natural.&lt;/p&gt;

&lt;p&gt;If the subject starts to get too long, that's a sign that you probably need to split up your commit to finer grained pieces.&lt;/p&gt;

&lt;h3&gt;
  
  
  Body
&lt;/h3&gt;

&lt;p&gt;The body should provide a meaningful commit message, which:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explains the problem the change tries to solve, i.e. what is wrong with the current code without the change.&lt;/li&gt;
&lt;li&gt;Justifies the way the change solves the problem, i.e. why the result with the change is better.&lt;/li&gt;
&lt;li&gt;Alternate solutions considered but discarded, if any.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Footer
&lt;/h3&gt;

&lt;p&gt;All breaking changes have to be mentioned in footer with the description of the change, justification and migration notes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BREAKING CHANGE:

`port-runner` command line option has changed to `runner-port`, so that it is
consistent with the configuration file syntax.

To migrate your project, change all the commands, where you use `--port-runner`
to `--runner-port`.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;p&gt;If in doubt which identifier to use, run &lt;code&gt;git log --no-merges&lt;/code&gt; on the&lt;br&gt;
files you are modifying to see the current conventions.&lt;/p&gt;

&lt;p&gt;Don't spoil the git history with multiple same message commits, better use &lt;code&gt;git commit --amend --no-edit --date=now&lt;/code&gt; to append same work in progress.&lt;/p&gt;

&lt;p&gt;This first line should be a concise summary of the changes introduced by the commit; if there are any technical details that cannot be expressed in these strict size constraints, put them in the body instead.&lt;/p&gt;

&lt;p&gt;Remember the Conventional Commits spec is more like a guideline not a mandated rule or something. You are free to modify or adopt it in a way that makes you and your team happy.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>git</category>
    </item>
    <item>
      <title>State of JS 2021 Survey Results</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Sun, 20 Feb 2022 01:05:31 +0000</pubDate>
      <link>https://forem.com/ageekdev/state-of-js-2021-survey-results-2amo</link>
      <guid>https://forem.com/ageekdev/state-of-js-2021-survey-results-2amo</guid>
      <description>&lt;p&gt;&lt;a href="https://2021.stateofjs.com/en-US/"&gt;State of JS 2021 survey results&lt;/a&gt; just came out, looking beautiful as always, now it's a good time to try new shining JavaScripts tools.&lt;/p&gt;

&lt;p&gt;A lot happened in 2021. So much in fact that the survey was pushed back all the way to 2022!&lt;/p&gt;

&lt;p&gt;I like the idea of &lt;a href="https://2021.stateofjs.com/en-US/libraries"&gt;library tier list&lt;/a&gt; like &lt;strong&gt;hero tier list&lt;/strong&gt; in many games I played. It will help us make faster decision on which ones to invest but also push lower-tier ones to death faster.&lt;/p&gt;

&lt;p&gt;This report is a good place to have a big picture of JavaScript ecosystem. What do you think about the results? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Cracking the Frontend Interview, Part 1: Overview</title>
      <dc:creator>ΛGΣΣK</dc:creator>
      <pubDate>Fri, 18 Feb 2022 03:23:50 +0000</pubDate>
      <link>https://forem.com/ageekdev/cracking-the-frontend-interview-part-1-overview-kca</link>
      <guid>https://forem.com/ageekdev/cracking-the-frontend-interview-part-1-overview-kca</guid>
      <description>&lt;p&gt;After having a job at your dream company, you often realise that tackling the interview is more difficult than working at real projects. Let's take an overview look at what to focus when preparing for the &lt;strong&gt;frontend&lt;/strong&gt; (front-end / front end) developer interview.&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ageek.dev/frontend-interview-part-1-overview"&gt;&lt;strong&gt;Part 1: Overview&lt;/strong&gt;&lt;/a&gt; &lt;em&gt;(this post)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ageek.dev/frontend-interview-part-2-html"&gt;Part 2: HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ageek.dev/frontend-interview-part-3-css"&gt;Part 3: CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ageek.dev/frontend-interview-part-4-javascript"&gt;Part 4: JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ageek.dev/frontend-interview-part-5-react"&gt;Part 5: React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ageek.dev/frontend-interview-part-6-webdev"&gt;Part 6: WebDev&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;This series is quite language agnostic except the framework when I only cover React. One reason is I'm working on React and quite good at it. Other reason is that we can both achieve client-side and server-side rendering with JavaScript and React.&lt;/p&gt;

&lt;p&gt;It's personal preference to pick other JS frameworks like Vue or Angular, server-side languages like PHP, Ruby, Python, Java, C#, etc. Just pick one and being good at it, there's alway open jobs out there for you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By failing to prepare, you are preparing to fail. (Benjamin Franklin)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Expectation
&lt;/h2&gt;

&lt;p&gt;Different job levels require different responsibilities and minimum qualifications. Different companies establish different expectations to filter candidates who fit well with their cultures. Whatever situation is, here are 5 factors that will have big influence on your way looking for a job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Technical proficiency&lt;/strong&gt;: I strongly believe that &lt;em&gt;skills beat experiences&lt;/em&gt;. If you're good at what you're doing then you'll have all the confidence in this world. You'll create your own luck. You can even build your own products if no one hires you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Years of experiences&lt;/strong&gt;: Many companies filter candidates by number years of experiences! It might not be perfect, but it's a simple mechanism when hiring senior or manager level! A matter of fact that many of us are mediocre engineers. &lt;em&gt;It sounds debatable but it's true&lt;/em&gt;. You'll see many engineers who actually stack years of experiences without advancing at all in big companies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Personal projects&lt;/strong&gt;: Anything like hobby projects, side projects or open-source projects will count. These make you stand out from the rest. Invest on these as soon as possible, especially fresh graduates who don't have commercial experience yet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Former employers&lt;/strong&gt;: Who doesn't like a candidate previously worked at Google or Facebook (unless they don't have enough money to pay you 🤑)! Having a list of former prestigious employers (relative to your market) will give you a huge advantage position in the interview process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interviewing skills&lt;/strong&gt;: Competition at prestigious companies is fierce with thousands applications from top engineers around the world. You need extra gear like interview skills to be the chosen one.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Proficiency
&lt;/h2&gt;

&lt;p&gt;You may have heard stories people somehow got a decent job by luck with tips and tricks, focusing solely on problem solving skills. But at the end of the day, you'll be working with these technologies day in and day out, being a decent engineer is always your north star.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basics&lt;/strong&gt;: It's critical to have solid understanding of computer science including problem solving, design patterns, system design, networking, database, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Whether you love or hate data structures &amp;amp; algorithms, you have to take considerable amount of time to practice. Majority companies are using it and it's not going to change anytime soon.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are many self-taught frontend developers these days who don't have time to learn computer science fundamentals properly. It's okay as long as you can do the job and make enough money for your life. But it doesn't mean it's safe to skip this, I mean it's not cool to call yourself a software engineer when you don't know much about computer science.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;: Quite easy to pick up, not any fancy things here. Expected to know at least available HTML elements, how DOM works, semantic HTML, web storage, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;: Learn proper raw CSS, how CSS engine works, and Responsive Web Design. You may only use CSS frameworks all the time but a frontend engineer doesn't know to layout using raw CSS seems unqualified.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;: A decent knowledge of JavaScript is required. Fluent data structures &amp;amp; algorithms coding in JavaScript is perfect. You can do almost anything with this language nowadays so don't hesitate to put a lot of effort on it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React&lt;/strong&gt;: (or any other web framework) Just pick one and never look back, knowing only one is going to be just fine. Pick the exact one your dream company is using would be a huge advantage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WebDev&lt;/strong&gt;: Having a basic knowledge of Standard JavaScript APIs, XMLHttpRequest and other browser special-purpose APIs like runtime, storage, notifications, window, socket, file system, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many more web technologies to learn that I can't cover here. Check &lt;a href="https://roadmap.sh/frontend"&gt;frontend roadmap&lt;/a&gt; for the exhaustive list. The more you know, the more advantages you have compare to other candidates.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Try not to get lost in the maze of frontend technologies.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Cultural Fit
&lt;/h2&gt;

&lt;p&gt;Your dream company is a living entity which has standards and principles, trying so hard everyday to deliver their core values. You both should have a good match, or you could end up &lt;a href="https://medium.com/@andrewgoldis/why-i-quit-amazon-just-5-months-after-ive-started-4ce872520f02"&gt;working miserably months later&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Know yourself&lt;/strong&gt;: This is so important but underrated. You should define your own principles. What you really want. Who you really are. What you've done. What you can offer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Know your dream company&lt;/strong&gt;: This is when you respect the open internet. Things are much more open these days with the rise of community like forums, groups, twitter, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Practice telling stories to meet the cultural fit&lt;/strong&gt;: When you find a good match between a company and yourself, adjust your life stories and work experiences to emphasize that you are a good fit to that company. It's not lying but telling your stories in different ways.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Job Application
&lt;/h2&gt;

&lt;p&gt;It doesn't take much time to write a good resume by following tons of tips around the net.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Research the market&lt;/strong&gt;: Look around, track all open positions you want to apply into an excel file. Give them a priority order.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Revise your resume&lt;/strong&gt;: No one forbids you from submitting the same resume to all open positions ! Many do that 👹. But revising resume a bit to fit the position (frontend engineer, fullstack engineer, software engineer, etc) is recommended.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Submit job application&lt;/strong&gt;: There are many strategies here (one at a time, multiple at a time, dream companies first, dream companies last, etc) and via referrals, recruiters or job boards. Do whatever you want. I found submitting via referral is the best to guarantee you an interview slot.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Interview Process
&lt;/h2&gt;

&lt;p&gt;An interview process at a company starts when you receive an email or phone call from recruiter to setup the interviews. Recruiters often follow your decisions on date and time of interviews, so buy some time if you need to. Following are 5 common steps you'll encounter for technical positions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Phone interview w/ hiring manager&lt;/strong&gt;: Undoubtedly the easiest one. One reason is hiring manager is often professional and conventional so you can predict what will be asked and prepare for it. Other reason is most questions are behavioral questions, we all assume behavioral questions are easier than technical questions, right? 😋. Hard to fail if you know the company well and align your answers to fit the expectation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Phone interview w/ team member&lt;/strong&gt; &lt;em&gt;(1-3)&lt;/em&gt;: Normally you'll have from 1 to 3 phone/video technical interviews with your potential teammates. Some companies focus on data structures &amp;amp; algorithms. Others focus on frontend technologies only. Better ask recruiters before these rounds to have better preparation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Take home assignment&lt;/strong&gt; &lt;em&gt;(sometimes)&lt;/em&gt;: Some companies may ask you to deliver an assignment in couple of days. I had experiences at this step as interviewer who reviewed candidates' assignments, I can tell you I was always very harsh because I had plenty of time to look at the code 😂. So please try your best to code beautifully and test appropriately. A little investment in UI/UX design would be awesome. &lt;strong&gt;Some people may think about cheating at this step. Don't! You may end up very embarrassing later at onsite interview&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Onsite interview&lt;/strong&gt;: Regardless of how many interviews I took, I found myself very nervous and tired at this step. You simply can't cover your lack of knowledge after many 1-on-1(2) interviews all day long. You're better good at what you're applying for or this could give you a damage on your confidence later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Offer Negotiation&lt;/strong&gt;: It's awesome to finally get here, you're almost there, don't screw it up 😅. Try to balance between what you know about the market, working environment, project status, career development and compensation package.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Interviews at different companies may differ in terms of order and number of interviews, you better prepare all these 5 types when applying multiple at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be a professional candidate&lt;/strong&gt;. Sound cliche but never hurts if you are. Fresh graduates might not know how to do this. Experienced engineers sometimes are arrogant and act like a 🤬.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unprofessional interviewer exists&lt;/strong&gt;. Not many companies have seminars to train their employees how to conduct a professional interview. Software engineers often asked to do the technical interviews without a solid understanding what the company actually looking for. You may encounter some interviewers who are very technical bias, looking for someone similar to theme, asking personal questions, humiliating candidates, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Good enough is good enough&lt;/strong&gt;. I can guarantee that you can never cover all technologies need for your upcoming technical interviews. The more you learn, the more you know you don't know! Better to set a deadline and go for it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be patient with hiring process&lt;/strong&gt;. One-shot interviews are rare these days unless you're exceptional and invited to work by companies. Most of us will go through very long and grueling interview which might come in vain if we fail any step of it. This is especially true applying to small non-prestigious companies when we're constantly questioning ourself whether the efforts will pay off or the offers end up very disappointing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s also important to note that if it doesn’t work out the first time, it’s not the end of the line.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Don't stress out, prepare seriously and you'll be doing just fine. Wish you all reading this post to have very successful interviews in the future.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>career</category>
    </item>
  </channel>
</rss>
