<?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 Tharindu Nanayakkara on Medium]]></title>
        <description><![CDATA[Stories by Tharindu Nanayakkara on Medium]]></description>
        <link>https://medium.com/@tharindunanayakkara?source=rss-bee59e9e8c80------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eAI1DLII58wp3SBfLQaQ4w.png</url>
            <title>Stories by Tharindu Nanayakkara on Medium</title>
            <link>https://medium.com/@tharindunanayakkara?source=rss-bee59e9e8c80------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 14:59:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tharindunanayakkara/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[Main performance issues in React Native]]></title>
            <link>https://tharindunanayakkara.medium.com/main-performance-issues-in-react-native-eeb1cd8b753f?source=rss-bee59e9e8c80------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeb1cd8b753f</guid>
            <category><![CDATA[cross-platform-apps]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-app-performance]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Tharindu Nanayakkara]]></dc:creator>
            <pubDate>Fri, 01 Nov 2024 07:31:15 GMT</pubDate>
            <atom:updated>2024-11-01T07:31:15.881Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yffCYtMmxKiFVmgRcOI9tg.jpeg" /></figure><p>React Native is a powerful framework for building cross-platform mobile applications, but certain performance issues can arise due to its hybrid nature. Here are some of the main performance issues commonly encountered in React Native development and how they affect app</p><h3>1. Excessive Use of JavaScript Bridge</h3><ul><li><strong>Problem</strong>: React Native relies on a “bridge” to facilitate communication between JavaScript and native code (Objective-C, Swift, Java, or Kotlin). Heavy usage of the bridge can lead to a bottleneck, causing sluggish performance when data or commands are transferred too frequently or in large volumes.</li><li><strong>Impact</strong>: This bridge bottleneck can cause delays, particularly in animations, navigation, and complex UI interactions.</li><li><strong>Solution</strong>: Minimize interactions across the bridge, batch UI updates, or use native modules for performance-critical tasks.</li></ul><h3>2. Unoptimized Image Handling</h3><ul><li><strong>Problem</strong>: Handling large or high-resolution images without optimization can result in high memory usage, impacting performance on devices with limited resources.</li><li><strong>Impact</strong>: Slow load times and occasional app crashes, especially in resource-intensive screens.</li><li><strong>Solution</strong>: Use libraries like react-native-fast-image, compress images, and utilize progressive image loading to improve performance.</li></ul><h3>3. Inefficient Lists and Large Data Sets</h3><ul><li><strong>Problem</strong>: Lists are common in mobile apps, but handling large lists can result in performance problems if the list components aren’t optimized.</li><li><strong>Impact</strong>: Laggy scrolling, memory issues, and delayed item rendering in large lists.</li><li><strong>Solution</strong>: Use optimized list components such as FlatList, SectionList, and VirtualizedList, and enable windowing (e.g., lazy-loading of list items). For very large lists, consider recyclerlistview, which is designed for high-performance lists.</li></ul><h3>4. Unnecessary Re-renders and Reconciliation</h3><ul><li><strong>Problem</strong>: React’s reconciliation algorithm, which determines what updates are needed in the UI, can lead to unnecessary re-renders if the state and props management isn’t optimized.</li><li><strong>Impact</strong>: Performance issues such as delays and laggy interactions in components.</li><li><strong>Solution</strong>: Use React.memo for component memoization, useCallback for event handlers, and useMemo for complex calculations. Avoid deep component trees when possible and minimize the number of stateful components.</li></ul><h3>5. Slow Navigation Transitions</h3><ul><li><strong>Problem</strong>: React Native’s navigation libraries (e.g., react-navigation) can sometimes cause slow transitions, particularly on lower-end devices.</li><li><strong>Impact</strong>: Noticeable delay when moving between screens, especially with complex navigation stacks.</li><li><strong>Solution</strong>: Use native navigation solutions like react-native-navigation (by Wix) for smoother transitions or offload complex animations to the native side using libraries like react-native-reanimated.</li></ul><h3>6. Memory Leaks</h3><ul><li><strong>Problem</strong>: Memory leaks can occur when components are not properly cleaned up, leading to excessive memory usage over time.</li><li><strong>Impact</strong>: Decreased app performance, slowdowns, and possible app crashes due to high memory usage.</li><li><strong>Solution</strong>: Ensure that timers, listeners, and async tasks are cleared when components unmount. Use tools like Xcode’s Instruments (iOS) and Android Studio Profiler (Android) to detect memory leaks and profile memory usage.</li></ul><h3>7. Heavy Animations and Transitions</h3><ul><li><strong>Problem</strong>: Animations that rely heavily on JavaScript (such as those created with the default Animated library) can be laggy because they require frequent updates across the JavaScript bridge.</li><li><strong>Impact</strong>: Janky, choppy animations, especially on lower-end devices.</li><li><strong>Solution</strong>: Use libraries like react-native-reanimated or react-native-gesture-handler, which offload animations to the native thread, leading to smoother animations.</li></ul><h3>8. Large Application Bundle Size</h3><ul><li><strong>Problem</strong>: React Native apps can become bloated with unused libraries and assets, increasing the app’s bundle size.</li><li><strong>Impact</strong>: Increased load times and higher memory usage, affecting performance and making it harder for users with slower internet connections to download the app.</li><li><strong>Solution</strong>: Remove unused dependencies, use dynamic imports, compress assets, and take advantage of code-splitting techniques to load only what’s needed.</li></ul><h3>9. Slow Initialization Times</h3><ul><li><strong>Problem</strong>: React Native apps can have slower initialization times than native apps because the JavaScript code has to load, parse, and initialize.</li><li><strong>Impact</strong>: Longer loading screens and a slower app startup, which can be especially noticeable on older devices.</li><li><strong>Solution</strong>: Code-splitting, lazy-loading components, and optimizing asset loading can help reduce initialization time. You can also display a loading screen to manage user expectations.</li></ul><h3>10. Excessive Network Requests</h3><ul><li><strong>Problem</strong>: Making many API calls or failing to handle them efficiently can lead to delays and high data usage.</li><li><strong>Impact</strong>: Sluggish performance due to delays in loading or updating data.</li><li><strong>Solution</strong>: Use techniques like request batching, caching, and debounce to reduce the number of network calls. Tools like redux-persist or caching libraries can help with efficient data management.</li></ul><p>Optimizing React Native for high performance often requires a combination of native and JavaScript strategies, along with tools like profiling (e.g., Flipper, Android Studio Profiler, Xcode Instruments) to diagnose and tackle these issues. By addressing each of these areas, developers can make React Native apps run more efficiently and feel closer to a truly native experience.</p><p>If I have missed out any important issues please let me know I shall give you a shoutout in the blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeb1cd8b753f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I integrated  ‘Sign in with Apple’ to Keycloak]]></title>
            <link>https://tharindunanayakkara.medium.com/how-i-integrated-sign-in-with-apple-to-keycloak-3dae9bc7e46f?source=rss-bee59e9e8c80------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dae9bc7e46f</guid>
            <category><![CDATA[identity-provider]]></category>
            <category><![CDATA[sign-in-with-apple]]></category>
            <category><![CDATA[apple-sign-in]]></category>
            <category><![CDATA[apple-review]]></category>
            <category><![CDATA[keycloak]]></category>
            <dc:creator><![CDATA[Tharindu Nanayakkara]]></dc:creator>
            <pubDate>Fri, 30 Oct 2020 06:00:52 GMT</pubDate>
            <atom:updated>2020-10-30T06:00:52.896Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I integrated ‘<em>Sign in with Apple</em>’ to Keycloak</h3><p><em>The latest </em><a href="https://developer.apple.com/app-store/review/guidelines/#sign-in-with-apple"><em>Apple App Store Review Guidelines,</em></a><em> require you to add Sign in with Apple if you’re using any other third-party or social login services in our app. So I thought of share my experience on integrating ‘Sign in with Apple’ into Keycloak.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*JN5itseyQB0Ns-UofcbNVQ.png" /></figure><p>I’ll walk you through the process step by step.</p><ol><li><strong>How to registering an application in the Apple Developer Portal</strong></li></ol><p>First, sign in to the Apple Developer Portal and click on <a href="https://developer.apple.com/account/resources/identifiers/list/bundleId">Certificates, Identifiers and Profiles</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*baoYL0YYy0dIGpGaX0CM-g.jpeg" /></figure><p>If your app does not have an App ID, create one. The App ID will help you to collect information about your app.</p><p>You’ll also want to enable <em>Sign in with Apple</em> capability for your app ID.</p><p>Next, let’s create a Services ID. The Services ID will identify the particular instance of your app, and is used as the OAuth client_id.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJeoG-n1DF-PYBIHcgdU-Q.jpeg" /></figure><p>Next step you’ll need to define a description and an identifier. This description is what you’ll see during the login flow and the identifier becomes the OAuth client_id. Also tick the <em>Sign in with Apple</em><strong> </strong>option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JPK7zBuz9onyiESebad_4w.jpeg" /></figure><p>Next, click the configure button next to <em>Sign in with Apple</em> and define the domain of your app and redirect urls. And continue and save the steps.</p><p>Next step is to create a Private Key for client authentication. In the main <strong>Certificates, Identifiers &amp; Profiles</strong> screen, choose <strong>Keys</strong> from the side tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*683G7UbvPQdg_wpLycNk7A.jpeg" /></figure><p>Press plus button to add a new key. Fill the required information and check the <em>Sign in with Apple</em>. Select the configure button next to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjmUEFt1DinuOzB9rwOJIA.jpeg" /></figure><p>The generated new private key can be <strong>downloaded only once</strong>, so make sure you save that in secure place.</p><p><strong>2. Keycloak configurations</strong></p><p>Current latest version(11.0.2) of Keycloak does not include support for apple as an Identity Provider. So you’ll have to look for a another solution. So I found out that there’s a git repository created by BenjaminFavre which gives an extension to Keycloak, that provides support for <em>Sign in with Apple</em>.</p><p>Here’s the link for the repository: <a href="https://github.com/BenjaminFavre/keycloak-apple-social-identity-provider">Apple Social Identity Provider for Keycloak</a></p><p>Download the latest release of the provider JAR file given in the above link.</p><p>Follow the Keycloak <a href="https://www.keycloak.org/docs/latest/server_development/index.html#using-the-keycloak-deployer">instructions</a> and install the provider JAR file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaxBLv6P5C3GRCN7ZjKrbg.jpeg" /></figure><p>Login to Keycloak admin console and select Identity Providers tab and then select apple from the drop down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuFI6tI5azRFv0sdui_wVA.jpeg" /></figure><p>Fill the above form with the relevant information taken from appstore account. Fill <em>Client secret</em> with the base 64 content of your private key file, which you downloaded from appstore connect account (Remember to trim delimiters and new lines!). Fill <em>Team ID</em> and <em>Key ID</em> with the corresponding values.</p><p>I assume you have an idea about Keycloak theming, so I’m not going to deep dive into that here.</p><p>Hope this article would help you with integrating <em>Sign in with Apple</em> into Keycloak. If you have any questions or suggestions feel free to comment 🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dae9bc7e46f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>