<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[ByteBullet]]></title><description><![CDATA[Weekly curated list of packages, news and technologies every junior or senior React/Typescript developer needs. Shot directly to your inbox each Saturday!]]></description><link>https://newsletter.bytebullet.dev</link><image><url>https://substackcdn.com/image/fetch/$s_!p_9S!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94d1f42-ab70-425b-b8f2-d6c4cf04a1d9_500x500.png</url><title>ByteBullet</title><link>https://newsletter.bytebullet.dev</link></image><generator>Substack</generator><lastBuildDate>Tue, 07 Apr 2026 19:07:26 GMT</lastBuildDate><atom:link href="https://newsletter.bytebullet.dev/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Tomáš Falešník]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[bytebullet@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[bytebullet@substack.com]]></itunes:email><itunes:name><![CDATA[Tomáš Falešník]]></itunes:name></itunes:owner><itunes:author><![CDATA[Tomáš Falešník]]></itunes:author><googleplay:owner><![CDATA[bytebullet@substack.com]]></googleplay:owner><googleplay:email><![CDATA[bytebullet@substack.com]]></googleplay:email><googleplay:author><![CDATA[Tomáš Falešník]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Collection of React and TS Learning Resources]]></title><description><![CDATA[A constantly growing collection of valuable resources which will be handy whether you are a beginner or seasoned developer!&#128293;]]></description><link>https://newsletter.bytebullet.dev/p/collection-of-react-and-ts-learning</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/collection-of-react-and-ts-learning</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sun, 27 Aug 2023 19:12:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!W5Af!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi! It&#8217;s <strong><a href="https://twitter.com/ByteBulletDev">Tom&#225;&#353;</a></strong>, and I'm thrilled to present this week's edition of ByteBullet. Over the past month, I've been repeatedly asked for recommendations on best practices, design patterns and learning resources. As a result, I've put together this edition, which I intend to keep up to date! So, whether you want to revisit a specific resource or embark on a new learning journey, you can always bookmark this edition for easy access!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Want to stay up to date? Consider subscribing, it would make my day! &#9829;&#65039;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W5Af!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W5Af!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 424w, https://substackcdn.com/image/fetch/$s_!W5Af!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 848w, https://substackcdn.com/image/fetch/$s_!W5Af!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!W5Af!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W5Af!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg" width="507" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:507,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72274,&quot;alt&quot;:&quot;What should I learn as a front end developer meme&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What should I learn as a front end developer meme" title="What should I learn as a front end developer meme" srcset="https://substackcdn.com/image/fetch/$s_!W5Af!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 424w, https://substackcdn.com/image/fetch/$s_!W5Af!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 848w, https://substackcdn.com/image/fetch/$s_!W5Af!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!W5Af!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6689b32-6a92-438a-acb4-a8eea6274200_507x500.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">A classy meme</figcaption></figure></div><p>Regardless of your level of experience, whether you're a seasoned developer or just starting out, I believe you'll discover at least one valuable resource within this collection. It's designed to expand over time, so if you have any suggestions for resources that you think should be highlighted, don't hesitate to reach out to me! Without any more delay, let's dive right into the edition!</p><h3>Just for the juniors among us</h3><p>I know that many of my readers are probably juniors, college students or generally people, who might not have that much work experience. Thus I selected a few learning sources, that cover the basics that are needed even before starting your React/Typescript journey!</p><ul><li><p><strong><a href="https://javascript.info/">javascript.info</a></strong></p><ul><li><p>complete starter for your JS journey before you embark in to the world of Typescript</p></li></ul></li><li><p><strong><a href="https://www.codestackr.com/blog/web-development-roadmap-2023">2023 Web Development Beginner Roadmap</a></strong></p></li><li><p><strong><a href="https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html">Typescript for the New Programmer</a></strong></p></li><li><p><strong><a href="https://www.freecodecamp.org/news/top-javascript-concepts-to-know-before-learning-react/">Basic JS Concepts Before Learning React</a></strong></p></li><li><p><strong><a href="https://roadmap.sh/frontend">Frontend Developer Roadmap.sh</a></strong></p><ul><li><p>An interactive roadmap where you can view which topics you should learn on the developer path you take</p></li></ul></li></ul><h3>Read the docs!</h3><p>Documentation is one of the most important places to start, especially when you are dealing with React and Typescript, as their documentation is pristine and has quite a low friction when you know basic JS and web concepts.</p><ul><li><p><strong><a href="https://react.dev">react.dev</a></strong></p></li><li><p><strong><a href="https://www.typescriptlang.org/docs/">typescriptlang.org</a> </strong>(read their amazing handbook)</p></li></ul><h3>And the Spicy Stuff &#127798;</h3><p>After you are finished with the docs (or at least have some basic knowledge) Then I recommend to read the following:</p><ul><li><p><strong><a href="https://github.com/type-challenges/type-challenges">type-challenges</a></strong></p><ul><li><p>A collection of Typescript challenges with an online judge</p></li></ul></li><li><p><strong><a href="https://basarat.gitbook.io/typescript/">Typescript Deep Dive</a></strong></p></li><li><p><strong><a href="https://www.patterns.dev/posts/reactjs">React Design Patterns</a> </strong></p><ul><li><p>This is an amazing resource on various design patterns from which can many be utilized also outside of React. Although this particular knowledge base might be a bit overwhelming for beginner programmers. I would recommend this to juniors and above.</p></li></ul></li><li><p><strong><a href="https://usehooks.com">usehooks.com</a></strong></p><ul><li><p>Many useful React hook that you might need already implemented, tested and maintained</p><p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/collection-of-react-and-ts-learning?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/collection-of-react-and-ts-learning?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p></li></ul></li></ul><h2>Other Editions that might Interest you</h2><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;dda3ba34-065e-446e-9ffc-3fa2a6cbf8fd&quot;,&quot;caption&quot;:&quot;Hey, it&#8217;s Tom&#225;&#353;! I hope you enjoy this newsletter as much as I do! &#9829;&#65039; If you have any tools, topics, library you would like to see featured, or just want to say hi, then consider joining my discord server, dm or mail directly. Without further ado, let&#8217;s shoot straight into this weeks edition!&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;#06: My favorite client side API stack&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:148184027,&quot;name&quot;:&quot;Tom&#225;&#353; Fale&#353;n&#237;k&quot;,&quot;bio&quot;:&quot;Senior React and TypeScript developer with 5+ years of experience.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1149ff41-ba69-44ac-b4b6-e8e0c86fd46d_640x799.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2023-08-12T08:52:04.447Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.bytebullet.dev/p/06-my-favorite-client-side-api-stack&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:135943613,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;ByteBullet&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94d1f42-ab70-425b-b8f2-d6c4cf04a1d9_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;1be255f1-38a1-4c37-b313-25a6edae523c&quot;,&quot;caption&quot;:&quot;Hey everyone! In last week&#8217;s edition we took a look at my favorite API client side stack where I mentioned we could completely remove any state management libraries and rely only on cache in react-query. But one question still persists: What if my app requires a global state?&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;#07: Current state of state management&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:148184027,&quot;name&quot;:&quot;Tom&#225;&#353; Fale&#353;n&#237;k&quot;,&quot;bio&quot;:&quot;Senior React and TypeScript developer with 5+ years of experience.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1149ff41-ba69-44ac-b4b6-e8e0c86fd46d_640x799.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2023-08-19T15:48:33.473Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.bytebullet.dev/p/07-current-state-of-state-management&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:136200492,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:1,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;ByteBullet&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94d1f42-ab70-425b-b8f2-d6c4cf04a1d9_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2>Do you have a valuable resource that you think others should see?</h2><p>I do not take this list as complete, I will be growing it! Thus if you have any resources you would like to share then dm me on twitter <strong><a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a></strong>, <strong><a href="mailto:thomas@bytebullet.dev">mail me</a></strong> or be one of the first people who join <strong><a href="https://discord.gg/QkCvgJHete">my Discord server</a></strong>!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Want to stay up to date? Want to support me in making ByteBullet? Then subscribe! &#9829;&#65039;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[#07: Current state of state management]]></title><description><![CDATA[What are current options for state management? Why would I need a state manager? What is relevant? What is maintained? Everything answered in this edition! &#128293;]]></description><link>https://newsletter.bytebullet.dev/p/07-current-state-of-state-management</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/07-current-state-of-state-management</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 19 Aug 2023 15:48:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7CFK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone! In <strong><a href="https://newsletter.bytebullet.dev/p/06-my-favorite-client-side-api-stack">last week&#8217;s edition</a></strong> we took a look at my favorite API client side stack where I mentioned we could completely remove any state management libraries and rely only on cache in <strong><a href="https://tanstack.com/query/latest/">react-query</a></strong>. But one question still persists:</p><div class="pullquote"><p>What if my app requires a global state?</p></div><p>Here is what's in store to answer the question above (text highlighted red is a link):</p><ul><li><p>Why do I need a state manager?</p></li><li><p><strong><a href="https://recoiljs.org">Recoil</a> </strong>- atomic approach, created by Facebook, simple</p></li><li><p><strong><a href="https://jotai.org">Jotai</a></strong> - atomic approach, more features than <strong><a href="https://recoiljs.org">Recoil</a> </strong>(out of the box)</p></li><li><p><strong><a href="https://redux.js.org">Redux</a> </strong>- dispatch events which change state, a lot of boilerplate code</p></li><li><p><strong><a href="https://github.com/pmndrs/zustand">Zustand</a> </strong>- supercharged useState</p></li><li><p><strong><a href="https://hookstate.js.org">Hookstate</a></strong> - supercharged useState</p></li><li><p><strong><a href="https://mobx.js.org/README.html">Mobx</a></strong> - pure JS with adapters for react, state in classes</p></li><li><p><strong><a href="https://effector.dev/docs/recipes/react/counter">Effector</a></strong> - pure JS with adapters for react, create effects and dispatch them on stores</p></li><li><p><strong><a href="https://valtio.pmnd.rs">Valtio</a></strong> - wrap your initial state in a proxy and then directly modify it, resulting in change propagation</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/07-current-state-of-state-management?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/07-current-state-of-state-management?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></li></ul><h2>Why do I need a state manager?</h2><p>Let&#8217;s take for example a simple todo list app. One might not need a state manager if the app only creates, displays, edits and deletes (<strong><a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete">CRUD</a></strong>) the entries with an API. Everything can be done with a simple <code>fetch</code> and basic react constructs or to be future proof with <strong><a href="https://tanstack.com/query/latest/">react-query</a> </strong>and it&#8217;s cache.</p><p>But imagine we want to add theme switching, complex notification system, undo/redo functionality or complete offline mode without an API. Each of these might require a global state depending on the use case and future plans with the app. </p><blockquote><p><strong>Adding global state is easy, reworking it is hard and removing it is fundamentally impossible</strong>. </p></blockquote><p>I have worked on an app where <strong><a href="https://redux.js.org">Redux</a> </strong>was used to only cache API calls and was intertwined with each aspect of the app. This would require a rewrite and refactor of each component in the app. </p><p>That is why I always use <strong><a href="https://tanstack.com/query/latest/">react-query</a></strong> as it satisfies 99% of all use cases. If it does not then I personally opt for <strong><a href="https://react.dev/learn/passing-data-deeply-with-context">context providers</a></strong> or atomic states (later on). But there are still use cases where robust global state managers are required. For example fully offline apps which do not sync with an API like an audio mixer, photo editor, simple note taking app, &#8230;</p><p>With everything out of my mind, let&#8217;s head straight into currently maintained and robust solutions for state management by implementing a simple counter app with each one of them.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/07-current-state-of-state-management?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/07-current-state-of-state-management?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Recoil</h2><p><strong><a href="https://recoiljs.org">Recoil</a></strong> is a simple but powerful tool made by Facebook which is the first on the list that utilizes the atomic approach to state management. You crate atoms (separate atomic state values) and then <em>use</em> hooks which work like <code>useSate</code>, but propagate to each component that uses them.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7CFK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7CFK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 424w, https://substackcdn.com/image/fetch/$s_!7CFK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 848w, https://substackcdn.com/image/fetch/$s_!7CFK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 1272w, https://substackcdn.com/image/fetch/$s_!7CFK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7CFK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png" width="1456" height="1349" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1349,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:252835,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7CFK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 424w, https://substackcdn.com/image/fetch/$s_!7CFK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 848w, https://substackcdn.com/image/fetch/$s_!7CFK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 1272w, https://substackcdn.com/image/fetch/$s_!7CFK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa106da4b-037c-45df-bf7b-79899f6d493d_1718x1592.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Jotai</h2><p><strong><a href="https://jotai.org">Jotai</a></strong> also utilizes atomic approach. It is similar to <strong><a href="https://recoiljs.org">Recoil</a></strong> but offers more functionality thanks to it&#8217;s built in utility features (storage, async, SSR, &#8230;) and integrations (tRPC, react-query, &#8230;) this means that you can have same developer facing interface for state management and API&#8217;s.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6uLf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6uLf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 424w, https://substackcdn.com/image/fetch/$s_!6uLf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 848w, https://substackcdn.com/image/fetch/$s_!6uLf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!6uLf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6uLf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png" width="1456" height="797" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:797,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176002,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6uLf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 424w, https://substackcdn.com/image/fetch/$s_!6uLf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 848w, https://substackcdn.com/image/fetch/$s_!6uLf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!6uLf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d5cd165-b382-4f0c-a1ef-ec866e73d4ce_1944x1064.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Redux</h2><p><strong><a href="https://redux.js.org">Redux</a> </strong>was the go-to global state management library for a long time. But these days it requires more boiler plate code than others. It has reducers which are combined into one store. You dispatch actions, which are then caught by the reducers and they modify the state in the store accordingly. </p><p>They created <strong><a href="https://redux-toolkit.js.org">redux-toolkit</a> </strong>which mostly addresses the boilerplate problem, but still <strong><a href="https://redux.js.org">Redux</a></strong> requires quite a lot of setup in comparison to other libraries so I opted to link <strong><a href="https://redux-toolkit.js.org/tutorials/quick-start">their</a> </strong>example of a counter app implementation using <strong><a href="https://redux-toolkit.js.org">redux-toolkit</a> </strong>which will make more sense then me just showing here one component and an implementation of <strong><a href="https://redux-toolkit.js.org/api/createSlice">slice</a></strong> from <strong><a href="https://redux-toolkit.js.org">redux-toolkit</a></strong>.</p><h2>Zustand</h2><p><strong><a href="https://github.com/pmndrs/zustand">Zustand</a></strong> is the weird kid on the block, but in a good way. It works by creating a store which contains values and modification functions. Thus the data is fully encapsulated. This is good because you have a consistent interface and you are less likely to duplicate code.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-7uO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-7uO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 424w, https://substackcdn.com/image/fetch/$s_!-7uO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 848w, https://substackcdn.com/image/fetch/$s_!-7uO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 1272w, https://substackcdn.com/image/fetch/$s_!-7uO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-7uO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png" width="1456" height="698" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:698,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:152961,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-7uO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 424w, https://substackcdn.com/image/fetch/$s_!-7uO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 848w, https://substackcdn.com/image/fetch/$s_!-7uO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 1272w, https://substackcdn.com/image/fetch/$s_!-7uO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee9895a1-08e1-4dd5-a807-9445c458466f_1944x932.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/07-current-state-of-state-management?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/07-current-state-of-state-management?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2>Hookstate</h2><p><strong><a href="https://hookstate.js.org">Hookstate</a> </strong>creates a state using the <code>hookstate</code> function. This store can be manipulated directly from outside or using hooks from inside react components. That is pretty much it. I strongly suggest you to take a look at the examples they give on their web.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5D2b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5D2b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 424w, https://substackcdn.com/image/fetch/$s_!5D2b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 848w, https://substackcdn.com/image/fetch/$s_!5D2b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!5D2b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5D2b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png" width="1456" height="797" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:797,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:174370,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5D2b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 424w, https://substackcdn.com/image/fetch/$s_!5D2b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 848w, https://substackcdn.com/image/fetch/$s_!5D2b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!5D2b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fee9980-0193-432f-96a1-c7bfdd5490cf_1944x1064.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Mobx</h2><p><strong><a href="https://mobx.js.org/README.html">Mobx</a> </strong>is also one of the older state managers. It is pure JS (can be used without react) and also has adapters for react. It utilizes JS classes which completely encapsulate the whole state. It is quite complex to show a fully self explanatory code example. Code is more than words. Go take a look at their website! </p><h2>Effector</h2><p><strong><a href="https://effector.dev/docs/recipes/react/counter">Effector</a> </strong>works by calling events, which you define, that Stores subscribe to. It has pretty simple functional API even tho the description can be a bit intimidating.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G-9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G-9y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 424w, https://substackcdn.com/image/fetch/$s_!G-9y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 848w, https://substackcdn.com/image/fetch/$s_!G-9y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 1272w, https://substackcdn.com/image/fetch/$s_!G-9y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G-9y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png" width="1456" height="621" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d2394034-326a-4065-b554-e79566bfc2da_2184x932.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:621,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:159956,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!G-9y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 424w, https://substackcdn.com/image/fetch/$s_!G-9y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 848w, https://substackcdn.com/image/fetch/$s_!G-9y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 1272w, https://substackcdn.com/image/fetch/$s_!G-9y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2394034-326a-4065-b554-e79566bfc2da_2184x932.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Valtio</h2><p><strong><a href="https://valtio.pmnd.rs">Valtio</a> </strong>is quite interesting as it utilizes a proxy around your initial state that can be modified directly. It is similar to the <strong><a href="https://github.com/pmndrs/zustand">Zustand</a></strong> API but with one layer of abstraction removed. Each one has it&#8217;s use cases, so if you are deciding between these two, then I recommend to compare the docs directly. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wGCS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wGCS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 424w, https://substackcdn.com/image/fetch/$s_!wGCS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 848w, https://substackcdn.com/image/fetch/$s_!wGCS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!wGCS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wGCS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png" width="1456" height="635" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:635,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:183421,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wGCS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 424w, https://substackcdn.com/image/fetch/$s_!wGCS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 848w, https://substackcdn.com/image/fetch/$s_!wGCS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!wGCS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34d8eccc-64ba-47ea-bc61-ebb11b82c843_2438x1064.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>What would you choose?</h2><p>I would personally choose jotai as it offers both ease of use and extensibility via different integrations. <strong>What would you choose and why?</strong> <strong><a href="https://twitter.com/ByteBulletDev">Dm</a>,</strong> <strong><a href="mailto:thomas@bytebullet.dev">mail</a></strong> or join my <strong><a href="https://discord.gg/QkCvgJHete">discord server</a></strong>, where we can chat directly!</p><p>It took me some time to gather this information and it would make my day, if you would join my newsletter! &#9829;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><strong>ByteBullet</strong> is reader supported. Join other Software Engineers who receive this newsletter weekly each Saturday!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[#06: My favorite client side API stack]]></title><description><![CDATA[Hey! This week we take a look into my (currently) most favorite API client side stack. Axios as an API client and react-query as the "state" management hedgehog.]]></description><link>https://newsletter.bytebullet.dev/p/06-my-favorite-client-side-api-stack</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/06-my-favorite-client-side-api-stack</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 12 Aug 2023 08:52:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hey, it&#8217;s <strong><a href="https://twitter.com/ByteBulletDev">Tom&#225;&#353;</a>!</strong> I hope you enjoy this newsletter as much as I do! &#9829;&#65039;</em></p><p><em>If you have any <strong>tools</strong>, <strong>topics</strong>, <strong>library</strong> you would like to see <strong>featured</strong>, or just want to <strong>say hi</strong>, then consider joining my <strong><a href="https://discord.gg/QkCvgJHete">discord server</a>,</strong> <strong><a href="https://twitter.com/ByteBulletDev">dm</a></strong> or <strong><a href="mailto:thomas@bytebullet.dev">mail</a> </strong>directly.</em></p><p>Without further ado, let&#8217;s shoot straight into this weeks edition!</p><div class="pullquote"><p>How would <strong>you</strong> implement client side REST API?</p></div><p>A question that sparked this edition and more editions to come when I was having a beer with friends last week. In this issue, we are going to take a look at my most favorite client side REST API stack implementation in React and Typescript.</p><p>Here is what&#8217;s in store today:</p><ul><li><p><strong><a href="https://axios-http.com/docs/intro">Axios</a> </strong>- API client that (almost) everybody knows</p></li><li><p><strong><a href="https://tanstack.com/query/v3/">react-query</a></strong> - powerful declarative caching enterprise level wrapper around API calls</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p></li></ul><h2>Axios</h2><p>99% of you probably know <strong><a href="https://axios-http.com/docs/intro">Axios</a></strong>, but I would describe it as the standard in current web dev when talking about API calls. It allows you to create a client instance where you define the API root with all of the necessary headers that you require to then simply reuse and create REST request just on the required endpoints.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SMov!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SMov!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 424w, https://substackcdn.com/image/fetch/$s_!SMov!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 848w, https://substackcdn.com/image/fetch/$s_!SMov!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 1272w, https://substackcdn.com/image/fetch/$s_!SMov!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SMov!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png" width="1456" height="1059" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1059,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:189341,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SMov!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 424w, https://substackcdn.com/image/fetch/$s_!SMov!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 848w, https://substackcdn.com/image/fetch/$s_!SMov!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 1272w, https://substackcdn.com/image/fetch/$s_!SMov!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb059f6b-4f35-4afe-954d-f8fd24e30f78_1700x1236.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Notable mention here is generic <code>fetch</code> function in JS/TS which is great for single use scripts where you don&#8217;t want to bundle in any other unnecessary dependencies to reduce the size of the script. But I would personally not recommended this for large applications as it lacks the nice to have features which <strong><a href="https://axios-http.com/docs/intro">Axios</a></strong> has.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/06-my-favorite-client-side-api-stack?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/06-my-favorite-client-side-api-stack?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2>react-query</h2><p><strong><a href="https://tanstack.com/query/v3/">react-query</a> </strong>+ <strong><a href="https://axios-http.com/docs/intro">Axios</a> </strong>is my go to stack for client side implementation of API fetching. It is beginner friendly and  it allows you to completely ditch the global state which was the golden standard for some past years. </p><p>With <strong><a href="https://tanstack.com/query/v3/">react-query</a></strong> you create <em><a href="https://tanstack.com/query/v4/docs/react/guides/mutations">mutators</a></em> (which do changes) and <em><a href="https://tanstack.com/query/v4/docs/react/guides/queries">queries</a> </em>(which read data). You use and <strong>reuse</strong> these in combination with API request functions (can be <code>fetch</code>, <strong><a href="https://axios-http.com/docs/intro">Axios</a></strong>,<strong> </strong>or any other API client) which you define. It supports a fully fledged cache system with tag invalidation and  pagination, suspense, query cancellation, optimistic updates, &#8230;</p><h3><em><strong>How do you replace the global state?</strong>  </em></h3><p>When you do a classic <em>query</em> with <code>fetch</code> you just take the data, push them through some logic, store them somewhere and maintain the state for next request, refresh&#8230; All this work to just work with an API and probably stored in <strong><a href="https://redux.js.org">redux</a></strong> and in a better case fetched with <strong><a href="https://redux-toolkit.js.org/rtk-query/overview">rtk-query</a> </strong>which I <em>controversially</em> consider <em>bloatware</em> in <strong>new projects. </strong></p><p>This creates unnecessary spaghetti code and the old looking JS-like typescript, promise nesting, etc&#8230; Nobody want&#8217;s this (<em>Note: rtk-query is fine if you are stuck with redux in an old project</em>) </p><p>This package brings cache into play, where you can define custom hooks to reuse the queries/mutators, which return the desired data from cache or fetch them if they are not in the cache. Then if you want to update the data, you create mutator, which invalidates the cache. If you use the query hook in 100 places then only one request is made and the data is then distributed among all of the hook calls.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h3>Give me the code already!</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JDpz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JDpz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 424w, https://substackcdn.com/image/fetch/$s_!JDpz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 848w, https://substackcdn.com/image/fetch/$s_!JDpz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 1272w, https://substackcdn.com/image/fetch/$s_!JDpz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JDpz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png" width="1456" height="1675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1675,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:369517,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JDpz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 424w, https://substackcdn.com/image/fetch/$s_!JDpz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 848w, https://substackcdn.com/image/fetch/$s_!JDpz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 1272w, https://substackcdn.com/image/fetch/$s_!JDpz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe554335c-f326-4a66-8528-de3c8e15614c_1916x2204.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!anQT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!anQT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 424w, https://substackcdn.com/image/fetch/$s_!anQT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 848w, https://substackcdn.com/image/fetch/$s_!anQT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 1272w, https://substackcdn.com/image/fetch/$s_!anQT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!anQT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png" width="1456" height="1408" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1408,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:274797,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!anQT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 424w, https://substackcdn.com/image/fetch/$s_!anQT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 848w, https://substackcdn.com/image/fetch/$s_!anQT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 1272w, https://substackcdn.com/image/fetch/$s_!anQT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b40d1bc-297b-4e1f-b277-46e3b0d8a774_1642x1588.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!glnq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!glnq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 424w, https://substackcdn.com/image/fetch/$s_!glnq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 848w, https://substackcdn.com/image/fetch/$s_!glnq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 1272w, https://substackcdn.com/image/fetch/$s_!glnq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!glnq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png" width="1456" height="908" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:908,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148742,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!glnq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 424w, https://substackcdn.com/image/fetch/$s_!glnq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 848w, https://substackcdn.com/image/fetch/$s_!glnq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 1272w, https://substackcdn.com/image/fetch/$s_!glnq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3056586e-f11a-44c4-99ef-6908f39611c8_1700x1060.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Using this approach you can completely build your app state management on <strong><a href="https://tanstack.com/query/v3/">react-query</a></strong> relying on cache, cache invalidation and on optimistic updates.</p><blockquote><p><em>Note: <a href="https://tanstack.com/query/v4/">react-query V4</a> enables by default <a href="https://tkdodo.eu/blog/react-query-render-optimizations#tracked-queries">tracked queries</a>. This will result for </em><code>useUser </code><em>in notifying us when any of the fields </em><code>data</code>, <code>isLoading</code>, <code>isError</code> change</p></blockquote><h2>Did you like this weeks edition?</h2><p>Do you want me to do this kind of write up style around packages, maybe even more often than once a week or just want to say &#8220;<em>hi&#8221;</em>? Then <strong><a href="https://twitter.com/ByteBulletDev">dm</a></strong> or <strong><a href="mailto:thomas@bytebullet.dev">mail</a> </strong>me<strong> </strong>directly and consider joining my <strong><a href="https://discord.gg/QkCvgJHete">discord server</a>!</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">This newsletter is reader supported, so join other <strong>Software Engineers</strong> who receive this <strong>2-3 minute</strong> newsletter each week straight into their inbox. This would make my day!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Thanks for reading,<br><em>Tom&#225;&#353; Fale&#353;n&#237;k</em></p><p></p>]]></content:encoded></item><item><title><![CDATA[#05: Code generation at runtime with AI and other AI tools!]]></title><description><![CDATA[Hi! This week we take a closer look at AI tools for Typescript and React. Runtime code generation for Typescript. Sweep, the junior developer you always wanted. Other developer-focused tools!]]></description><link>https://newsletter.bytebullet.dev/p/05-code-generation-at-runtime-with</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/05-code-generation-at-runtime-with</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 05 Aug 2023 06:00:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GzNX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hey, it&#8217;s <strong><a href="https://twitter.com/ByteBulletDev">Tom&#225;&#353;</a>!</strong> I hope you enjoy this newsletter as much as I do! &#9829;&#65039;</em></p><p><em>If you have any <strong>tools</strong>, <strong>topics</strong>, <strong>library</strong> you would like to see <strong>featured</strong>, or just want to <strong>say hi</strong>, then consider joining my <strong><a href="https://discord.gg/QkCvgJHete">discord server</a>,</strong> dm or <strong><a href="mailto:thomas@bytebullet.dev">mail</a> </strong>directly.</em></p><div><hr></div><p>Welcome to this week&#8217;s edition of ByteBullet! This week we have a roundup of AI-powered developer tools and packages. </p><p>Here's a sneak peek of what's in store:</p><ul><li><p><strong><a href="https://github.com/jumploops/magic">magic</a> </strong>- AI run-time code generation for TypeScript</p></li><li><p><strong><a href="https://github.com/sweepai/sweep">Sweep</a></strong> - AI powered junior developer that does the tasks which nobody wants to do</p></li><li><p><strong><a href="https://vercel.com/blog/introducing-the-vercel-ai-sdk">Vercel AI SDK</a></strong> - toolkit which helps developers build AI products with React/Next.JS or Svelte/SvelteKit</p></li><li><p><strong><a href="https://github.com/coderabbitai/ai-pr-reviewer">ai-pr-reviewer</a> </strong>- automated GitHub PR reviews using GPT</p></li></ul><p>But before we dive into this weeks edition, please consider subscribing and sharing this issue with your colleagues and friends!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/05-code-generation-at-runtime-with?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/05-code-generation-at-runtime-with?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join other <strong>Software Engineers</strong> who read this newsletter and stay up to date with this <strong>weekly curated list</strong></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Magic</h2><p><strong><a href="https://github.com/jumploops/magic">Magic</a> </strong>is a tool that magically generates type safe functions at runtime in your code base. I personally think that this is a really cool usage of AI. The project was partially also generated by AI. But I would categorize <strong><a href="https://github.com/jumploops/magic">Magic</a> </strong>as an esoteric proof of concept tool. Give it a try and open a PR if you find any problems.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GzNX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GzNX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 424w, https://substackcdn.com/image/fetch/$s_!GzNX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 848w, https://substackcdn.com/image/fetch/$s_!GzNX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 1272w, https://substackcdn.com/image/fetch/$s_!GzNX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GzNX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png" width="1456" height="751" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:751,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:116545,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GzNX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 424w, https://substackcdn.com/image/fetch/$s_!GzNX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 848w, https://substackcdn.com/image/fetch/$s_!GzNX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 1272w, https://substackcdn.com/image/fetch/$s_!GzNX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ed1da3d-0410-4eca-b83e-9a4201e3a81f_1798x928.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Sweep</h2><p><strong><a href="https://github.com/sweepai/sweep">Sweep</a></strong> is an AI junior developer that transforms bug reports &amp; feature requests into code changes. You just simply add it to your GitHub repository and prefix your issues or PRs with <code>&#8220;Sweep: &#8220;</code>. Their pricing is also very generous compared to other AI tools. You get unlimited GPT3.5 tickets and 5 GPT4 credits which are used when a pr is created for example.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Vercel AI SDK</h2><p><strong><a href="https://vercel.com/blog/introducing-the-vercel-ai-sdk">Vercel AI SDK</a> </strong>carries a very well known name &#8220;<strong>Vercel</strong>&#8221; and that also reflects the quality of the package. This package allows you to seamlessly integrate AI tools into your React and Svelte projects e2e. It includes integration beginning  from Next.JS all the way up to React. So all bells and whistles included!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5iKe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5iKe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 424w, https://substackcdn.com/image/fetch/$s_!5iKe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 848w, https://substackcdn.com/image/fetch/$s_!5iKe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!5iKe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5iKe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png" width="1456" height="1153" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1153,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:200593,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5iKe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 424w, https://substackcdn.com/image/fetch/$s_!5iKe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 848w, https://substackcdn.com/image/fetch/$s_!5iKe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!5iKe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5faefb3a-aff7-4484-9c8b-dae9a99bc83b_1838x1456.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/05-code-generation-at-runtime-with?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/05-code-generation-at-runtime-with?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2>AI Powered PR Review</h2><p><strong><a href="https://github.com/coderabbitai/ai-pr-reviewer">ai-pr-reviewer</a> </strong>is a GitHub <strong>Action</strong> that many people would find useful in their projects. It utilizes OpenAI to go through your PRs via GitHub Actions and summarize, find bugs, give line by line suggestions and much more. It also has incremental file reviews that save on cost, because only changed files are reviewed. Give it a try if you have your OpenAI API key!</p><h2>That's it!</h2><p>If you enjoyed this edition or want to suggest your package for next one then consider liking, leaving a comment or dm me on <strong><a href="https://discord.gg/QkCvgJHete">discord</a></strong>/<strong><a href="https://twitter.com/ByteBulletDev">twitter</a>. </strong></p><p>PS: We are going to be talking about ways and tools that can be used to implement client side API. Subscribe so you don&#8217;t miss out!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">This newsletter is reader supported, so join other <strong>Software Engineers</strong> who receive this <strong>2 minute</strong> <strong>curated</strong> list each week straight into their inbox. This would make my day!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[#04: Solito, ts-rest, Nativewind, typed-memo.ts]]></title><description><![CDATA[React Native + Next.js = &#9829;&#65039;. Incrementally adaptable API typing with ts-reset. Tailwind in React Native. Did you know React.memo does not accept generics?]]></description><link>https://newsletter.bytebullet.dev/p/04-solito-ts-reset-nativewind-typed</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/04-solito-ts-reset-nativewind-typed</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 29 Jul 2023 06:01:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!KtQk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="pullquote"><p>A word from me. If you enjoy my content, then let your friends or colleagues know using the button below. Me and your friends will greatly appreciate that because every developer will utilize this curated collection of packages and technologies! </p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/04-solito-ts-reset-nativewind-typed?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/04-solito-ts-reset-nativewind-typed?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p>Welcome to this weeks edition of ByteBullet. This week we are heading into React Native territory but we still have great TypeScript libraries included.</p><p>Here&#8217;s a sneak peak of what&#8217;s in store:</p><ul><li><p><strong><a href="https://solito.dev">Solito</a></strong> - The missing piece for using React Native with Next.js to build cross-platform apps</p></li><li><p><strong><a href="https://ts-rest.com">ts-rest</a></strong> - Incrementally adoptable type-safety for your new and existing APIs</p></li><li><p><strong><a href="https://www.nativewind.dev">Nativewind</a></strong> - Use Tailwind in React Native to build cross platform apps using universal style system</p></li><li><p><strong><a href="https://gist.github.com/muningis/d86a92ba64373389dd9cb99b7b922831">typed-memo.ts</a></strong> - The missing piece in <a href="https://www.npmjs.com/package/@total-typescript/ts-reset">@total-typescript/ts-reset</a> which fixes generic type safety in <code>React.memo</code></p></li></ul><p>But before we shoot straight into this weeks edition<strong>, let me ask you a question:</strong></p><div class="pullquote"><p>Do you have a <strong>library</strong>, <strong>technology</strong>, <strong>opinion</strong> or just want to <strong>say &#8220;hi&#8221;</strong>?</p></div><p>Then do not hesitate to hit me up on twitter <strong><a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a></strong> or reply to this email directly!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Solito</h2><p><strong><a href="https://solito.dev">Solito</a></strong> is a cross platform framework targeting react-native + Next.js stack. It can be used to create cross platform apps. Solito was featured as #3 on the front page of Hackernews. It can be used in combination with <strong><a href="https://nativebase.io">Nativebase</a></strong>, <strong><a href="https://www.nativewind.dev">Nativewind</a></strong> or other cross platform UI frameworks to build great and easy to manage projects.</p><p>This is a bigger project to fit into a simple code snippet, thus I advise you to take a look and give some luck to the <strong><a href="https://solito.dev">Solito</a></strong> project by <strong><a href="https://fernandorojo.co">Fernando Rojo</a></strong>.</p><h2>ts-rest</h2><div><hr></div><p><em>EDIT: We are going to talk about <strong><a href="https://ts-rest.com">ts-rest</a> </strong>project, which is a full ecosystem of packages which brings adoptable type-safety into your projects. </em></p><p><em>I have mistakenly addressed <strong><a href="https://www.npmjs.com/package/@total-typescript/ts-reset">@total-typescript/ts-reset</a></strong> before which fixes several TypeScript typing issues. We are going to talk about it next Saturday!</em></p><div><hr></div><p><strong><a href="https://ts-rest.com">ts-rest</a></strong> is an incrementally adoptable type-safety system for your new and existing APIs. This is not just one package, this is a full ecosystem with adapters built for many notable tools like <em>react-query, solid-query, express, next and more&#8230;</em> Take a look at the following code example taken from their website!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KtQk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KtQk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 424w, https://substackcdn.com/image/fetch/$s_!KtQk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 848w, https://substackcdn.com/image/fetch/$s_!KtQk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 1272w, https://substackcdn.com/image/fetch/$s_!KtQk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KtQk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png" width="1456" height="1123" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1123,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:177185,&quot;alt&quot;:&quot;ts-rest client code example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ts-rest client code example" title="ts-rest client code example" srcset="https://substackcdn.com/image/fetch/$s_!KtQk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 424w, https://substackcdn.com/image/fetch/$s_!KtQk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 848w, https://substackcdn.com/image/fetch/$s_!KtQk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 1272w, https://substackcdn.com/image/fetch/$s_!KtQk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c50ca3-2ed2-443b-8b37-44432dcb6d16_1602x1236.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">ts-rest client code example</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DKJB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DKJB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 424w, https://substackcdn.com/image/fetch/$s_!DKJB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 848w, https://substackcdn.com/image/fetch/$s_!DKJB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 1272w, https://substackcdn.com/image/fetch/$s_!DKJB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DKJB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png" width="1456" height="1507" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1507,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:268924,&quot;alt&quot;:&quot;ts-rest contract code example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ts-rest contract code example" title="ts-rest contract code example" srcset="https://substackcdn.com/image/fetch/$s_!DKJB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 424w, https://substackcdn.com/image/fetch/$s_!DKJB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 848w, https://substackcdn.com/image/fetch/$s_!DKJB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 1272w, https://substackcdn.com/image/fetch/$s_!DKJB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfef23da-f6f8-466a-aa04-65710367491e_1662x1720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">ts-rest contract code example</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zkmO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zkmO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 424w, https://substackcdn.com/image/fetch/$s_!zkmO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 848w, https://substackcdn.com/image/fetch/$s_!zkmO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 1272w, https://substackcdn.com/image/fetch/$s_!zkmO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zkmO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png" width="1456" height="1226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1226,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:244841,&quot;alt&quot;:&quot;ts-rest server code example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ts-rest server code example" title="ts-rest server code example" srcset="https://substackcdn.com/image/fetch/$s_!zkmO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 424w, https://substackcdn.com/image/fetch/$s_!zkmO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 848w, https://substackcdn.com/image/fetch/$s_!zkmO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 1272w, https://substackcdn.com/image/fetch/$s_!zkmO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8652e42-dd25-4f4d-9712-9cd64efe6f85_1834x1544.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">ts-rest server code example</figcaption></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Nativewind</h2><p><strong><a href="https://www.nativewind.dev">Nativewind</a></strong> is a tool which uses <strong><a href="https://tailwindcss.com">Tailwind CSS</a> </strong>scripting language to build a universal style system for React Native, which can also be used on web using a simple babel plugin. It can be also used in combination with Next.js.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Jifk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jifk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 424w, https://substackcdn.com/image/fetch/$s_!Jifk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 848w, https://substackcdn.com/image/fetch/$s_!Jifk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 1272w, https://substackcdn.com/image/fetch/$s_!Jifk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jifk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png" width="1456" height="982" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:982,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:230413,&quot;alt&quot;:&quot;Nativewind code example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Nativewind code example" title="Nativewind code example" srcset="https://substackcdn.com/image/fetch/$s_!Jifk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 424w, https://substackcdn.com/image/fetch/$s_!Jifk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 848w, https://substackcdn.com/image/fetch/$s_!Jifk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 1272w, https://substackcdn.com/image/fetch/$s_!Jifk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf39bae4-49b5-4dd0-b060-56a844ddb987_1898x1280.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Nativewind code example</figcaption></figure></div><p>The code example above (taken from their official website) can be simplified using babel preprocessor, which automatically wraps each component with the <code>styled()</code> function. Head over to their <strong><a href="https://www.nativewind.dev">website</a></strong> and give them some love!</p><h2>typed-memo.ts</h2><p>And to finish off this edition we have a quick code snippet that <strong><a href="https://twitter.com/muningis">@munigis</a> </strong>suggested after <strong><a href="https://twitter.com/mattpocockuk">@mattpocockuk</a> </strong>created a pool asking:</p><blockquote><p>If there was a ts-reset/react, what would you add to it? Top of my list is forwardRef, but I'm not sure I want to add it alone.</p></blockquote><p><strong><a href="https://gist.github.com/muningis/d86a92ba64373389dd9cb99b7b922831">typed-memo.ts</a></strong> is a quick code snippet that fixes an issue that has been bothering react since the inception of <code>React.memo</code>. If you pass a generic to the component it will not give you type safe props.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cbSC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cbSC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 424w, https://substackcdn.com/image/fetch/$s_!cbSC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 848w, https://substackcdn.com/image/fetch/$s_!cbSC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!cbSC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cbSC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png" width="1456" height="914" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:914,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:182100,&quot;alt&quot;:&quot;typed-memo code example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="typed-memo code example" title="typed-memo code example" srcset="https://substackcdn.com/image/fetch/$s_!cbSC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 424w, https://substackcdn.com/image/fetch/$s_!cbSC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 848w, https://substackcdn.com/image/fetch/$s_!cbSC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!cbSC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdc24875-7df5-4be3-93b1-c9b442cbcd86_2108x1324.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">typed-memo code example</figcaption></figure></div><p>In the code example above, the usage of name attribute will not be typed, unless you use the <strong><a href="https://gist.github.com/muningis/d86a92ba64373389dd9cb99b7b922831">typed-memo.ts</a></strong> code snippet from above.</p><h2>See you next Saturday!</h2><p>Did you miss something? Want to talk about anything or just say hi? <em>Shoot</em> me a message <strong><a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a></strong> or reply to this email directly! &#9829;&#65039;</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Join other <strong>successful</strong> <strong>engineers</strong> who receive this curated list of packages and technologies every Saturday!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[#03: Cheating at React? Forget SASS/LESS, Prisma Pagination, Million, ArkType]]></title><description><![CDATA[Nesting coming to CSS, the ultimate Typescript + React cheatsheet, prisma pagination extension that no-one asked for and everybody loves, Million and ArkType validator!]]></description><link>https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 22 Jul 2023 10:00:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lbNo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to the third edition of the ByteBullet newsletter! We're back with another exciting lineup of topics that will pique your interest and keep you at the forefront of the latest developments.</p><p>In this edition, we'll be covering the following captivating subjects:</p><ul><li><p><a href="https://github.com/ibnumusyaffa/simple-react-typescript-cheatsheet">React TypeScript Cheatsheet</a> - your companion for mastering React with TypeScript</p></li><li><p><a href="https://developer.chrome.com/articles/css-nesting/">CSS Nesting</a> - finally coming to native css!</p></li><li><p><a href="https://github.com/deptyped/prisma-extension-pagination">Prisma Pagination Extension</a> - community driven extension that makes pagination in Prisma 100 times easier &#128293;</p></li><li><p><a href="https://million.dev">React Million</a> - 70% faster react?</p></li><li><p><a href="https://arktype.io">ArkType</a> - javascript runtime validation library that can infer TypeScript definitions 1:1 </p></li></ul><p>Before we delve into these exciting topics, don't forget to join the conversation on Twitter at <a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a>. Follow us for intriguing updates, engaging discussions on TypeScript and React, and much more. Feel free to drop us a message and be a part of our growing community!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>React TypeScript Cheatsheet</h2><p>Ever for get how to use <code>useRef</code> and <code>forwardRef</code>? Do that no more! This simple yet comprehensive cheatsheet will be your go to source for the things you do not use that often. It can be found <a href="https://github.com/ibnumusyaffa/simple-react-typescript-cheatsheet">here</a>.</p><h2>Is SASS/LESS&#8217;s Time Over?</h2><p>Native CSS nesting is a long debated feature (more on it <a href="https://developer.chrome.com/articles/css-nesting/">here</a>) which has been talked about even more recently. But will it replace the beloved preprocessors which we are used to? </p><p>Nesting in CSS preprocessors is one of the main features which help developers make readable and maintainable code. We must not forget that nesting is not the only feature CSS preprocessors bring us. Notable preprocessor features: functions, maps, mixins, &#8230;.</p><p>Bringing nesting in to native CSS is extremely useful, but it is still not fully supported. We will have to wait a little bit more to be able to fully utilize this over CSS preprocessors (<a href="https://caniuse.com/css-nesting">caniuse.com/css-nesting</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lbNo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lbNo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 424w, https://substackcdn.com/image/fetch/$s_!lbNo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 848w, https://substackcdn.com/image/fetch/$s_!lbNo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 1272w, https://substackcdn.com/image/fetch/$s_!lbNo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lbNo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png" width="1456" height="965" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:965,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:83271,&quot;alt&quot;:&quot;CSS Nesting code example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="CSS Nesting code example" title="CSS Nesting code example" srcset="https://substackcdn.com/image/fetch/$s_!lbNo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 424w, https://substackcdn.com/image/fetch/$s_!lbNo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 848w, https://substackcdn.com/image/fetch/$s_!lbNo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 1272w, https://substackcdn.com/image/fetch/$s_!lbNo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e798f2a-677c-4942-a89a-ca7f2d10c5b3_1466x972.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">CSS Nesting Example</figcaption></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting/comments"><span>Leave a comment</span></a></p><h2>Prisma Pagination Extension</h2><p>Prisma extensions are handy pieces of code which can be imported into prisma and used to simplify/shorten certain tasks for the end developer. Pagination is a known pain point for developers and thus <a href="https://github.com/deptyped/prisma-extension-pagination/tree/main">this</a> handy pagination extensions was made by the community.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QNG7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QNG7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 424w, https://substackcdn.com/image/fetch/$s_!QNG7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 848w, https://substackcdn.com/image/fetch/$s_!QNG7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 1272w, https://substackcdn.com/image/fetch/$s_!QNG7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QNG7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png" width="1456" height="1083" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1083,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:178392,&quot;alt&quot;:&quot;Prisma Pagination Code Example &quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Prisma Pagination Code Example " title="Prisma Pagination Code Example " srcset="https://substackcdn.com/image/fetch/$s_!QNG7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 424w, https://substackcdn.com/image/fetch/$s_!QNG7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 848w, https://substackcdn.com/image/fetch/$s_!QNG7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 1272w, https://substackcdn.com/image/fetch/$s_!QNG7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab8727a0-7675-4f9d-8c5e-21fbb5de9b99_1662x1236.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Prisma Pagination Example</figcaption></figure></div><p>It supports page number pagination and also cursor based pagination. It returns the need information by default (offset, nextPage, etc..). Basically it handles the most of the unwanted developer burden regarding pagination.</p><h2>Million</h2><p>I believe most of you have heard about million, the library that makes React 70% faster. I still want to share it with you as I think there might still a few people that might not know about it and could find it useful. I recommend either going to their <a href="https://million.dev">homepage</a> or <a href="https://www.youtube.com/watch?v=VkezQMb1DHw">this</a> video from fireship.</p><h2>ArkType</h2><p>And to end this weeks edition on a weird note: ArkType, the JS runtime validation no-one asked for, but we still got it. This is a continuation of edition #01 on validation where we mention Typia, the runtime validation that can compile TypeScript types and use it at runtime. If you have missed it check it out!</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;98cc787a-55b0-4f08-a37b-2ea65035615e&quot;,&quot;caption&quot;:&quot;TLDR; In this weeks issue: TS-Pattern - pattern matching in TS Typia - object validation against TS Interfaces react-charts - charts library from TanStack TypeScript 5.2 Beta Typescript + Haskell = &#9829;&#65039; I have stumbled upon a great library which helps with reducing the clutter that comes with messy switch statements and pattern matching.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;#01: Patterns, validations, charts, ...&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:148184027,&quot;name&quot;:&quot;Tom&#225;&#353; Fale&#353;n&#237;k&quot;,&quot;bio&quot;:&quot;Senior React and TypeScript developer.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9e77775-6dd5-4f3e-8a0d-949fc677be3e_144x144.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2023-07-08T16:03:13.469Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.bytebullet.dev/p/01-patterns-validations-charts&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:131206947,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:1,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;ByteBullet&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94d1f42-ab70-425b-b8f2-d6c4cf04a1d9_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>ArkType is a run time JS validator which can 1:1 infer TypeScript types and reuse them as highly optimized validation. It has its own extended version of validation rules, that can be applied to types. As always, code is more descriptive than words!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2w15!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2w15!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 424w, https://substackcdn.com/image/fetch/$s_!2w15!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 848w, https://substackcdn.com/image/fetch/$s_!2w15!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 1272w, https://substackcdn.com/image/fetch/$s_!2w15!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2w15!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png" width="1456" height="1149" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1149,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155564,&quot;alt&quot;:&quot;ArkType Code Example&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ArkType Code Example" title="ArkType Code Example" srcset="https://substackcdn.com/image/fetch/$s_!2w15!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 424w, https://substackcdn.com/image/fetch/$s_!2w15!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 848w, https://substackcdn.com/image/fetch/$s_!2w15!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 1272w, https://substackcdn.com/image/fetch/$s_!2w15!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdddc6a93-d7b3-4f95-a5cd-429f2a5cc6ba_1622x1280.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">ArkType Example</figcaption></figure></div><h2>Do you know any other notable library!</h2><p>And that is a wrap for this weeks edition! If you <strong>know</strong> any other <strong>library</strong>, <strong>notable mention</strong> or want to <strong>just chat</strong> about TypeScript and React, then do not hesitate and hit me up <strong><a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a></strong>, at <strong>thomas@bytebullet.dev</strong> or here in comments!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/p/03-cheating-at-react-million-arktype-css-nesting/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[#02: Strictly<T>, Effect-TS, Result<T>, Prisma 5.0]]></title><description><![CDATA[Discover Strict Object Types, Prisma is finally getting the long awaited speed boost and Bid Farewell to Exceptions with Results and Effects!]]></description><link>https://newsletter.bytebullet.dev/p/02-strictlyt-effect-ts-resultt-prisma</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/02-strictlyt-effect-ts-resultt-prisma</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 15 Jul 2023 06:01:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!n8gJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to the second edition of the ByteBullet newsletter! Get ready to dive into a range of fascinating topics that await you in this week's issue.</p><p>Here's a sneak peek of what's in store:</p><ul><li><p><a href="https://twitter.com/MananTank_/status/1677610004743086080?s=20">Strictly&lt;T&gt;</a> - strict object type you&#8217;ve always wanted</p></li><li><p><a href="https://github.com/prisma/prisma/releases/tag/5.0.0">Prisma 5.0</a> - the long awaited speed bump</p></li><li><p><a href="https://github.com/Effect-TS/effect">Effect-TS</a> - functional effect system for TS</p></li><li><p><a href="https://github.com/badrap/result">@badrap/result</a> - result type taking cues from Rust and Haskell</p></li></ul><p>But before we jump into these topics, I'd like to personally invite you to connect with me on Twitter at <a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a>. It's the place where I share intriguing updates and engage in discussions about TypeScript and React. Feel free to hit me up!</p><h2>Make it Strict</h2><p>You would expect the following code to compile with an error, because the <code>returnWhatIWant</code> function expects to return at least <code>Doggo.</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n8gJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n8gJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 424w, https://substackcdn.com/image/fetch/$s_!n8gJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 848w, https://substackcdn.com/image/fetch/$s_!n8gJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 1272w, https://substackcdn.com/image/fetch/$s_!n8gJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n8gJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png" width="1456" height="658" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:658,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99500,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!n8gJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 424w, https://substackcdn.com/image/fetch/$s_!n8gJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 848w, https://substackcdn.com/image/fetch/$s_!n8gJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 1272w, https://substackcdn.com/image/fetch/$s_!n8gJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd96e492-26c3-47e1-991a-e2b90e697793_1762x796.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The code works without any problems. Imagine we are not returning a dog but crucial user details, then this could result in data leaks. This is where the <a href="https://twitter.com/MananTank_/status/1677610004743086080?s=20">Strictly&lt;T&gt;</a> comes in handy.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!40lX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!40lX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 424w, https://substackcdn.com/image/fetch/$s_!40lX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 848w, https://substackcdn.com/image/fetch/$s_!40lX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 1272w, https://substackcdn.com/image/fetch/$s_!40lX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!40lX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png" width="1456" height="761" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:761,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:144834,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!40lX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 424w, https://substackcdn.com/image/fetch/$s_!40lX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 848w, https://substackcdn.com/image/fetch/$s_!40lX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 1272w, https://substackcdn.com/image/fetch/$s_!40lX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1056453a-7f05-4b76-9f3b-45affcca8e8c_1860x972.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I have to leave a note here. If you have any sensitive data or data that you are not 100% sure about, use a validator like Typia, zod or yup. If you have not heard about Typia then checkout my previous edition!</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;74d7525c-b0a1-42e8-ad62-519a79eab2d6&quot;,&quot;caption&quot;:&quot;TLDR; In this weeks issue: TS-Pattern - pattern matching in TS Typia - object validation against TS Interfaces react-charts - charts library from TanStack TypeScript 5.2 Beta Typescript + Haskell = &#9829;&#65039; I have stumbled upon a great library which helps with reducing the clutter that comes with messy switch statements and pattern matching.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;#01: Patterns, validations, charts, ...&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:148184027,&quot;name&quot;:&quot;Tomas Falesnik&quot;,&quot;bio&quot;:&quot;Senior React and TypeScript developer.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9e77775-6dd5-4f3e-8a0d-949fc677be3e_144x144.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2023-07-08T16:03:13.469Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://newsletter.bytebullet.dev/p/01-patterns-validations-charts&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:131206947,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;ByteBullet&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94d1f42-ab70-425b-b8f2-d6c4cf04a1d9_500x500.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2>Prisma 5.0 speed bump</h2><p>This week version 5.0 was released for the prisma project. It brings many features and improvements with the main highlight being the long awaited speed boost. They have achieved it thanks to replacing the <em>GraphQL</em> <em>like</em> protocol between the prisma client and query engine with <strong>jsonProtocol</strong>.</p><p>Sadly I cannot fit in all of the changes, so <a href="https://github.com/prisma/prisma/releases/tag/5.0.0">here</a> is the whole changelog.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Effect-TS (Haskell again?)</h2><p>Functional paradigm is a powerful toy when used correctly. This is where tools like <a href="https://github.com/Effect-TS/effect">Effect-TS</a> or <a href="https://github.com/gvergnaud/ts-pattern">TS-Pattern</a> from my previous edition come in. Effect brings you, the programmer, ability to effortlessly handle async operations, manage errors, and compose complex workflows in a concise and type-safe manner. With improved testability and enhanced code maintainability, Effect-TS unlocks new levels of productivity for TypeScript developers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bEPF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bEPF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 424w, https://substackcdn.com/image/fetch/$s_!bEPF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 848w, https://substackcdn.com/image/fetch/$s_!bEPF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!bEPF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bEPF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png" width="1456" height="1004" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1004,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:306174,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bEPF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 424w, https://substackcdn.com/image/fetch/$s_!bEPF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 848w, https://substackcdn.com/image/fetch/$s_!bEPF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!bEPF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb15d1822-550b-4986-8797-b08ff284aa70_2112x1456.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Result&lt;T&gt;</h2><p>And to finish this weeks round up we take a look at the <a href="https://github.com/badrap/result">@badrap/result</a>. This Type removes all the hassle from exception handling. As always, code is more descriptive than words:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eNJ-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eNJ-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 424w, https://substackcdn.com/image/fetch/$s_!eNJ-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 848w, https://substackcdn.com/image/fetch/$s_!eNJ-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 1272w, https://substackcdn.com/image/fetch/$s_!eNJ-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eNJ-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png" width="1456" height="774" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:774,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:160212,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eNJ-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 424w, https://substackcdn.com/image/fetch/$s_!eNJ-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 848w, https://substackcdn.com/image/fetch/$s_!eNJ-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 1272w, https://substackcdn.com/image/fetch/$s_!eNJ-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3d42547-3397-46af-83ce-fedefe77cd95_1994x1060.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The <strong>Result</strong> <strong>type</strong> is smart and knows what you are accessing. You can see that if you access <em>isErr</em>, then the <em>error </em> variable is available. The same goes for the <em>isOk</em> value.</p><h2>See you next Saturday!</h2><p>If you want to reach me, hit me up on twitter <a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a></p>]]></content:encoded></item><item><title><![CDATA[#01: Patterns, validations, charts, ...]]></title><description><![CDATA[Typescript meets Haskell, validating objects agains TS interfaces, charting reimagined and much more! I am very excited to announce the first issue of yours truly ByteBullet Newsletter.]]></description><link>https://newsletter.bytebullet.dev/p/01-patterns-validations-charts</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/01-patterns-validations-charts</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Sat, 08 Jul 2023 16:03:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>TLDR; In this weeks issue:</p><ul><li><p><a href="https://github.com/gvergnaud/ts-pattern">TS-Pattern</a> - pattern matching in TS</p></li><li><p><a href="https://typia.io/docs/validators/is/">Typia</a> - object validation against TS Interfaces</p></li><li><p><a href="https://codesandbox.io/s/github/tannerlinsley/react-charts/tree/beta/examples/simple">react-charts</a> - charts library from TanStack</p></li><li><p>TypeScript 5.2 Beta</p></li></ul><h1>Typescript + Haskell = &#9829;&#65039;</h1><p>I have stumbled upon a great library which helps with reducing the clutter that comes with messy switch statements and pattern matching. <a href="https://github.com/gvergnaud/ts-pattern">TS-Pattern</a> is &#8220;The exhaustive Pattern Matching library for TypeScript with smart type inference.&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MV7U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MV7U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 424w, https://substackcdn.com/image/fetch/$s_!MV7U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 848w, https://substackcdn.com/image/fetch/$s_!MV7U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 1272w, https://substackcdn.com/image/fetch/$s_!MV7U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MV7U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png" width="1456" height="1318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1318,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:269365,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MV7U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 424w, https://substackcdn.com/image/fetch/$s_!MV7U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 848w, https://substackcdn.com/image/fetch/$s_!MV7U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 1272w, https://substackcdn.com/image/fetch/$s_!MV7U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F923ad0af-6e6e-4288-8fd0-fd33f9654c6e_1980x1792.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Did you enjoy Haskell + TypeScript? Subscribe and share it with others!</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2></h2><h2>Typia</h2><p>Take a Typescript interface and slap it against any object at runtime and tell me if they are equal. Forget yup, zod or any other validation libraries. There is a new kid around the block: <a href="https://typia.io/docs/">Typia</a>. It does exactly as said in the beginning and has integrations with Prisma (enforce max length of a string, email, etc&#8230;)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FaT4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FaT4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 424w, https://substackcdn.com/image/fetch/$s_!FaT4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 848w, https://substackcdn.com/image/fetch/$s_!FaT4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 1272w, https://substackcdn.com/image/fetch/$s_!FaT4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FaT4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png" width="1456" height="1548" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1548,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:185503,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FaT4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 424w, https://substackcdn.com/image/fetch/$s_!FaT4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 848w, https://substackcdn.com/image/fetch/$s_!FaT4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 1272w, https://substackcdn.com/image/fetch/$s_!FaT4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd910906a-fb3e-4522-ae0c-17728ba5fe97_1765x1876.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Charts, charts, charts&#8230;</h2><p>Charts can be a bit of a pain point for a web developer. Thankfully libraries like <a href="https://github.com/recharts/recharts">Recharts</a> exist. But this week I have tried <a href="https://react-charts.tanstack.com">react-charts</a> from people at Tanstack. It allows you to quickly create powerful charts. Code has more descriptive abilities than words (at least in this case) so I recommend to take a look at <a href="https://codesandbox.io/s/github/tannerlinsley/react-charts/tree/beta/examples/simple">this CodeBox</a> example they have created.</p><h2>TypeScript 5.2 Beta</h2><p>Last week people at Microsoft announced the 5.2 beta of TypeScript. You can read more <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#decorator-metadata">here</a>. Quick summarization:</p><ul><li><p><code>using</code> Declarations and Explicit Resource Management</p></li><li><p><a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#decorator-metadata">Decorator Metadata</a></p></li><li><p><a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#named-and-anonymous-tuple-elements">Named and Anonymous Tuple Elements</a></p></li><li><p><a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#easier-method-usage-for-unions-of-arrays">Easier Method Usage for Unions of Arrays</a></p></li><li><p><a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#comma-completions-for-object-members">Comma Completions for Object Members</a></p></li><li><p><a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#inline-variable-refactoring">Inline Variable Refactoring</a></p></li><li><p><a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#breaking-changes-and-correctness-fixes">Breaking Changes and Correctness Fixes</a></p></li></ul><h2>See you next Saturday!</h2><p>If you want to reach me, hit me up on twitter <a href="https://twitter.com/ByteBulletDev">@ByteBulletDev</a></p>]]></content:encoded></item><item><title><![CDATA[#00: 📢 Coming Soon 🚀]]></title><description><![CDATA[Attention, coding enthusiasts!]]></description><link>https://newsletter.bytebullet.dev/p/coming-soon</link><guid isPermaLink="false">https://newsletter.bytebullet.dev/p/coming-soon</guid><dc:creator><![CDATA[Tomáš Falešník]]></dc:creator><pubDate>Thu, 25 May 2023 08:19:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94d1f42-ab70-425b-b8f2-d6c4cf04a1d9_500x500.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Attention, coding enthusiasts! We are excited to inform you about the upcoming release of our newsletter, <strong>ByteBullet</strong>. Tailored specifically for React and Typescript enthusiasts like you, ByteBullet aims to be the ultimate destination for staying updated on the latest news, trends, and valuable insights in the realm of these robust technologies.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.bytebullet.dev/subscribe?"><span>Subscribe now</span></a></p><h2>Why?</h2><p>Whether you're a seasoned developer or just starting your coding journey, our <strong>byte-packed newsletters</strong> will deliver a rapid-fire roundup of all things <strong>React</strong> and <strong>Typescript</strong>. Stay tuned as we aim to empower you with <strong>valuable resources, tutorials, best practices, and much more.</strong> Be prepared to level up your skills and keep your coding arsenal fully loaded. Subscribe now and get ready to experience the bullet-fast evolution of React and Typescript firsthand. Stay tuned for the launch of ByteBullet, your ultimate coding ammunition! &#128165;&#128293;</p><h2>Should I subscribe?</h2><p>It is up to you to subscribe now and unlock the power of <strong>ByteBullet</strong>! As a seasoned developer with 4+ years of experience in Typescript, React, GitOps/DevOps, and SRE, I've curated a newsletter that delivers the latest insights, news, and expert tips directly to your inbox. Don't miss out on the opportunity to supercharge your skills and stay ahead of the curve. Join the ByteBullet community today and ignite your coding journey!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.bytebullet.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Supercharge your coding journey. Subscribe to ByteBullet and level up today! </p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item></channel></rss>