From 7ff0af77050e711362a5628f7e000fac8efcfe01 Mon Sep 17 00:00:00 2001 From: sheykei Date: Thu, 16 Jan 2025 11:23:41 +0100 Subject: [PATCH 1/3] remove: deprecated json --- package.json | 10 +++++----- packages/dappkit | 2 +- src/modules/chain/routes/chain.$id.header.tsx | 2 +- src/modules/chain/routes/chain.$id.opportunities.tsx | 2 +- src/modules/chain/routes/chains.list.tsx | 2 +- src/modules/interaction/routes/transaction.$name.tsx | 6 +++--- .../leaderboard.($chain).($address).leaderboard.tsx | 4 ++-- src/modules/opportunity/routes/opportunities.list.tsx | 2 +- .../routes/opportunity.$chain.$type.$id.header.tsx | 2 +- .../opportunity.$chain.$type.$id.leaderboard.tsx | 4 ++-- src/modules/protocol/routes/protocol.$id.header.tsx | 4 ++-- .../protocol/routes/protocol.$id.opportunities.tsx | 2 +- src/modules/protocol/routes/protocols.header.tsx | 2 +- src/modules/protocol/routes/protocols.list.tsx | 2 +- src/modules/token/routes/token.$symbol.header.tsx | 4 ++-- .../token/routes/token.$symbol.opportunities.tsx | 2 +- src/modules/token/routes/tokens.list.tsx | 2 +- src/modules/user/routes/user.$address.claims.tsx | 2 +- src/modules/user/routes/user.$address.header.tsx | 2 +- src/modules/user/routes/user.$address.liquidity.tsx | 2 +- src/modules/user/routes/user.$address.rewards.tsx | 3 ++- src/root.tsx | 2 +- 22 files changed, 33 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 718c48c..ba7e025 100644 --- a/package.json +++ b/package.json @@ -24,11 +24,11 @@ "@merkl/api": "0.10.307", "@radix-ui/react-accordion": "^1.2.1", "@radix-ui/react-scroll-area": "^1.2.0", - "@remix-run/dev": "^2.11.2", - "@remix-run/node": "^2.11.2", - "@remix-run/react": "^2.11.2", - "@remix-run/serve": "^2.11.2", - "@remixicon/react": "^4.2.0", + "@remix-run/dev": "^2.15.2", + "@remix-run/node": "^2.15.2", + "@remix-run/react": "^2.15.2", + "@remix-run/serve": "^2.15.2", + "@remixicon/react": "^4.6.0", "@svgr/rollup": "^8.1.0", "@tanstack/react-query": "^5.55.4", "@vitejs/plugin-react": "^4.3.1", diff --git a/packages/dappkit b/packages/dappkit index 74d48bc..fcb19b0 160000 --- a/packages/dappkit +++ b/packages/dappkit @@ -1 +1 @@ -Subproject commit 74d48bc2d2cd908ca76613ff476c4878b5946ad5 +Subproject commit fcb19b06aa1fbcd0196601f59e5c80746aedf7c8 diff --git a/src/modules/chain/routes/chain.$id.header.tsx b/src/modules/chain/routes/chain.$id.header.tsx index 0185ea0..cc35053 100644 --- a/src/modules/chain/routes/chain.$id.header.tsx +++ b/src/modules/chain/routes/chain.$id.header.tsx @@ -17,7 +17,7 @@ export async function loader({ params: { id } }: LoaderFunctionArgs) { const { sum: dailyRewards } = await OpportunityService.getAggregate({ chainId: chain.id.toString() }, "dailyRewards"); - return json({ chain, count, dailyRewards, maxApr: opportunitiesByApr?.[0]?.apr }); + return { chain, count, dailyRewards, maxApr: opportunitiesByApr?.[0]?.apr }; } export const clientLoader = Cache.wrap("chain", 300); diff --git a/src/modules/chain/routes/chain.$id.opportunities.tsx b/src/modules/chain/routes/chain.$id.opportunities.tsx index 5a2cba0..4fcdec2 100644 --- a/src/modules/chain/routes/chain.$id.opportunities.tsx +++ b/src/modules/chain/routes/chain.$id.opportunities.tsx @@ -19,7 +19,7 @@ export async function loader({ params: { id: chainId }, request }: LoaderFunctio const { protocols } = await ProtocolService.getManyFromRequest(request); - return json({ opportunities, count, protocols, featuredOpportunities }); + return { opportunities, count, protocols, featuredOpportunities }; } export const clientLoader = Cache.wrap("chain/opportunities", 300); diff --git a/src/modules/chain/routes/chains.list.tsx b/src/modules/chain/routes/chains.list.tsx index fac1175..0fca094 100644 --- a/src/modules/chain/routes/chains.list.tsx +++ b/src/modules/chain/routes/chains.list.tsx @@ -10,7 +10,7 @@ import { ChainService } from "../../../modules/chain/chain.service"; export async function loader(_args: LoaderFunctionArgs) { const chains = await ChainService.getAll(); - return json({ chains, count: chains.length }); + return { chains, count: chains.length }; } export const clientLoader = Cache.wrap("chains", 300); diff --git a/src/modules/interaction/routes/transaction.$name.tsx b/src/modules/interaction/routes/transaction.$name.tsx index 6b4c371..93d71f4 100644 --- a/src/modules/interaction/routes/transaction.$name.tsx +++ b/src/modules/interaction/routes/transaction.$name.tsx @@ -25,9 +25,9 @@ export const action = async ({ params: { name }, request }: ActionFunctionArgs) if (payload.sponsor) { const sponsoredTx = await ZyfiService.wrapAndPrepareTx(tx); - return json(sponsoredTx); + return sponsoredTx; } - return json(tx); + return tx; } case "supply": { try { @@ -49,7 +49,7 @@ export const action = async ({ params: { name }, request }: ActionFunctionArgs) }); } - return json(tx); + return tx; } catch (err) { console.error(err); diff --git a/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx b/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx index 3d8e6ce..8564b2c 100644 --- a/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx +++ b/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx @@ -17,13 +17,13 @@ export async function loader({ params: { address, chain: chainName }, request }: address: token.address, }); - return json({ + return { rewards, token, chain, count, total, - }); + }; } export const clientLoader = Cache.wrap("leaderboard", 300); diff --git a/src/modules/opportunity/routes/opportunities.list.tsx b/src/modules/opportunity/routes/opportunities.list.tsx index 85f286f..9e03bde 100644 --- a/src/modules/opportunity/routes/opportunities.list.tsx +++ b/src/modules/opportunity/routes/opportunities.list.tsx @@ -17,7 +17,7 @@ export async function loader({ request }: LoaderFunctionArgs) { const chains = await ChainService.getAll(); const { protocols } = await ProtocolService.getManyFromRequest(request); - return json({ opportunities, chains, count, protocols, featuredOpportunities }); + return { opportunities, chains, count, protocols, featuredOpportunities }; } export const clientLoader = Cache.wrap("opportunities", 300); diff --git a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx index e7dbbfb..dc6a6ad 100644 --- a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx +++ b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx @@ -26,7 +26,7 @@ export async function loader({ params: { id, type, chain: chainId } }: LoaderFun type: type, identifier: id, }); - return json({ rawOpportunity, chain }); + return { rawOpportunity, chain }; } export const clientLoader = Cache.wrap("opportunity", 300); diff --git a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx index aa1ea46..597819e 100644 --- a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx +++ b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx @@ -46,14 +46,14 @@ export async function loader({ params: { id, type, chain: chainId }, request }: campaignId: selectedCampaign.campaignId, }); - return json({ + return { computeChain, rewards, campaigns, count, total, selectedCampaign, - }); + }; } export default function Index() { diff --git a/src/modules/protocol/routes/protocol.$id.header.tsx b/src/modules/protocol/routes/protocol.$id.header.tsx index ce1b437..45b47bb 100644 --- a/src/modules/protocol/routes/protocol.$id.header.tsx +++ b/src/modules/protocol/routes/protocol.$id.header.tsx @@ -23,14 +23,14 @@ export async function loader({ params: { id }, request }: LoaderFunctionArgs) { const { sum } = await OpportunityService.getAggregate({ mainProtocolId: id }, "dailyRewards"); - return json({ + return { opportunities, count, protocol, liveOpportunityCount: liveCount, maxApr: opportunitiesByApr?.[0]?.apr, dailyRewards: sum, - }); + }; } export const clientLoader = Cache.wrap("protocol", 300); diff --git a/src/modules/protocol/routes/protocol.$id.opportunities.tsx b/src/modules/protocol/routes/protocol.$id.opportunities.tsx index 661957c..b12cae6 100644 --- a/src/modules/protocol/routes/protocol.$id.opportunities.tsx +++ b/src/modules/protocol/routes/protocol.$id.opportunities.tsx @@ -16,7 +16,7 @@ export async function loader({ params: { id }, request }: LoaderFunctionArgs) { //TODO: embed this in client/service const { protocols } = await ProtocolService.getManyFromRequest(request); - return json({ opportunities, count, protocols, featuredOpportunities }); + return { opportunities, count, protocols, featuredOpportunities }; } export default function Index() { diff --git a/src/modules/protocol/routes/protocols.header.tsx b/src/modules/protocol/routes/protocols.header.tsx index 892b47b..3c2f08a 100644 --- a/src/modules/protocol/routes/protocols.header.tsx +++ b/src/modules/protocol/routes/protocols.header.tsx @@ -14,7 +14,7 @@ export const meta: MetaFunction = () => { export async function loader({ request }: LoaderFunctionArgs) { const { protocols, count } = await ProtocolService.getManyFromRequest(request); - return json({ protocols, count }); + return { protocols, count }; } export default function Index() { diff --git a/src/modules/protocol/routes/protocols.list.tsx b/src/modules/protocol/routes/protocols.list.tsx index 412254e..c42ea86 100644 --- a/src/modules/protocol/routes/protocols.list.tsx +++ b/src/modules/protocol/routes/protocols.list.tsx @@ -8,7 +8,7 @@ import { ProtocolService } from "../../../modules/protocol/protocol.service"; export async function loader({ request }: LoaderFunctionArgs) { const { protocols, count } = await ProtocolService.getManyFromRequest(request); - return json({ protocols, count }); + return { protocols, count }; } export const clientLoader = Cache.wrap("protocols", 300); diff --git a/src/modules/token/routes/token.$symbol.header.tsx b/src/modules/token/routes/token.$symbol.header.tsx index eeea5fe..6c8db22 100644 --- a/src/modules/token/routes/token.$symbol.header.tsx +++ b/src/modules/token/routes/token.$symbol.header.tsx @@ -20,13 +20,13 @@ export async function loader({ params: { symbol } }: LoaderFunctionArgs) { const { sum: dailyRewards } = await OpportunityService.getAggregate({ tokens: symbol }, "dailyRewards"); - return json({ + return { tokens, chains, dailyRewards, maxApr: opportunitiesByApr?.[0]?.apr, count, - }); + }; } export const clientLoader = Cache.wrap("token", 300); diff --git a/src/modules/token/routes/token.$symbol.opportunities.tsx b/src/modules/token/routes/token.$symbol.opportunities.tsx index 767dbd1..a54bdae 100644 --- a/src/modules/token/routes/token.$symbol.opportunities.tsx +++ b/src/modules/token/routes/token.$symbol.opportunities.tsx @@ -16,7 +16,7 @@ export async function loader({ params: { symbol }, request }: LoaderFunctionArgs //TODO: embed this in client/service const chains = await ChainService.getAll(); - return json({ opportunities, chains, count, featuredOpportunities }); + return { opportunities, chains, count, featuredOpportunities }; } export const clientLoader = Cache.wrap("token/opportunities", 300); diff --git a/src/modules/token/routes/tokens.list.tsx b/src/modules/token/routes/tokens.list.tsx index bb34528..a92833d 100644 --- a/src/modules/token/routes/tokens.list.tsx +++ b/src/modules/token/routes/tokens.list.tsx @@ -11,7 +11,7 @@ import { TokenService } from "../../../modules/token/token.service"; export async function loader({ request }: LoaderFunctionArgs) { const { tokens, count } = await TokenService.getManyFromRequest(request); - return json({ tokens, count }); + return { tokens, count }; } export const clientLoader = Cache.wrap("tokens", 300); diff --git a/src/modules/user/routes/user.$address.claims.tsx b/src/modules/user/routes/user.$address.claims.tsx index 9f693ca..99afe58 100644 --- a/src/modules/user/routes/user.$address.claims.tsx +++ b/src/modules/user/routes/user.$address.claims.tsx @@ -8,7 +8,7 @@ import { ClaimsService } from "../../../modules/claim/claim.service"; export async function loader({ params: { address } }: LoaderFunctionArgs) { if (!address || !isAddress(address)) throw ""; const claims = await ClaimsService.getForUser(address); - return json({ claims }); + return { claims }; } export default function Index() { const { claims } = useLoaderData(); diff --git a/src/modules/user/routes/user.$address.header.tsx b/src/modules/user/routes/user.$address.header.tsx index 1de2120..f4991c1 100644 --- a/src/modules/user/routes/user.$address.header.tsx +++ b/src/modules/user/routes/user.$address.header.tsx @@ -28,7 +28,7 @@ export async function loader({ params: { address }, request }: LoaderFunctionArg )?.[0] : null; - return json({ rewards, address, token }); + return { rewards, address, token }; } export const meta: MetaFunction = ({ data, error }) => { diff --git a/src/modules/user/routes/user.$address.liquidity.tsx b/src/modules/user/routes/user.$address.liquidity.tsx index 55056c7..ac74393 100644 --- a/src/modules/user/routes/user.$address.liquidity.tsx +++ b/src/modules/user/routes/user.$address.liquidity.tsx @@ -16,7 +16,7 @@ export async function loader({ params: { address } }: LoaderFunctionArgs) { address, chainId: defaultChain, }); - return json({ positions }); + return { positions }; } export default function Index() { diff --git a/src/modules/user/routes/user.$address.rewards.tsx b/src/modules/user/routes/user.$address.rewards.tsx index 573f305..e62fa80 100644 --- a/src/modules/user/routes/user.$address.rewards.tsx +++ b/src/modules/user/routes/user.$address.rewards.tsx @@ -12,7 +12,8 @@ import type { OutletContextRewards } from "./user.$address.header"; export async function loader({ params: { address } }: LoaderFunctionArgs) { if (!address || !isAddress(address)) throw ""; - return json({ address }); + + return { address }; } export default function Index() { diff --git a/src/root.tsx b/src/root.tsx index 0512271..2535f0f 100644 --- a/src/root.tsx +++ b/src/root.tsx @@ -33,7 +33,7 @@ export async function loader(_args: LoaderFunctionArgs) { if (!chains) throw new Response("Unable to fetch chains", { status: 500 }); - return json({ ENV: { API_URL: process.env.API_URL }, chains }); + return { ENV: { API_URL: process.env.API_URL }, chains }; } export const clientLoader = Cache.wrap("root", 300); From 90f14d0256d2a6a316735a31281e66f57c711840 Mon Sep 17 00:00:00 2001 From: sheykei Date: Thu, 16 Jan 2025 15:35:31 +0100 Subject: [PATCH 2/3] remove: remaining json --- .../routes/leaderboard.($chain).($address).header.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx b/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx index 2578a10..62afbb0 100644 --- a/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx +++ b/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx @@ -24,10 +24,10 @@ export const extractChainAndTokenFromParams = async (address: string | undefined export async function loader({ params: { address, chain: chainName } }: LoaderFunctionArgs) { const { chain, token } = await extractChainAndTokenFromParams(address, chainName); - return json({ + return { token, chain, - }); + }; } export const meta: MetaFunction = ({ data: _data }) => { From 27fd39c19d9218c489f550310bdebb8309678371 Mon Sep 17 00:00:00 2001 From: sheykei Date: Thu, 16 Jan 2025 15:36:40 +0100 Subject: [PATCH 3/3] fix: lint --- src/modules/chain/routes/chain.$id.header.tsx | 2 +- src/modules/chain/routes/chain.$id.opportunities.tsx | 2 +- src/modules/chain/routes/chains.list.tsx | 2 +- src/modules/interaction/routes/transaction.$name.tsx | 2 +- .../routes/leaderboard.($chain).($address).header.tsx | 2 +- .../routes/leaderboard.($chain).($address).leaderboard.tsx | 2 +- src/modules/opportunity/routes/opportunities.list.tsx | 2 +- .../opportunity/routes/opportunity.$chain.$type.$id.header.tsx | 2 +- .../routes/opportunity.$chain.$type.$id.leaderboard.tsx | 2 +- src/modules/protocol/routes/protocol.$id.header.tsx | 2 +- src/modules/protocol/routes/protocol.$id.opportunities.tsx | 2 +- src/modules/protocol/routes/protocols.header.tsx | 2 +- src/modules/protocol/routes/protocols.list.tsx | 2 +- src/modules/token/routes/token.$symbol.header.tsx | 2 +- src/modules/token/routes/token.$symbol.opportunities.tsx | 2 +- src/modules/token/routes/tokens.list.tsx | 2 +- src/modules/user/routes/user.$address.claims.tsx | 2 +- src/modules/user/routes/user.$address.header.tsx | 2 +- src/modules/user/routes/user.$address.liquidity.tsx | 2 +- src/modules/user/routes/user.$address.rewards.tsx | 2 +- src/root.tsx | 1 - 21 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/modules/chain/routes/chain.$id.header.tsx b/src/modules/chain/routes/chain.$id.header.tsx index cc35053..a4de4f1 100644 --- a/src/modules/chain/routes/chain.$id.header.tsx +++ b/src/modules/chain/routes/chain.$id.header.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, type MetaFunction, json } from "@remix-run/node"; +import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { Outlet, useLoaderData } from "@remix-run/react"; import Hero, { defaultHeroSideDatas } from "../../../components/composite/Hero"; import { Cache } from "../../../modules/cache/cache.service"; diff --git a/src/modules/chain/routes/chain.$id.opportunities.tsx b/src/modules/chain/routes/chain.$id.opportunities.tsx index 4fcdec2..bf2c5b7 100644 --- a/src/modules/chain/routes/chain.$id.opportunities.tsx +++ b/src/modules/chain/routes/chain.$id.opportunities.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Container, Group, Space, Title } from "dappkit"; import OpportunityLibrary from "../../../components/element/opportunity/OpportunityLibrary"; diff --git a/src/modules/chain/routes/chains.list.tsx b/src/modules/chain/routes/chains.list.tsx index 0fca094..0d1d062 100644 --- a/src/modules/chain/routes/chains.list.tsx +++ b/src/modules/chain/routes/chains.list.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import { json, useLoaderData } from "@remix-run/react"; +import { useLoaderData } from "@remix-run/react"; import { useNavigate } from "@remix-run/react"; import { Container, Space } from "dappkit"; import { useEffect } from "react"; diff --git a/src/modules/interaction/routes/transaction.$name.tsx b/src/modules/interaction/routes/transaction.$name.tsx index 93d71f4..995ddcc 100644 --- a/src/modules/interaction/routes/transaction.$name.tsx +++ b/src/modules/interaction/routes/transaction.$name.tsx @@ -1,4 +1,4 @@ -import { type ActionFunctionArgs, json } from "@remix-run/node"; +import type { ActionFunctionArgs } from "@remix-run/node"; import { encodeFunctionData, parseAbi } from "viem"; import { api } from "../../../api/"; import { ZyfiService } from "../../../modules/zyfi/zyfi.service"; diff --git a/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx b/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx index 62afbb0..bbd313f 100644 --- a/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx +++ b/src/modules/leaderboard/routes/leaderboard.($chain).($address).header.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import type { MetaFunction } from "@remix-run/node"; import { Outlet, useLoaderData } from "@remix-run/react"; import { I18n } from "../../../I18n"; diff --git a/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx b/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx index 8564b2c..3e69d28 100644 --- a/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx +++ b/src/modules/leaderboard/routes/leaderboard.($chain).($address).leaderboard.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Box, Container, Group, Space, Title, Value } from "dappkit"; import { Suspense, useMemo } from "react"; diff --git a/src/modules/opportunity/routes/opportunities.list.tsx b/src/modules/opportunity/routes/opportunities.list.tsx index 9e03bde..ee94884 100644 --- a/src/modules/opportunity/routes/opportunities.list.tsx +++ b/src/modules/opportunity/routes/opportunities.list.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import { json, useLoaderData } from "@remix-run/react"; +import { useLoaderData } from "@remix-run/react"; import { Container, Group, Space, Title } from "dappkit"; import OpportunityLibrary from "../../../components/element/opportunity/OpportunityLibrary"; import { ErrorContent } from "../../../components/layout/ErrorContent"; diff --git a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx index dc6a6ad..c2c958a 100644 --- a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx +++ b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.header.tsx @@ -1,5 +1,5 @@ import type { Chain } from "@merkl/api"; -import { type LoaderFunctionArgs, type MetaFunction, json } from "@remix-run/node"; +import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { Meta, Outlet, useLoaderData } from "@remix-run/react"; import { Button, Group, Icon } from "dappkit"; import { useClipboard } from "dappkit"; diff --git a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx index 597819e..94ce13d 100644 --- a/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx +++ b/src/modules/opportunity/routes/opportunity.$chain.$type.$id.leaderboard.tsx @@ -1,5 +1,5 @@ import type { Campaign } from "@merkl/api"; -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Box, diff --git a/src/modules/protocol/routes/protocol.$id.header.tsx b/src/modules/protocol/routes/protocol.$id.header.tsx index 45b47bb..280e327 100644 --- a/src/modules/protocol/routes/protocol.$id.header.tsx +++ b/src/modules/protocol/routes/protocol.$id.header.tsx @@ -1,5 +1,5 @@ import type { Opportunity } from "@merkl/api"; -import { type LoaderFunctionArgs, type MetaFunction, json } from "@remix-run/node"; +import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { Outlet, useLoaderData } from "@remix-run/react"; import { Group } from "dappkit"; import { I18n } from "../../../I18n"; diff --git a/src/modules/protocol/routes/protocol.$id.opportunities.tsx b/src/modules/protocol/routes/protocol.$id.opportunities.tsx index b12cae6..bbbf0cc 100644 --- a/src/modules/protocol/routes/protocol.$id.opportunities.tsx +++ b/src/modules/protocol/routes/protocol.$id.opportunities.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Container, Group, Space, Title } from "dappkit"; import { useWalletContext } from "dappkit"; diff --git a/src/modules/protocol/routes/protocols.header.tsx b/src/modules/protocol/routes/protocols.header.tsx index 3c2f08a..bc185e7 100644 --- a/src/modules/protocol/routes/protocols.header.tsx +++ b/src/modules/protocol/routes/protocols.header.tsx @@ -4,7 +4,7 @@ import { v4 as uuidv4 } from "uuid"; import Hero from "../../../components/composite/Hero"; import { ProtocolService } from "../../../modules/protocol/protocol.service"; -import { Outlet, json, useLoaderData } from "@remix-run/react"; +import { Outlet, useLoaderData } from "@remix-run/react"; import { I18n } from "../../../I18n"; export const meta: MetaFunction = () => { diff --git a/src/modules/protocol/routes/protocols.list.tsx b/src/modules/protocol/routes/protocols.list.tsx index c42ea86..bfe0774 100644 --- a/src/modules/protocol/routes/protocols.list.tsx +++ b/src/modules/protocol/routes/protocols.list.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Container, Space } from "dappkit"; import ProtocolLibrary from "../../../components/element/protocol/ProtocolLibrary"; diff --git a/src/modules/token/routes/token.$symbol.header.tsx b/src/modules/token/routes/token.$symbol.header.tsx index 6c8db22..f8e694e 100644 --- a/src/modules/token/routes/token.$symbol.header.tsx +++ b/src/modules/token/routes/token.$symbol.header.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, type MetaFunction, json } from "@remix-run/node"; +import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { Outlet, useLoaderData } from "@remix-run/react"; import { I18n } from "../../../I18n"; import Hero, { defaultHeroSideDatas } from "../../../components/composite/Hero"; diff --git a/src/modules/token/routes/token.$symbol.opportunities.tsx b/src/modules/token/routes/token.$symbol.opportunities.tsx index a54bdae..1b00dd8 100644 --- a/src/modules/token/routes/token.$symbol.opportunities.tsx +++ b/src/modules/token/routes/token.$symbol.opportunities.tsx @@ -1,4 +1,4 @@ -import { type LoaderFunctionArgs, json } from "@remix-run/node"; +import type { LoaderFunctionArgs } from "@remix-run/node"; import { useLoaderData } from "@remix-run/react"; import { Container, Group, Space, Title } from "dappkit"; import OpportunityLibrary from "../../../components/element/opportunity/OpportunityLibrary"; diff --git a/src/modules/token/routes/tokens.list.tsx b/src/modules/token/routes/tokens.list.tsx index a92833d..3ae0ccd 100644 --- a/src/modules/token/routes/tokens.list.tsx +++ b/src/modules/token/routes/tokens.list.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import { json, useLoaderData } from "@remix-run/react"; +import { useLoaderData } from "@remix-run/react"; import { useNavigate } from "@remix-run/react"; import { Container, Space } from "dappkit"; import { useEffect } from "react"; diff --git a/src/modules/user/routes/user.$address.claims.tsx b/src/modules/user/routes/user.$address.claims.tsx index 99afe58..abd0b44 100644 --- a/src/modules/user/routes/user.$address.claims.tsx +++ b/src/modules/user/routes/user.$address.claims.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import { json, useLoaderData } from "@remix-run/react"; +import { useLoaderData } from "@remix-run/react"; import { Container, Space } from "dappkit"; import { isAddress } from "viem"; import HistoricalClaimsLibrary from "../../../components/element/historicalClaimsLibrary/HistoricalClaimsLibrary"; diff --git a/src/modules/user/routes/user.$address.header.tsx b/src/modules/user/routes/user.$address.header.tsx index f4991c1..5592cfe 100644 --- a/src/modules/user/routes/user.$address.header.tsx +++ b/src/modules/user/routes/user.$address.header.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; -import { Outlet, json, useFetcher, useLoaderData } from "@remix-run/react"; +import { Outlet, useFetcher, useLoaderData } from "@remix-run/react"; import { Button, Divider, Dropdown, Group, Hash, Icon, Text, Value } from "dappkit"; import { TransactionButton, type TransactionButtonProps } from "dappkit"; import { useWalletContext } from "dappkit"; diff --git a/src/modules/user/routes/user.$address.liquidity.tsx b/src/modules/user/routes/user.$address.liquidity.tsx index ac74393..0207989 100644 --- a/src/modules/user/routes/user.$address.liquidity.tsx +++ b/src/modules/user/routes/user.$address.liquidity.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import { json, useLoaderData } from "@remix-run/react"; +import { useLoaderData } from "@remix-run/react"; import { Container } from "dappkit"; import { isAddress } from "viem"; import PositionLibrary from "../../../components/element/position/PositionLibrary"; diff --git a/src/modules/user/routes/user.$address.rewards.tsx b/src/modules/user/routes/user.$address.rewards.tsx index e62fa80..674e3ff 100644 --- a/src/modules/user/routes/user.$address.rewards.tsx +++ b/src/modules/user/routes/user.$address.rewards.tsx @@ -1,5 +1,5 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import { json, useLoaderData, useOutletContext } from "@remix-run/react"; +import { useLoaderData, useOutletContext } from "@remix-run/react"; import { Container, Fmt, Group, Icon, Space, Text, useWalletContext } from "dappkit"; import { useMemo } from "react"; import { isAddress } from "viem"; diff --git a/src/root.tsx b/src/root.tsx index 2535f0f..2d65b60 100644 --- a/src/root.tsx +++ b/src/root.tsx @@ -6,7 +6,6 @@ import { Scripts, ScrollRestoration, isRouteErrorResponse, - json, useLoaderData, useNavigate, useRouteError,