<?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 Abdul Ahad on Medium]]></title>
        <description><![CDATA[Stories by Abdul Ahad on Medium]]></description>
        <link>https://medium.com/@abdulahad2024?source=rss-fcd581e9f0b0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-46KE7wd_iwdQKnlSC-p1w.png</url>
            <title>Stories by Abdul Ahad on Medium</title>
            <link>https://medium.com/@abdulahad2024?source=rss-fcd581e9f0b0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 17:54:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdulahad2024/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[From Your Browser to Google: The Journey of a Web Request]]></title>
            <link>https://medium.com/@abdulahad2024/from-your-browser-to-google-the-journey-of-a-web-request-cdf0f1d2f4a5?source=rss-fcd581e9f0b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdf0f1d2f4a5</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[browsing-internet]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Abdul Ahad]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 16:59:19 GMT</pubDate>
            <atom:updated>2024-12-20T16:59:19.381Z</atom:updated>
            <content:encoded><![CDATA[<p>When you open your browser and type <a href="http://www.google.com/"><strong>www.google.com</strong></a> into the address bar, it’s easy to take for granted the complexity of what happens behind the scenes. From resolving the web address to loading the webpage on your screen, there’s a symphony of processes and protocols working in perfect harmony. Let’s break it down step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vz020O6AQrSO70_4bJu2JA.png" /></figure><h3>Step 1: Entering the Web Address</h3><p>When you hit Enter after typing <a href="http://www.google.com/"><strong>www.google.com</strong></a>, the browser first checks its local cache to see if it already knows the IP address for this URL. If it doesn’t, the browser initiates a series of steps to resolve the URL into an IP address that your computer can use to communicate with Google’s servers.</p><h3>Step 2: Resolving the Domain Name</h3><p>This is where the Domain Name System (DNS) comes in. DNS acts like a phone book for the internet, translating human-readable domain names (like <a href="http://www.google.com/"><strong>www.google.com</strong></a>) into numerical IP addresses (like <strong>142.250.190.78</strong>).</p><ol><li><strong>Browser Cache</strong>: First, the browser checks its own DNS cache.</li><li><strong>Operating System Cache</strong>: If the browser cache has no record, it queries the operating system’s DNS resolver.</li><li><strong>Router</strong>: If the OS cache also lacks the information, the query is forwarded to your router.</li><li><strong>ISP DNS Server</strong>: The router sends the query to your Internet Service Provider’s DNS server, which will check its records.</li><li><strong>Recursive Resolution</strong>: If the ISP DNS server doesn’t know the IP address, it queries other DNS servers, following a hierarchical structure starting with the root DNS servers, then moving to TLD (Top-Level Domain) servers (like those for <strong>.com</strong>), and finally the authoritative server for <strong>google.com</strong>.</li></ol><p>Once the IP address is found, it is sent back through this chain to your browser.</p><h3>Step 3: Establishing a Connection (The Role of OSI Layers)</h3><p>Now that the browser knows the IP address of Google’s server, it begins establishing a connection. This is where the OSI (Open Systems Interconnection) model’s layers come into play.</p><ol><li><strong>Application Layer</strong>: The browser initiates an HTTP/HTTPS request to Google’s server. HTTPS adds a layer of security via encryption.</li><li><strong>Transport Layer</strong>: The browser uses the TCP protocol to ensure reliable data transmission. A three-way handshake (SYN, SYN-ACK, ACK) is performed between your device and Google’s server.</li><li><strong>Network Layer</strong>: IP is used to route the data packets across the internet. Your device’s IP address and Google’s IP address are included in these packets.</li><li><strong>Data Link and Physical Layers</strong>: These layers handle the actual transmission of data over the physical network (like Wi-Fi or Ethernet) using MAC addresses and electrical signals.</li></ol><h3>Step 4: Google’s Server Responds</h3><p>Once the connection is established, your browser sends an HTTP GET request to Google’s server, asking for the webpage. Google’s server processes the request and sends back an HTTP response, which includes the HTML, CSS, JavaScript, and other resources needed to render the page.</p><h3>Step 5: Loading the Bundle.js File</h3><p>Modern web applications, including Google, often rely on JavaScript bundles to handle interactivity. A file like <strong>bundle.js</strong> contains all the JavaScript code required for the application to run.</p><ol><li><strong>Browser Requests the File</strong>: If the HTML response includes a reference to <strong>bundle.js</strong>, the browser makes another HTTP request to fetch it.</li><li><strong>Content Delivery Network (CDN)</strong>: Google often serves its resources via a CDN. The request for <strong>bundle.js</strong> might be routed to the nearest CDN server to reduce latency.</li><li><strong>Compression and Optimization</strong>: The file is usually minified and compressed (e.g., using Gzip) to speed up the download.</li><li><strong>Caching</strong>: The browser may cache the file for future use, reducing the need to download it again.</li></ol><h3>Step 6: Rendering the Page</h3><p>Once <strong>bundle.js</strong> and other resources (like images and CSS) are downloaded:</p><ol><li><strong>Parsing</strong>: The browser parses the HTML, CSS, and JavaScript.</li><li><strong>DOM and CSSOM Construction</strong>: It creates a Document Object Model (DOM) from the HTML and a CSS Object Model (CSSOM) from the CSS.</li><li><strong>JavaScript Execution</strong>: The browser’s JavaScript engine (like V8 in Chrome) executes the code in <strong>bundle.js</strong>, enabling interactivity and dynamic content.</li><li><strong>Rendering</strong>: The browser combines the DOM and CSSOM into a Render Tree and paints the pixels on your screen.</li></ol><h3>Step 7: Continuous Communication</h3><p>Even after the page loads, the browser may continue to communicate with Google’s servers via AJAX requests or WebSockets. These enable features like live search suggestions or real-time updates.</p><h3>Final Thoughts</h3><p>Every time you type a URL like <a href="http://www.google.com/"><strong>www.google.com</strong></a>, you’re leveraging decades of innovation in networking, computing, and web technologies. From DNS resolution to OSI layer coordination and efficient resource loading, this process ensures a seamless browsing experience. While much of it happens in milliseconds, the underlying mechanisms are nothing short of remarkable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdf0f1d2f4a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing Bitcode Issues in Xcode 16: How to Resolve Invalid Executable Errors When Uploading iOS…]]></title>
            <link>https://medium.com/@abdulahad2024/fixing-bitcode-issues-in-xcode-16-how-to-resolve-invalid-executable-errors-when-uploading-ios-da07a5a39c7c?source=rss-fcd581e9f0b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/da07a5a39c7c</guid>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[xcode16]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Abdul Ahad]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 21:19:05 GMT</pubDate>
            <atom:updated>2024-09-25T21:19:05.982Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fixing Bitcode Issues in Xcode 16: How to Resolve Invalid Executable Errors When Uploading iOS Builds</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vCY7Q7l_pjUERaWqoasxdQ.png" /></figure><p>Every year, <a href="https://www.apple.com/">Apple</a> rolls out frequent software updates packed with new features, they sometimes come with unexpected glitches and bugs — Xcode 16 is no different!</p><p>After updating to <strong>Xcode 16</strong>, many of us have encountered issues — particularly related to <strong>bitcode</strong>. One common problem is being unable to upload iOS builds to <strong>AppStore Connect</strong> due to bitcode errors. Here’s a quick and comprehensive guide to fix the issue, along with an explanation of what’s happening behind the scenes.</p><h3>What is Bitcode?</h3><p><strong>Bitcode</strong> is an intermediate representation of your app that is uploaded to the App Store. It allows Apple to recompile your app to optimize it for future hardware architectures and devices without requiring you to resubmit your code. In essence, it provides flexibility for future-proofing iOS apps.</p><p>However, with <strong>Xcode 16</strong>, Apple has <strong>deprecated bitcode</strong> for all platforms, meaning that builds with <strong>bitcode enabled</strong> are no longer accepted. This change has caused issues for developers who use third-party libraries or frameworks that still have bitcode enabled, resulting in upload failures.</p><h3>The Issue with Xcode 16</h3><p>When trying to upload an iOS build to <strong>AppStore Connect</strong>, developers may encounter the following error message:</p><blockquote><strong><em>Invalid Executable:</em></strong><em> The executable ‘YourAppName.app/Frameworks/YourFramework.framework/YourFramework’ contains bitcode. (ID: 94c6633c-824a-41c8-aab4-d817b403e15b)</em></blockquote><p>The problem occurs because <strong>Xcode 16</strong> does not allow peer dependencies (like third-party libraries) to be built with bitcode enabled, yet some frameworks may still include it. This causes the build upload to fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*naREs2NbsCBSM8Yc" /><figcaption>Invalid Executable Error</figcaption></figure><h3>Step-by-Step Solution</h3><p>To resolve this issue, you need to <strong>strip the bitcode</strong> from the affected frameworks and update your project files accordingly.</p><h4>1. Strip Bitcode From the Framework</h4><p>Before building the project in Xcode, run the following command in your terminal:</p><pre>xcrun bitcode_strip -r YourFramework.framework/YourFramework -o YourFramework.framework/YourFramework</pre><p>This command strips the bitcode from your framework, resolving the immediate problem with that dependency. Make sure to add the correct path to your framework inside Pods folder. Your path may differ than mine.</p><h4>2. Update the Podfile</h4><p>You’ll also need to modify your <strong>Podfile</strong> to ensure that future builds handle bitcode removal for other frameworks. Add this code to your <strong>Podfile</strong>:</p><pre>post_install do |installer|<br>  bitcode_strip_path = `xcrun --find bitcode_strip`.chop!<br><br>  def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)<br>    framework_path = File.join(Dir.pwd, framework_relative_path)<br>    command = &quot;#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}&quot;<br>    puts &quot;Stripping bitcode: #{command}&quot;<br>    system(command)<br>  end<br><br>  framework_paths = [<br>    &quot;Pods/YourFramework/YourFramework/dynamic/YourFramework.xcframework/ios-arm64_armv7/YourFramework.framework/YourFramework&quot;,<br>  ]<br><br>  framework_paths.each do |framework_relative_path|<br>    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)<br>  end<br>end</pre><p>This script ensures that <strong>bitcode</strong> is stripped from specified frameworks during your build process, preventing future errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kt6nthtQlcgD0JpMV6mF_g.png" /><figcaption>ios/Podfile</figcaption></figure><h4>3. Rebuild and Upload</h4><p>Once you’ve stripped bitcode and updated the <strong>Podfile</strong>, rebuild your project in <strong>Xcode 16</strong> and try uploading it to <strong>AppStore Connect</strong>. The bitcode error should no longer appear.</p><p><strong>Conclusion</strong><br>By understanding the changes in <strong>Xcode 16</strong> and following these steps, you can resolve the bitcode issue and successfully upload your iOS builds to <strong>AppStore Connect</strong>. Staying updated with Xcode’s evolving features ensures smoother development and fewer surprises during the release process.</p><p>Feel free to give your feedback in the comments section below and don’t forget to like and share it with your friends among your circle. See ya next time, bye! bye! 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da07a5a39c7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-Time Network Status Detection in React JS/Next JS]]></title>
            <link>https://medium.com/@abdulahad2024/real-time-network-status-detection-in-react-js-next-js-67595c4bd81c?source=rss-fcd581e9f0b0------2</link>
            <guid isPermaLink="false">https://medium.com/p/67595c4bd81c</guid>
            <category><![CDATA[network-status]]></category>
            <category><![CDATA[internet-connection]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Abdul Ahad]]></dc:creator>
            <pubDate>Tue, 19 Mar 2024 21:53:51 GMT</pubDate>
            <atom:updated>2024-03-19T21:53:51.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFFM03Ok4FAn81Sb3Go50g.jpeg" /></figure><h3><strong>Importance of Real-Time Network Status Detection:</strong></h3><p>In today’s rapidly evolving digital landscape, the ability to detect and respond to network status changes in real-time has become paramount for ensuring seamless user experiences in web applications. Whether it’s delivering timely notifications to users about connectivity issues or dynamically adjusting content delivery based on network conditions, real-time network status detection has emerged as a crucial aspect of modern web development.</p><p>In this comprehensive guide, we’ll learn how to implement a real-time network status detection in React JS and Next JS. After following this article, your final result may look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_EnMQKfu67DQ3NEnYWAH6A.gif" /><figcaption>Real-time Network Status Detection in React JS</figcaption></figure><h3><strong>Real-Time Network Status Detection in JavaScript:</strong></h3><p>In order to implement network status detection in React applications, we don’t have to install any fancy third party package from npm website instead we will be using JavaScript web API and building the solution on our own.</p><p>In JavaScript Web API, navigator.onLine is a property provided by the JavaScript Navigator object, which represents the state of the network connection of the browser. It returns a boolean value indicating whether the browser is currently online or offline.</p><p>Are you excited to know more about JS navigator object in detail? You can read it on<a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine"> JS MDN official docs</a>.</p><h3>Real-Time Network Status Detection in React JS:</h3><p>Let’s not wait any further and implement it in React/Next JS. I am pre-assuming that y’all know how to do a basic setup of a React or Next JS application. If you don’t know, then don’t worry, you can find its basic guide in <a href="https://react.dev/learn/start-a-new-react-project">React official docs</a> and <a href="https://nextjs.org/docs/getting-started/installation">Next JS official docs</a>.</p><p>Alright, so after setting up a basic application either in React JS or Next JS, we have to brain-storm our solution.</p><p>In our solution, we have to make use of JS Web API’s navigator.onLineproperty and as we all know that we have to make this solution reusable so that we can grab this information out anywhere we need in our codebase.</p><p>In my experience with React JS, I’ve found some of the very powerful tools (concepts) and custom hooks is one of them. You can achieve better code reusability and maintainability while working with custom hooks.</p><p>Let’s implement a custom hook with the following code:</p><pre>import { useEffect, useState } from &quot;react&quot;;<br><br>const useNetworkStatus = () =&gt; {<br>  const [isOnline, setOnline] = useState&lt;boolean&gt;(true);<br><br>  const updateNetworkStatus = () =&gt; {<br>    setOnline(navigator.onLine);<br>  };<br><br>  useEffect(() =&gt; {<br>    window.addEventListener(&quot;load&quot;, updateNetworkStatus);<br>    window.addEventListener(&quot;online&quot;, updateNetworkStatus);<br>    window.addEventListener(&quot;offline&quot;, updateNetworkStatus);<br><br>    return () =&gt; {<br>        window.removeEventListener(&quot;load&quot;, updateNetworkStatus);<br>        window.removeEventListener(&quot;online&quot;, updateNetworkStatus);<br>        window.removeEventListener(&quot;offline&quot;, updateNetworkStatus);<br>    };<br>  }, [navigator.onLine]);<br><br>  return { isOnline };<br>};<br><br>export default useNetworkStatus;</pre><p>Woo-hoo! 😲 wait a minute! Its too much of a code at once. Isn’t it? Well lets discuss it one by one in detail.</p><p>I created a custom hook with useState and useEffect and added my core logic inside it. The last thing that we have to think about is when do we want to check the network status in our React application? I have used the following three events (occasions), you can add any other event if you want.</p><ol><li><strong>Load Event:</strong> triggers whenever our application is loaded, mounted or refreshed.</li><li><strong>Offline Event:</strong> triggers whenever the web API detects that the internet connection is lost or offline.</li><li><strong>Online Event:</strong> triggers whenever the web API detects that the internet connection is back online.</li></ol><p>Based on the above events, I added three event listeners inside useEffect hook and added navigator.onLine in its dependency array so that whenever our browser detects a change in network status, our useEffect re-renders. Last but not the least, we have to clear these events from frontend whenever our useEffect unmount from the screen.</p><p>We returned the boolean state isOnline as an object from our custom hook so that we can destructure it whenever we want to use it. We can make use of our custom hook as follows:</p><pre>import React from &#39;react&#39;;<br><br>const App = () =&gt; {<br><br>  const { isOnline } = useNetworkStatus();<br><br>  return (<br>      &lt;div&gt;<br>        {isOnline ? &lt;MainApp /&gt; : &lt;NetworkOffline /&gt;}<br>      &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>If the user is online, then we can enroute the user to our main app. Otherwise, we will show NetworkOffline component to the user with a message of internet disconnection inside it.</p><p>If you have been following along and implementing the above solution with me side by side, you must’ve known by this time that the above solution is not working on the initial load of the application. This is because the load event of the browser often does not work well with some browsers including Google Chrome. In order to resolve this issue, we have to create another useEffect hook with no dependency in its dependency array and call our updateNetworkStatus function inside it so that it triggers on the initial mount of our component.</p><p>Hurrah! 🥳 we’ve done it! The final updated code for our custom hook will look like the following:</p><pre>import { useEffect, useState } from &quot;react&quot;;<br><br>const useNetworkStatus = () =&gt; {<br>  const [isOnline, setOnline] = useState&lt;boolean&gt;(true);<br><br>  const updateNetworkStatus = () =&gt; {<br>    setOnline(navigator.onLine);<br>  };<br><br>  //   sometimes, the load event does not trigger on some browsers, that is why manually calling updateNetworkStatus on initial mount<br>  useEffect(() =&gt; {<br>    updateNetworkStatus();<br>  }, []);<br><br>  useEffect(() =&gt; {<br>    window.addEventListener(&quot;load&quot;, updateNetworkStatus);<br>    window.addEventListener(&quot;online&quot;, updateNetworkStatus);<br>    window.addEventListener(&quot;offline&quot;, updateNetworkStatus);<br><br>    return () =&gt; {<br>        window.removeEventListener(&quot;load&quot;, updateNetworkStatus);<br>        window.removeEventListener(&quot;online&quot;, updateNetworkStatus);<br>        window.removeEventListener(&quot;offline&quot;, updateNetworkStatus);<br>    };<br>  }, [navigator.onLine]);<br><br>  return { isOnline };<br>};<br><br>export default useNetworkStatus;</pre><p>Feel free to give your feedback in the comments section below and don’t forget to like and share it with your friends among your circle. See ya next time, bye! bye! 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67595c4bd81c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>