<?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 Muhammed ERDAL on Medium]]></title>
        <description><![CDATA[Stories by Muhammed ERDAL on Medium]]></description>
        <link>https://medium.com/@coderdal?source=rss-10eec97376ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*to40MCszk2UBz-xo2_cRrQ.jpeg</url>
            <title>Stories by Muhammed ERDAL on Medium</title>
            <link>https://medium.com/@coderdal?source=rss-10eec97376ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 10 Apr 2026 02:57:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@coderdal/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[Critical Alert: React Server Components Vulnerability “React2Shell” (And How to Fix It)]]></title>
            <link>https://coderdal.medium.com/critical-alert-react-server-components-vulnerability-react2shell-and-how-to-fix-it-4652c31c7798?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/4652c31c7798</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 08:25:31 GMT</pubDate>
            <atom:updated>2025-12-09T08:28:10.001Z</atom:updated>
            <content:encoded><![CDATA[<p>If you noticed unexpected 403 errors or latency spikes across your favorite websites lately, you weren’t alone. The frontend world is currently busy with one of the most big security vulnerability: <strong>“React2Shell” (</strong>CVE-2025–55182 and CVE-2025–66478<strong>)</strong>.</p><p>This is not just a npm audit warning. This is a severity <strong>10/10</strong> Remote Code Execution (RCE) vulnerability affecting the Next.js and React 19 ecosystem. The impact was so widespread that it triggered a global response from major infrastructure providers like Cloudflare, effectively putting a large chunk of the modern web on high alert.</p><p>A 10.0 critical severity vulnerablility affecting server-side use of React.js, tracked as <a href="https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components">CVE-2025–55182</a> in React.js and <a href="https://github.com/vercel/next.js/security/advisories/GHSA-9qr9-h5gf-34mp">CVE-2025–66478</a> specifically for the Next.js framework. (<a href="https://react2shell.com/">react2shell.com</a>)</p><p>Let’s see what happened, and what you need to do immediately.</p><h3>What is the Vulnerability?</h3><p>At a high level, the vulnerability exploits the <strong>React Server Components (RSC) “Flight” protocol</strong>. This protocol manages the data stream between the server and the client in the applications.</p><p>Due to improper input validation in the react-server* packages, an unauthenticated attacker can inject a malicious payload into the stream. When the server attempts to deserialize this payload, it executes malicious code.</p><p><strong>TL;DR</strong>: A bad actor can send a specific payload to your server and execute arbitrary code. They don’t need a login; they just need your server to be running a vulnerable version.</p><h3>Global Impact</h3><p>The scale of this vulnerability been clearer when Cloudflare, the backbone of a significant portion of the internet, stepped in.</p><p>As detailed in the <a href="https://blog.cloudflare.com/5-december-2025-outage/"><strong>Cloudflare Blog: The December 5th Outage</strong></a>, the attack signatures began spiking globally, forcing Cloudflare to deploy emergency WAF rules. Because millions of sites run on Next.js, the potential attack surface was massive.</p><p>Cloudflare’s WAF (Web Application Firewall) team had to deploy emergency rulesets to block these specific “Flight” protocol payloads at the edge. For a brief period, this aggressive filtering caused friction across the web, as legitimate RSC traffic was scrutinized to separate it from malicious attempts. It was a rare moment where we saw a framework-specific bug cause near-internet-wide congestion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7zqPJIq9Kqz3Us15.png" /><figcaption>HTTP 500 errors served by Cloudflare during the incident timeframe. <a href="https://blog.cloudflare.com/5-december-2025-outage/">https://blog.cloudflare.com/5-december-2025-outage/</a></figcaption></figure><p>This intervention bought developers time, <strong>but relying on a WAF is not a permanent fix.</strong> You must patch the root cause.</p><h3>Are You Affected?</h3><p>This vulnerability primarily targets the <strong>React 19 ecosystem</strong> and frameworks built on top of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XdgPtFGLJ_rSmZsBN4AhVA.png" /><figcaption>Affected and patched packages and versions in React.js (<a href="https://github.com/facebook/react/security/advisories/GHSA-fv66-9v8q-g76r">https://github.com/facebook/react/security/advisories/GHSA-fv66-9v8q-g76r</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uj8UTl1MLQ_mG0gybsG6Q.png" /><figcaption>Affected and patched packages and versions in Next.js (<a href="https://github.com/vercel/next.js/security/advisories/GHSA-9qr9-h5gf-34mp">https://github.com/vercel/next.js/security/advisories/GHSA-9qr9-h5gf-34mp</a>)</figcaption></figure><h4>1. Next.js Users (High Risk)</h4><p>If you are running any version of the Next.js App Router, you are <strong>at high risk</strong> if you have not patched. Next.js heavily leverages RSC and bundles the vulnerable dependencies.</p><ul><li><strong>Vulnerable Versions:</strong> Next.js ≥14.3.0, 15.x, 16.x, and Canary builds from 14.3.0 running with React 19 dependencies.</li><li><strong>Reason:</strong> Next.js exposes the vulnerable react-server-dom-* packages via its routing layer, making the RCE surface highly accessible via standard HTTP requests.</li></ul><blockquote>All users of stable 15.x or 16.x Next.js versions should upgrade to a patched, stable version immediately. (<a href="https://github.com/vercel/next.js/security/advisories/GHSA-9qr9-h5gf-34mp">RCE in React Server Components</a>)</blockquote><h4>2. Pure React 19 Users (Conditional Risk)</h4><p>If you are using React 19 in a custom setup (e.g., with a custom bundler like Webpack or Vite):</p><ul><li><strong>Vulnerable Versions:</strong> React versions 19.0, 19.1 or 19.2.</li><li>You are only vulnerable if you have <strong>explicitly installed</strong> and are utilizing the <strong>server-side components</strong> such as react-server-dom-webpack or react-server-dom-node for <strong>custom RSC </strong>implementation.</li><li>If you are <strong>only using</strong> React 19 for standard <strong>client-side rendering</strong> (CSR), <strong>you are probably safe</strong> from this specific RCE. But still would be the best to patch.</li></ul><blockquote>If your app’s React code does not use a server, your app is not affected by this vulnerability. If your app does not use a framework, bundler, or bundler plugin that supports React Server Components, your app is not affected by this vulnerability. (<a href="https://github.com/facebook/react/security/advisories/GHSA-fv66-9v8q-g76r">Critical Security Vulnerability in React Server Components</a>)</blockquote><h3>The Solution</h3><p>The React and Next.js teams have responded quickly with patches that harden the serialization logic. There is no complex workaround required; the solution is a strict dependency upgrade.</p><h4>For Next.js App Router Users:</h4><p>Upgrade Next.js, React, and React DOM.</p><pre>npm install next@15.0.5   // for 15.0.x<br>npm install next@15.1.9   // for 15.1.x<br>npm install next@15.2.6   // for 15.2.x<br>npm install next@15.3.6   // for 15.3.x<br>npm install next@15.4.8   // for 15.4.x<br>npm install next@15.5.7   // for 15.5.x<br>npm install next@16.0.7   // for 16.0.x<br><br>npm install next@latest   // for the latest version</pre><blockquote><em>Target Next.js Versions:</em> Ensure your version is at least <strong>15.0.5</strong>, <strong>15.1.9</strong>, or <strong>16.0.7</strong>. <em>Target React Versions:</em> Ensure both react and react-dom are at <strong>19.0.1+</strong>.</blockquote><blockquote><strong>Verify Lock Files:</strong> Double-check your package-lock.json to confirm that underlying transitive dependencies (like react-server-dom-*) have been updated to the patched versions (e.g., 19.2.1+).</blockquote><h4>For Pure React.js Users:</h4><p>Update Core and RSC-Specific Packages:</p><pre>npm install react@latest<br>npm install react-dom@latest<br><br># Optionally If you are using React Router’s unstable RSC APIs,<br># you should upgrade the following package.json dependencies if they exist:<br><br>npm install react-server-dom-parcel@latest<br>npm install react-server-dom-webpack@latest<br>npm install react-server-dom-turbopack@latest<br>npm install react-server-dom-node@latest</pre><h3>Conclusion</h3><p>The “React2Shell” incident is a wake-up call. It highlights how deeply the modern web relies on frameworks like Next.js. When a vulnerability hits the core protocol, it ripples from individual startups all the way up to edge providers like Cloudflare.</p><p>Don’t rely solely on the edge to protect you. Update your builds today.</p><p>Thanks for reading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4652c31c7798" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we call them Computers ? How it works ? How it Co]]></title>
            <link>https://coderdal.medium.com/why-we-call-them-computers-how-it-works-how-it-co-6acd19fd88d4?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/6acd19fd88d4</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 14:38:22 GMT</pubDate>
            <atom:updated>2024-09-21T14:38:22.491Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why we call them Computers ? How it works ? How it Computes ?</h3><p>Have you ever thought about how computers work? Or do you think it is a magical process? How do these electronic components, which have entered our lives in the last century and have gained a very important place, really work? Let’s have a look…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*GYle4XR_bPpnEMSq.jpg" /><figcaption>The Summit Supercomputer — Wikipedia</figcaption></figure><h4>History of the Computers</h4><p>You may be surprised to learn that <strong>computers have been around a lot longer</strong> than you think. In fact, <strong>they date back to 2400 BC</strong>. <strong>The abacus</strong>, <strong>developed in China around 2400 BC</strong>, is <strong>considered </strong>the <strong>primitive ancestor of today’s computers</strong>. This <strong>tool was used for simple addition </strong>and <strong>multiplication</strong> and helped to <strong>perform arithmetic</strong> <strong>calculations</strong>.<br><strong>Charles Babbage</strong> <strong>introduced</strong> the <strong>concept of </strong>the <strong>programmable computer</strong>. <strong>He’s </strong>often <strong>referred </strong>to as the “<strong>father of the computer</strong>. <strong>Babbage designed </strong>and <strong>invented </strong>the <strong>first mechanical computer</strong> in the <strong>early 19th century</strong>. <br>If you’re wondering <strong>how this relates</strong> to <strong>today’s computers</strong>, I’ll explain in a moment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*CvWxA8zGGufT1S1V.jpg" /><figcaption>Copy of a <a href="https://en.wikipedia.org/wiki/Roman_abacus">Roman abacus</a> — Wikipedia</figcaption></figure><p><strong>How long</strong> have <strong>computers</strong>(<em>including mobile phones and others</em>) <strong>that we actually know existed?</strong> Unlike mechanical, analog (calculation) computers, <strong>digital computers</strong> have been <strong>invented </strong>in the <strong>last hundred years</strong> and have <strong>experienced incredible development</strong>. <br><strong>The </strong><a href="https://en.wikipedia.org/wiki/Torpedo_Data_Computer"><strong>Torpedo Data Computer</strong></a>, <strong>considered </strong>the <strong>first digital computer</strong>, was an <strong>electromechanical analog computer</strong> <strong>developed by </strong>the <strong>United States Navy </strong>for a submarine in <strong>1938</strong>.<br>During <strong>World War II</strong>, the <strong>search of</strong> <strong>different ways</strong> to <strong>perform</strong> <strong>complex arithmetic operations</strong> <strong>was a major factor</strong> in the <strong>development of the computer.</strong> The <strong>Enigma machine</strong>(1930), which <strong>had a major impact</strong> <strong>on the course of the war</strong> and an <strong>important place</strong> <strong>in </strong>the <strong>history of computers</strong>, was a <strong>machine designed </strong>to <strong>decode encrypted messages</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*kvI6IHUM1AJ-EiiO.jpg" /><figcaption>Torpedo Data Computer 1860 — Wikipedia</figcaption></figure><p>If you <strong>look at</strong> the <strong>history of computers</strong>, you’ll see that <strong>it’s not wrong to call them “computers”.</strong> Nowadays, <strong>these machines</strong> are <strong>in every aspect of our lives</strong>, <strong>allowing </strong>you to <strong>access this article</strong>, <strong>have phone calls</strong>, and <strong>many other things</strong>. <strong>In fact</strong>, <strong>they do one thing</strong> and one thing only: “<strong>computing</strong>”.</p><h4>How does the Computer Computes ?</h4><p><strong>How does</strong> just doing <strong>computing allow you</strong> to <strong>make phone calls</strong>, <strong>surf the internet </strong>and <strong>watch videos</strong>?<br>We have the <strong>power of mathematics</strong> and <strong>engineering</strong> to <strong>thank for that</strong>.<br><strong>Computers</strong>, <strong>smart devices</strong> and <strong>others work</strong> <strong>entirely</strong> <strong>with numbers</strong> and the <strong>manipulation of numbers</strong>. Numbers are language of the computers.<br><strong>The numbers we use</strong> in daily life <strong>are </strong>slightly <strong>different from </strong>the <strong>numbers computers use</strong>. <strong>Computers don’t use</strong> the <strong>decimal number system</strong> <strong>we use</strong> in daily life. <strong>The reason</strong> for this <strong>is electronics</strong>. <strong>Computers use electrical circuits</strong>(transistors) <strong>to store</strong> and <strong>compute the data</strong>, and they <strong>can only store two values; which is: one</strong>(1) and <strong>zero</strong>(0). <strong>All </strong>the amazing <strong>calculations </strong>and <strong>operations </strong>that your <strong>computers perform</strong> in daily life <strong>are based on these</strong> <strong>two possibilities</strong>. <strong>But </strong>wait, <strong>there’s more</strong>!</p><p><strong>The decimal number system</strong> we use in daily life <strong>is </strong>a <strong>10-based system</strong>.<br><strong>We have ten digits</strong>: <strong>0, 1, …, 8, 9</strong>. <strong>We put these digits next to each other</strong> <strong>to form a number</strong>. The <strong>rightmost digit</strong> of these numbers is <strong>10⁰ * n</strong>, and <strong>as we</strong> <strong>move to the left digits</strong>, we get <strong>10¹ * n</strong>, <strong>10² * n</strong>, <strong>and so on</strong>. This means that the <strong>leftmost digit</strong> is <strong>always the largest </strong>digit, and the <strong>rightmost digit</strong> is the <strong>ones</strong> digit, the <strong>smallest </strong>digit.<br><strong>In computers</strong>, the <strong>same thing</strong> is done <strong>with 0 and 1</strong>, which is to say, <strong>in </strong>terms of the <strong>base 2 </strong>which is <strong>also called</strong> as <strong>Binary</strong>. <strong>2⁰ * n</strong>, <strong>2¹ * n, …<br>When we multiply the base by the exponent</strong>(<em>the position number</em>) and <strong>multiply the results</strong>, <strong>we get the number</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*5QPB1ma8T1Xhbcb9.jpg" /><figcaption>Value of a number in Decimal System — theplctutor.com</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/0*jk-iVyke4E_rSGHa.PNG" /><figcaption>Value of a number in Binary System —Geeksforgeeks</figcaption></figure><p>We now have a <strong>superficial understanding</strong> of <strong>how computers perform numerical operations</strong>, but <strong>what about data other than numbers</strong>?<br>How are <strong>texts,</strong> <strong>photos</strong>, <strong>sounds</strong>, and <strong>videos represented</strong>?</p><p><strong>Computers can only process and understand numbers</strong>. But <strong>we do not have to</strong> <strong>characterize all numbers as numbers</strong>. <strong>Some numbers can have special meanings</strong> to us. For example, “01000001” <strong>may mean</strong> the <strong>letter A</strong> to us. It is <strong>a number</strong>, but <strong>we can interpret</strong> <strong>it </strong>any way we want.<br><strong>In fact, that’s exactly what we do</strong>, for example: <strong>we define special numbers for each letter</strong> to display text on the computer, and <strong>when we write a text</strong>, <strong>we actually tell the computer these numbers</strong>, <strong>not the letters or words</strong>, <strong>because it can process</strong> <strong>only numbers</strong>.<br>However, <strong>this solution requires a standard</strong> because the values representing the <strong>letters must be the same</strong> on <strong>all computers</strong> and in <strong>all environments</strong>, <strong>otherwise</strong> <strong>differences </strong>and <strong>problems </strong>will <strong>occur</strong>.<br><strong>For these problems</strong>, <strong>various standards</strong> have been <strong>created </strong>and are <strong>followed</strong> <strong>by </strong>all <strong>computer developers</strong>. <strong>ASCII </strong>is <strong>one of the most popular</strong> <strong>character encoding standards</strong>.</p><figure><img alt="ASCII Table — Wikipedia" src="https://cdn-images-1.medium.com/max/1024/0*mUl5_L864-J1E_Pu.png" /><figcaption>ASCII Table — Wikipedia</figcaption></figure><p><strong>To support different alphabets</strong>, <strong>emojis </strong>and <strong>special characters</strong>, more <strong>advanced </strong>and <strong>larger character encoding</strong> <strong>standards such as</strong> <a href="https://en.wikipedia.org/wiki/UTF-8"><strong>UTF-8</strong></a> are <strong>used today</strong>.</p><p><strong>Similarly</strong>, <strong>there are standards</strong> created <strong>for different types of data</strong>. <strong>Audio encoding formats</strong>(MP3, AAC), <strong>video encoding formats</strong>(H.264…) and more..</p><p>That is why <strong>the files we use</strong> <strong>on </strong>our <strong>computers have different extensions</strong>. These <strong>extensions indicate</strong> <strong>whether our computer will process the file</strong> as a text file, a video file, or something else.<em>(.txt, .mp4, .mp3)</em></p><p>Thanks for reading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6acd19fd88d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Scope in JavaScript | Deep Dive]]></title>
            <link>https://coderdal.medium.com/understanding-scope-in-javascript-deep-dive-dbec1b50b690?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbec1b50b690</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 19:35:30 GMT</pubDate>
            <atom:updated>2024-07-11T19:35:30.556Z</atom:updated>
            <content:encoded><![CDATA[<p>Javascript has changed a lot since its release. The concept of <strong>Scope</strong> also gained a different dimension with <strong>ES6</strong><em>(2015)</em>. In this article, I will discuss the concept of <strong>Scope in JavaScript</strong> in detail by giving examples. Understanding scope is important for writing clean, efficient, and bug-free JavaScript code. Let’s start !</p><h3>Okay but, What is Scope ?</h3><p>Scope refers to the region of the code where a variable is defined and accessible. A scope can be thought of as a container that holds a set of variables, functions and other declarations. e.g.</p><h4>The Scope Chain</h4><p>Scope chain is a hierarchical structure that represents the nesting of scopes in JavaScript. When a variable or function is accessed, JavaScript traverses the scope chain to find the variable’s declaration; starts from innermost scope and moves outward through the chain of parent scopes until it finds the variable or reaches the global scope. If the accessed reference doesn’t exist in the scope, you will get <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError"><em>ReferenceError</em></a>.</p><h3>Scope Types</h3><p>JavaScript has three main types of scope:</p><ul><li><strong>Global scope</strong>: Variables declared <strong>outside</strong> of any <strong>function or block</strong> are assigned global scope. These variables are accessible from any part of the codebase. (var, let, const)</li><li><strong>Function scope</strong>: Each function creates a new scope, which contains its local variables and functions. (var, let, const)</li><li><strong>Block scope </strong><em>(ES6)</em>: Blocks, such as if statements and loops, creates a new scope <strong>{}</strong>. (let, const)</li></ul><p>Before taking a look at each type, let’s talk about variable declarations.</p><p>In JavaScript, there are three main ways to declare variables: <strong>var, let, const</strong>. Each of these keywords has different scope behaviors that affect how the variable can be accessed and manipulated within the code. Let me explain:</p><ol><li><strong>var</strong>: The <strong>var</strong> keyword is the oldest way to declare variables in JavaScript. Declarations with <strong>var</strong> has <strong>function scope</strong>, so they are only accessible within the function in which they are declared. If a variable is declared <strong>outside of a function</strong> using <strong>var</strong>, it becomes a <strong>global variable</strong> and can be accessed anywhere in the code. <strong>i.e.</strong> declaring every variable in global can lead to potential naming conflicts and make the code harder to maintain. So it’s not recommended nowadays.</li><li><strong>let</strong>: The <strong>let</strong> keyword was introduced in <strong>ES6</strong> (<em>ECMAScript 2015</em>) as a way to declare <strong>block-scoped</strong> variables. Variables declared with <strong>let</strong> are only accessible within the <strong>block</strong> in which they are defined, whether it’s a function, loop, or conditional statement. This helps prevent variable hoisting and makes the code more predictable and easier to reason about.</li><li><strong>const</strong>: The <strong>const</strong> keyword is also introduced in <strong>ES6</strong> and similar to <strong>let</strong> in that it also creates <strong>block-scoped</strong> variables. However, variables declared with <strong>const</strong> are <strong>read-only</strong>, meaning their value cannot be changed once it has been assigned. This makes const a good choice for variables that should not be reassigned, such as constants or configuration values.</li></ol><h4>Global Scope</h4><p>Global scope is the <strong>largest scope</strong> available. Declarations in the global scope are <strong>accessible</strong> from <strong>anywhere</strong> in your code, whether inside functions, if statements, or other blocks of code.</p><pre>var globalVar = &quot;I&#39;m a global variable declared with var.&quot;;<br>let globalLet = &quot;I&#39;m a global variable declared with let.&quot;;<br>const globalConst = &quot;I&#39;m a global variable declared with const&quot;;<br><br>function someFunction() {<br>    console.log(globalVar); // Accessible<br>    console.log(globalLet); // Accessible<br>    console.log(globalConst); // Accessible<br>}<br><br>someFunction();<br>console.log(globalVar); // Also accessible</pre><h4>Function Scope</h4><p>Each <strong>function creates</strong> a new <strong>scope</strong>. This is also known as <strong>local scope</strong>. <strong>Variables</strong> defined inside a function are <strong>not accessible</strong> from <strong>outside</strong> the function and variables declared with <strong>var</strong>, <strong>let</strong> and <strong>const </strong>are quite similar when declared inside a function.</p><pre>function exampleFunction() {<br>    var functionVar = &quot;Function variable declared with var.&quot;;<br>    let functionLet = &quot;Function variable declared with let.&quot;;<br>    const functionConst = &quot;Function variable declared with const&quot;;<br>    console.log(functionVar, functionLet, functionConst); // Accessible<br>}<br><br>exampleFunction();<br>console.log(functionVar, functionLet, functionConst);<br>// Error: functionVar, functionLet, functionConst is not defined</pre><h4>Block Scope</h4><p>JavaScript since it’s release had only <strong>Global Scope</strong> and <strong>Function Scope</strong>. After <strong>ES6</strong>,<strong> </strong><strong>let</strong> and <strong>const</strong> were introduced and these two keywords provides <strong>Block Scope</strong> in JavaScript. <strong>ECMAScript (ES6) 2015</strong> <strong>was</strong> the <strong>second major revision</strong> to JavaScript. The <strong>variables</strong> declared <strong>inside</strong> a <strong>{ } block</strong> (if, for, while loops, etc.) using <strong>let</strong> or <strong>const</strong> cannot be accessed from outside the block.</p><p>Introduced with the let and const keywords in ES6, block scope restricts the variable&#39;s visibility to the block it is declared in .</p><pre><br>if (true) {<br>    let blockLet = &quot;Block variable declared with let.&quot;;<br>    const blockConst = &quot;Block variable declared with const&quot;;<br>    console.log(blockLet, blockConst); // Accessible<br>}<br><br>console.log(blockLet, blockConst); <br>// Error: blockLet, blockConst is not defined</pre><blockquote><strong><em>Note:</em></strong><em> Variables declared with </em><strong><em>var</em></strong><em> </em><strong><em>doesn’t have block scope</em></strong><em>. Unlike </em><strong><em>let </em></strong><em>and </em><strong><em>const</em></strong><em>, </em><strong><em>var</em></strong><em> is function-scoped or global-scoped, meaning it does not respect block boundaries such as those created by </em><em>if statements or </em><em>for loops.</em></blockquote><p>Thanks for reading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbec1b50b690" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uygulamalarınıza Çoklu Dil Desteği Nasıl Eklenir ? i18next Nedir ?]]></title>
            <link>https://coderdal.medium.com/uygulamalar%C4%B1n%C4%B1za-%C3%A7oklu-dil-deste%C4%9Fi-nas%C4%B1l-eklenir-i18next-nedir-3f91a621d652?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f91a621d652</guid>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:00:24 GMT</pubDate>
            <atom:updated>2024-01-24T20:01:49.301Z</atom:updated>
            <content:encoded><![CDATA[<h3>Uygulamalarınıza Çoklu Dil Desteği Nasıl Eklenir ? i18next Nedir ?</h3><p>Günümüz dünyasında içerik ve uygulamaları farklı dillerde sunmak önemli bir gereksinim haline gelmiştir. <strong>i18next</strong>, bu gereksinimi uygulamalarınızda kolay ve hızlı bir şekilde karşılayabilmeniz için kullanabileceğiniz güçlü bir araçtır. <strong>i18next, </strong>Çok dilli içerik yönetimini ve çeviri sürecini etkili ve verimli bir şekilde yönetmenize olanak tanır.</p><h3>i18next Nedir ?</h3><p><strong>i18next, </strong>JavaScript ile geliştirilmiş olan bir <em>internationalization </em><strong><em>(uluslararasılaştırma) </em></strong>frameworküdür. <strong>JavaScript</strong> ile geliştirilmesine rağmen birçok programlama diliyle uyumlu bir şekilde çalışabilmektedir. <strong>i18next </strong>ile ister <strong>Mobil </strong>ister <strong>Web </strong>ister <strong>Masaüstü </strong>uygulamalarınıza kolay bir şekilde çoklu dil desteğini ekleyebilirsiniz.</p><p>Başlangıçta <strong>Frontend frameworkleri </strong>için geliştirilen bu kütüphane, bugün <strong>Node.js, PHP, Ruby ve IOS, Android </strong>gibi birçok ortamda aktif olarak desteklenmektedir. Bu yazıda, <strong>JavaScript</strong> tarafını ele alacağım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*otPrCGKgRjpl635x" /><figcaption>Some of the technologies i18next supports.</figcaption></figure><p>Kütüphanenin temeldeki çalışma mantığı, uygulamada görünecek olan içeriklerin — metinlerin; kullanıcı diline göre (<em>localization</em>) belirlenen dil paketinden (<em>Nesne formatında bulunan</em>) alınması üzerinedir. Ancak kütüphanenin nasıl kullanılacağına geçmeden önce bazı avantajlarından bahsetmek istiyorum:</p><h3>i18next Avantajları Nelerdir?</h3><ul><li>Kullanıcı dilini tespit etme.</li><li>Uygun dil paketini çalıştırma.</li><li>İsteğe bağlı içerik cache mekanizması.</li><li><a href="https://www.i18next.com/overview/plugins-and-utils">Eklentiler</a>, topluluk tarafından oluşturulan <strong>Çeviri</strong>, <strong>Formatlandırma </strong>ve <strong>Dil tespiti</strong> gibi işlevler için geliştirilmiş bir çok eklenti.</li></ul><p>Özel ihtiyaçlara karşı esnek bir yapısı mevcuttur.</p><ul><li>Tarih formatlandırma gibi işlemlerde <strong>moment.js </strong>gibi paketlerle uyumlu çalışan ulusal yapı desteği.</li></ul><p><strong>Ölçeklendirme</strong>, küçük projelerden büyük projelere kadar uyumlu çalışma desteği, dil paketlerini modüler kullanma desteği.</p><p><strong>Ekosistem</strong>, Geniş ve aktif topluluk sayesinde, bir çok platformda aktif geliştirici kitlesi ve destekçiler.</p><h3>i18next Nasıl Kurulur ?</h3><p><strong>NOT:</strong> Kurulum işlemi çalışma ortamına ve kullandığınız framework’e göre değişkenlik gösterebilir. Bu yazıda <strong>React</strong> ve <strong>Vue</strong> üzerinden ilerleyeceğim. <a href="https://www.i18next.com/">Farklı ortamlarda kurulum için dökümantasyonu inceleyebilirsiniz.</a></p><h4>Vue için Kurulum</h4><pre># npm<br>npm install i18next --save<br>npm install i18next-vue --save</pre><h4>React için Kurulum</h4><pre># npm<br>npm install i18next --save<br>npm install react-i18next --save</pre><h4><strong>CDN ile Kurulum</strong></h4><p><strong>unpkg.com</strong></p><ul><li><a href="https://unpkg.com/i18next/dist/umd/i18next.js">https://unpkg.com/i18next/dist/umd/i18next.js</a></li><li><a href="https://unpkg.com/i18next/dist/umd/i18next.min.js">https://unpkg.com/i18next/dist/umd/i18next.min.js</a></li></ul><p><strong>Esm veya Cjs:</strong></p><ul><li><a href="https://unpkg.com/i18next/dist/esm/i18next.js">https://unpkg.com/i18next/dist/esm/i18next.js</a></li><li><a href="https://unpkg.com/i18next/dist/cjs/i18next.js">https://unpkg.com/i18next/dist/cjs/i18next.js</a></li></ul><h3>i18next Nasıl Kullanılır ?</h3><p>Kurulum işlemini çalıştığınız teknolojilerle uyumlu bir şekilde yaptıktan sonra, <strong>i18next’i </strong>konfigüre ederek kullanmaya hazır hale getirebilirsiniz.</p><p>Konfigürasyon dosyasında, ayarlamaları ve dil tercihine göre seçilecek olan çevirileri tanımlayabilirsiniz. <strong>i18next </strong>kullanıcı dili seçeneğine göre tanımladığınız dil paketlerinden seçileni dahil edecek ve uygulama içerisinde bir içeriğe erişmek istediğinizde bu dil paketinden belirttiğiniz içeriği alacaktır.</p><p><strong>NOT:</strong> Çeviri içeriklerini bağımsız bir dosyada .js veya .json formatında saklamak ve konfigürasyon dosyasına dahil etmek daha doğru bir kullanım şekli olacaktır. Ancak örneklerde direkt olarak tanımlayacağız.</p><p>Öncelikle <strong>i18next</strong>’i konfigüre etmek için proje ana dizininde veya src/lang klasörü içerisinde i18n.js adında bir dosya oluşturun. Bu dosya dil sisteminin yönetildiği ve tanımlandığı dosya olacak.</p><p>Bu dosyanın yapısı bütün teknolojilerde neredeyse aynı ancak <strong>React </strong>ve<strong> Vue </strong>gibi Frameworklerde ek olarak özel bazı paketler yüklemek gerekiyor.</p><pre>// i18n.js<br><br>import i18next from &#39;i18next&#39;;// i18next<br><br>i18next<br>  .init({<br>    lng:&quot;tr&quot;,// Kullanıcı dili --&gt; Seçilecek olan dil paketi. Manuel eklemek yerine i18next-browser-languagedetector gibi paketleri de kullanabilirsiniz.<br>    debug: true,// hata ayıklama modu, konsol&#39;da çıktı verir.<br>    fallbackLng: &#39;en&#39;,// çeviri mevcut değilse kullanılacak olan varsayılan dil paketi.<br>    resources: {// dil paketleri<br>      en: {// en paketi<br>        translation: {// en paket çevirileri<br>          test: &quot;Test message English&quot;,<br>          title: &quot;Content Title&quot;<br>        }<br>      },<br>      tr: {// tr paketi<br>        translation:{// tr paket çevirileri<br>            test: &quot;Deneme mesajı Türkçe&quot;,<br>            title: &quot;İçerik Başlığı&quot;<br>        }<br>      }<br>    }<br>  });</pre><p>Dil paketleri <strong>Object </strong>veya <strong>JSON </strong>formatında tanımlanabilir. Dil paketi seçilirken dil paketinin <strong>key değeri</strong> dikkate alınır. Dil paketindeki bir çeviriye ulaşırken ise, translation içerisindeki değerler üzerinden aksiyon alınır. translation kendi içerisinde de nesneler içerebilir.</p><p>Konfigürasyon dosyamızı sorunsuz bir şekilde tanımladıktan ve çevirileri ekledikten sonra, neredeyse çoklu dil desteğini kullanmaya hazırsınız.</p><p>Son olarak kullandığınız framework’e özel bazı konfigürasyonları yapmanız gerekebilir. <strong>React </strong>ve <strong>Vue</strong> için bu konfigürasyonlar nasıl yapılır:</p><h4>Vue ile <strong>i18next </strong>nasıl kullanılır ?</h4><p>Vue 3 kullanıyorsanız tek yapmanız gereken Vue instance’ına <strong>i18n</strong> paketini ve <strong>konfigürasyon dosyasını</strong> tanıtmak. Bunu main.js dosyasında direkt olarak yapabilirsiniz ancak kodları düzenli tutmak ve konfigürasyonu tek bir dosyada tamamlamak için aşağıdaki adımları uygulayabilirsiniz:</p><ul><li>i18n.js dosyasına kurmuş olduğunuz i18next-vue paketini dahil edin.</li><li>Bu dosyadan aşağıdaki gibi bir default fonksiyon dışa aktarın.</li><li>main.js dosyanızda bu fonksiyonu çağırın ve argüman olarak Vue instance’ını gönderin.</li><li>Hazırsınız !</li></ul><pre>// i18n.js<br>import I18NextVue from &#39;i18next-vue&#39;;// i18next-vue<br><br>....<br>// Bu fonksiyon instance&#39;ı alacak ve i18next&#39;i instance&#39;a dahil edecek.<br>export default function (app) {<br>  app.use(I18NextVue, { i18next })<br>  return app<br>}</pre><pre>// main.js<br><br>import i18n from &quot;./i18n.js&quot;;<br><br>const app = createApp(App);<br><br>....<br>// app instance&#39;ını argüman olarak ilet<br>i18n(app).mount(&#39;#app&#39;)</pre><p>Artık <strong>Vue</strong> uygulamanızda istediğiniz her yerde <strong>Vue </strong>instance’ı üzerinde tanımlanan $t() fonksiyonu aracılığıyla dil paketi içeriklerine erişebilirsiniz.</p><p>$t() fonksiyonuna argüman olarak <strong>string formatında</strong> ulaşmak istediğiniz çeviri elemanının <strong>key değerini</strong> gönderdiğinizde ulaşmak istediğiniz değeri uygun dil paketi içerisinden geri döndürecektir. Bir nesne elemanına erişmek için ise; string olarak <strong>dot notation</strong> yöntemini kullanabilirsiniz.</p><pre>Örnek Kullanım:<br>&lt;template&gt;<br>&lt;h2&gt;{{$t(&#39;test&#39;)}}&lt;/h2&gt; --&gt; Deneme mesajı Türkçe<br>&lt;/template&gt;</pre><p><strong>Programatik Olarak Dil Değiştirme</strong></p><p><strong>Vue</strong> üzerinde <strong>i18next</strong> Dilini değiştirmek için, <strong>Vue</strong> instance’da bulunan $i18next nesnesinde bulunan changeLanguage fonksiyonunu kullanabilirsiniz.</p><pre>// farklı dil paketine geçiş yap<br>this.$i18next.changeLanguage(&quot;en&quot;)</pre><h4>React ile i18next nasıl kullanılır ?</h4><p><strong>React</strong> kullanıyorsanız tek yapmanız gereken ilgili paketleri yükledikten sonra konfigürasyon dosyasında react-i18next paketini konfigürasyona dahil etmek ve konfigürasyonu dışarı aktarmak, son olarak i18n.js dosyasını index.js dosyasına dahil etmek.</p><pre>// i18n.js<br>import { initReactI18next } from &#39;react-i18next&#39;;// react i18next paketi<br><br>i18n<br>  .use(initReactI18next)// initReactI18next paketini kullan<br>  ...<br><br><br>export default i18n;// konfigürasyonu dışarı aktar</pre><pre>// index.js<br>...<br><br>// konfigürasyon&#39;u dahil et<br>import &#39;./i18n.js&#39;;<br><br>...<br>);</pre><p>Bundan sonra <strong>React </strong>uygulamanızda istediğiniz her yerde uygun dil paketinden içeriklerinizi dahil edebilirsiniz. Dil paketinde bulunan içeriklere erişmek için react-i18next paketinin sağladığı useTranslation hook’unu kullanabilirsiniz. Hook içerisinden return edilent fonksiyonunu tanımladıktan sonra bu fonskyion ile ulaşmak istediğiniz içeriklere erişebilirsiniz.</p><p>t fonksiyonuna argüman olarak <strong>string formatında</strong> ulaşmak istediğiniz çeviri elemanının <strong>key</strong> değerini gönderdiğinizde ulaşmak istediğiniz değeri uygun dil paketi içerisinden geri döndürecektir. Bir nesne elemanına erişmek için ise; string olarak <strong>dot notation</strong> yöntemini kullanabilirsiniz.</p><pre>// Örnek kullanım:<br><br>import { useTranslation } from &#39;react-i18next&#39;;// paketi dahil et<br><br>function App() {<br>  const { t } = useTranslation();// t fonksiyonunu tanımla<br><br>  return (<br>    &lt;div&gt;<br>        &lt;h2&gt;{t(&#39;test&#39;)}&lt;/h2&gt; --&gt; Deneme mesajı Türkçe<br>    &lt;/div&gt;<br>  )<br>}</pre><p><strong>Programatik Olarak Dil Değiştirme</strong></p><p><strong>React</strong> üzerinde <strong>i18next</strong> Dilini değiştirmek için, useTranslation hook’undan return edileni18n nesnesindeki changeLanguagefonksiyonunu kullanabilirsiniz.</p><pre>const { t, i18n } = useTranslation();<br><br>// farklı dil paketine geçiş yap<br>i18n.changeLanguage(&quot;en&quot;)</pre><p><strong>i18next, JSON </strong>formatındaki dil paketlerinizi otomatik olarak istediğiniz dile çevirmek için kullanabileceğiniz faydalı bir web servisi de sunmaktadır:</p><p><a href="https://translate.i18next.com/">https://translate.i18next.com/</a></p><h4>Kaynaklar</h4><ul><li><a href="https://en.wikipedia.org/wiki/Internationalization_and_localization">Internationalization and localization - Wikipedia</a></li><li><a href="https://www.i18next.com/">Introduction | i18next documentation</a></li><li><a href="https://locize.com/">locize - continuous localization as a service</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f91a621d652" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SASS Nedir ? Nasıl Çalışır ? Neden SASS ?]]></title>
            <link>https://coderdal.medium.com/sass-nedir-nas%C4%B1l-%C3%A7al%C4%B1%C5%9F%C4%B1r-neden-sass-5b5e6df79f77?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b5e6df79f77</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[sass]]></category>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Sat, 19 Aug 2023 17:21:23 GMT</pubDate>
            <atom:updated>2023-08-19T17:27:59.492Z</atom:updated>
            <content:encoded><![CDATA[<h3>SASS Nedir ? Nasıl Çalışır ? Neden SASS ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*iWb-2CPt3jVWlDyN.png" /><figcaption>Sass-lang logo.</figcaption></figure><h3>Sass Nedir ?</h3><p><strong>SASS</strong>, <strong>CSS</strong>’in daha güçlü, yetenekli ve esnek olmasını sağlayan bir önişlemcidir <em>(preprocessor)</em>. <strong>Web </strong>geliştirmenin bir standardı olan <strong>CSS</strong>’e<em> </em>yeni özellikler ve işlevler ekleyerek, daha yönetilebilir, özelleştirilmiş ve geliştirici-dostu olan yapılar oluşturmayı amaçlar. <strong>SASS</strong>, <strong>CSS</strong>’in temel özelliklerini genişletir ve geliştiricilere kod tekrarını azaltma, daha düzenli ve okunabilir kod yazma gibi avantajlar sunar.</p><h4>SASS’ın Temel Özellikleri Nelerdir ?</h4><ul><li><strong>Değişkenler</strong>: Aynı değeri birden çok kez kullanmanız gerektiğinde, değeri bir değişken olarak saklayabilir ve istediğiniz yerlerde kullanabilirsiniz. Bu, stil dosyalarının daha düzenli, okunabilir ve yönetilebilir olmasını sağlar.</li><li><strong>Nesting</strong>: Stil tanımlamalarını daha hiyerarşik bir yapıda yazabilirsiniz. Bu da stil dosyalarını daha okunabilir ve anlaşılır kılar.</li><li><strong>Mixin Yapısı</strong>: Tekrar eden stilleri ve özellikleri tanımlamak için kullanılır. <strong>Mixin</strong>’ler, stil kodunun daha az tekrar edilmesini sağlar ve bakımı kolaylaştırır.</li><li><strong>Extend — inheritance Yapısı</strong>: Bir stil tanımını başka bir stil tanımına aktarmanızı sağlar. Bu da kod tekrarını azaltır ve stil dosyalarını daha verimli hale getirir.</li><li><strong>Fonksiyonlar</strong>: Özel fonksiyonlar tanımlayabilir ve bunları stil özelliklerini hesaplamak gibi işlemler için kullanabilirsiniz.</li><li><strong>Partials: </strong>Stil kodlarınızı dosyalar halinde daha küçük parçalara bölerek modüler ve yüksek performanslı bir şekilde kullanmanızı sağlar.</li><li>…..</li></ul><h4>SASS’ın Avantajları Nelerdir ?</h4><ul><li><strong>Daha Verimli Kod Yönetimi</strong>: <strong>Değişkenler</strong>, <strong>Extend </strong>yapısı ve <strong>Mixin</strong>’ler sayesinde kod tekrarını önler ve stil dosyalarını daha düzenli hale getirir.</li><li><strong>Daha Hızlı Geliştirme</strong>: <strong>Nesting </strong>yapısı, stil tanımlamalarını daha hızlı ve kolay hale getirir, kod okunabilirliğini artırır.</li><li><strong>Daha Fazla Esneklik</strong>: <strong>Function</strong> ve <strong>Mixin </strong>gibi özellikler sayesinde stilleri daha esnek bir şekilde uygulayabilirsiniz.</li><li><strong>Daha İyi Bakım</strong>: Değişiklik yapmanız gerektiğinde, ortak yapıları güncellemek tüm sayfalardaki stil özelliklerini etkiler ve bakımı kolaylaştırır.</li><li><strong>Daha organize CSS</strong>: Stil dosyalarını daha düzenli bir şekilde organize etmenizi sağlar, <strong>Partials </strong>yapısı sunar..</li></ul><h4>SASS Nasıl Kullanılır?</h4><p><strong>SASS</strong> iki farklı sözdizimi kullanımına olanak tanır, <strong>SCSS</strong> ve <strong>SASS. </strong>Popüler olan ve sık kullanılan sözdizimi <strong>SCSS</strong>’tir.</p><ul><li><strong>SCSS:</strong> <strong>Sass’ın</strong> yeni ve genişletilmiş sözdizimidir. Geleneksel <strong>CSS</strong> yazımına daha yakındır ve stil tanımlamalarında süslü parantezler {} ve noktalı virgüller ; kullanır.</li><li><strong>SASS</strong>: <strong>Sass’ın</strong> orijinal sözdizimidir, stil tanımlamalarını daha kısa ve düzenli bir şekilde yazmanıza olanak tanır. Süslü parantezler ve noktalı virgüller kullanılmaz; boşluklar ve girintiler yapının şekillenmesini sağlar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*c_ETOZNPkPYp7QFa.png" /><figcaption>SCSS vs. SASS.</figcaption></figure><h4><strong>SASS Kullanım Örnekleri:</strong></h4><p><em>Örnekler için </em><strong><em>SCSS</em></strong><em> sözdizimini kullanacağım.</em></p><p><strong>Değişken Tanımlama ve Kullanma:</strong></p><pre>$font-stack: Helvetica, sans-serif;<br>$primary-color: #333;<br><br>body {<br>  font: 100% $font-stack;<br>  color: $primary-color;<br>}</pre><p><strong>Nesting Yapısı:</strong></p><pre>nav {<br>  ul {<br>    margin: 0;<br>    padding: 0;<br>    list-style: none;<br>  }<br><br>  li { display: inline-block; }<br><br>  a {<br>    display: block;<br>    padding: 6px 12px;<br>    text-decoration: none;<br>  }<br>}<br><br><br></pre><p><strong>Extend — Inheritance Yapısı:</strong></p><pre>%message-shared {<br>  border: 1px solid #ccc;<br>  padding: 10px;<br>  color: #333;<br>}<br><br>.message {<br>  @extend %message-shared;<br>}<br><br>.success {<br>  @extend %message-shared;<br>  border-color: green;<br>}</pre><h4>SASS Nasıl Çalışır ?</h4><p><strong>SASS </strong>bir <strong>CSS </strong>önişlemcisidir, tarayıcılar tarafından direkt olarak çalıştırılabilir bir yapı üretemez, Yani günün sonunda çalışacak olan kodların <strong>CSS</strong> formatında olması gerekmektedir. Bu nedenle <strong>SASS </strong>ile oluşturulan stil yapılarının öncelikle <strong>CSS’</strong>e dönüştürülmesi gerekmektedir. Bu dönüştürme işlemi için <strong>SASS </strong>ekibi tarafından sunulan farklı dönüştürücüler kullanılmaktadır.</p><p><strong>Javascript Sass: </strong><a href="https://sass-lang.com/documentation/js-api/">https://sass-lang.com/documentation/js-api/</a></p><p><strong>Dart Sass:</strong> <a href="https://sass-lang.com/documentation/cli/dart-sass/">https://sass-lang.com/documentation/cli/dart-sass/</a></p><p>Bu dönüştürücüler ile birlikte, <strong>cli</strong> veya <strong>paket</strong>ler aracılığıyla <strong>.scss</strong> veya <strong>.sass</strong> dosyalarını <strong>.css</strong> dosyalarına çevirebilir ve kullanıma hazır hale getirebilirsiniz.</p><p><em>Örnek Kullanım:</em><br>sass &lt;input.scss&gt; [output.css]</p><h4>Resmi Dökümantasyon:</h4><p><a href="https://sass-lang.com/">Sass: Syntactically Awesome Style Sheets</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b5e6df79f77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Hoisting Nedir ?]]></title>
            <link>https://coderdal.medium.com/javascript-hoisting-nedir-50e46573f006?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/50e46573f006</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[hoisting]]></category>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 22:25:02 GMT</pubDate>
            <atom:updated>2023-09-14T07:45:48.481Z</atom:updated>
            <content:encoded><![CDATA[<h3>JavaScript Hoisting Nedir ?</h3><p>Hoisting, JavaScript ile geliştirme yapıyorsanız çokça karşılaşacağınız bir kavramdır. Yeterince bilinmediği durumlarda, uygulamanızda ciddi sorunlara neden olabilir. Bu yazıda, JavaScript’te Hoisting nedir ? Ne için var ? gibi sorulara cevap vermeye çalışacağım; keyifli okumalar…</p><h4>Hoisting Nedir ? Tanımlama</h4><p><strong>JavaScript’te Hoisting </strong>kısaca kodda bir değişkenin veya fonksiyonun ne zaman tanımlandığının değiştirilmesi olayıdır.</p><p>Kelime anlamı <em>“yukarı çekmek, kaldırmak”</em> olan <strong>Hoisting</strong>, kodda tanımlanan bazı değişken ve-ya fonksiyon’ların yorumlayıcının en üst seviyesine taşınmasıdır.</p><h4>Neden Hoisting Var ?</h4><p>Normal bir <strong>JavaScript </strong>uygulamasında, kodlar ilk satırdan başlayarak sırasıyla aşağıya doğru devam ederek çalıştırılır. Ancak, <strong>Hoisting </strong>sayesinde kodda tanımlanan bazı değişken ve-ya fonksiyonlar; tanımlandıkları yere bakılmaksızın, kodun en üst seviyesine taşınır ve memory’de tutulur. Bu sayede bu değeler kodda her yerde erişilebilir hale gelir. Bu durumun temel amacı <strong>JavaScript’in </strong>karmaşık kodları çalıştırmasını ve derlemesini kolaylaştırmaktır. Yani <strong>Hoisting</strong>, <strong>JavaScript’in </strong>bazı değişken ve fonksiyonlara erişmek için kodda gezinmesine gerek kalmadan önceden en üstte tanımlamasıdır.</p><h4>Değişkenlerde Hoisting</h4><p>Değişkenlerde <strong>Hoisting </strong>olayı yalnızca <strong>var </strong>keyword’ü ile yapılan tanımlamalarda meydana gelir. Yani <strong>let</strong> ve <strong>const </strong>ile yapılan değişken tanımlamalarında <strong>Hoisting </strong>olayı meydana gelmez.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/0*OXMhMBI6ACBRA0Uf.png" /><figcaption>Değişkenlerde hoisting olayı örnek görsel.</figcaption></figure><pre>// true<br>var cod = &quot;erdal&quot;;<br><br>// false<br>const cod = &quot;erdal&quot;;<br>let cod = &quot;erdal&quot;;</pre><p>Hatta bu durum, <strong>var</strong> keyword’ü ile yapılan değişken tanımlamalarının bazılarının global scope’a taşınmasının temel nedenidir. Değişken programın en üst noktasına taşındığı için; programın her yerinde erişilebilir hale gelir.</p><p>Ancak burada dikkat edilmesi gereken önemli bir nokta var, değişkenlerde <strong>Hoisting </strong>olayı yalnızca tanımlamaların <strong>hoist </strong>edilmesini <em>(üste taşınmasını)</em> sağlar, değişkenin değerini üste taşımaz. <strong>JavaScript </strong>yalnızca bu değişkenin tanımlandığı bilgisine sahip olur. Yani <strong>var </strong>keyword’ü ile tanımladığınız değişkenleri tanımlama bloğundan önce kullanmaya çalışırsanız <strong>undefined</strong> değerini alırsınız. Bu da bildiğiniz üzere, değişkenin tanımlandığını ancak henüz bir değer atanmadığını temsil eder.<br>Ancak <strong>let</strong> ve <strong>const</strong> ile tanımlanan değişkenleri, tanımlamadan önceden kullanmaya çalışırsanız, <strong>Hoisting </strong>olayı olmayacağından, referans hatası alırsınız.</p><pre>console.log(erdal);// undefined<br><br>//  hoist | non-hoist<br>var erdal = &quot;coderdal&quot;;<br><br>console.log(erdal);// coderdal</pre><pre>console.log(erdal);// ReferenceError<br><br>//  no hoisting<br>const erdal = &quot;coderdal&quot;;<br>let erdal = &quot;coderdal&quot;;<br><br>console.log(erdal);// coderdal</pre><h4>Fonksiyonlarda Hoisting</h4><p>Fonksiyonlarda ise, hem fonksiyonun kendisi hem de işlevi <strong>Hoisting </strong>olayına maruz kalır. Ancak fonksiyonlarda <strong>Hoisting </strong>olayı yalnızca <strong>named function</strong>’larda<strong> </strong>meydana gelir. <strong>Function expression</strong>’larda<strong> Hoisting </strong>yapılmaz. Yani sadece <strong>function</strong> keyword’ü ile yapılan <strong>named function </strong>tanımlamalarında <strong>Hoisting </strong>meydana gelir.</p><pre>// true<br>function sayHello() {<br>  console.log(&quot;Hello from named function.&quot;);<br>}<br><br>// false<br>const sayHi = () =&gt; console.log(&quot;Hi from function expression.&quot;);<br>var sayHi = () =&gt; console.log(&quot;Hi from function expression.&quot;);<br>let sayHi = () =&gt; console.log(&quot;Hi from function expression.&quot;);<br>const sayHi = function() {console.log(&quot;Hi from function expression.&quot;)};<br>var sayHi = function() {console.log(&quot;Hi from function expression.&quot;)};<br>let sayHi = function() {console.log(&quot;Hi from function expression.&quot;)};</pre><h4>(var = Function) !== Hoisting</h4><p><strong>var</strong> keyword’ü ile tanımladığımız <strong>fonksiyonun </strong>işlevinin olmamasının<strong> </strong>nedeni, Değişkenlerde <strong>Hoisting olayının </strong>sadece değişkenin tanımlamasına yapılmasıdır. Yani değişkenin değeri tanımlanana kadar <strong>undefined</strong> olarak kalır, bu nedenle var ile tanımlanan fonksiyonda <strong>Hoisting </strong>olayı olmaz.</p><p>Günün sonunda sağdaki kutucukta bulunan kodlar çalıştığında, memory’de başlangıç değerleri soldaki tabloda olduğu gibi olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D2NgQZYTFfB4UKy5.png" /><figcaption>Hoisting örnek görsel.</figcaption></figure><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function">function expression - JavaScript | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function - JavaScript | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Glossary/Hoisting">Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms | MDN</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50e46573f006" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JSX Nedir ? Nasıl Çalışır ? | Derin React]]></title>
            <link>https://coderdal.medium.com/jsx-nedir-nas%C4%B1l-%C3%A7al%C4%B1%C5%9F%C4%B1r-derin-react-de7533cfbe36?source=rss-10eec97376ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/de7533cfbe36</guid>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[babel]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Muhammed ERDAL]]></dc:creator>
            <pubDate>Sun, 18 Dec 2022 18:48:07 GMT</pubDate>
            <atom:updated>2025-12-10T09:23:23.902Z</atom:updated>
            <content:encoded><![CDATA[<h3>JSX Nedir ? Nasıl Çalışır ?</h3><p>Bu yazıda <strong>React</strong> ile birlikte hayatımıza girmiş olan <strong>JSX </strong>nedir ? ve nasıl çalışır ? gibi sorulara yanıt vermeye çalışacağım.</p><p><strong>JSX </strong>aslında bir <strong>JavaScript syntax </strong>eklentisi. Bu eklenti özünde nasıl çalışıyor ?</p><p><strong>React </strong>etkileşimli kullanıcı arayüzleri oluşturmamızı ve <strong>DOM</strong>’u kontrol etmemizi sağlayan bir <strong>JavaScript </strong>kütüphanesidir.</p><p><strong>React</strong>’in ana prensiplerinden biri olan <strong>componentler </strong>uygulamamızı küçük parçalara bölebilmemize ve yönetebilmemize olanak sağlıyor.</p><p><strong>React</strong>’in bu <strong>componentleri </strong>yönetebilmesi, yeniden render edebilmesi için bu <strong>componentlerin template’inin </strong>(<em>HTML kodlarının</em>*) <strong>React </strong>tarafından istenilen format olan “<strong>React elements” </strong>dediğimiz nesneler şeklinde tanımlanmış olması gerekmektedir. Ancak bu “<strong>React elements”</strong> dediğimiz yapı hiç de developer-friendly değil. Bu kısma birazdan tekrar değineceğim.</p><p>Ancak bir <strong>React </strong>uygulamasının kodlarını ister <strong>JSX </strong>ister <strong>React elements </strong>yapısında oluşturun, bu kodların derleyici üzerinde direkt olarak çalışabileceğini ifade etmiyor; çünkü <strong>JavaScript </strong>bir programlama dili, <strong>React </strong>ise bir arayüz kütüphanesi. Bizim için anlamlı olan <strong>React </strong>kodları <strong>JavaScript </strong>için hiçbir anlamı ifade etmiyor.</p><p><strong>JavaScript’in </strong>yazdığımız kodu çalıştırabilmesi için öncelikle <strong>React kodlarını</strong> kendi anlayabileceği formata çevirmesi gerekiyor. Aslında bir <strong>React </strong>uygulamasının <strong>buildini </strong>alırken yaptığımız şey tam olarak bu. Eğer <strong>build </strong>aldığınız bir <strong>React </strong>uygulamasının kaynak kodlarına bakmaya çalıştıysanız, o kodların çok karmaşık olduğunu farketmişsinizdir.</p><p>Buraya kadar konuştuklarımız aslında <strong>React </strong>kodlarının <strong>Pure JavaScript’e </strong>çevrilmesiyle alakalıydı.</p><p><strong>React </strong>bazı durumlarda kendi içerisinde de bir format değişimine ihtiyaç duyabiliyor. Bunlardan biri de <strong>JSX syntax’ı</strong> kullandığımız durum.</p><p><strong>JSX </strong>dediğimiz <strong>syntax </strong>aslında bizim <strong>React </strong>kodlarını daha anlaşılabilir yazmamız için ortaya çıkıyor. <strong>“React elements”</strong> alternatifi olarak, <strong>JSX’i </strong>kullanıyoruz.</p><p><strong>JSX’e React </strong>uygulamamızdaki <strong>componentlarımızın template bölümünü tanımlarken</strong> yani ekranda görünecek olan <strong>HTML </strong>yapısını tanımlarken ihtiyaç duyuyoruz. Aslında Bu <strong>syntax </strong>aslında ne <strong>JavaScript </strong>ne de <strong>HTML</strong>.</p><p><strong>JSX, JavaScript (React) </strong>içerisine <strong>HTML, </strong>daha doğrusu <strong>HTML’i </strong>taklit eden elementler yazmamıza olanak sağlıyor.</p><p><strong>JSX’in </strong>kullanımı <strong>React ekibi</strong> tarafından önerilse de <strong>React </strong>uygulamaları geliştirmek için <strong>JSX </strong>bir zorunluluk değil.</p><p><strong>JSX’i </strong>kullanmadan da <strong>React </strong>uygulamaları geliştirebilirsiniz.</p><p>Fakat bu noktada biraz önce değinmiş olduğum bir problemle karşılaşırsınız: “<strong>React elements”.</strong>..</p><p><strong>“React elements”</strong> aslında, ugulamamızın <strong>HTML </strong>bölümünü yazmak için <strong>React</strong> tarafından geliştirilmiş bir eleman-obje formatı. Bu elemanları <strong>React </strong>kütüphanesinin içerisinde gelen özel metodlar aracılığıyla oluşturabiliyoruz.</p><p>Ancak<strong> React</strong> ile <strong>HTML </strong>elemanı oluşturarak kod yazmak ve kodu okumak oldukça zor. Buna basit bir örnekle bakalım.</p><p>Örnekte basit bir <strong>React component’ı </strong>oluşturuyoruz. Bu component’ın<strong> JSX syntax </strong>ile yazılmış hali ile <strong>React elements </strong>ile yazılmış olan halini karşılaştıracağız.</p><p><strong>Babel</strong> çevirici aracılığıyla <strong>JSX </strong>ile yazılmış olan kodun <strong>React elements’a</strong> çevirilmiş haline bakalım:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*A5LcQXp9YsU2SvpGUrEpXA.png" /><figcaption>Öncesi <strong>JSX </strong>(1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*DVGwgRNpWpyGshe-sisEgQ.png" /><figcaption>Sonrası <strong>React Elements </strong>(2)</figcaption></figure><p>Göründüğü üzere <strong>JSX</strong> dediğimiz formatta <em>(1),</em> yazdığımız kod çok daha okunaklı ve kısa bir kod.</p><p><strong>React elements </strong>dediğimiz formatta <em>(2), </em><strong>React.createElement(</strong>type, props, …children<strong>) </strong>gibi uzun ve okuması zor kodlar bulunuyor. Yalnızca bir <strong>div </strong>için bu kadar fazla kod yazmak, geliştirme süresini ciddi oranda artıracaktır.</p><p>Yani <strong>JSX Syntax’ına</strong> tamamen daha okunaklı kodlar yazmak için ihtiyaç duyuyoruz.</p><h4>React tarafından istenilen format “<strong>React elements&quot;</strong> ise, nasıl <strong>JSX </strong>yazabiliyoruz ?</h4><p>Burada da <a href="https://babeljs.io/"><strong>Babel </strong></a>adını verdiğimiz <strong>compiler </strong>devreye giriyor.</p><p><strong>Babel </strong>aslında yazdığımız <strong>JSX </strong>kodunu <strong>React’in</strong> anlayabileceği bir formata (React elements’a) çeviriyor. Yazdığımız <strong>JSX </strong>kodu ile <strong>React </strong>arasında bir nevi köprü görevi görüyor.</p><p><strong>Babel </strong><a href="https://create-react-app.dev/"><strong><em>create-react-app</em></strong></a> gibi şablonları kullandığınız takdirde otomatik olarak projenize dahil oluyor.</p><p>Üstelik bütün bu olaylar sahne arkasında bir sihir gibi gerçekleşiyor. Çoğu durumda sizin yapmanız gereken hiçbir şey kalmıyor.</p><p>Biraz önce baktığımız örnekte de açıkça göründüğü gibi, resmen olmasa da <strong>JSX </strong>aslında <strong>React </strong>için vazgeçilmez bir <strong>syntax </strong>biçimi.</p><p>İki farklı durumda yazacağımız kodlar arasındaki farklar açıkça belli.</p><p>Bir tarafta <strong>5 satırlık</strong> <strong>JSX kullanarak anlamlı bir kod </strong>yazarken, <strong>diğer tarafta</strong> <strong>da çok daha uzun ve okunabilirliği düşük bir kod</strong> mevcut.</p><h4>JSX aslında HTML mi ?</h4><p><strong>JSX </strong>kendine özgü yazım stili ile aslında ne <strong>HTML </strong>ne de <strong>JavaScript</strong> kodu.</p><p><strong>JSX </strong>elemanları, <strong>HTML </strong>elemanlarına benzeyen ve onları taklit eden yapılardır.</p><p><strong>JSX </strong>elemanlarının bazı özelliklerinin <strong>HTML’den</strong> farklı olmasının nedeni de bu farklılık aslında.</p><p>Örneğin:</p><ul><li><strong>JSX </strong>kodları, bütün elemanları saracak olan bir kapsayıcıya yani parent bir elemana ihtiyaç duyuyor, bu kapsayıcıyı kullanmak istemediğimiz yerlerde ise <a href="https://reactjs.org/docs/fragments.html"><strong>React Fragmentleri</strong></a> kullanıyoruz.</li><li><strong>JSX </strong>içerisinde elemanlara verdiğimiz <strong>attributelerinin</strong> tamamı <strong>HTML’den</strong> farklı olarak <strong>camelCase </strong>dediğimiz yazım şekliyle yazılıyor (e.g. <em>class </em>yerine <em>className</em>).</li><li><strong>JSX </strong>içerisinde { <strong>süslü parentezler</strong> <strong>arasında </strong>} direkt olarak <strong>JavaScript</strong> kodu çalıştırabilirsiniz.</li><li><strong>Inline stil</strong> tanımlamaları ve benzeri bir takım farklılıklar bulunuyor.</li></ul><p>Son olarak, Aslında Günün sonunda döngü şu şekilde çalışıyor;</p><ul><li><strong>Babel </strong>uygulamadaki<strong> JSX </strong>kodlarını <strong>React Elements’e</strong> çevirir.</li><li><strong>React </strong>ise<strong> </strong>kendi kodlarını <strong>Pure JavaScript’e</strong> çevirir.</li><li><strong>Javascript </strong>bu kodları <strong>derler</strong> ve <strong>uygulamamız çalıştırılabilir olur</strong>.</li></ul><h4><strong>Kaynaklar:</strong></h4><ul><li><a href="https://beta.reactjs.org/apis/react/createElement">createElement</a></li><li><a href="https://reactjs.org/docs/react-without-jsx.html">React Without JSX - React</a></li><li><a href="https://reactjs.org/docs/introducing-jsx.html">Introducing JSX - React</a></li><li><a href="https://www.freecodecamp.org/news/html-vs-jsx-whats-the-difference">HTML vs JSX - What&#39;s the Difference?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de7533cfbe36" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>