<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shub on Medium]]></title>
        <description><![CDATA[Stories by Shub on Medium]]></description>
        <link>https://medium.com/@champa.281982?source=rss-62492a0a2f4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GqFoZD1uDyOVjiZt</url>
            <title>Stories by Shub on Medium</title>
            <link>https://medium.com/@champa.281982?source=rss-62492a0a2f4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:53:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@champa.281982/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Demystifying the React Compiler]]></title>
            <link>https://medium.com/@champa.281982/demystifying-the-react-compiler-de2b5482d9a9?source=rss-62492a0a2f4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/de2b5482d9a9</guid>
            <category><![CDATA[react-memoization]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-compiler]]></category>
            <category><![CDATA[webdev]]></category>
            <dc:creator><![CDATA[Shub]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 10:21:37 GMT</pubDate>
            <atom:updated>2025-07-10T10:31:52.832Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>React Compiler made its debut last year, but I couldn’t find any convincing demos… So here’s a simple one to show you what it can do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gmF4NvbYQvwXURPX.png" /></figure><h3>Getting started</h3><p>On Next, you can turn it on from thenext.config file.</p><pre>const nextConfig = {<br> experimental: {<br>  reactCompiler: true,<br> },<br>}<br><br>export default nextConfig</pre><p>Don’t forget to install babel-plugin-react-compiler and remove --turbpack from dev script. See <a href="https://nextjs.org/docs/app/api-reference/config/next-config-js/reactCompiler">docs</a>.</p><p>Vite users can use vite-plugin-react to enable the compiler, by adding it as a Babel plugin. More info <a href="https://react.dev/blog/2025/04/21/react-compiler-rc#swc-support-experimental">here</a>.</p><h3>The Demo</h3><p>Here I’ve a simple button that increases count by 1 and a div with some items.</p><pre>function App() {<br> console.log(&#39;Component rendered&#39;)<br><br> const [count, setCount] = useState(0)<br><br> function increaseCount() {<br>  setCount(count + 1)<br> }<br><br> return (<br>  &lt;&gt;<br>   &lt;button onClick={increaseCount}&gt;count: {count}&lt;/button&gt;<br><br>   &lt;div&gt;<br>    {[0, 1, 2, 3, 4].map((i) =&gt; {<br>     console.log(i)<br>     return &lt;div key={i}&gt;Item {i}&lt;/div&gt;<br>    })}<br>   &lt;/div&gt;<br>  &lt;/&gt;<br> )<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vno7KQfUUDbpLzZ0NwuwOg.png" /><figcaption>Without react compiler: Every time you click the button, the items list will be re-rendered — for no good reason</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8_6mQpLm87dd5rIM_qH0Q.png" /><figcaption>With react compiler: I clicked count 10 times, the count updated but the items list didn’t re-render</figcaption></figure><p>Now imagine that list was a complex component or a huge UI block.</p><p>Earlier one’d use useMemo, useCallback and React.memo to optimize performance. But now the React Compiler does it for you automatically.</p><p>And, if you have the <a href="https://medium.com/r?url=https%3A%2F%2Fchromewebstore.google.com%2Fdetail%2Freact-developer-tools%2Ffmkadmapgofadopljbjfkapdkoienihi%3Fhl%3Den">React Developer Tools extension</a> you can see which components are auto-memoized by the compiler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HP4XpigCW0O_SoNnQEUwgg.png" /><figcaption>React Developer Tools chrome extension</figcaption></figure><p>Thanks for reading! 👋🏻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de2b5482d9a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VS Code hacks for beginners]]></title>
            <link>https://medium.com/@champa.281982/vs-code-hacks-for-beginners-cdd7358ff682?source=rss-62492a0a2f4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdd7358ff682</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[vs-code-extensions]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Shub]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 10:36:49 GMT</pubDate>
            <atom:updated>2025-06-04T07:20:34.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wtGUJSVVrIkxozXlSE1vEQ.png" /></figure><p>Visual Studio Code is one of the most popular IDE out there. This article explores some cool tweaks and tricks that you may like…</p><h3>Code Runner</h3><p>VS code terminal shows a lot of bloated stuffs such as paths and requires manual cleaning. If this seems annoying, <a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner">Code Runner</a> extension can come in handy for you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSNNaDnuqMXo5Ww7tZpePQ.png" /><figcaption>Terminal output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJ8vzLInq7fezQry08ZPfA.png" /><figcaption>Clean output with the extension</figcaption></figure><p>Make sure to check <a href="https://stackoverflow.com/questions/43643629"><em>Save file before Run</em></a> and <em>Clear Previous Output before Run</em>,<em> </em>and uncheck <em>Show Execution Message</em> in the extension settings. Also consider setting up a shortcut key for convenience. One downside, however, is that you can’t take user input in the output window.</p><h3>Code Snippets</h3><p>Snippets in VSC are like code templates (aka boilerplate code) that can be quickly inserted into your codebase by typing a trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0kW_Ol-rPG-UGeG1igl7w.gif" /><figcaption>A snippet for c++</figcaption></figure><p>Here’s an SO <a href="https://stackoverflow.com/questions/56608835">link</a> to set it up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*wmVAXgCqaACrFHch6tPmzQ.gif" /><figcaption>A snippet with <a href="https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax">placeholders</a></figcaption></figure><h3>Code formatter</h3><p>A code formatter helps enforce a specific coding style by adjusting indentation, spacing, braces, etc and this can save a lot of your manual effort.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier</a> is a popular code formatter that works on a lot of languages. For Python, there is a similar tool called <a href="https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter">Black</a> and <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools">C/C++ extension</a> automatically includes clang-format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tSosBjF0fEebAjtW1eeaw.gif" /><figcaption>Auto formatting of code</figcaption></figure><p>Setting up prettier for the first time might be a little daunting, but you can follow this <a href="https://stackoverflow.com/questions/52586965">link</a> for setup. Don’t forget to turn on <em>Format on Save</em> and <em>Save on Run</em> in settings.</p><p>Note: By default vsc lints opening braces in newline for c/c++. To get them on sameline, search forC_Cpp.clang_format_fallbackStyle in Settings and set it to {BasedOnStyle: Google, IndentWidth: 4} . For more info <a href="https://stackoverflow.com/questions/45823734">see</a>.</p><h3>Keyboard Shortcuts</h3><p>In addition to default shortcuts, VSC allows the user to define their own custom shortcuts. Creating one is pretty easy… Just tell ChatGPT what you’ve got in your mind, and it’ll provide you with the keybinding that you need to paste in the JSON file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbBjVZUXz65T5h0PxfRlfA.gif" /><figcaption>How to map custom keyboard shortcuts (video <a href="https://imgur.com/MuLvqlG">here</a>)</figcaption></figure><p>Here are a few suggested shortcuts to consider adding:</p><pre>-----------------------------------------<br>| Shift + Bksp/Del  | Delete line         |<br>-----------------------------------------<br>| Shift + Enter     | Run code            |<br>-----------------------------------------<br>| Del/Bksp          | Remove brackets     |<br>-----------------------------------------<br>| Ctrl + V          | Paste into terminal |<br>-----------------------------------------<br>| Ctrl + Arrow      | cursorWordPart      |<br>-----------------------------------------<br>| Ctrl + Shift + /  | Toggle Block Comment|<br>-----------------------------------------</pre><p>Additionally, there is a vast array of existing shortcuts available in VSC that you may find useful. Here are some I frequently use…</p><pre>--------------------------------------------<br>| Shortcut          | Function             |<br>--------------------------------------------<br>| Ctrl + /          | Add/remove comment   |<br>--------------------------------------------<br>| Ctrl + +/-        | Zoom                 |<br>--------------------------------------------<br>| Ctrl + \          | Split editor view    |<br>--------------------------------------------<br>| Ctrl + ,          | Settings             |<br>--------------------------------------------<br>| Ctrl + Shift + P  | Open palette         |<br>--------------------------------------------<br>| Ctrl + B          | Show sideBar         |<br>--------------------------------------------<br>| Shift + Click     | Fold all regions     | <br>|                   | inside               |<br>--------------------------------------------<br>| Ctrl + D          | Select next          |<br>|                   | occurrence of        |<br>|                   | current selection    |<br>--------------------------------------------</pre><h3>Highlight</h3><p>If you don’t like semicolons and curly braces cluttering the code, you can use the <a href="https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-highlight">Highlight</a> extension to dim/hide them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*MLB6Hni74ybxs68hSE8D7g.png" /><figcaption>Dimmed semicolons and curly braces</figcaption></figure><p>Here’s a <a href="https://stackoverflow.com/questions/76554077">link</a> to guide you through the setup process.</p><h3>Exclude file</h3><p>Go to settings and search for <em>exclude file</em>. Add the pattern that matches your file extension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*BABJLQBsz5dcDe7jRMPU_Q.png" /><figcaption>Excluding .exe and .vscode folder from sidebar</figcaption></figure><h3>Live Preview</h3><p><a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server">Live Preview extension</a> is a very handy tool to preview html pages. It shows real-time edits and sets up a local server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6JHR22vE6pAfl5dhdywGnQ.gif" /></figure><p>Lastly, I’d love to hear from you! If you have any extensions or features that you find particularly helpful or interesting, please share your recommendations in the comments.</p><p>Happy coding :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdd7358ff682" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>