<?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: Ankit kumar</title>
    <description>The latest articles on DEV Community by Ankit kumar (@ankit_kumar_41670acf33cf4).</description>
    <link>https://dev.to/ankit_kumar_41670acf33cf4</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%2F1644290%2F5a10e849-0477-4a35-abec-f15ff3b6189a.jpg</url>
      <title>DEV Community: Ankit kumar</title>
      <link>https://dev.to/ankit_kumar_41670acf33cf4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankit_kumar_41670acf33cf4"/>
    <language>en</language>
    <item>
      <title>🧠 The Ultimate JavaScript Head-Scratcher: typeof null and Other Peculiarities! 🤯</title>
      <dc:creator>Ankit kumar</dc:creator>
      <pubDate>Thu, 20 Jun 2024 11:59:31 +0000</pubDate>
      <link>https://dev.to/ankit_kumar_41670acf33cf4/the-ultimate-javascript-head-scratcher-typeof-null-and-other-peculiarities-4cjp</link>
      <guid>https://dev.to/ankit_kumar_41670acf33cf4/the-ultimate-javascript-head-scratcher-typeof-null-and-other-peculiarities-4cjp</guid>
      <description>&lt;p&gt;Hey Devs!&lt;/p&gt;

&lt;p&gt;Buckle up because today we’re diving into the wacky world of JavaScript quirks that will make you question your sanity, your code, and possibly your life choices. Let's decode some of the most bizarre, brain-twisting aspects of JavaScript that only the bravest dare to confront. 🚀&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
typeof null is object? Whaaat? 🤷‍♂️
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(typeof null); // 'object'

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

&lt;/div&gt;



&lt;p&gt;Why? Because of reasons. Well, it’s a bug in JavaScript that's been around since day one, and fixing it now would break the web. 🤦&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Mystery of NaN (Not-a-Number)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(NaN === NaN); // false

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

&lt;/div&gt;



&lt;p&gt;That’s right. In the JavaScript universe, even NaN doesn’t equal NaN. It's like trying to compare apples and oranges, but both are on fire. 🔥🍏🔥🍊&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Schrodinger’s Cat of Arrays 🐱📦
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arr = [1, 2, 3];
arr.length = 0;
console.log(arr[0]); // undefined

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

&lt;/div&gt;



&lt;p&gt;You just made the whole array disappear like a magic trick. Poof! 🎩✨&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Incredible Mutating const
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj = { a: 1 };
obj.a = 2;
console.log(obj.a); // 2

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

&lt;/div&gt;



&lt;p&gt;Surprise! const doesn’t make the object immutable. It just means you can’t reassign obj to something else, but you can still mutate its contents. Sneaky, right? 🕵️‍♀️&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Case of the Floating Decimal
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(0.1 + 0.2 === 0.3); // false

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

&lt;/div&gt;



&lt;p&gt;Just when you thought you could trust math, JavaScript throws in some floating-point shenanigans to keep you on your toes. 🤡&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Time-Traveling Date
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const date = new Date('2024-06-20');
date.setDate(date.getDate() - 1);
console.log(date.toString()); // Date in the previous month or year!

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

&lt;/div&gt;



&lt;p&gt;Dates are like time machines in JavaScript. Change one thing, and who knows where you'll end up? 🕰️🔮&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Mystery of Array vs. Object
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log([] instanceof Object); // true

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

&lt;/div&gt;



&lt;p&gt;Arrays are just specialized objects in JavaScript. It's like finding out your cat is actually a small, furry object that meows. 🐈➡️📦&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Phantom undefined
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let phantom;
console.log(phantom); // undefined
console.log(typeof phantom); // 'undefined'

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

&lt;/div&gt;



&lt;p&gt;Undefined variables are a rite of passage in JavaScript. Embrace the void! 🌌&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Inescapable Infinity
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(1 / 0); // Infinity

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

&lt;/div&gt;



&lt;p&gt;Divide by zero, and JavaScript just gives up and declares infinity. Simple as that. ♾️&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
The Quantum Leap of == and ===
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(0 == '0'); // true
console.log(0 === '0'); // false

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

