SlideShare a Scribd company logo
1 of 42
Remix
By Rahul Mohan and Mohammed Farhan
Speakers
• Rahul Mohan, Talentica Software
• Mohammed Farhan, Talentica Software
2
Some Prerequisite
• ReactJS
• What is SSR, CSR, SSG.
• SSR (Server-side rendering) : The good old days of PHP and
templating languages.
• SSR is faster but can be more costly in terms of deployment (thin
client) can’t be cached in end nodes (CDN’s)
• Pros of SSR:
• Social media-friendly.
• SEO friendly.
• Fast First Concertful Paint (FCP).
• Up-to-date content.
3
SSR,CSR,SSG
Cons:
• Slow TTFB
• Server-intensive workloads
• Can’t be cached by traditional CDNs
• Navigating across a site is slow without universal rendering
• TTI is longer than FTP with universal rendering
4
SSR,CSR,SSG
• SSR (Static side Rendering)
• Build the pages at run time, this was what the original web was
made on, but new frameworks have made this a good
alternative.
• Pros of SSG:
• Fast load times
• SEO friendly
• Cons of SSG:
• Problematic for sites with many pages
• No personalization
• Content may be stale
5
SSR,CSR,SSG
• Cons of SSG:
• Problematic for sites with many pages
• No personalization
• Content may be stale
6
SSR,CSR,SSG
• Client-Side Rendering
This everyone is known as react become very prevalent in the
last five years.
• Pros:
• Very responsive sites
• No need to wait for pages to be loaded
• Easy in a production env lower build times with the code-
base as static page assets don’t need to be built.
7
SSR,CSR,SSG
• Cons
• Hard to make is SEO Friendly (Google new ranking
algorithm)
• Bigger bundle sizes and slow first conceitful page.
• Not he best option for very thin client there is a JS
overhead.
8
Why Remix ?
• A Runtime for React
• Component + API Route (write your server-side code and
components in the same file).
• Cut down the API overheads of any fetch.
• Avoid the standard Pattern:
• <form method=“post” onSubmit={event => {
event.preventDefault();
}}
• Create state to manage data.
• Use effect hook to update UI.
9
Why Remix ?
• Use the form (browser) like the good old days of
PHP let the browser manage the state.
• useLoaderData,useActionData,useTransition
• Amazing error bounders on the sever side code
and the frontend side.
10
Why Remix ?
11
Prerequisites-The dev setup
12
• Node.js 14 or greater(Preferred 16)
• npm 7 or greater
Initial setup
• npx create-remix@latest
• Follow along with the defaults use some other
service if you want to have another server. (remix
app serer should do fine for now)
• cd project_name
13
Initial setup
14
The file Structure
15
The file Structure
16
• app/ - This is where all your Remix app code goes
• app/entry.client.tsx - This is the first bit of your JavaScript that will run when the
app loads in the browser. We use this file to hydrate our React components.
• app/entry.server.tsx - This is the first bit of your JavaScript that will run when a
request hits your server. Remix handles loading all the necessary data and
you're responsible for sending back the response. We'll use this file to render our
React app to a string/stream and send that as our response to the client.
• app/root.tsx - This is where we put the root component for our application. You
render the <html> element here.
• app/routes/ - This is where all your "route modules" will go. Remix uses the files
in this directory to create the URL routes for your app based on the name of the
files.
• public/ - This is where your static assets go (images/fonts/etc)
• remix.config.js - Remix has a handful of configuration options you can set in this
file.
The file Structure
17
• Let’s delete the files and start a new project
The file Structure
18
• Change your root
Routes
• /
• /blog
• /blog/:blogID
• /blog/new
• /login
19
Old way of routes
20
Routes: app/routes/index.tsx
21
Routes: app/root.tsx
22
Routes: Nested Routes
23
Routes: Nested Routes
24
Routes: Nested Routes
25
Routes: Parameterized Routes
26
Style and all that jazz
• We are going back to the good old days of stylesheets
27
Style and all that jazz
28
Style and all that jazz
29
Some Boring but important DB setup
30
• As this has nothing to do with react in general, I will be breezing
through most of it, but you can use any ORM you please and use
any underlying DB or API you please
• We will be using Prisma
• And a local DB
LoaderFunction,useLoaderData,Link
• LoaderFunction: This is simply an async
function you export that returns a response
• useLoaderData: The hook that replaces all
the other use hooks on your fronted
• Link: Similar to the one we all know and love
from react-router.
31
AUTHENTICATION - Process of recognizing a user's identity
 Password based authentication
 In web world HTTP cookies is the way to use for
