<?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: Vaishnavi M</title>
    <description>The latest articles on DEV Community by Vaishnavi M (@vaishnavi_m_1194).</description>
    <link>https://dev.to/vaishnavi_m_1194</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2079336%2Fb6318d8a-1c62-446c-9977-a8414666b3bd.png</url>
      <title>DEV Community: Vaishnavi M</title>
      <link>https://dev.to/vaishnavi_m_1194</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vaishnavi_m_1194"/>
    <language>en</language>
    <item>
      <title>Create react app vs Vite</title>
      <dc:creator>Vaishnavi M</dc:creator>
      <pubDate>Wed, 25 Sep 2024 15:04:03 +0000</pubDate>
      <link>https://dev.to/vaishnavi_m_1194/create-react-app-vs-vite-2b3i</link>
      <guid>https://dev.to/vaishnavi_m_1194/create-react-app-vs-vite-2b3i</guid>
      <description>&lt;p&gt;I have always relied on the npm command create-react-app to create the starter files for any React.js project. It does what it says on the tin, and creates all my starter template files, setups a local dev server and dev environment. Over the years I have become a little impatient because it takes around 3-4 minutes to setup a basic barebones app. Recently I have come to know about a faster way to setup React apps, which also gives you all the useful features that create-react-app gives you too. It is using a tool called Vite. Vite is another build tool like Webpack (create-react-app uses Webpack under the hood, read more here).&lt;/p&gt;

&lt;p&gt;In this post I will take you through the steps on how to install React.js app using Vite and point out some differences too. You can also see a video on the comparison of the two installation methods. In the Video below, You will discover that the installation time, plus time to run local server is astonishingly fast for Vite.&lt;/p&gt;

&lt;p&gt;So how do we start the ball rolling&lt;br&gt;
You can refer to the Vite &lt;a href="https://vitejs.dev/guide/#scaffolding-your-first-vite-project" rel="noopener noreferrer"&gt;docs&lt;/a&gt;, From there, you can choose from a few methods to start off your installation. We are going to use the template method. In their docs, the listed methods are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#npm 6.x
npm init vite@latest my-vue-app --template vue

#npm 7+, extra double-dash is needed:
npm init vite@latest my-vue-app -- --template vue

#yarn
yarn create vite my-vue-app --template vue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But these commands are for installing Vue.js, just as side note, Vite was originally developed for Vue.js but has been modified to use with other frameworks including React.js. For our case, all we need to do is replace the keyword after '--template', from vue to react. And dont forget to replace the app name to your choosing. So assuming that we are running npm version 6.x, we will run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init vite@latest my-react-app --template react 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we will cd into our directory and install the remainder of the starter files and run the dev server:&lt;/p&gt;

&lt;p&gt;cd my-react-app&lt;br&gt;
 npm install&lt;br&gt;
 npm run dev&lt;/p&gt;

&lt;p&gt;If you goto the browser. You should see a React logo with a counter and a button, as below.&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%2Ff0jva85ndh8v890rs2ph.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%2Ff0jva85ndh8v890rs2ph.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Directory structure of the our newly created app
&lt;/h2&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%2Fwpyxu0temouklku6iu7s.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%2Fwpyxu0temouklku6iu7s.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The thing to note here is that, main.js is the root file that imports/loads App.js. There is also a new file called vite.config.js, this is circled in the above image. This file is used to turn on and set new features for your build process. I will come to this file in the next section below.&lt;/p&gt;
&lt;h2&gt;
  
  
  One last thing about importing files...
&lt;/h2&gt;

&lt;p&gt;I have noticed that out the box this setup does not allow for absolute paths. With create-react-app, you can do&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import x from 'components/x'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;. With Vite, you have to do the relative pathing, like&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import x from '../../../'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p&gt;To fix this we need to change the vite.config.js file, which looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [reactRefresh()]
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we need to add an extra setting to resolve the path, this change will go after the "plugins" settings. It will end up looking like this after the change:&lt;/p&gt;