&lt;/div&gt;



&lt;p&gt;== and === are like parallel universes in JavaScript. One loves type coercion, and the other doesn’t even know what that means. 🌌🔗&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;JavaScript: Where rules are meant to be broken, and every quirk is a learning opportunity! 💡&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Did you survive this trip down the rabbit hole? 🕳️🐇 Share your favorite (or most dreaded) JavaScript quirks below, and let’s revel in the madness together! 😜&lt;/p&gt;

&lt;p&gt;Happy coding, folks! 🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>Apple Login In Next Js Typescript</title>
      <dc:creator>Ankit kumar</dc:creator>
      <pubDate>Thu, 20 Jun 2024 10:58:27 +0000</pubDate>
      <link>https://dev.to/ankit_kumar_41670acf33cf4/apple-login-in-next-js-typescript-5810</link>
      <guid>https://dev.to/ankit_kumar_41670acf33cf4/apple-login-in-next-js-typescript-5810</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;To integrate Apple Sign-In in a Next.js app with TypeScript, you need to follow a structured approach involving setting up Apple Sign-In in your Apple Developer account, implementing server-side authentication, and handling the client-side login flow.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0liv434z8obrbhw9zwbx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0liv434z8obrbhw9zwbx.png" alt="Image description" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a comprehensive guide to add Apple Sign-In to your Next.js TypeScript app:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Set Up Apple Sign-In in &lt;a href="https://developer.apple.com/" rel="noopener noreferrer"&gt;Apple Developer&lt;/a&gt; Account&lt;br&gt;
Create an Apple Developer Account:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Go to Apple Developer and log in or create an account.&lt;/p&gt;

&lt;p&gt;2.Create an App ID:&lt;/p&gt;

&lt;p&gt;Go to Certificates, Identifiers &amp;amp; Profiles.&lt;br&gt;
Navigate to Identifiers and create a new App ID with the Sign in with Apple capability.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generate a Service ID:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create a new Service ID under Identifiers with the Sign in with Apple capability.&lt;/p&gt;