authentication.
 HTTP Cookies – Server sends small piece of data to user’
browser and it stores it and sends back to server with later
request for user specific authentication.
 How to set cookie ?
 Set-Cookie: <cookie-name>=<cookie-value>
32
33
Remix‘s Session
 Allow server to identify if request coming form same person
 Remix comes with pre-built session storage options.
1. CreateCookieSessionStorage
2. createMemorySessionStorage
3. CreateFileSessionStorage
4. CreateCloudflareKVSessionStorage(cloudflare-workers)
5. CreateSessionStorage(Custom)
34
How to create cookie session with Remix ?
35
Error handling
 Error handling in remix is stellar
 Route modules has Error Boundary component exported and used
 Error Boundary also works on server errors, action and loaders.
 Error Boundary is some kind of same that we have in REACT16
36
export function ErrorBoundary() {
}
Unexpected Error handling
Error those are not known or guessed it could be catch with this
Expected Error handling
Error those are known and based on that dev can display information to user
SEO With Meta tags
 Remix has meta export for route modules
 <Meta/> Tag for app/root.tsx . It’s in built.
Resource Routing
 Renders other than HTML document like CSV data, image, RSS feed.
 Crete a file under routes jokes[.]rss.tsx
Remix can work without loading JavaScript to the page ?
Thank You

More Related Content

Similar to Remix

Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!Teamstudio
 
JavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User ExperienceJavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User Experiencereeder29
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Dimitri de Putte
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
RESTful web
RESTful webRESTful web
RESTful webAlvin Qi
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
 
Delivering Mobile Apps That Perform
Delivering Mobile Apps That PerformDelivering Mobile Apps That Perform
Delivering Mobile Apps That PerformRuben Goncalves
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...Ram G Athreya
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applicationsEugene Lazutkin
 
AOUG_11Nov2016_Challenges_with_EBS12_2
AOUG_11Nov2016_Challenges_with_EBS12_2AOUG_11Nov2016_Challenges_with_EBS12_2
AOUG_11Nov2016_Challenges_with_EBS12_2Sean Braymen
 
2014 09-12 lambda-architecture-at-indix
2014 09-12 lambda-architecture-at-indix2014 09-12 lambda-architecture-at-indix
2014 09-12 lambda-architecture-at-indixYu Ishikawa
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
ReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security BugsReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security BugsPriyanka Aash
 

Similar to Remix (20)

Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
 
#Webperf Choreography
#Webperf Choreography#Webperf Choreography
#Webperf Choreography
 
JavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User ExperienceJavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User Experience
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Javascript for Wep Apps
Javascript for Wep AppsJavascript for Wep Apps
Javascript for Wep Apps
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
RESTful web
RESTful webRESTful web
RESTful web
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
Delivering Mobile Apps That Perform
Delivering Mobile Apps That PerformDelivering Mobile Apps That Perform
Delivering Mobile Apps That Perform
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
AOUG_11Nov2016_Challenges_with_EBS12_2
AOUG_11Nov2016_Challenges_with_EBS12_2AOUG_11Nov2016_Challenges_with_EBS12_2
AOUG_11Nov2016_Challenges_with_EBS12_2
 
2014 09-12 lambda-architecture-at-indix
2014 09-12 lambda-architecture-at-indix2014 09-12 lambda-architecture-at-indix
2014 09-12 lambda-architecture-at-indix
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
ReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security BugsReproNow—Save Time Reproducing and Triaging Security Bugs
ReproNow—Save Time Reproducing and Triaging Security Bugs
 

More from Talentica Software

Typescript: Beginner to Advanced
Typescript: Beginner to AdvancedTypescript: Beginner to Advanced
Typescript: Beginner to AdvancedTalentica Software
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in ReactTalentica Software
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternTalentica Software
 
Setting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | TalenticaSetting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | TalenticaTalentica Software
 
Connected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryConnected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryTalentica Software
 
Mobile App Monetization - Ecosystem & Emerging Trends
Mobile App Monetization - Ecosystem & Emerging TrendsMobile App Monetization - Ecosystem & Emerging Trends
Mobile App Monetization - Ecosystem & Emerging TrendsTalentica Software
 
