<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pravesh Vyas</title>
    <description>The latest articles on DEV Community by Pravesh Vyas (@vp5h).</description>
    <link>https://dev.to/vp5h</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F656413%2Fcb37b644-8a70-4c7b-8fa2-9f23675eac96.jpg</url>
      <title>DEV Community: Pravesh Vyas</title>
      <link>https://dev.to/vp5h</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vp5h"/>
    <language>en</language>
    <item>
      <title>Git Merge</title>
      <dc:creator>Pravesh Vyas</dc:creator>
      <pubDate>Thu, 12 Aug 2021 19:01:23 +0000</pubDate>
      <link>https://dev.to/vp5h/git-merge-k4a</link>
      <guid>https://dev.to/vp5h/git-merge-k4a</guid>
      <description>&lt;p&gt;Git Merge, It is one of those concepts that newbies Barely use, These are Majorly used in cases where we need to development on a Experimental feature or Want to try something which we don't like to ship. The Idea of Merging two separate branches to one always fascinated me, But I always use to think How would Merge Conflicts be resolved in a case Where things don't add Up or we have a file which has two different version on two separate branches. Lets see How Merging Works in Git.&lt;/p&gt;

&lt;h2&gt;
  
  
  According to definition
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Git merge will combine multiple sequences of commits into one unified history. In the most frequent use cases, git merge is used to combine two branches. The following examples in this document will focus on this branch merging pattern. In these scenarios, git merge takes two commit pointers, usually the branch tips, and will find a common base commit between them. Once Git finds a common base commit it will create a new "merge commit" that combines the changes of each queued merge commit sequence.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx05h36a9zhcmb43t68ey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx05h36a9zhcmb43t68ey.png" alt="Unmerged Git Branches"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth23nsektnnp661dxm52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth23nsektnnp661dxm52.png" alt="Merged branches"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image we can see that there is a Common base between the Two Points we want to Merge, What happens here is Git Diffs Both the Branches Against there Common Ancestor and Calculates Changes based on it. &lt;/p&gt;
&lt;h2&gt;
  
  
  Types Of Merges
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Fast Forward Merge.&lt;/p&gt;

&lt;p&gt;It occurs when there's a direct path between the current branch tip and the Current Tip. It Basically merges the history of Both the Tips.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feg81wj6d5ujk0lfs69df.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feg81wj6d5ujk0lfs69df.png" alt="03-04 Fast forward merge.svg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;3 way merge&lt;/p&gt;

&lt;p&gt;This Happens when there's no direct path between the Main and Current Branch. The Name comes from the Fact that git uses three commits to get make the merge commit it combines the source, feature and common base to come to a new merged commit .&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ee2bkisvrr576sfmibe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ee2bkisvrr576sfmibe.png" alt="05-06 Fast forward merge.svg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a three way there could conflicts to files changes in the both the Tips&lt;/p&gt;
&lt;h2&gt;
  
  
  Conflict Resolution
&lt;/h2&gt;

&lt;p&gt;To resolve them what we need to do is change the files and Use the Command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git Add 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GIt Commit -m "SomeThing here" 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get the Tips Merges &lt;/p&gt;

&lt;p&gt;and it will create the Merged Branch.&lt;/p&gt;

&lt;p&gt;Various Commands that can help in resolution of conflicts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log —merge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It helps in producing the list of command that are causing the conflicts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git Diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It helps in finding the difference between files between two States&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git merge —abort

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It helps  by ending the merge process returns the repo into the original state as it was before merging happened.&lt;/p&gt;

&lt;p&gt;That Sums up how merging Works Across Branches.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
    </item>
    <item>
      <title>React From 33000ft</title>
      <dc:creator>Pravesh Vyas</dc:creator>
      <pubDate>Thu, 12 Aug 2021 10:41:11 +0000</pubDate>
      <link>https://dev.to/vp5h/react-from-33000ft-3g9o</link>
      <guid>https://dev.to/vp5h/react-from-33000ft-3g9o</guid>
      <description>&lt;p&gt;Hi Folks, It's 2021, We all agree on the fact that React Came out as the most popular Library in JavaScript Scene for Good Enough Time. In my reasoning It came on top Because, It was meant for scale people at Facebook, Designed It in a way that really solves a critical problem, of all the models of time, Which is Re Rendering on the smallest of changes that occur some where deep inside the Tree. This use to cause Cascading Changes in DOM, Which would make code unreliable for Devs to Change on, Nobody would be interested to do changes in such a messy system, Which in turn causes Dev Processes so slow down.&lt;/p&gt;

&lt;p&gt;Now that you have Heard the Story lets look, In to Tech that Enabled this, If you go to React's Home page you would see the Following things &lt;/p&gt;

&lt;h2&gt;
  
  
  Declarative
&lt;/h2&gt;

&lt;p&gt;To understand this we need to Understand what's the Difference between a declarative and imperative way of doing Things.&lt;/p&gt;

&lt;p&gt;In a Nutshell, We can say that, We are choosing to Loose control over Control Flow to make our code more Reusable and Performant , There's a Saying that you take better decisions by not Taking decisions at all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codeburst.io/declarative-vs-imperative-programming-a8a7c93d9ad2"&gt;For getting More detailed Perview Head on to&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So yeah, They Unknowingly choose this way of doing Things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Component Based System
&lt;/h2&gt;

&lt;p&gt;FaceBook had Been Playing around with these sort of things for a long till they got to React, They had a php Extension called Xhp, Which got you out from the hassle of Opening and closing &amp;lt;?php&amp;gt; Tags all around the code &lt;/p&gt;

&lt;p&gt;They introduced a New type of Syntax where they passed Html elements as functions. It worked out great for them. The Above extension also had a feature of Making Components, Which directly impacted the contributed to the creation of Component based System.&lt;/p&gt;

&lt;h2&gt;
  
  
  Virtual Dom
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T_ANKM_u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12srpnst39sxyftny9c0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T_ANKM_u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12srpnst39sxyftny9c0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Before understanding Virtual Dom, Lets get hang of DOM. It stands for Document object model, It basically represents the UI of the whole App as a Tree Data Structure. It all works Fine and good until you add Complex Functionality to the App. To solve this What React Developers Did Was they introduced a Virtual Dom which Calculates and Process everything that Real Dom would do whenever a change happens. And choose a way in which Least manipulation will Happen in the DOM and Hence Cause a Better end User Experience&lt;/p&gt;

&lt;p&gt;&lt;a href="https://programmingwithmosh.com/react/react-virtual-dom-explained/"&gt;More About V-Dom&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Server Side Rendering
&lt;/h2&gt;

&lt;p&gt;Its is one of those Features That Comes out of the box in React, What happens here is the app Pre Renders the Whole HTML of the Page and Sends it to the Client, Reducing the Render Cost that comes on to the user, It also Is used Heavily when we are interacting with constantly changing data, These Days People are Using NexT.js and NuxT.js For Complex Apps. Which Work on the Above Principle &lt;/p&gt;

&lt;p&gt;This Sums Up the Core Features of React, I think Nothing Can Go as  Big as React, Without the contribution from community&lt;/p&gt;

&lt;p&gt;Which Caused it become How Popular it is today, Of course It Wouldn't have been possible without the Opensource Community we have around it.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