&lt;p&gt;Configure the Return URLs with the callback URL you will use in your Next.js app (e.g., &lt;a href="https://yourdomain.com/api/auth/apple/callback" rel="noopener noreferrer"&gt;https://yourdomain.com/api/auth/apple/callback&lt;/a&gt;).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Key:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Navigate to Keys and create a new key, enabling the Sign in with Apple capability.&lt;br&gt;
Download the generated key file (.p8) as it will be used for JWT signing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure Apple Sign-In:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Obtain the following credentials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client ID: Your Service ID.&lt;/li&gt;
&lt;li&gt;Team ID: Your Apple Developer Team ID.&lt;/li&gt;
&lt;li&gt;Key ID: The ID of the key you created.&lt;/li&gt;
&lt;li&gt;Private Key: The contents of the .p8 file you downloaded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.Server-Side: Implement Authentication in Next.js&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Dependencies:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install next-auth @auth/core axios jwt-decode

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

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Create an API Route for Apple Sign-In:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create a new file pages/api/auth/[...nextauth].ts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/api/auth/[...nextauth].ts
import NextAuth from 'next-auth';
import AppleProvider from 'next-auth/providers/apple';

export default NextAuth({
  providers: [
    AppleProvider({
      clientId: process.env.APPLE_CLIENT_ID!,
      clientSecret: {
        appleId: process.env.APPLE_CLIENT_ID!,
        teamId: process.env.APPLE_TEAM_ID!,
        privateKey: process.env.APPLE_PRIVATE_KEY!,
        keyId: process.env.APPLE_KEY_ID!,
        privateKeyId: process.env.APPLE_PRIVATE_KEY_ID!,
      },
    }),
  ],
  secret: process.env.NEXTAUTH_SECRET,
  callbacks: {
    async jwt({ token, account }) {
      if (account) {
        token.accessToken = account.access_token;
      }
      return token;
    },
    async session({ session, token }) {
      session.accessToken = token.accessToken;
      return session;
    },
  },
});

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

&lt;/div&gt;



&lt;p&gt;Ensure you have the necessary environment variables set in your .env.local:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;APPLE_CLIENT_ID=your_service_id
APPLE_TEAM_ID=your_team_id
APPLE_KEY_ID=your_key_id
APPLE_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----
NEXTAUTH_SECRET=your_next_auth_secret

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

&lt;/div&gt;



&lt;p&gt;3.Create JWT Generator for Apple Client Secret:&lt;/p&gt;

&lt;p&gt;In your Next.js project, create a helper file lib/apple-jwt.ts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// lib/apple-jwt.ts
import jwt from 'jsonwebtoken';

export const generateClientSecret = () =&amp;gt; {
  const payload = {
    iss: process.env.APPLE_TEAM_ID,
    iat: Math.floor(Date.now() / 1000),
    exp: Math.floor(Date.now() / 1000) + 3600, // 1 hour expiration
    aud: 'https://appleid.apple.com',
    sub: process.env.APPLE_CLIENT_ID,
  };

  const options = {
    algorithm: 'ES256',
    header: {
      kid: process.env.APPLE_KEY_ID,
      typ: 'JWT',
    },
  };

  return jwt.sign(payload, process.env.APPLE_PRIVATE_KEY!, options);
};

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

&lt;/div&gt;



&lt;p&gt;4.Ensure the .p8 Private Key is Correctly Formatted:&lt;/p&gt;

&lt;p&gt;Make sure your .p8 private key is correctly formatted with newline characters. You might need to replace actual newline characters with \n.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Client-Side: Handle Apple Sign-In Button&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Install the Apple Sign-In Button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react-apple-signin-auth

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

&lt;/div&gt;



&lt;p&gt;2.Implement the Apple Sign-In Button:&lt;/p&gt;

&lt;p&gt;Create a component for the Apple Sign-In button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// components/AppleSignInButton.tsx
import React from 'react';
import AppleSignin from 'react-apple-signin-auth';
import { signIn } from 'next-auth/react';

const AppleSignInButton: React.FC = () =&amp;gt; {
  return (
    &amp;lt;AppleSignin
      authOptions={{
        clientId: process.env.NEXT_PUBLIC_APPLE_CLIENT_ID!,
        scope: 'name email',
        redirectURI: `${window.location.origin}/api/auth/callback/apple`,
        state: 'state',
        nonce: 'nonce',
        usePopup: true,
      }}
      onSuccess={(response) =&amp;gt; {
        console.log('Apple SignIn Success', response);
      }}
      onError={(error) =&amp;gt; {
        console.error('Apple SignIn Error', error);
      }}
      render={(props) =&amp;gt; (
        &amp;lt;button onClick={props.onClick} disabled={props.disabled}&amp;gt;
          Sign in with Apple
        &amp;lt;/button&amp;gt;
      )}
    /&amp;gt;
  );
};

export default AppleSignInButton;

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

&lt;/div&gt;



&lt;p&gt;3.Use the Apple Sign-In Button in Your App:&lt;/p&gt;

&lt;p&gt;In your page or component where you want to include the Apple Sign-In:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/index.tsx
import AppleSignInButton from '../components/AppleSignInButton';

const HomePage: React.FC = () =&amp;gt; {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Sign in&amp;lt;/h1&amp;gt;
      &amp;lt;AppleSignInButton /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default HomePage;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Environment Configuration&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ensure you have these environment variables set up in .env.local:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NEXT_PUBLIC_APPLE_CLIENT_ID=your_service_id
APPLE_TEAM_ID=your_team_id
APPLE_KEY_ID=your_key_id
APPLE_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----
NEXTAUTH_SECRET=your_next_auth_secret

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Testing
1.Run Your App:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev

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

&lt;/div&gt;



&lt;p&gt;2.Navigate to Your Sign-In Page and test the Apple Sign-In flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Troubleshooting&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ensure Redirect URI Matches:&lt;/strong&gt; The redirect URI in your Apple Developer configuration must match the one used in your app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;**Verify JWT: **Make sure the JWT signing configuration is correct, and you have properly formatted your private key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Console Errors:&lt;/strong&gt; Check the browser console and network tab for any errors during the sign-in process for more debugging information.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This should set up Apple Sign-In in your Next.js TypeScript app. Make sure to test thoroughly and handle any specific requirements for your application.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>javascript</category>
      <category>oauth</category>
    </item>
    <item>
      <title>Create modern web applications using Next.js and Vercel.</title>
      <dc:creator>Ankit kumar</dc:creator>
      <pubDate>Tue, 18 Jun 2024 09:27:42 +0000</pubDate>
      <link>https://dev.to/ankit_kumar_41670acf33cf4/create-modern-web-applications-using-nextjs-and-vercel-1842</link>
      <guid>https://dev.to/ankit_kumar_41670acf33cf4/create-modern-web-applications-using-nextjs-and-vercel-1842</guid>
      <description>&lt;p&gt;At Futurice, we are passionate about building. With over 20 years of experience in creating digital experiences, we have seen our tools evolve over the decades. We find building high-performing web applications incredibly satisfying with the current tools at our disposal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgcjbwzgonl7z2yy0xc4q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgcjbwzgonl7z2yy0xc4q.png" alt="Image description" width="360" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In particular, Next.js, a JavaScript framework from the creators of Vercel has been a favourite. After shipping a few projects using Next.js, including for Jagex and WRAP, we decided to partner with Vercel to show how much we value their view of building modern web apps. Let me walk you through what we love about building with Next.js and Vercel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Choosing the right tools&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When considering to (re-)build web applications for our clients, we take certain considerations into mind. We only suggest tools and stacks that we fully believe in and have tested thoroughly ourselves.&lt;/p&gt;

&lt;p&gt;Developer experience is key, for our own people and also to ensure that future developers can have an enjoyable experience maintaining applications for our clients. In the last 8+ years, we mostly opted for React, the popular JavaScript framework, due to its popularity amongst talented developers and great community support. React has been great to build solid single-page client-side applications with a seamless experience for users.&lt;/p&gt;

&lt;p&gt;Working with pure React in its early days presented several challenges, however. Client-side rendering (CSR) often resulted in slower initial page loads (often caused by slow server-client network waterfalls) and limited SEO options due to the lack of pre-rendered content. Data fetching required manual implementation, leading to boilerplate code and potential performance bottlenecks. Additionally, the absence of a built-in router necessitated the use of third-party libraries, adding complexity to the development process.&lt;/p&gt;

&lt;p&gt;However, the emergence of modern frameworks like Next.js has revolutionised React development by introducing Server Components. These components pre-render on the server, significantly improving initial load times and SEO. Next.js also offers built-in data fetching capabilities and a robust routing system, streamlining the development process and enhancing the overall user experience. This shift towards server-rendered components addresses many of the historical pain points associated with pure React and paved the way for a more performant and developer-friendly web development experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Next.js&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgo344crl3zkcsepsb86y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgo344crl3zkcsepsb86y.png" alt="Image description" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next.js is a powerful and versatile framework that offers compelling reasons to choose it for developing modern web applications. One of its key advantages is its built-in support for server-side rendering (SSR) and static site generation (SSG), enabling faster page loads and improved performance. This not only enhances the user experience but also contributes to better SEO results. Next.js integrates nicely with React, which means a familiar and efficient development experience for React developers. Its automatic code-splitting feature optimises the application’s bundle size, ensuring that only necessary code is loaded, resulting in faster load times. The framework also comes with an intuitive file-based routing system, simplifying the organisation of code and making navigation more straightforward. Additionally, Next.js supports a wide range of data-fetching strategies, including server-side data fetching and incremental static regeneration, offering flexibility in handling dynamic content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Vercel&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F6owxgjmmmiehvdeaojsa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F6owxgjmmmiehvdeaojsa.jpg" alt="Image description" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a platform for deploying your web application, Vercel streamlines web development by automating deployments and continuously integrating code changes. In its core functionality, it is similar to other platforms like Netlify and Heroku, however, it comes with seamless integration and optimization specifically for Next.js apps and a global edge network to deliver content with low latency worldwide.&lt;/p&gt;

&lt;p&gt;Vercel offers zero-configuration deployment for Next.js apps and provides support for serverless functions and HTTPS certificate handling. You can also bundle and ship Next.js applications to the provider of your choice but with additional integration and configuration effort. For us the simplicity and convenience outweigh the potential greater flexibility you can have with self-hosting. Depending on your personal setup or company restrictions this might differ of course.&lt;/p&gt;

&lt;p&gt;With its automatic deployment and continuous integration features, Vercel ensures that updates are deployed whenever changes are pushed to the repository, streamlining the development workflow. When integrated with GitHub, every Pull Request gets its dedicated preview environment which makes viewing changes, especially for non-technical roles in our teams much easier.&lt;/p&gt;

&lt;p&gt;Vercel’s collaboration features make it easier for development teams to work together, and I personally like the comment feature for preview deployments which easily allowed one of my designer colleagues to leave feedback directly on the page for me to investigate. In addition, the integration with popular version control systems like Git and support for environment variables enhance the platform’s flexibility and security.&lt;/p&gt;

&lt;p&gt;One of Vercel’s unique selling points lies in its global edge network, an integrated Content Delivery Network (CDN) that caches content in strategic locations. This ensures content gets delivered with reduced load times, regardless of the user’s location. Especially when working with clients that have a global user base this offers a cost-effective solution instead of configuring a separate CDN.&lt;/p&gt;

&lt;p&gt;An exciting future ahead&lt;br&gt;
The team around Guillermo Rauch (CEO of Vercel) is constantly working on expanding Vercel, and there are some recently released or announced features that we are particularly excited about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;AI SDK: An open-source library to build conversational streaming user interfaces using existing components from your applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Partial Pre-rendering: This feature combines the benefits of fast static rendering and personalised dynamic rendering. It allows users to pre-render only the parts of the page that need to be personalised, while the rest of the page is statically rendered.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DX Platform: The new DX platform with monorepo support, code owners, and conformance provides security at a glance and health reporting in one view. It allows users to manage their projects more efficiently and securely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;v0.dev: Vercel’s GenAI website builder that allows you to generate entire web interfaces including React component trees via single prompts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Draft Mode: This feature enables cross-discipline collaboration by allowing users to comment and edit content in preview builds. It is a great way to get feedback from team members and stakeholders before publishing the content.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Practicing System Design in JavaScript: Cache System and the Shortest Path for Graph</title>
      <dc:creator>Ankit kumar</dc:creator>
      <pubDate>Tue, 18 Jun 2024 09:14:41 +0000</pubDate>
      <link>https://dev.to/ankit_kumar_41670acf33cf4/practicing-system-design-in-javascript-cache-system-and-the-shortest-path-for-graph-3bg5</link>
      <guid>https://dev.to/ankit_kumar_41670acf33cf4/practicing-system-design-in-javascript-cache-system-and-the-shortest-path-for-graph-3bg5</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
Data structure is one of unavoidable challenges when applying the software engineer role. I studied basic data structures and wrote down an article in JavaScript before.&lt;/p&gt;

&lt;p&gt;However, it’s hard to apply data structures to design a system or solve the real problem.&lt;/p&gt;

&lt;p&gt;The target of article is for recording common problems with data structures. I choose two interesting problems from Cracking the coding Interview and turn the solutions to JavaScript. We will use hash table, linked list, list(array) to solve these questions.&lt;/p&gt;

&lt;p&gt;Please Design a Cache for a Single System?&lt;br&gt;
How to Find the Shortest Search Path between Two People?&lt;/p&gt;

&lt;p&gt;Please Design a Cache for a Single System?&lt;br&gt;
Requirements&lt;br&gt;
Design a cache system with the following properties.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
