-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IssueId #221316 feat Add Lazy Routing in ALL [React] #90
Open
ajinkyapandetekdi
wants to merge
6
commits into
Sunbird-ALL:all-1.1
Choose a base branch
from
ajinkyapandetekdi:updated-all-1.1
base: all-1.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
53f1736
IssueId #221316 feat Add Lazy Routing in ALL [React]
ajinkyapandetekdi 703e6ca
IssueId #221316 feat Add Lazy Routing in ALL [React]
ajinkyapandetekdi c65920c
IssueId #221315 feat: React App Performance Optimization
ajinkyapandetekdi 08944cc
IssueId #221315 feat: React App Performance Optimization
ajinkyapandetekdi 7f8b44f
IssueId #221315 feat: React App Performance Optimization
ajinkyapandetekdi ccf8dff
IssueId #221315 feat: React App Performance Optimization
ajinkyapandetekdi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ | |
href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link href="https://fonts.cdnfonts.com/css/bad-comic" rel="stylesheet" /> | ||
<script src="./js/jquery-3.7.0.min.js" defer></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js"></script> | ||
<title>EkStep</title> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Define the name for the cache | ||
const CACHE_NAME = 'my-cache-v1'; | ||
|
||
// Event listener for installation of the service worker | ||
self.addEventListener('install', event => { | ||
// Perform installation steps | ||
event.waitUntil( | ||
caches.open(CACHE_NAME) | ||
.then(cache => { | ||
console.log('Opened cache'); | ||
// No need to pre-cache any resources during installation | ||
}) | ||
); | ||
}); | ||
|
||
// Event listener for fetching assets | ||
self.addEventListener('fetch', event => { | ||
event.respondWith( | ||
caches.open(CACHE_NAME).then(cache => { | ||
return cache.match(event.request).then(response => { | ||
if (response) { | ||
// Resource is in cache, return it | ||
// console.log('Resource is cached:', event.request.url); | ||
return response; | ||
} | ||
|
||
// Resource is not in cache, fetch it from network and cache it | ||
return fetch(event.request).then(networkResponse => { | ||
// Check if fetched response is valid | ||
if (!networkResponse || networkResponse.status !== 200 || networkResponse.type !== 'basic') { | ||
return networkResponse; | ||
} | ||
|
||
// Clone the response because it's a stream that can only be consumed once | ||
const responseToCache = networkResponse.clone(); | ||
|
||
// Cache the fetched response | ||
caches.open(CACHE_NAME).then(cache => { | ||
cache.put(event.request, responseToCache); | ||
}); | ||
|
||
// console.log('Resource is fetched from network and cached:', event.request.url); | ||
return networkResponse; | ||
}).catch(error => { | ||
// Fetch failed, return a fallback response | ||
console.error('Fetch failed:', error); | ||
// You can return a custom offline page or a fallback response here | ||
}); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
// Event listener for activation of the service worker | ||
self.addEventListener('activate', event => { | ||
const cacheWhitelist = [CACHE_NAME]; | ||
|
||
event.waitUntil( | ||
caches.keys().then(cacheNames => { | ||
return Promise.all( | ||
cacheNames.map(cacheName => { | ||
if (cacheWhitelist.indexOf(cacheName) === -1) { | ||
// Delete caches not in cacheWhitelist | ||
return caches.delete(cacheName); | ||
} | ||
}) | ||
); | ||
}) | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ const Mechanics4 = ({ | |
paddingX: type === "word" ? 0 : "20px", | ||
}} | ||
> | ||
{selectedWords?.map((elem) => ( | ||
{selectedWords?.map((elem, index) => ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure all elements in lists have a unique + key={`word-${index}`} Adding a unique Also applies to: 186-186, 194-194, 211-211 |
||
<span | ||
onClick={() => handleWords(elem, true)} | ||
style={{ | ||
|
@@ -183,14 +183,15 @@ const Mechanics4 = ({ | |
cursor: "pointer", | ||
marginLeft: type === "word" ? 0 : "20px", | ||
}} | ||
key={index} | ||
> | ||
{elem} | ||
</span> | ||
))} | ||
</Box> | ||
</Box> | ||
<Box sx={{ display: "flex", justifyContent: "center", mb: 3 }}> | ||
{words?.map((elem) => ( | ||
{words?.map((elem,index) => ( | ||
<> | ||
{type === "word" ? ( | ||
<Box | ||
|
@@ -207,6 +208,7 @@ const Mechanics4 = ({ | |
borderRadius: "12px", | ||
border: "5px solid #10618E", | ||
}} | ||
key={index} | ||
> | ||
<span | ||
style={{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor conditional blocks for better readability and performance.
Committable suggestion