&lt;p&gt;import { defineConfig } from 'vite'&lt;br&gt;
import reactRefresh from '@vitejs/plugin-react-refresh'&lt;br&gt;
import path from 'path'&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// https://vitejs.dev/config/
export default defineConfig({
  plugins: [reactRefresh()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
})

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

&lt;/div&gt;



&lt;p&gt;and this will allow us to refer to paths as&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import x from '@/component/x'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;!IMPORTATNT to prefix with '@' in path.&lt;/p&gt;

&lt;h2&gt;
  
  
  conclusion
&lt;/h2&gt;

&lt;p&gt;I did find Vite impressingly fast. It took me 55 secs to install and run on local server. I have not done much heavy development using Vite but it looks promising. It is too early for me to say if I will use it on any bigger projects in the future. There are other methods of installing React.js using Vite, these methods are maintained by other communities. &lt;a href="https://github.com/vitejs/awesome-vite#user-content-react" rel="noopener noreferrer"&gt;Check out other community maintained templates here&lt;/a&gt;, you can also find one with Tailwind. Please leave comments on your experiences too.&lt;/p&gt;

&lt;p&gt;Note: Vite has templates to build apps in the following frameworks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vanilla
vanilla-ts
vue
vue-ts
react
react-ts
preact
preact-ts
lit-element
lit-element-ts
svelte
svelte-ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so to create a build in react typescript , just change the last bit to "react-ts" after the "--template" , so it becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init vite@latest my-react-app --template react-ts 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>vite</category>
      <category>react</category>
    </item>
    <item>
      <title>Git Rebase vs Git Merge: A Comprehensive Guide</title>
      <dc:creator>Vaishnavi M</dc:creator>
      <pubDate>Mon, 16 Sep 2024 09:41:00 +0000</pubDate>
      <link>https://dev.to/vaishnavi_m_1194/git-rebase-vs-git-merge-a-comprehensive-guide-3lem</link>
      <guid>https://dev.to/vaishnavi_m_1194/git-rebase-vs-git-merge-a-comprehensive-guide-3lem</guid>
      <description>&lt;p&gt;Git, a distributed version control system, offers a variety of ways developers can integrate changes from one branch into another: git merge and git rebase being two of the most commonly used strategies. Understanding the differences, benefits, and best practices of both can greatly enhance your Git workflow efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Git Merge
&lt;/h2&gt;

&lt;p&gt;Think of git merge as a handshake between two branches. The git merge command integrates changes from one branch into another. It takes the contents of a source branch and integrates it with the target branch. If the histories of both branches have diverged, Git creates a new merge commit to combine the histories, preserving the history as it happened.&lt;/p&gt;

&lt;p&gt;Consider two branches, feature and master:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A---B---C feature
 /
D---E---F---G master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Merging feature into master would result in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A---B---C feature
 /         \
D---E---F---G---H master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The master branch now includes a new commit H that represents the merge commit, preserving the history of both branches as they happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Git Rebase
&lt;/h2&gt;

&lt;p&gt;git rebase is a command that allows you to integrate changes from one branch into another, similar to git merge. But it works in a different way. Let's consider git rebase as a painting process. Imagine the master branch as a wall and the feature branch as an artist. Initially, the master branch (the wall) is painted first. The feature branch (the artist) then comes in and adds their work on top of the master branch's work.&lt;/p&gt;

&lt;p&gt;However, if the original painting (the master branch) is updated, the artist (the feature branch) would temporarily remove their painting, allow the wall to be updated, and then add their painting back on top of the updated wall. This is essentially what happens in git rebase.&lt;/p&gt;

&lt;p&gt;git rebase takes the changes made in the feature branch and reapplies them onto the master branch, effectively creating a new base for the feature branch and rewriting history. This results in a more linear and clean commit history.&lt;/p&gt;

&lt;p&gt;Consider again two branches, feature and master:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A---B---C feature
 /
D---E---F---G master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rebasing feature onto master would give:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;D---E---F---G master
             \
              A'---B'---C' feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commits A, B, and C are reapplied onto master, creating new commits A', B', and C'.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparing Git Merge and Git Rebase
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Benefits and Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preserving History:&lt;/strong&gt; Git merge preserves history as it happened, including the time and order of all commits, while Git rebase can rewrite and clean up history, making it more linear and comprehensible. This can be beneficial when you want to understand the development process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conflict Resolution:&lt;/strong&gt; When merging, conflicts need to be resolved once during the merge commit. However, during a rebase, you may have to resolve conflicts for each commit being reapplied. This can become tedious if many commits have similar conflicts.&lt;br&gt;
Best Practices&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rebase for Local Cleanup:&lt;/strong&gt; Rebase can be used to clean up local, in-progress features. By periodically performing an interactive rebase, you can ensure each commit in your feature is focused and meaningful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merge for Public Commits:&lt;/strong&gt; Once you have shared your branch with others, it is best practice to use merge. Rebase could potentially rewrite the commit history and create confusion for other developers.&lt;br&gt;
Avoid Rebasing Public Branches: Rebasing a public branch that others have based work on is a bad practice as it alters the commit history. This can cause confusion and further conflicts for other developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Both git merge and git rebase are powerful tools for integrating changes from one branch into another. They serve different purposes and are used in different scenarios. It's essential to understand the implications of each and choose the right tool for the right situation.&lt;/p&gt;

&lt;p&gt;git merge is great for combining code from two different branches and preserving the exact historical timeline of commits. On the other hand, git rebase is excellent for making your feature branch up to date with the latest code from the master branch, keeping the history of your feature branch clean and making it appear as if the work happened sequentially.&lt;/p&gt;

&lt;p&gt;In both cases, conflicts can arise and need to be resolved manually. But remember, once you've shared your branch with others, it's a best practice to use git merge to avoid rewriting public commit history.&lt;/p&gt;

</description>
      <category>git</category>
      <category>programming</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Understanding Blockchain Technology: A Comprehensive Guide</title>
      <dc:creator>Vaishnavi M</dc:creator>
      <pubDate>Mon, 16 Sep 2024 08:58:11 +0000</pubDate>
      <link>https://dev.to/vaishnavi_m_1194/understanding-blockchain-technology-a-comprehensive-guide-19oe</link>
      <guid>https://dev.to/vaishnavi_m_1194/understanding-blockchain-technology-a-comprehensive-guide-19oe</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Blockchain ?&lt;/strong&gt;&lt;br&gt;
Blockchain is a distributed ledger technology that allows records of transactions across several computers in a safe and clear manner. As it does not require any central authority to tamper with the data, the block is immutable and tamper-proof. The generalized application of this technology is seen in cryptocurrencies, smart contracts, and other industries for safe data management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Blockchain Works ?&lt;/strong&gt;&lt;br&gt;
A blockchain stores data in blocks, which are collected together in a chronological chain. Each block contains a cryptographic hash of the previous block; hence, if any alteration is done in the previous block, it can be recognized easily due to the change in the hash. Transactions are validated by a decentralized network of computers, and hence the system is secure and resistant to the entry of malware.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn230r34o4vr63ft3z8sa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn230r34o4vr63ft3z8sa.png" alt="Image description" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Blockchain&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public blockchain (e.g., Bitcoin, Ethereum)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faeyl78otkz0uiwp8c8b9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faeyl78otkz0uiwp8c8b9.png" alt="Image description" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Private blockchain (e.g., Hyperledger)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ljj8vesje5jfr9b1g4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ljj8vesje5jfr9b1g4f.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consortium blockchain (e.g., Corda)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngcqwcsnksnhgahrqpy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngcqwcsnksnhgahrqpy1.png" alt="Image description" width="386" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hybrid blockchain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi63vtdfxlo48ykxy2d2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi63vtdfxlo48ykxy2d2m.png" alt="Image description" width="800" height="714"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Applications of Blockchain Technology&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cryptocurrencies and Digital Payments (Bitcoin, Ethereum)&lt;/li&gt;
&lt;li&gt;Supply Chain Management&lt;/li&gt;
&lt;li&gt;Healthcare&lt;/li&gt;
&lt;li&gt;Voting Systems&lt;/li&gt;
&lt;li&gt;Real Estate&lt;/li&gt;
&lt;li&gt;Smart Contracts&lt;/li&gt;
&lt;li&gt;NFTs and Tokenization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Blockchain in Industry&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Blockchain is transforming industries like,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finance&lt;/li&gt;
&lt;li&gt;Logistics&lt;/li&gt;
&lt;li&gt;Government&lt;/li&gt;
&lt;li&gt;Energy&lt;/li&gt;
&lt;li&gt;Intellectual Property&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Challenges and Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability issues&lt;/li&gt;
&lt;li&gt;Energy consumption concerns&lt;/li&gt;
&lt;li&gt;Regulatory and legal challenges&lt;/li&gt;
&lt;li&gt;Security vulnerabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Future of Blockchain Technology&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trends in blockchain development (Layer 2 solutions, interoperability)&lt;/li&gt;
&lt;li&gt;Role of blockchain in Web 3.0&lt;/li&gt;
&lt;li&gt;Potential impact on the economy and society&lt;/li&gt;
&lt;li&gt;Integrating blockchain with other technologies (AI, IoT)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>cryptocurrency</category>
      <category>smartcontract</category>
    </item>
  </channel>
</rss>
