[Perf Improvement] Booking Page score should be in green now (#2057)
* Avoid crypto to land in the browser * Avoid prefetching as it has Crypto code bundled in AvatarGroup * Use md5 directly if avatar not available Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
1 parent
91b732ff1c
commit
ce0c8347fb
2 files changed
+8
-2
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { ArrowRightIcon } from "@heroicons/react/outline";
|
||||
import { BadgeCheckIcon } from "@heroicons/react/solid";
|
||||
import crypto from "crypto";
|
||||
import { GetServerSidePropsContext } from "next";
|
||||
import dynamic from "next/dynamic";
|
||||
import Link from "next/link";
|
||||
@@ -66,7 +65,9 @@ export default function User(props: inferSSRProps<typeof getServerSideProps>) {
|
||||
style={{ display: "flex" }}
|
||||
className="group hover:border-brand relative rounded-sm border border-neutral-200 bg-white hover:bg-gray-50 dark:border-0 dark:bg-neutral-900 dark:hover:border-neutral-600">
|
||||
<ArrowRightIcon className="absolute right-3 top-3 h-4 w-4 text-black opacity-0 transition-opacity group-hover:opacity-100 dark:text-white" />
|
||||
{/* Don't prefetch till the time we drop the amount of javascript in [user][type] page which is impacting score for [user] page */}
|
||||
<Link
|
||||
prefetch={false}
|
||||
href={{
|
||||
pathname: `/${user.username}/${type.slug}`,
|
||||
query,
|
||||
@@ -121,6 +122,7 @@ export default function User(props: inferSSRProps<typeof getServerSideProps>) {
|
||||
|
||||
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
|
||||
const ssr = await ssrInit(context);
|
||||
const crypto = require("crypto");
|
||||
|
||||
const username = (context.query.user as string).toLowerCase();
|
||||
const dataFetchStart = Date.now();
|
||||
|
||||
Reference in new issue
Block a user