Android Media Player Development
Android Media Player DevelopmentAndroid Media Player Development
Android Media Player DevelopmentTalentica Software
 
Cross Platform Mobile Technologies
Cross Platform Mobile TechnologiesCross Platform Mobile Technologies
Cross Platform Mobile TechnologiesTalentica Software
 
Big Data Technologies - Hadoop
Big Data Technologies - HadoopBig Data Technologies - Hadoop
Big Data Technologies - HadoopTalentica Software
 
Continous Integration: A Case Study
Continous Integration: A Case StudyContinous Integration: A Case Study
Continous Integration: A Case StudyTalentica Software
 
Technology Challenges in Building New Media Applications
Technology Challenges in Building New Media ApplicationsTechnology Challenges in Building New Media Applications
Technology Challenges in Building New Media ApplicationsTalentica Software
 
Flex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application DevelopmentFlex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application DevelopmentTalentica Software
 

More from Talentica Software (20)

Typescript: Beginner to Advanced
Typescript: Beginner to AdvancedTypescript: Beginner to Advanced
Typescript: Beginner to Advanced
 
Web 3.0
Web 3.0Web 3.0
Web 3.0
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in React
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
 
Node js Chapter-2
Node js Chapter-2Node js Chapter-2
Node js Chapter-2
 
Node.js Chapter1
Node.js Chapter1Node.js Chapter1
Node.js Chapter1
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Setting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | TalenticaSetting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | Talentica
 
Connected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discoveryConnected World in android - Local data sharing and service discovery
Connected World in android - Local data sharing and service discovery
 
Mobile App Monetization - Ecosystem & Emerging Trends
Mobile App Monetization - Ecosystem & Emerging TrendsMobile App Monetization - Ecosystem & Emerging Trends
Mobile App Monetization - Ecosystem & Emerging Trends
 
Android Media Player Development
Android Media Player DevelopmentAndroid Media Player Development
Android Media Player Development
 
Cross Platform Mobile Technologies
Cross Platform Mobile TechnologiesCross Platform Mobile Technologies
Cross Platform Mobile Technologies
 
Big Data Technologies - Hadoop
Big Data Technologies - HadoopBig Data Technologies - Hadoop
Big Data Technologies - Hadoop
 
Big Data – Are You Ready?
Big Data – Are You Ready?Big Data – Are You Ready?
Big Data – Are You Ready?
 
Legacy modernization
Legacy modernizationLegacy modernization
Legacy modernization
 
Continous Integration: A Case Study
Continous Integration: A Case StudyContinous Integration: A Case Study
Continous Integration: A Case Study
 
Technology Challenges in Building New Media Applications
Technology Challenges in Building New Media ApplicationsTechnology Challenges in Building New Media Applications
Technology Challenges in Building New Media Applications
 
Flex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application DevelopmentFlex on Grails - Rich Internet Applications With Rapid Application Development
Flex on Grails - Rich Internet Applications With Rapid Application Development
 

Recently uploaded

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 

Recently uploaded (20)

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 

