Skip to content

Commit

Permalink
Chore/update next 15 (#1756)
Browse files Browse the repository at this point in the history
* update next, frames/render

* update csp

* ignore types issues in framesjs

* remove unused import

* remove console log

* update apps/web next version

* fix jobs page

* resolve build issues

* add parser options

* fix type issues

* fix default font

* update 3d tools

* remove unnecessary fixes

* minor fix

* add parser options
  • Loading branch information
brendan-defi authored Feb 13, 2025
1 parent 02150fb commit 3c892b2
Show file tree
Hide file tree
Showing 13 changed files with 4,960 additions and 4,793 deletions.
4 changes: 4 additions & 0 deletions apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module.exports = {
'plugin:react/jsx-runtime',
'eslint-config-prettier',
],
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
settings: {
next: {
rootDir: __dirname,
Expand Down
9 changes: 4 additions & 5 deletions apps/web/app/(base-org)/jobs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ export const metadata: Metadata = {
},
};

// Revalidate every 30 minutes
export const revalidate = 60 * 30;

async function getJobs() {
const res = await fetch(`${greenhouseApiUrl}/boards/basejobs/jobs?content=true`, {
next: { revalidate },
next: { revalidate: 60 * 30 }, // Revalidate every 30 minutes
});
try {
const { jobs } = (await res.json()) as { jobs: JobType[] };
return jobs;
} catch (error) {}
} catch (_error) {
console.error(_error);
}
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body {
height: 100%;
margin: 0;
min-height: 100vh;
font-family: '__coinbaseDisplay_7118f1';
font-family: var(--font-coinbase-display), sans-serif;
}

*,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
4 changes: 1 addition & 3 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ const baseConfig = {

// Enable strict mode in development
reactStrictMode: !isProdEnv,

// Minify for production builds
swcMinify: false,
};

function extendBaseConfig(customConfig = {}, plugins = []) {
Expand Down Expand Up @@ -119,6 +116,7 @@ const contentSecurityPolicy = {
'https://unpkg.com/@lottiefiles/dotlottie-web@0.31.1/dist/dotlottie-player.wasm', // lottie player
`https://${process.env.NEXT_PUBLIC_PINATA_GATEWAY_URL}`,
'https://usdc-claim-git-master-coinbase-vercel.vercel.app',
'https://eth.merkle.io', // new default viem rpc
],
'frame-src': ['https://p.datadoghq.com'],
'frame-ancestors': ["'self'", baseXYZDomains],
Expand Down
15 changes: 10 additions & 5 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@coinbase/onchainkit": "^0.35.2",
"@datadog/browser-logs": "^5.23.3",
"@datadog/browser-rum": "^5.23.3",
"@frames.js/render": "^0.3.14",
"@frames.js/render": "^0.5.5",
"@guildxyz/sdk": "2.6.0",
"@headlessui/react": "^1.7.19",
"@heroicons/react": "^2.1.3",
Expand All @@ -30,8 +30,8 @@
"@radix-ui/react-tooltip": "^1.1.2",
"@rainbow-me/rainbowkit": "^2.1.5",
"@react-three/drei": "^9.113.0",
"@react-three/fiber": "^8.17.7",
"@react-three/postprocessing": "^2.16.2",
"@react-three/fiber": "^9.0.0-alpha.8",
"@react-three/postprocessing": "^3.0.0-rc.0",
"@react-three/rapier": "1.1.1",
"@tanstack/react-query": "^5",
"@types/jsdom": "^21.1.7",
Expand All @@ -56,7 +56,7 @@
"jsdom": "^25.0.0",
"jsonwebtoken": "^9.0.2",
"kysely": "^0.27.3",
"next": "^14.2.16",
"next": "^15.1.6",
"node-fetch": "^3.3.0",
"permissionless": "^0.1.41",
"pg": "^8.12.0",
Expand Down Expand Up @@ -91,10 +91,15 @@
"@types/react": "^18",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@typescript-eslint/type-utils": "^7.8.0",
"@typescript-eslint/types": "^7.8.0",
"@typescript-eslint/utils": "^7.8.0",
"autoprefixer": "^10.4.13",
"csv-parser": "^3.0.0",
"dotenv": "^16.0.3",
"eslint-config-next": "^13.1.6",
"eslint-config-next": "^15.1.6",
"jest": "^29.7.0",
"postcss": "^8.4.21",
"prettier-plugin-tailwindcss": "^0.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ export default function Frame({ url, className }: FrameProps) {
const currentFrameStackItem = openFrameState.currentFrameStackItem;
if (!openFrameWorksPersisted && currentFrameStackItem) {
const status = currentFrameStackItem.status;
// @ts-expect-error frames.js type incompatibility between v1 and v2
if (status === 'done' && currentFrameStackItem.frameResult.frame.accepts) {
// @ts-expect-error frames.js type incompatibility between v1 and v2
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
const acceptsAnonymous = currentFrameStackItem.frameResult.frame.accepts.some(
// @ts-expect-error frames.js type incompatibility between v1 and v2
(element) => element.id === 'anonymous',
);
if (acceptsAnonymous) {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/ThreeHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Physics = dynamic(async () => import('@react-three/rapier').then((mod) =>
ssr: false,
});

/*
/*
The Main Scene
- Keeps track of window focus, intersection observer
- Listen to pointer event for rotation context
Expand Down Expand Up @@ -223,7 +223,7 @@ function Loader() {
);
}

/*
/*
The Environment
- Loads the JPEG / HDR gainmap file
- Set as global texture
Expand Down Expand Up @@ -274,7 +274,7 @@ function EnvironmentSetup() {
);
}

/*
/*
The GLTF Scene
- Loads the GLTF file / 3D scene
*/
Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/hooks/useAggregatedDiscountValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ import { useMemo } from 'react';

export type DiscountData = AttestationData & { discountKey: `0x${string}` };

export type MappedDiscountData = {
[key in Discount]?: DiscountData;
};
export type MappedDiscountData = Partial<Record<Discount, DiscountData>>;

export function findFirstValidDiscount(
aggregatedData: MappedDiscountData,
): DiscountData | undefined {
const priorityOrder: Partial<{ [key in Discount]: number }> & { default: 3 } = {
const priorityOrder: Partial<Record<Discount, number>> & { default: 3 } = {
[Discount.DISCOUNT_CODE]: 0,
[Discount.BNS_NAME]: 1,
[Discount.CB1]: 2,
Expand Down
4 changes: 1 addition & 3 deletions apps/web/src/utils/proofs/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import {
USERNAME_EA_DISCOUNT_VALIDATORS,
} from 'apps/web/src/addresses/usernames';

const validators: {
[key in ProofTableNamespace]: Record<number, Address>;
} = {
const validators: Record<ProofTableNamespace, Record<number, Address>> = {
[ProofTableNamespace.CBIDDiscount]: USERNAME_CB_ID_DISCOUNT_VALIDATORS,
[ProofTableNamespace.BaseEthHolders]: USERNAME_BASE_ETH_HOLDERS_DISCOUNT_VALIDATORS,
[ProofTableNamespace.BNSDiscount]: USERNAME_BNS_DISCOUNT_VALIDATORS,
Expand Down
8 changes: 2 additions & 6 deletions apps/web/src/utils/proofs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ export type DiscountValue = {
discountValidatorAddress: Address;
};

export type DiscountTypes = {
[key in DiscountType]?: DiscountValue;
};
export type DiscountTypes = Partial<Record<DiscountType, DiscountValue>>;

export type PreviousClaims = {
[key in DiscountType]?: PreviousClaim;
};
export type PreviousClaims = Partial<Record<DiscountType, PreviousClaim>>;

export type MerkleTreeProofResponse = {
discountValidatorAddress: Address;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint": "^8.27.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "13.1.1",
"eslint-config-next": "15.1.6",
"eslint-config-prettier": "^8.5.0",
"eslint-formatter-codeframe": "^7.32.1",
"eslint-import-resolver-typescript": "^3.5.2",
Expand Down Expand Up @@ -80,14 +80,14 @@
"dependencies": {
"@datadog/browser-logs": "^5.23.3",
"@linaria/babel-preset": "^4.4.3",
"@next/bundle-analyzer": "^14.2.5",
"@next/bundle-analyzer": "^15.1.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-select": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.2",
"classnames": "^2.3.2",
"clsx": "^1.2.1",
"moment": "^2.29.4",
"next": "14.2.10",
"next": "15.1.6",
"tslib": "^2.3.0"
},
"lint-staged": {
Expand Down
Loading

0 comments on commit 3c892b2

Please sign in to comment.