Skip to content

Commit 7c6bdf4

Browse files
committed
chore: more UI performance improvements
This PR contains a few related performance improvements: 1. Enable react compiler for IH, Entropy Explorer, and component library 2. Refactor Drawer state management to reduce rerenders drastically 3. Rev nextjs patch version 4. Disable turbopack for IH as it's causing major issues with webinspector
1 parent 35ed791 commit 7c6bdf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2648
-501
lines changed

apps/entropy-explorer/next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
const config = {
2+
experimental: {
3+
reactCompiler: true,
4+
},
5+
26
reactStrictMode: true,
37

48
pageExtensions: ["ts", "tsx", "mdx"],

apps/entropy-explorer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@types/react": "catalog:",
4646
"@types/react-dom": "catalog:",
4747
"autoprefixer": "catalog:",
48+
"babel-plugin-react-compiler": "catalog:",
4849
"eslint": "catalog:",
4950
"jest": "catalog:",
5051
"postcss": "catalog:",

apps/entropy-explorer/src/components/Home/chain-select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const useResolvedProps = () => {
9696
textValue: chainTextValue,
9797
buttonLabel: viemChain?.name ?? "Chain",
9898
...(viemChain && {
99-
icon: () => <ChainIcon id={viemChain.id} />,
99+
icon: <ChainIcon id={viemChain.id} />,
100100
}),
101101
};
102102
};

apps/entropy-explorer/src/components/Home/request-drawer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const RequestDrawerBody = ({ request }: { request: Request }) => {
6565
label="Details"
6666
fill
6767
className={styles.details ?? ""}
68-
stickyHeader
68+
stickyHeader="top"
6969
columns={[
7070
{
7171
id: "field",
@@ -254,7 +254,7 @@ const CallbackFailedInfo = ({ request }: { request: CallbackErrorRequest }) => {
254254
<Button
255255
size="sm"
256256
variant="ghost"
257-
beforeIcon={Question}
257+
beforeIcon={<Question />}
258258
rounded
259259
hideText
260260
href="https://docs.pyth.network/entropy/debug-callback-failures"

apps/insights/next.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
const config = {
2-
reactStrictMode: true,
3-
4-
pageExtensions: ["ts", "tsx", "mdx"],
5-
62
experimental: {
73
useCache: true,
4+
reactCompiler: true,
85
},
96

7+
reactStrictMode: true,
8+
9+
pageExtensions: ["ts", "tsx", "mdx"],
10+
1011
logging: {
1112
fetches: {
1213
fullUrl: true,

apps/insights/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"fix:lint:eslint": "eslint --fix .",
1313
"fix:lint:stylelint": "stylelint --fix 'src/**/*.scss'",
1414
"pull:env": "[ $CI ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_TBkf9EyQjQF37gs4Vk0sQKJj97kE vercel env pull",
15-
"start:dev": "next dev --port 3003 --turbopack",
15+
"start:dev": "next dev --port 3003",
1616
"start:prod": "next start --port 3003",
1717
"test:format": "prettier --check .",
1818
"test:lint:eslint": "eslint . --max-warnings 0",
@@ -58,6 +58,7 @@
5858
"@types/react": "catalog:",
5959
"@types/react-dom": "catalog:",
6060
"autoprefixer": "catalog:",
61+
"babel-plugin-react-compiler": "catalog:",
6162
"eslint": "catalog:",
6263
"jest": "catalog:",
6364
"postcss": "catalog:",

apps/insights/src/components/Explain/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Explain = ({ size, title, children }: Props) => (
1717
className={styles.trigger ?? ""}
1818
variant="ghost"
1919
size={size}
20-
beforeIcon={(props) => <Info weight="fill" {...props} />}
20+
beforeIcon={<Info weight="fill" />}
2121
rounded
2222
hideText
2323
alert={{

apps/insights/src/components/PriceComponentDrawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ const HeadingExtra = ({ status, ...props }: HeadingExtraProps) => {
270270
<OpenButton
271271
variant="ghost"
272272
hideText
273-
beforeIcon={ArrowSquareOut}
273+
beforeIcon={<ArrowSquareOut />}
274274
rounded
275275
className={styles.ghostOpenButton ?? ""}
276276
{...props}

apps/insights/src/components/PriceComponentsCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ export const PriceComponentsCardContents = <
489489
label={label}
490490
fill
491491
rounded
492-
stickyHeader
492+
stickyHeader="appHeader"
493493
className={styles.table ?? ""}
494494
columns={[
495495
{

apps/insights/src/components/PriceFeed/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const PriceFeedHeaderImpl = (props: PriceFeedHeaderImplProps) => (
135135
<Button
136136
variant="outline"
137137
size="sm"
138-
beforeIcon={ListDashes}
138+
beforeIcon={<ListDashes />}
139139
isPending={props.isLoading}
140140
{...(!props.isLoading && {
141141
drawer: {

0 commit comments

Comments
 (0)