Remix

  • 1. Remix By Rahul Mohan and Mohammed Farhan
  • 2. Speakers • Rahul Mohan, Talentica Software • Mohammed Farhan, Talentica Software 2
  • 3. Some Prerequisite • ReactJS • What is SSR, CSR, SSG. • SSR (Server-side rendering) : The good old days of PHP and templating languages. • SSR is faster but can be more costly in terms of deployment (thin client) can’t be cached in end nodes (CDN’s) • Pros of SSR: • Social media-friendly. • SEO friendly. • Fast First Concertful Paint (FCP). • Up-to-date content. 3
  • 4. SSR,CSR,SSG Cons: • Slow TTFB • Server-intensive workloads • Can’t be cached by traditional CDNs • Navigating across a site is slow without universal rendering • TTI is longer than FTP with universal rendering 4
  • 5. SSR,CSR,SSG • SSR (Static side Rendering) • Build the pages at run time, this was what the original web was made on, but new frameworks have made this a good alternative. • Pros of SSG: • Fast load times • SEO friendly • Cons of SSG: • Problematic for sites with many pages • No personalization • Content may be stale 5
  • 6. SSR,CSR,SSG • Cons of SSG: • Problematic for sites with many pages • No personalization • Content may be stale 6
  • 7. SSR,CSR,SSG • Client-Side Rendering This everyone is known as react become very prevalent in the last five years. • Pros: • Very responsive sites • No need to wait for pages to be loaded • Easy in a production env lower build times with the code- base as static page assets don’t need to be built. 7
  • 8. SSR,CSR,SSG • Cons • Hard to make is SEO Friendly (Google new ranking algorithm) • Bigger bundle sizes and slow first conceitful page. • Not he best option for very thin client there is a JS overhead. 8
  • 9. Why Remix ? • A Runtime for React • Component + API Route (write your server-side code and components in the same file). • Cut down the API overheads of any fetch. • Avoid the standard Pattern: • <form method=“post” onSubmit={event => { event.preventDefault(); }} • Create state to manage data. • Use effect hook to update UI. 9
  • 10. Why Remix ? • Use the form (browser) like the good old days of PHP let the browser manage the state. • useLoaderData,useActionData,useTransition • Amazing error bounders on the sever side code and the frontend side. 10
  • 12. Prerequisites-The dev setup 12 • Node.js 14 or greater(Preferred 16) • npm 7 or greater
  • 13. Initial setup • npx create-remix@latest • Follow along with the defaults use some other service if you want to have another server. (remix app serer should do fine for now) • cd project_name 13
  • 16. The file Structure 16 • app/ - This is where all your Remix app code goes • app/entry.client.tsx - This is the first bit of your JavaScript that will run when the app loads in the browser. We use this file to hydrate our React components. • app/entry.server.tsx - This is the first bit of your JavaScript that will run when a request hits your server. Remix handles loading all the necessary data and you're responsible for sending back the response. We'll use this file to render our React app to a string/stream and send that as our response to the client. • app/root.tsx - This is where we put the root component for our application. You render the <html> element here. • app/routes/ - This is where all your "route modules" will go. Remix uses the files in this directory to create the URL routes for your app based on the name of the files. • public/ - This is where your static assets go (images/fonts/etc) • remix.config.js - Remix has a handful of configuration options you can set in this file.
  • 17. The file Structure 17 • Let’s delete the files and start a new project
  • 18. The file Structure 18 • Change your root
  • 19. Routes • / • /blog • /blog/:blogID • /blog/new • /login 19
  • 20. Old way of routes 20
  • 27. Style and all that jazz • We are going back to the good old days of stylesheets 27
  • 28. Style and all that jazz 28
  • 29. Style and all that jazz 29
  • 30. Some Boring but important DB setup 30 • As this has nothing to do with react in general, I will be breezing through most of it, but you can use any ORM you please and use any underlying DB or API you please • We will be using Prisma • And a local DB
  • 31. LoaderFunction,useLoaderData,Link • LoaderFunction: This is simply an async function you export that returns a response • useLoaderData: The hook that replaces all the other use hooks on your fronted • Link: Similar to the one we all know and love from react-router. 31
  • 32. AUTHENTICATION - Process of recognizing a user's identity  Password based authentication  In web world HTTP cookies is the way to use for authentication.  HTTP Cookies – Server sends small piece of data to user’ browser and it stores it and sends back to server with later request for user specific authentication.  How to set cookie ?  Set-Cookie: <cookie-name>=<cookie-value> 32
  • 33. 33
  • 34. Remix‘s Session  Allow server to identify if request coming form same person  Remix comes with pre-built session storage options. 1. CreateCookieSessionStorage 2. createMemorySessionStorage 3. CreateFileSessionStorage 4. CreateCloudflareKVSessionStorage(cloudflare-workers) 5. CreateSessionStorage(Custom) 34
  • 35. How to create cookie session with Remix ? 35
  • 36. Error handling  Error handling in remix is stellar  Route modules has Error Boundary component exported and used  Error Boundary also works on server errors, action and loaders.  Error Boundary is some kind of same that we have in REACT16 36 export function ErrorBoundary() { }
  • 37. Unexpected Error handling Error those are not known or guessed it could be catch with this
  • 38. Expected Error handling Error those are known and based on that dev can display information to user
  • 39. SEO With Meta tags  Remix has meta export for route modules  <Meta/> Tag for app/root.tsx . It’s in built.
  • 40. Resource Routing  Renders other than HTML document like CSV data, image, RSS feed.  Crete a file under routes jokes[.]rss.tsx
  • 41. Remix can work without loading JavaScript to the page ?