refined-vegetable-38843
07/05/2020, 6:54 AMable-glass-75333
07/05/2020, 7:27 AMgreen-knife-71366
07/08/2020, 9:01 AMlively-kitchen-45586
07/09/2020, 3:18 AMif (isLoading) { <LoadingSkeletons/> }
from the public pages of my side project app.
There's tremendous performance gains to be had by pre-rendering pages (and treating the pre-render as a skeleton), and then fetching for fresh data with SWR after load if necessary.
Thesis:
https://twitter.com/sarupbanskota/status/1281054466628673536
Solution:
https://twitter.com/sarupbanskota/status/1281057252225323010lively-kitchen-45586
07/09/2020, 4:31 AMif (isLoading) { return <ProductSkeleton/ >}
In the approach I'm proposing, you load with a stale version of the product. Stale = pre-rendered product. Most product oriented details are probably still fresh, but things like upvote or comments count are gone stale. Once rendered, you do an SWR call to fetch the latest upvote numbers, and counter-up-animate the votes.
const { refreshedProduct, isLoadingRefreshedProduct } = functionUsingSWR()
...
if (isLoadingRefreshedProduct) { return <Product votes={product.votes} /> }
return <Product votes={refreshedProduct.votes} animateUpFrom={product.votes}>
This can be improved further — once Next.js lands the ability to revalidate-on-demand, then you don't need the SWR bits. Once there is an upvote, you trigger some webhook to revalidate the page, and by default you load the freshest results.
So you effectively treat the results of your pre-rendered page as the skeleton
https://twitter.com/sarupbanskota/status/1281057252225323010brash-monitor-80970
07/09/2020, 8:45 AMabundant-cpu-16374
07/09/2020, 3:21 PMdamp-coat-97256
07/09/2020, 5:13 PMloud-glass-33663
07/10/2020, 2:38 AMacoustic-sunset-3680
07/10/2020, 3:29 AMmagnificent-solstice-42554
07/10/2020, 9:10 AM<http://www.foo.com|www.foo.com>
and <http://blog.foo.com|blog.foo.com>
.
Is it advisable to have the same google analytics tracking ID for both? Or use separate ones?acceptable-flag-71699
07/10/2020, 9:15 AMcalm-grass-85557
07/10/2020, 12:03 PMdry-monkey-93718
07/10/2020, 12:25 PM.github
beforemany-raincoat-20537
07/12/2020, 5:22 AMdata structures and algorithms
questions? I know it might vary depending on company but what is the general trend like? How was your experience interviewing? Were you asked DS Algo questions? I am asking this from a backend developer perspective.polite-vr-99522
07/13/2020, 5:32 AMenough-australia-17557
07/13/2020, 7:19 AMUS/Canada work authorization
on angel.co
I interviewed with a company and marked that section as No as i didn’t knew about this. The interview went fine, but I got stuck in the final round due to this, can someone here please tell me what this is? Do I need a certificate to show it as a proof or something. Google isn’t helping much here for more info around this.creamy-bird-1828
07/13/2020, 1:05 PMgorgeous-lunch-25580
07/13/2020, 3:42 PMclean-salesmen-57717
07/13/2020, 8:50 PMdamp-coat-97256
07/14/2020, 4:51 AMcurved-minister-23111
07/14/2020, 5:31 AMlively-kitchen-45586
07/14/2020, 7:08 AMnice-electrician-7689
07/14/2020, 7:53 PMdry-monkey-93718
07/15/2020, 9:30 AMbrash-monitor-80970
07/15/2020, 10:07 AMsticky-manchester-85950
07/15/2020, 5:59 PM