@ReactPlayIO
Amazing Features & Performance
Tech Lead, Naukri.com
Divyansh Gupta
Hi.
Where to find me;
@iamdivyansh
Divyansh.2392@gmail.com
Before we start NEXT....
Vision of React & Its Shortcomings...
React , alone takes time...
Next.js comes to rescue....
Next.js , reducing initial load time ..
Next.js - SSR+SEOSupport
No State
No
UseEffect
Server
Rendered
SEO
Friendly
Network payload is still
huge
PROBLEM #1
Dual Rendering context
provide mental overload
PROBLEM #2
EMBODIES
REACT'S VISION
FOR THE FUTURE
Next.js - Is it the new Standard ?
Next 12
Six Months Ago,
Pre-rendering
strategies - SSG, ISR,
SSR
Next 13.0.1
App Router Beta
Improved Error
Reporting
Server Components
Layouts and Pages
Next 13.4
App Router ( Stable )
Simplified Data Fetching
Server Actions ( Alpha )
• Layouts:
• A layout is UI that is shared between multiple pages.
• Layout is on the top hierarchy of the component tree which
wraps any page or any child segments.
• Pages:
• A page is a UI unique to a route segment.
• A page.js file is required to make a route segment publicly
accessible.
• Pages are Server Components by default but can be set to
a Client Component.
- Features
- Best Practices
- Performance
App Router ( Stable with Next.js 13.4 )
- Buit on top of React Server Components
• Shared Layouts and Nested Layouts
• Nested routes
• Streaming and Loading UI
• Error handling at any level
• Dynamic intercept Route handlers
• Not Found UI
Component Hierarchy
• Layouts:
• A layout is UI that is shared between multiple pages.
• Layout is on the top hierarchy of the component tree which
wraps any page or any child segments.
• Pages:
• A page is a UI unique to a route segment.
• A page.js file is required to make a route segment publicly
accessible.
• Pages are Server Components by default but can be set to
a Client Component.
Performance Benefits of
App Router
• Uses Server-Centric Routing
• On Navigating Routes, it stores the result of React Server
Components payload in an in-memory client-side cache
which is split by route segment – allowing cache to be
reused
• SupportPartialRendering
• Does supportAdvanceRoutingPatterns
• ParallelRoutes
• InterceptRoutes
React Server components
Performance Benefits of
React Server components
React Server Components vs
Server Side Rendering
Simplified Data fetching
Caching vs Dynamic vs Revalidating Data
• Fetch with Next helps us with data fetching and to achieve different caching strategies.
• By default, fetch will automatically fetch and cache data indefinitely.
• To fetch fresh data on every fetch request, use the cache: 'no-store' option.
• To revalidate cached data at a timed interval, you can use the
Metadata API
(Static)
Metadata API
(Dynamic)
Server Actions
( Alpha )
Other Features
• Font Optimization - @next/font
• Image Optimizations & Core Web Vitals Improvement - @next/image
• Link API Improvement for better engagement
• Introducing Client-Side Hooks
• Introducing Special Functions for Server Components
Read More on Medium
% Enhancements
+
Dev Exp
+
Built In-SEO Support
What we know & 😍
Superior DX, focus on Performance, built in SEO
support means Good Choice for Production Apps
😍
Thank you!
Questions ??
@iamdivyans
h

Next.js - ReactPlayIO.pptx

  • 1.
  • 2.
    Tech Lead, Naukri.com DivyanshGupta Hi. Where to find me; @iamdivyansh Divyansh.2392@gmail.com
  • 3.
  • 4.
    Vision of React& Its Shortcomings...
  • 5.
    React , alonetakes time...
  • 6.
    Next.js comes torescue....
  • 7.
    Next.js , reducinginitial load time ..
  • 8.
    Next.js - SSR+SEOSupport NoState No UseEffect Server Rendered SEO Friendly
  • 9.
    Network payload isstill huge PROBLEM #1
  • 10.
    Dual Rendering context providemental overload PROBLEM #2
  • 11.
  • 12.
    Next.js - Isit the new Standard ?
  • 13.
    Next 12 Six MonthsAgo, Pre-rendering strategies - SSG, ISR, SSR Next 13.0.1 App Router Beta Improved Error Reporting Server Components Layouts and Pages Next 13.4 App Router ( Stable ) Simplified Data Fetching Server Actions ( Alpha )
  • 14.
    • Layouts: • Alayout is UI that is shared between multiple pages. • Layout is on the top hierarchy of the component tree which wraps any page or any child segments. • Pages: • A page is a UI unique to a route segment. • A page.js file is required to make a route segment publicly accessible. • Pages are Server Components by default but can be set to a Client Component. - Features - Best Practices - Performance
  • 15.
    App Router (Stable with Next.js 13.4 ) - Buit on top of React Server Components • Shared Layouts and Nested Layouts • Nested routes • Streaming and Loading UI • Error handling at any level • Dynamic intercept Route handlers • Not Found UI
  • 16.
    Component Hierarchy • Layouts: •A layout is UI that is shared between multiple pages. • Layout is on the top hierarchy of the component tree which wraps any page or any child segments. • Pages: • A page is a UI unique to a route segment. • A page.js file is required to make a route segment publicly accessible. • Pages are Server Components by default but can be set to a Client Component.
  • 17.
    Performance Benefits of AppRouter • Uses Server-Centric Routing • On Navigating Routes, it stores the result of React Server Components payload in an in-memory client-side cache which is split by route segment – allowing cache to be reused • SupportPartialRendering • Does supportAdvanceRoutingPatterns • ParallelRoutes • InterceptRoutes
  • 18.
  • 19.
  • 20.
    React Server Componentsvs Server Side Rendering
  • 21.
  • 22.
    Caching vs Dynamicvs Revalidating Data • Fetch with Next helps us with data fetching and to achieve different caching strategies. • By default, fetch will automatically fetch and cache data indefinitely. • To fetch fresh data on every fetch request, use the cache: 'no-store' option. • To revalidate cached data at a timed interval, you can use the
  • 23.
  • 24.
  • 25.
  • 26.
    Other Features • FontOptimization - @next/font • Image Optimizations & Core Web Vitals Improvement - @next/image • Link API Improvement for better engagement • Introducing Client-Side Hooks • Introducing Special Functions for Server Components Read More on Medium
  • 27.
    % Enhancements + Dev Exp + BuiltIn-SEO Support What we know & 😍
  • 28.
    Superior DX, focuson Performance, built in SEO support means Good Choice for Production Apps 😍
  • 29.