<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prasath Ravichandran on Medium]]></title>
        <description><![CDATA[Stories by Prasath Ravichandran on Medium]]></description>
        <link>https://medium.com/@prasathravi?source=rss-d9d8585ecf68------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmJ61mSndvgpN2wlYTtXeg.jpeg</url>
            <title>Stories by Prasath Ravichandran on Medium</title>
            <link>https://medium.com/@prasathravi?source=rss-d9d8585ecf68------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:21:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prasathravi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Lynx — Is a New Era of mobile app development? ]]></title>
            <link>https://medium.com/@prasathravi/lynx-is-a-new-era-of-mobile-app-development-40b5b1a51af2?source=rss-d9d8585ecf68------2</link>
            <guid isPermaLink="false">https://medium.com/p/40b5b1a51af2</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[lynx]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[crossplatform-mobile-app]]></category>
            <dc:creator><![CDATA[Prasath Ravichandran]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 15:46:14 GMT</pubDate>
            <atom:updated>2025-03-12T15:55:53.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aRQOJvC524-VCXRH_QPTQg.png" /></figure><h3>Lynx — Is a New Era of mobile app development? 🙀📱</h3><p>A groundbreaking and revolutionary JavaScript framework has just emerged. Yesterday, ByteDance, the visionary company behind TikTok, unveiled an open-source, multi-platform app development framework called <a href="https://lynxjs.org/"><strong><em>Lynx</em></strong></a> 🐈. This blazing-fast framework has the potential to transform app development and inspire innovation.</p><p>Developers have the opportunity to set aside established frameworks such as <a href="https://react.dev/"><strong><em>React</em></strong></a> and <a href="https://flutter.dev/?gad_source=1&amp;gclid=Cj0KCQjw4cS-BhDGARIsABg4_J27OaNerzyzvLIRkLbMHxM-X5fFeLGMRbB1SMIofMY1Vw59URjZEaQaAtjoEALw_wcB&amp;gclsrc=aw.ds"><strong><em>Flutter</em></strong></a> in favor of creating native mobile applications from the ground up using innovative Rust-based tools and a high-performance dual-threaded UI rendering engine. One of the frameworks in question, Lynx, positions itself as an alternative to <a href="https://reactnative.dev/"><strong><em>React Native</em></strong></a>, allowing web developers to create mobile applications for iOS and Android using JavaScript.</p><p>However, Lynx claims to deliver smoother, <strong>pixel-perfect</strong> user interfaces and faster launch times compared to existing cross-platform tools. This raises an important question: Is Lynx a legitimate contender to replace React Native? In this article, we will explore Lynx’s capabilities to evaluate its effectiveness and potential as a development tool.</p><p>Lynx is a reliable framework used in <strong>high-traffic apps at TikTok</strong>, while it doesn’t run the main TikTok app where users post videos, it does support the search panel, TikTok Studio, and several other related apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bl2sGnyfzkqnOTRsbhWifw.jpeg" /></figure><h3>Why Lynx?</h3><p>In their official documentation, the primary concern highlighted is performance. From the beginning, many have blamed React Native for not being purely native. This issue stems from the <strong>single-threaded JavaScript bridge</strong>, which facilitates communication between JavaScript code and native code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vObEbmxEV4R9I6NspdrZuQ.png" /></figure><p>However, this single-threaded bridge can become a significant blockage, potentially leading to performance issues. The React Native team tackled the issue by developing a custom engine known as <a href="https://reactnative.dev/docs/hermes"><strong><em>Hermes</em></strong></a>, alongside the release of the fabric renderer a few years back. This innovation is often referred to as a bridge-less architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paITez-5I52UyyUDa9WtBg.png" /></figure><p>ByteDance has adopted a unique approach with Lynx by implementing a dual-threaded architecture that separates user code from framework code into two distinct run times.</p><p>The primary thread operates on <a href="https://github.com/lynx-family/primjs"><strong><em>Prim.js</em></strong></a>, which is built on <a href="https://bellard.org/quickjs/"><strong><em>Quick.js</em></strong></a>, a lightweight JavaScript engine designed to manage synchronous UI tasks like initial loading, high-priority event handling, and more. Meanwhile, user code runs in a separate background thread.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2F_5FqQr1bMmCtgNJW06w.png" /></figure><p>This setup keeps the main thread free of heavy workloads, ensuring that it remains responsive and non-blocking. This result in <strong><em>IFR(Instant first-frame rendering)</em></strong> and <strong><em>MTS(Main-thread scripting).</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*o3_RikVBFbew2kXLQNhprw.gif" /><figcaption><a href="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/killers/ifr.mp4">https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/killers/ifr.mp4</a></figcaption></figure><h3>Benefits of Lynx:</h3><ul><li>It is framework-specific, so you can build app using svelte, Vue or any other framework, not only React.</li><li>It supports actual native CSS features for styling like transition, animation, gradients, and so on.</li></ul><h3>Let’s develop mobile app in Lynx,</h3><p>When you kick off the project for the first time, you’ll spot <a href="https://rspack.dev/"><strong><em>Rspack</em></strong></a>, which is a module bundler based on Rust and kinda like Vite. It’ll set up a starter project for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQX63rTgvfwZUDq0e2CHIA.png" /></figure><h4>Installation:</h4><p>Create a new project using this command,</p><pre>npm create rspeedy@latest</pre><p>Once the boilerplate project is created, for Android it is straightforward to run the application, but in iOS it expects some extra steps, <a href="https://lynxjs.org/guide/start/quick-start.html#ios-simulator-platform=macos-arm64,explorer-platform=ios-simulator"><em>run in iOS simulator</em></a>. The starter template looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*gPDsHjQ7eLcOGf_wOqv0rQ.png" /></figure><h4>Create a component:</h4><p>Let’s create a Card component, create a new file called <strong><em>ImageCard.tsx</em></strong> and add the following code,</p><pre>type Picture = {<br>  width: number;<br>  height: number;<br>  src: string;<br>};<br><br>export default function ImageCard({ width, height, src }: Picture) {<br>  return (<br>    &lt;view className=&quot;picture-wrapper&quot;&gt;<br>      &lt;image<br>        className=&quot;image&quot;<br>        style={{ width: &#39;100%&#39;, aspectRatio: width / height }}<br>        src={src}<br>      /&gt;<br>    &lt;/view&gt;<br>  );<br>}</pre><p>then import the ImageCard component in the <strong><em>App.tsx</em></strong> file,</p><pre>import { useCallback, useEffect, useState } from &#39;@lynx-js/react&#39;;<br><br>import &#39;./App.css&#39;;<br>import ImageCard from &#39;./ImageCard.jsx&#39;;<br><br>import pic0 from &#39;./assets/0.png&#39;;<br><br>export function App() {<br>  return (<br>    &lt;view className=&quot;gallery-wrapper single-card&quot;&gt;<br>      &lt;ImageCard width={512} height={429} src={pic0} /&gt;<br>    &lt;/view&gt;<br>  );<br>}</pre><p>add some CSS styling, then run the app in the simulator,</p><pre>.gallery-wrapper {<br>  height: 100vh;<br>  background-color: black;<br>}<br><br>.single-card {<br>  display: flex;<br>  align-items: center;<br>  justify-content: center;<br>}<br><br>.picture-wrapper {<br>  border-radius: 10px;<br>  overflow: hidden;<br>  width: 100%;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0zGNKZNdydzav-h5m_OjGQ.png" /></figure><h3>UI building blocks:</h3><p>The concept of an element tag is similar to <a href="https://developer.mozilla.org/en-US/docs/Glossary/Element">HTML elements</a>, which can be used to encapsulate different parts of the content to present or operate in a specific manner.</p><p>Unlike HTML, Lynx uses some unique element tags such as <a href="https://lynxjs.org/api/elements/built-in/view.html">&lt;view&gt;</a>, <a href="https://lynxjs.org/api/elements/built-in/text.html">&lt;text&gt;</a>, and <a href="https://lynxjs.org/api/elements/built-in/image.html">&lt;image&gt;</a> to display different content. For example, in Lynx, the following source code can be used to display a piece of text:</p><pre>&lt;view&gt;<br>   &lt;text&gt;Hello world by Lynx&lt;/text&gt;<br>&lt;/view&gt;</pre><p>The element tags in the source code will be parsed by the Lynx engine at runtime and translated into <a href="https://lynxjs.org/guide/spec.html#element"><em>elements</em></a> for rendering. Nested element tags will form a tree composed of elements, which we refer to as the <a href="https://lynxjs.org/guide/spec.html#element-tree"><em>element tree</em></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DeYLWcMF7LooBJ1-Ye-lGA.png" /></figure><h4>UI Interactions:</h4><p>Let’s add some interactions in our mobile app, create a file called <strong><em>LikeIcon.tsx</em></strong>, and add the following code,</p><pre>import { useState } from &#39;@lynx-js/react&#39;;<br><br>import redHeart from &#39;./assets/redHeart.png&#39;;<br>import whiteHeart from &#39;./assets/whiteHeart.png&#39;;<br><br>export default function LikeIcon() {<br>  const [liked, setLiked] = useState(false);<br><br>  return (<br>    &lt;view className=&quot;like-icon&quot; bindtap={()=&gt; setLiked(true)}&gt;<br>      {liked &amp;&amp; &lt;view className=&quot;circle&quot; /&gt;}<br>      {liked &amp;&amp; &lt;view className=&quot;circle circleAfter&quot; /&gt;}<br>      &lt;image src={liked ? redHeart : whiteHeart} className=&quot;heart-love&quot; /&gt;<br>    &lt;/view&gt;<br>  );<br>}</pre><p>then import the <strong><em>LikeIcon.tsx</em></strong> component into <strong><em>ImageCard.tsx</em></strong> component,</p><pre>import LikeIcon from &quot;./LikeIcon.jsx&quot;;<br><br>type Picture = {<br>  width: number;<br>  height: number;<br>  src: string;<br>};<br><br>export default function ImageCard({ width, height, src }: Picture) {<br>  return (<br>    &lt;view className=&quot;picture-wrapper&quot;&gt;<br>      &lt;image<br>        className=&quot;image&quot;<br>        style={{ width: &#39;100%&#39;, aspectRatio: width / height }}<br>        src={src}<br>      /&gt;<br>      &lt;LikeIcon/&gt;  {/** &lt;--- Add LikeIcon component here... */}<br>    &lt;/view&gt;<br>  );<br>}</pre><p>and CSS for like icon animation effect,</p><pre>.glow {<br>  background-color: #333;<br>  border-radius: 4px;<br>  background: linear-gradient(<br>    45deg,<br>    rgba(255, 255, 255, 0) 20%,<br>    rgba(255, 255, 255, 0.8) 50%,<br>    rgba(255, 255, 255, 0) 80%<br>  );<br>  animation: flow 3s linear infinite;<br>}<br><br>@keyframes flow {<br>  0% {<br>    transform: translateY(-100%);<br>  }<br>  100% {<br>    transform: translateY(100%);<br>  }<br>}<br><br>.like-icon {<br>  position: absolute;<br>  display: grid;<br>  justify-items: center;<br>  align-items: center;<br>  top: 0px;<br>  right: 0px;<br>  width: 48px;<br>  height: 48px;<br>}<br><br>.heart-love {<br>  width: 16px;<br>  height: 16px;<br>}<br><br>.circle {<br>  position: absolute;<br>  top: calc(50% - 8px);<br>  left: calc(50% - 8px);<br>  height: 16px;<br>  width: 16px;<br>  border: 2px solid red;<br>  border-radius: 50%;<br>  transform: scale(0);<br>  opacity: 1;<br>  animation: ripple 1s 1 ease-out;<br>}<br><br>.circleAfter {<br>  animation-delay: 0.5s;<br>}<br><br>@keyframes ripple {<br>  0% {<br>    transform: scale(1);<br>    opacity: 1;<br>  }<br>  100% {<br>    transform: scale(2);<br>    opacity: 0;<br>  }<br>}</pre><p>then the final UI looks like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vJxDG46gTUUFXbNapeH3CQ.gif" /></figure><h3>Final thoughts:</h3><p>Lynx is definitely an exciting new player, trying to solve some of the pain points developers face with React Native — especially when it comes to performance and native rendering. It feels fresh and modern, and there’s potential there. But let’s be real — <strong><em>React Native</em></strong> and <strong><em>Flutter</em></strong> has a huge head start with a massive community, tons of libraries, and proven use in big apps.</p><p>Lynx is still pretty new, so it’s not quite ready to take the crown just yet. Still, it’s worth keeping an eye on — it might grow into something big over time.</p><p>Hope you enjoyed this little deep dive into Lynx! 🦁✨ It’s still early days, but definitely something to keep on your radar 👀. If you found this article helpful or just cool to read, don’t forget to hit that follow button for more tech content coming your way 🚀💬.</p><p>Thanks for reading — catch you in the next one! 🙌😊</p><h3>Good to know:</h3><ul><li>Composing Elements — <a href="https://lynxjs.org/guide/ui/elements-components.html">https://lynxjs.org/guide/ui/elements-components.html</a></li><li>Understanding Layouts — <a href="https://lynxjs.org/guide/ui/layout.html">https://lynxjs.org/guide/ui/layout.html</a></li><li>Scripting Interaction — <a href="https://lynxjs.org/guide/interaction/event-handling.html">https://lynxjs.org/guide/interaction/event-handling.html</a></li><li>Rspeedy — <a href="https://www.npmjs.com/package/create-rspeedy">https://www.npmjs.com/package/create-rspeedy</a></li><li>Let’s take a first look at Lynx — <a href="https://youtu.be/-qjE8JkIVoQ?si=aEBEygloqyzPiqtW">https://youtu.be/-qjE8JkIVoQ?si=aEBEygloqyzPiqtW</a></li><li>I tired tiktok Lynx — <a href="https://youtu.be/DDmqukrpvrM?si=51z0OgjzXrcn5p-d">https://youtu.be/DDmqukrpvrM?si=51z0OgjzXrcn5p-d</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40b5b1a51af2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redux Toolkit — createApi, fetchBaseQuery functionality ]]></title>
            <link>https://towardsdev.com/redux-toolkit-createapi-fetchbasequery-functionality-4ed1f9d64f29?source=rss-d9d8585ecf68------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ed1f9d64f29</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tailwind]]></category>
            <category><![CDATA[redux-toolkit]]></category>
            <category><![CDATA[gpt]]></category>
            <dc:creator><![CDATA[Prasath Ravichandran]]></dc:creator>
            <pubDate>Sat, 08 Jul 2023 18:24:06 GMT</pubDate>
            <atom:updated>2023-07-18T17:10:40.662Z</atom:updated>
            <content:encoded><![CDATA[<h3>Redux Toolkit — createApi, fetchBaseQuery functionality 🚀🚀🚀</h3><p>RTK Query(Redux toolkit) is a robust data fetching and caching tool. It is designed to simplify common loading cases in a web application, eliminating the need to hand-write data fetching &amp; caching logic yourself.</p><p>Two days back, I was working on one mini-project called the article Extractor and Summarize.</p><p>How the project works is, <br>If you want to check on the overview of any website or article, copy/paste the URL into the input box and the API, which uses GPT to summarize the article content from the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*hlqlwS50fJuzL2f8dzH-GQ.gif" /><figcaption>quick demo of summarize</figcaption></figure><p>Here I am using Article Extractor and Summarizer API from the Rapid API. So for each query, I need to make an API request to the Rapid API server.</p><p>The whole project is a React-based one, so I used the Redux toolkit for state management and making API calls also.</p><p>Previously we used one middleware called Redux-thunk, which will allow writing functions with logic inside that can interact with a Redux store dispatch and getState methods. But we have other alternatives which will do the work in a simpler way by using RTK queries.</p><p>RTK query includes two core APIs, those are,</p><ul><li><strong>createAPI() </strong>— It allows you to define a set of endpoints and describe how to retrieve data from a series of endpoints, including the configuration of how to fetch and transform that data.</li><li><strong>fetchBaseQuery() </strong>— A small wrapper <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">fetch</a> that aims to simplify requests. Intended as the recommended baseQuery to be used createApi for the majority of users.</li></ul><p>Let’s see a small workaround on how these two APIs work,</p><ol><li>Create a react project using Vite, and install the redux toolkit package,</li></ol><pre>npm create vite@latest<br>npm install @reduxjs/toolkit </pre><p>2. Create files called <strong>Store.ts</strong> and <strong>Article.ts, </strong>open the <strong>Store.ts</strong> file then initialize the store by using the <strong>configureStore</strong> function.</p><pre>import { configureStore } from &quot;@reduxjs/toolkit&quot;;<br><br><br>export const Store = configureStore({<br>  reducer: {<br>    <br>  },<br><br>});</pre><p>3. Open the <strong>Article.ts</strong> file, and initialize the <strong>createApi</strong> function. The <strong>createApi</strong> function contains the object parameter,</p><ul><li>reducerPath — Reducer name</li><li>baseQuery — It is an object and we can specify the endpoint inside the <strong>fetchBaseQuery</strong> function.</li><li>endPoints — It is a set of operations that you want to perform against your server. Here we can query/mutate data on the server side.</li></ul><pre>import { createApi, fetchBaseQuery } from &quot;@reduxjs/toolkit/query/react&quot;;<br>export const ArticleAPI = createApi({<br>  reducerPath:&#39;&#39;,<br>  baseQuery:fetchBaseQuery({<br>    <br>  }),<br>  endpoints:()=&gt;({<br><br>  })<br>})</pre><p>4. Inside the <strong>fetchBaseQuery </strong>method, include the baseUrl and headers. Here I am using the Rapid API endpoint, you can adjust the API on your own.</p><pre>import { createApi, fetchBaseQuery } from &quot;@reduxjs/toolkit/query/react&quot;;<br>export const ArticleAPI = createApi({<br>  reducerPath:&#39;&#39;,<br>  baseQuery:fetchBaseQuery({<br>    baseUrl: &quot;https://article-extractor-and-summarizer.p.rapidapi.com/&quot;,<br>    prepareHeaders: (headers) =&gt; {<br>      headers.set(&quot;X-RapidAPI-Key&quot;, rapidapiKey);<br>      headers.set(<br>        &quot;X-RapidAPI-Host&quot;,<br>        &quot;article-extractor-and-summarizer.p.rapidapi.com&quot;<br>      );<br>    },<br>  }),<br>  endpoints:()=&gt;({<br><br>  })<br>})</pre><p>5. In the endpoint object, we can access the builder object, from there we can query the data from the server.</p><pre>import { createApi, fetchBaseQuery } from &quot;@reduxjs/toolkit/query/react&quot;;<br>export const ArticleAPI = createApi({<br>  reducerPath:&#39;&#39;,<br>  baseQuery:fetchBaseQuery({<br>    baseUrl: &quot;https://article-extractor-and-summarizer.p.rapidapi.com/&quot;,<br>    prepareHeaders: (headers) =&gt; {<br>      headers.set(&quot;X-RapidAPI-Key&quot;, rapidapiKey);<br>      headers.set(<br>        &quot;X-RapidAPI-Host&quot;,<br>        &quot;article-extractor-and-summarizer.p.rapidapi.com&quot;<br>      );<br>    },<br>  }),<br>  endpoints: (builder) =&gt; ({<br>    getSummary: builder.query({<br>      query: (params) =&gt;<br>        `/summarize?url=${encodeURIComponent(params.articleUrl)}&amp;length=3`,<br>    }),<br>  }),<br>})</pre><p>Here, I am defining the query called <strong>getSummary, </strong>so we can utilize it from the front end.</p><p>6. Finally, give the appropriate reducer name in the reducerPath, and export the <strong>getSummary</strong> query as a custom hook.</p><blockquote>It is a cool feature😎😎, once we include any query inside the <strong>endPoints</strong> function, the RTK query will automatically converted to <strong>custom hook</strong>. We can add lazy loading functionally also.</blockquote><pre>import { createApi, fetchBaseQuery } from &quot;@reduxjs/toolkit/query/react&quot;;<br><br>const rapidapiKey = import.meta.env.VITE_RAPID_API_ARTICLE_KEY;<br><br>export const ArticleApi = createApi({<br>  reducerPath: &quot;articleApi&quot;,<br>  baseQuery: fetchBaseQuery({<br>    baseUrl: &quot;https://article-extractor-and-summarizer.p.rapidapi.com/&quot;,<br>    prepareHeaders: (headers) =&gt; {<br>      headers.set(&quot;X-RapidAPI-Key&quot;, rapidapiKey);<br>      headers.set(<br>        &quot;X-RapidAPI-Host&quot;,<br>        &quot;article-extractor-and-summarizer.p.rapidapi.com&quot;<br>      );<br>    },<br>  }),<br>  endpoints: (builder) =&gt; ({<br>    getSummary: builder.query({<br>      query: (params) =&gt;<br>        `/summarize?url=${encodeURIComponent(params.articleUrl)}&amp;length=3`,<br>    }),<br>  }),<br>});<br><br>export const { useLazyGetSummaryQuery } = ArticleApi;<br><br>// PS: If you don&#39;t want lazy loading functionality, remove &#39;Lazy&#39; <br>// from the exports statement, then its look like this,<br><br>// export const { useGetSummaryQuery } = ArticleApi;</pre><p>The Reducer is complete, now we can add it to the store&#39;s middleware.</p><p>7. Jump into the <strong>Store.ts</strong> file, import the ArticleApi reducer, and add it under the reducer object. Then add the ArticleApi middleware into the middleware function.</p><pre>import { configureStore } from &quot;@reduxjs/toolkit&quot;;<br>import { ArticleApi } from &quot;./Article&quot;;<br><br>export const Store = configureStore({<br>  reducer: {<br>    [ArticleApi.reducerPath]: ArticleApi.reducer,<br>  },<br>  middleware: (getDefaultMiddleware) =&gt;<br>    getDefaultMiddleware().concat(ArticleApi.middleware),<br>});</pre><p>Here the middleware function will return a defaultMiddleware function, here we can concatenate more than one reducer’s middleware.</p><p>8. From the React side, you can utilize the RTK query custom hooks like this,</p><pre><br>import { FormEvent, useEffect, useState } from &quot;react&quot;;<br>import { useLazyGetSummaryQuery } from &quot;../services/Article&quot;;<br><br>export interface ArticleProps {<br>  url: string;<br>  summary: string;<br>}<br><br>const [article, setArticle] = useState({<br>    url: &quot;&quot;,<br>    summary: &quot;&quot;,<br>});<br>const [allArticles, setAllArticles] = useState&lt;ArticleProps[]&gt;([]);<br><br>const [getSummary, { isFetching, error }] = useLazyGetSummaryQuery&lt;any&gt;();<br><br>const handleSend = async (e: FormEvent) =&gt; {<br>    e.preventDefault();<br>    const { data } = await getSummary({ articleUrl: article.url });<br><br>    if (data?.summary) {<br>      const newArticle = { ...article, summary: data.summary };<br>      const updateAllArticles = [newArticle, ...allArticles];<br>      setArticle(newArticle);<br>      setAllArticles(updateAllArticles);<br><br>      localStorage.setItem(&quot;articles&quot;, JSON.stringify(updateAllArticles));<br>      setArticle((prev) =&gt; ({ ...prev, url: &quot;&quot; }));<br>    }<br>};<br><br>...<br> &lt;form<br>     className=&quot;relative flex justify-center items-center&quot;<br>     onSubmit={handleSend}<br>  &gt;<br>     &lt;img<br>       src={linkIcon}<br>       alt=&quot;link_icon&quot;<br>       className=&quot;absolute left-0 my-2 ml-3 w-5&quot;<br>      /&gt;<br>      &lt;input<br>         type=&quot;url&quot;<br>         placeholder=&quot;Enter a URL&quot;<br>         value={article.url}<br>         onChange={(e) =&gt;<br>           setArticle((prev) =&gt; ({ ...prev, url: e.target.value }))<br>          }<br>         required<br>         className=&quot;url_input peer&quot;<br>       /&gt;<br>       &lt;button<br>         type=&quot;submit&quot;<br>         className=&quot;submit_btn peer-focus:border-gray-700&quot;<br>        &gt;<br>         &lt;img src={send} alt=&quot;send_icon&quot; className=&quot;w-5 h-5&quot; /&gt;<br>       &lt;/button&gt;<br>  &lt;/form&gt;<br>...</pre><p>PS: The whole project source code is available on GitHub. Please refer to the <a href="https://github.com/PrasathRavichandran/Summarizer">link</a></p><blockquote><a href="https://summizer-gpt.netlify.app/">Check out the deployed version of the summarizer application here ✌️✌️✌️</a></blockquote><p>I hope from this article we can understand the functionality of createApi and fetchBaseQuery from RTK query. Please share your thoughts on this as a comment. If you like this article, please hit the clap 👏 , which will increase my dopamine 😂😂😂 and motives me to put good concepts as an article.</p><p>And If you like this article please share it with your friends ✌️✌️</p><p>Thanks for reading!</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ed1f9d64f29" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/redux-toolkit-createapi-fetchbasequery-functionality-4ed1f9d64f29">Redux Toolkit — createApi, fetchBaseQuery functionality 🚀🚀🚀</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React native Reanimated — Quick Look]]></title>
            <link>https://medium.com/@prasathravi/react-native-reanimated-quick-look-a7cfdcef0867?source=rss-d9d8585ecf68------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7cfdcef0867</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react-native-animation]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[reanimated]]></category>
            <dc:creator><![CDATA[Prasath Ravichandran]]></dc:creator>
            <pubDate>Wed, 08 Jun 2022 03:31:41 GMT</pubDate>
            <atom:updated>2022-06-08T03:31:41.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3R5jnUQmJ2eOCbI30k0V0g.png" /></figure><h3>React native Reanimated — Quick Look🎨🎨🎨</h3><p><strong>React Native</strong>, a popular JavaScript-based UI software framework that allows you to build natively rendering mobile apps both in Android and iOS. This framework lets you create an application for various platforms by using the same codebase.</p><p>What is so special about React Native is that we can write our application code in JavaScript and the JS engine runs our JavaScript code on its own thread and then communicates to the native thread via a bridge. Here is a simple diagram to help up think about this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ng63fFFG97Pim4o2-dTiEQ.png" /></figure><p>Generally, this works well! We don’t have to remember that there is a bridge, we just write JavaScript and create awesome applications. But there are certain aspects of an application where the user is going to notice when performance is taking a hit. One of those aspects is animation. Luckily, React native comes with its own <a href="https://reactnative.dev/docs/animated">animation tool</a> that can create some smooth animation.</p><p>React native’s animated API helps you declare animation in JS, and then push your animation declarations to the native UI thread for execution. However, there are certain limitations to what you can do with React native animated API. In a real-world application, we would have a tool that allows you to create an animation that’s, <strong>run primarily on the native UI thread</strong> and allow us to forget about the <strong>bridge</strong>.</p><h3>Intro of React native reanimated2:</h3><p><a href="https://docs.swmansion.com/react-native-reanimated/">React native reanimated</a> is a library that helps us to build smooth animations and handle gesture events. It replaces React native animated API and provides JS animation APIs that are easy to use and run on the native thread.</p><h4>Shared Value:</h4><p>A fundamental concept that lies behind the Reanimated 2.0 is the <a href="https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/shared-values">shared Value</a>. It is essentially a <strong>primitive value</strong> on the JS side but can be used to drive animations on the UI side. We can update shared values on the JS side and see these changes are reflected on the UI thread.</p><p>Let’s look at a simple example for shared value,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e227bd3923b5a10d066105c4555b4de8/href">https://medium.com/media/e227bd3923b5a10d066105c4555b4de8/href</a></iframe><p>In the above example, If we hit the button the shared value gets incremented!</p><h4>Animated styles:</h4><p>When we think of animation, we generally animate various styles. Reanimated gives us a <a href="https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/animations">useAnimatedStyle</a> hook that allows us to animate styles using shared values. Let’s look at an example,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/74bbad26900c29c89ce03b5c48176509/href">https://medium.com/media/74bbad26900c29c89ce03b5c48176509/href</a></iframe><p>In the above example, we use <strong>useAnimatedStyle</strong> to create a style that is dynamic based on our shared value. We pass that animated style to <strong>Animated.View</strong>, and as we press our button, the little square will move across the screen.</p><h3>Let’s demonstrate animation using RN reanimated 2.0, with some examples:</h3><p>let’s develop a <strong>search input box</strong>, which will shrink during input field focus and it expands when we press outside anywhere in the screen. The final output would look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vRir_qyPgeuk6cwCHlKlMA.gif" /></figure><h4>Installation and config:</h4><p>You can create a new react-native project by running these commands in the terminal,</p><blockquote><strong>npx react-native init AwesomeProject</strong></blockquote><p>Please follow the instructions in the <strong>React native Reanimate2.0</strong> official documentation for installation in your project. <a href="https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation">React native reanimated installation</a></p><p>I hope you guys have successfully configured a reanimated library in your project. Let’s start designing the input box and cancel button,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9cf503a55a666af7185f6fafc808b0a2/href">https://medium.com/media/9cf503a55a666af7185f6fafc808b0a2/href</a></iframe><p>The final design should look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*tP-be4VwcdnELNiKIoJbZQ.png" /></figure><p>Let’s declare the <a href="https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/shared-values">shared value</a> for <strong>Input box length, Search Text placement </strong>and <strong>Cancel button appearance</strong>. Import the <strong>useSharedValue hook</strong> from the RN reanimated library, and declare the values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9963a4fb2af65b2e9c1c1ef6f7d7cba9/href">https://medium.com/media/9963a4fb2af65b2e9c1c1ef6f7d7cba9/href</a></iframe><p>Then, define the Animated styles for the <strong>Input box, Search Text placement</strong>, and the <strong>Cancel button</strong>. Import the <strong>useAnimatedStyle hook</strong> from the RN reanimated library, and define the functions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6980af066f266a8269366652023bd37f/href">https://medium.com/media/6980af066f266a8269366652023bd37f/href</a></iframe><p>Here we are using <a href="https://docs.swmansion.com/react-native-reanimated/docs/api/animations/withTiming">withTiming</a> <strong>callback function</strong> to start the time based on the animation. The withTiming needs two arguments, one is<strong> toValue</strong> and the second one is the object contains <strong>duration and easing.</strong></p><blockquote>In <strong>InputLengthStyles</strong> function, we are updating(animating) <strong>width</strong> property, which is not possible in React native animated API nowadays 😂😂</blockquote><p>Let’s add the defined animated styles into our JSX components,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2227860cb8281b16dfa56b6163e1381e/href">https://medium.com/media/2227860cb8281b16dfa56b6163e1381e/href</a></iframe><p>Finally trigger the animation during <strong>focusing(touching) the text input</strong> and reset the animated values when clicking the <strong>cancel button</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b3a9e4bdc4735de361ebdcd407c6ff0c/href">https://medium.com/media/b3a9e4bdc4735de361ebdcd407c6ff0c/href</a></iframe><p>The final code would look this,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c58f923cc49ac91e3acdda9cb23b5af3/href">https://medium.com/media/c58f923cc49ac91e3acdda9cb23b5af3/href</a></iframe><p>PS: Here is the git gist link for full <a href="https://gist.github.com/PrasathRavichandran/c5469789ea12ce490c247e7c673cb403">source code</a> ✌️✌️</p><p>I hope you successfully implemented the search box input animation by using this article. And I hope this article will help you to understand the React native reanimated library and how to use it in your project 😊😊 Please share your comments, if you know any other libraries for React native animation other than React native animated API and Reanimated.</p><p>And If you like this article please share it with your friends ✌️✌️</p><p>Thanks for reading!</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7cfdcef0867" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Universe App in Flutter with a card swiper]]></title>
            <link>https://medium.com/@prasathravi/universe-app-in-flutter-with-a-card-swiper-370109432e9a?source=rss-d9d8585ecf68------2</link>
            <guid isPermaLink="false">https://medium.com/p/370109432e9a</guid>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Prasath Ravichandran]]></dc:creator>
            <pubDate>Tue, 24 May 2022 12:32:34 GMT</pubDate>
            <atom:updated>2022-05-24T12:40:56.004Z</atom:updated>
            <content:encoded><![CDATA[<h4>Developing a universe app for Android and iOS using Flutter Framework.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*oeJdd2BZTEeHPUiWCX6jDw.gif" /><figcaption>Universe App demo</figcaption></figure><p>Flutter is one of the most popular UI software development kits nowadays. With the use of Flutter, we can create a beautiful, fast app that targets both iOS and Android Platforms.</p><p>In this project, we are going to build this nice-looking UI in Flutter. This App features a listing of <em>planets in a beautiful list view</em>, and <em>details of planets on a separate page</em> with a nice transition animation.</p><p>Through this project, we are going to learn about:</p><ul><li>How to design a layout with common widgets like <strong>Stack</strong>, <strong>Column</strong>, <strong>Row</strong>, <strong>Card</strong>, <strong>Text</strong>, <strong>etc</strong></li><li>How to structure the project with <strong>reusable widgets</strong></li><li>How to work with <strong>ListView</strong>, <strong>Card Swiper widgets</strong></li><li>How to work with <strong>page Transition</strong> and <strong>Hero animation </strong>during routing</li></ul><h4>Let’s jump in and let&#39;s get started...</h4><p>First, create a <a href="https://docs.flutter.dev/get-started/codelab"><strong><em>new project</em></strong></a> in a flutter and create one <strong>model</strong> folder inside the <strong>lib</strong> folder.</p><h4>1. Create a Model class:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef792f01d9af634fb3f7e03608ddbde0/href">https://medium.com/media/ef792f01d9af634fb3f7e03608ddbde0/href</a></iframe><p>I have created on Model class object for each planet, that contains <strong>position</strong>, <strong>name</strong>, <strong>iconImage</strong>, <strong>description</strong>, and <strong>images.</strong></p><h4>2. Add packages, constants, and images to the project:</h4><p>For the <a href="https://pub.dev/packages/card_swiper"><strong><em>card swiping</em></strong></a> and <a href="https://pub.dev/packages/ionicons"><strong><em>icons</em></strong></a> I used third-party packages from the pub package manager. Please add these dependencies inside <strong><em>pubspec.yaml</em></strong> file. I created one separate file for color constants, Please use those constants.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f73d978d4dfffb07de2d930565f4aade/href">https://medium.com/media/f73d978d4dfffb07de2d930565f4aade/href</a></iframe><h4>3. Home page:</h4><p>In this section, we are going to design the homepage of the application. The homepage will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*eTMi7SaWkOxFLUUmaIBlsA.png" /><figcaption>Home Page UI Design</figcaption></figure><p><strong>Add Gradient and headers:</strong></p><p>For Gradient, use<strong> </strong>the<strong> </strong><a href="https://api.flutter.dev/flutter/painting/LinearGradient-class.html"><strong><em>Linear Gradient</em></strong></a> <strong><em>widget</em></strong> inside the<strong> </strong><a href="https://api.flutter.dev/flutter/widgets/Container-class.html"><strong><em>Container</em></strong></a><strong><em> widget</em></strong>, the linear Gradient contains <em>colors, begin, end, and stops</em> properties.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46009fa26b86320de0110fb5fa06c980/href">https://medium.com/media/46009fa26b86320de0110fb5fa06c980/href</a></iframe><p>Then create a header view, the header view contains two parts <em>heading</em> and a <em>subheading</em>. For <em>heading and subheading</em>, use a <a href="https://api.flutter.dev/flutter/widgets/Text-class.html"><strong><em>Text</em></strong></a><strong><em> widget</em></strong> and Wrap both inside the <a href="https://api.flutter.dev/flutter/widgets/Column-class.html"><strong><em>Column</em></strong></a><strong><em> widget</em></strong> to get vertical alignment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7c88d13ff2039bc56b18228837a3995/href">https://medium.com/media/d7c88d13ff2039bc56b18228837a3995/href</a></iframe><blockquote>The subheading is a dropdown, but I used <strong>Text widget</strong> to design it without dropdown functionality. If you want dropdown functionality, use <a href="https://api.flutter.dev/flutter/material/DropdownButton-class.html"><strong>DropdownButton</strong></a><strong> widget</strong> ✌️</blockquote><p><strong>Add Card Swiper and Swiper pagination:</strong></p><p>First, create a<em> </em><strong><em>CustomCard widget</em></strong> in a separate file, so we can reuse it for cleaner code. The <strong><em>custom card widget</em></strong> expects the <strong><em>planet name</em></strong> as an argument, and the <strong><em>CustomCard</em> widget</strong> should look like this,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81fd5b79c27c5a028c2b933fd0146519/href">https://medium.com/media/81fd5b79c27c5a028c2b933fd0146519/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*mDWO6UI6RM_GsNiVnA8YzA.png" /></figure><p>Then we will add card swiper functionality to it. For Card swiper, use <a href="https://pub.dev/packages/card_swiper"><strong><em>card_swiper</em></strong></a> library from the pub package manager, because there is no inbuild widget for card swiper in Flutter ✌️</p><p>The Swiper widget contains constructor argument <strong><em>itemCount, itemWidth, itemHeight, pagination(for dot swiper),</em></strong> and <strong><em>itemBuilder</em></strong>. The itemBuilder is a function, that return widgets, so we will return our <strong><em>customCard</em> <em>widget</em></strong> inside the <a href="https://api.flutter.dev/flutter/widgets/Stack-class.html"><strong><em>Stack</em></strong></a> <strong><em>widget</em></strong> and add the planet image under the <strong><em>customCard widget</em></strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f02f31466a73276a72efd2779931329/href">https://medium.com/media/4f02f31466a73276a72efd2779931329/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*_5oxUL-qJs7X4YwLbfcr2Q.png" /></figure><p>The final <strong><em>output after adding customCard</em></strong><em> </em>should looks like this ☝️</p><p>Then add the custom bottom navigation bar widget in the <strong><em>bottomNavigationBar</em></strong><em>, </em>wrapped inside the<em> </em><a href="https://api.flutter.dev/flutter/material/Scaffold-class.html"><strong><em>Scaffold</em></strong></a><strong><em> widget</em></strong><em>.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a8d440f31e464a1a04e6118a181bbc8/href">https://medium.com/media/4a8d440f31e464a1a04e6118a181bbc8/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*FFiaJI-7OAsd7S55t9WhEQ.png" /></figure><p>The final <strong><em>home page</em></strong> design looks like this ☝️</p><h4>3. Details page:</h4><p>The details page contains the planet name, description, and images of the planets in the gallery section. Use the<strong> </strong><a href="https://api.flutter.dev/flutter/widgets/Text-class.html"><strong><em>Text</em></strong></a><strong> <em>widget</em></strong> to display the planet name and description and use the <a href="https://api.flutter.dev/flutter/widgets/ListView-class.html"><strong><em>ListView widget</em></strong></a> to display the horizontal list of gallery images.</p><p>Then use the <a href="https://api.flutter.dev/flutter/widgets/Positioned-class.html"><strong><em>Positioned widget</em></strong></a> to fit the back arrow icon and the planet image on the top. All the Text, ListView, and Positioned widgets are wrapped inside <a href="https://api.flutter.dev/flutter/widgets/Stack-class.html"><strong><em>Stack widget</em></strong></a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbf9661d4b690b2c63ccf5d8cdf00352/href">https://medium.com/media/bbf9661d4b690b2c63ccf5d8cdf00352/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*94sokNNFsCE6TQDzNMac0A.png" /></figure><p>The final <strong><em>details page</em></strong> design looks like this ☝️</p><h4>4. Page-Transition and Hero Animation:</h4><p>For page transition, wrap the Swiper card(from the Home page) inside the <a href="https://api.flutter.dev/flutter/material/InkWell-class.html"><strong><em>Inkwell</em></strong></a> <strong><em>widget</em></strong>, to get on tab functionality. From there, we can use <a href="https://docs.flutter.dev/cookbook/animation/page-route-animation"><strong><em>PageRouteBuilder</em></strong></a> to navigate to the details page.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ae5af07f60b3c90946b70f0cd3e9609/href">https://medium.com/media/9ae5af07f60b3c90946b70f0cd3e9609/href</a></iframe><p>And wrap the planet image with the <a href="https://api.flutter.dev/flutter/widgets/Hero-class.html"><strong><em>Hero</em></strong></a><strong><em> widget. </em></strong>In Hero Widget, the tag object is important and that needs to be unique. If the tag of this hero matches the tag of a hero on a <a href="https://api.flutter.dev/flutter/widgets/PageRoute-class.html"><strong><em>PageRoute</em></strong></a> that we’re navigating to or from, then a hero animation will be triggered.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9251d16f1ccbdebdabc73dd8a07807a5/href">https://medium.com/media/9251d16f1ccbdebdabc73dd8a07807a5/href</a></iframe><h4>4. Resources:</h4><p>The Full project source code is found in my <a href="https://github.com/PrasathRavichandran/universe_minimal_ui"><strong><em>Github repository</em></strong></a><strong><em> </em></strong>👍 You can refer to it in case you have any queries ✌️</p><h4>5. Conclusion:</h4><p>I hope you have learned how to build a beautiful flutter app using these articles. This project is my first flutter project.</p><p><strong>My Learnings:</strong> First I learned dart, the OOPS concept in the dart, and some youtube tutorials for designing layouts in Flutter.</p><p>I hope you found this article helpful. If you have any queries, feel free to comment below and I’ll answer them.</p><p>Thanks for reading! Happy coding!</p><h4>Useful resources:</h4><p>Design Courtesy: <a href="https://dribbble.com/shots/6600859-Explore-Universe-App-UI">https://dribbble.com/shots/6600859-Explore-Universe-App-UI</a> 👏</p><p>Dart Programming: <a href="https://dart.dev/guides/language/language-tour">Dart docs</a>, <a href="https://youtu.be/5xlVP04905w">https://youtu.be/5xlVP04905w</a></p><p>OOPS in dart: <a href="https://youtu.be/apIaNRp7_rs">https://youtu.be/apIaNRp7_rs</a></p><p>Flutter: <a href="https://youtu.be/ly0hAtV7EBg">https://youtu.be/ly0hAtV7EBg</a>, <a href="https://www.youtube.com/c/CodeXdev">https://youtube.com/c/CodeXdev</a></p><p>Sound null safety issue: <a href="https://stackoverflow.com/questions/64917744/cannot-run-with-sound-null-safety-because-dependencies-dont-support-null-safety">https://stackoverflow.com/questions/64917744/cannot-run-with-sound-null-safety-because-dependencies-dont-support-null-safety</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=370109432e9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bootstrap 5 Alpha — Updates & Features]]></title>
            <link>https://medium.com/@prasathravi/bootstrap-5-alpha-updates-features-cff3b862418f?source=rss-d9d8585ecf68------2</link>
            <guid isPermaLink="false">https://medium.com/p/cff3b862418f</guid>
            <category><![CDATA[bootstrap-5]]></category>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Prasath Ravichandran]]></dc:creator>
            <pubDate>Sat, 27 Jun 2020 11:56:04 GMT</pubDate>
            <atom:updated>2020-06-27T11:56:04.646Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bootstrap 5 Alpha — Updates &amp; Features</h3><p>In a couple of days back, Bootstrap has migrated from v4 to v5. And they introduced a set of new features, which are helpful for many front-end developers to focus only on building tools that are more future-friendly, faster JavaScript, and fewer dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7m8szFsPNjbty8hyWGGCg.png" /></figure><blockquote>The main updates from this migration are,</blockquote><ul><li>Bootstrap 5 is no longer depends on <strong>jQuery.</strong></li><li>They dropped support for <strong>Internet Explorer.</strong></li><li>Bootstrap provides us a <strong>brand new icon pack</strong>. So hereafter the developers no need to depend on a third-party icon pack.</li></ul><h3>New updates and features:-</h3><h4>Improved docs:</h4><ul><li>New look and feel.</li><li>To improve readability, the docs pages are no longer full-width.</li><li>They’re giving us more guidance to customize our theme so that not every website and app looks the same.</li><li>For faster navigation, docs have upgraded with sidebar to use expandable sections.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q7YXvLIeKhRHZlBPF9CVgQ.png" /></figure><h4>Expanded Color Palette:</h4><p>The color palettes have also expanded for further customization, as many different shades of different colors similar to other CSS frameworks like Materialize.</p><p>With an extensive color system built-in, you can more easily customize the look and feel of your app without ever leaving the codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2XtJf0Rq6rDW3tTt4mBBpg.png" /></figure><h4>CSS Custom Properties:</h4><p>One of the reasons for <strong><em>dropping support for Internet Explorer</em></strong> is CSS custom variables. Before there were only a handful of root variables for colors and fonts in version 4.</p><pre>.table {<br>  --bs-table-bg: #{$table-bg};<br>  --bs-table-accent-bg: transparent;<br>  --bs-table-striped-color: #{$table-striped-color};<br>  --bs-table-striped-bg: #{$table-striped-bg};<br>  --bs-table-active-color: #{$table-active-color};<br>  --bs-table-active-bg: #{$table-active-bg};<br>  --bs-table-hover-color: #{$table-hover-color};<br>  --bs-table-hover-bg: #{$table-hover-bg};<br><br>  // Styles here...<br>}</pre><blockquote>Here we are using CSS custom properties to update the default options in the table element.</blockquote><h4>Utilities API:</h4><p>They have implemented a brand new utility API in Bootstrap v5. We can have the ability to modify or remove the built-in utilities by creating our own SCSS utilities on the fly.</p><pre>$utilities: () !default;<br>$utilities: map-merge(<br>  (<br>    // ...<br>    &quot;width&quot;: (<br>      property: width,<br>      class: w,<br>      values: (<br>        25: 25%,<br>        50: 50%,<br>        75: 75%,<br>        100: 100%,<br>        auto: auto<br>      )<br>    ),<br>    // ...<br>    &quot;margin&quot;: (<br>      responsive: true,<br>      property: margin,<br>      class: m,<br>      values: map-merge($spacers, (auto: auto))<br>    ),<br>    // ...<br>  ), $utilities);</pre><blockquote>Here we are trying to modify the width property by setting the class name as w-* and the * should be the values or spacer.</blockquote><h4>Enhanced Grid System:</h4><ul><li>The new sizing tier of <strong>xxl</strong> is introduced.</li><li>The gutter class is replaced with a utility, much like the margin and padding. So you can do <strong>.g-*</strong></li><li>The form layout is replaced with a new grid.</li><li>The vertical spacing classes have been added.</li><li>The columns are no longer <strong>position: relative</strong>.</li></ul><pre>&lt;div class=&quot;row g-5&quot;&gt;<br>  &lt;div class=&quot;col&quot;&gt;...&lt;/div&gt;<br>  &lt;div class=&quot;col&quot;&gt;...&lt;/div&gt;<br>  &lt;div class=&quot;col&quot;&gt;...&lt;/div&gt;<br>&lt;/div&gt;</pre><blockquote>Here’s a quick example of how to use the new grid gutter classes.</blockquote><h3>Design a simple form using bootstrap 5:-</h3><p>Let’s design a simple signup form using bootstrap 5, bootstrap-icons. Here I am using sets of npm command to install bootstrap 5 in the project.</p><h4>Get started:</h4><p>Head to <a href="https://v5.getbootstrap.com/">https://v5.getbootstrap.com</a> to explore the new release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_EEo2QHdPTh5ux84tVkMA.png" /></figure><h4>Installation:</h4><p>To install bootstrap5 and bootstrap-icons, open the terminal and run the commands,</p><blockquote>npm init -y</blockquote><blockquote>npm install bootstrap@5.0.0-alpha1</blockquote><blockquote>npm install bootstrap-icons</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bOB8nxMjfq2yTCk-aWDN-A.gif" /><figcaption>To install bootstrap5, bootstrap-icons from the visual studio code.</figcaption></figure><h4>Install Live Sass Compiler:</h4><p>The live Sass compiler is one of the visual studio code extensions and this extension helps you to compile/transpile your SASS/SCSS files to CSS files in realtime with live browser reload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xcZgY_y8oqVD_ZvC-j6Q7Q.png" /><figcaption>Live Sass compiler extension in visual studio code.</figcaption></figure><blockquote>After the installation finished, click <strong>watch Sass</strong> from the visual studio code status bar.</blockquote><h4>Configuration:</h4><p>After all the installations are finished,</p><ul><li>Create a <strong>styles directory</strong> inside your project folder.</li><li>Create <strong>main.scss</strong> file inside the <strong>styles directory</strong>.</li><li>Then, import the path of bootstrap.scss inside the <strong>main.scss</strong> file.</li></ul><blockquote>@import ‘../node_modules/bootstrap/scss/bootstrap.scss’;</blockquote><ul><li>Click <strong>watch Sass</strong> from the status bar of the visual studio code to compiles the *.scss code to *.css file.</li><li>Then create <strong>index.html</strong> and link <strong>main.css</strong> as a stylesheet for the application.</li></ul><blockquote>&lt;link rel=”stylesheet” href=”./styles/main.css”/&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzHj6t8VkfT1yBAFUVT8Cw.gif" /><figcaption>Configure the project folders and files.</figcaption></figure><h3>Development:-</h3><h4>Folder Structure:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*UaR3DcTzeZ4jEyWk0rRbQw.png" /></figure><h4>Index.html:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef5d1d8e883bb5fcc09aeec5219f2a97/href">https://medium.com/media/ef5d1d8e883bb5fcc09aeec5219f2a97/href</a></iframe><p>Here the signup form consists of <strong><em>two input fields</em></strong> and a <strong><em>button</em></strong> to submit. I have used the <strong><em>flexbox (class=”d-flex”) property </em></strong>to align the signup form horizontally and vertically center to the screen. After that run the index.html file in the browser, the output looks like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RzE86YrtVjS5ZzXVsiMVkA.png" /><figcaption>The output of the basic bootstrap signup form.</figcaption></figure><h4>main.scss:</h4><ul><li><strong><em>Working on CSS properties:</em></strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a09cdf27a0335a86b0628cc3fa648f50/href">https://medium.com/media/a09cdf27a0335a86b0628cc3fa648f50/href</a></iframe><p>Here I update the CSS properties of the button and form inputs by changing the <strong><em>primary color </em></strong>and<strong><em> </em></strong>set the <strong><em>border-radius to zero. </em></strong>After that run the index.html file in the browser, the output should look like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhSAOC08bFxnPVUz5NSr2g.png" /></figure><ul><li><strong><em>Working on utility API:</em></strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65d4052a6d371188fb455183ef910853/href">https://medium.com/media/65d4052a6d371188fb455183ef910853/href</a></iframe><p>Here I have created the utilities for <strong>input padding</strong> by providing property name <strong><em>(property: padding)</em></strong>, class <strong><em>(class: ip)</em></strong>, and values. The <strong>class=”ip-*”</strong> is added to the utility property.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cfa7c14e13b5a66f224a22606c87dc7/href">https://medium.com/media/2cfa7c14e13b5a66f224a22606c87dc7/href</a></iframe><p>Here I am using <strong><em>class=”form-control ip-4” </em></strong>for one of the input elements. After that run the index.html file in the browser, the output should look like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aOb4N-YX5nEkjS1ZtYtMJA.png" /></figure><h3>Conclusion:-</h3><p>I hope you have learned about the latest updates and features of the bootstrap v5. One side note, <strong>the bootstrap 5 is in the Alpha stage so don’t use bootstrap5 in production. Just wait for the official release.</strong></p><p>I have attached the <a href="https://github.com/PrasathRavichandran/bootstrap-5-signup-form">GitHub repository</a> link for this <strong><em>simple signup form using bootstrap 5</em></strong> below.</p><p><a href="https://github.com/PrasathRavichandran/bootstrap-5-signup-form">PrasathRavichandran/bootstrap-5-signup-form</a></p><p>I hope you found this article is helpful. If you have any queries, feel free to comment below and I’ll answer it as soon as I can. Thanks.</p><h4>Let’s connect!</h4><p>You can find me on <a href="https://github.com/PrasathRavichandran">GitHub</a> | <a href="https://www.linkedin.com/in/prasathravi/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cff3b862418f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>