Get ready for rollout of next.js version

This commit is contained in:
Jordan Eldredge 2025-06-06 12:54:48 -04:00
parent 186129ecb9
commit 33ca103c10
8 changed files with 60 additions and 17 deletions

View file

@ -0,0 +1,18 @@
"use client";
// There is some bug between how JSZip pulls in setimmediate (which it expects
// to polyfill `window.setimmediate` and our Webpack setup. The result is that
// one of our bundles is missing the polyfill. If we call JSZip code from within
// that bundle the polyfill is not present and we get an error.
//
// This explicit import should ensure that the polyfill is present in the
// entrypoint bundle and thus always set on `window`.
//
// We should be able to remove this once we root cause the bundling issue.
import "setimmediate";
import LegacyApp from "../../skin-museum-client/src/App";
import SearchLogo from "./SearchLogo";
export default function App() {
return <LegacyApp next={true} searchLogo={<SearchLogo />} />;
}

View file

@ -0,0 +1,19 @@
"use client";
// import { useWindowSize } from "../../skin-museum-client/src/hooks";
// import AlgoliaLogo from "../../skin-museum-client/src/searchByAlgoliaDarkbBackground.svg";
// import algoliaLogoSmallUrl from "../../skin-museum-client/src/searchByAlgoliaSmall.png";
export default function SearchLogo() {
return null;
// const { windowWidth } = useWindowSize();
// if (windowWidth > 500) {
// return <AlgoliaLogo.ReactComponent />;
// }
// return (
// <img
// alt="Search by Algolia"
// style={{ width: 25, height: 25, paddingTop: 4 }}
// src={algoliaLogoSmallUrl}
// />
// );
}

View file

@ -1,4 +1,4 @@
import App from "../../../skin-museum-client/src/App";
import App from "../App";
import type { Metadata } from "next";
const DESCRIPTION =
@ -73,5 +73,5 @@ export async function generateMetadata({ searchParams }): Promise<Metadata> {
}
export default function Page() {
return <App next={true} />;
return <App />;
}

View file

@ -1,13 +1,3 @@
// There is some bug between how JSZip pulls in setimmediate (which it expects
// to polyfill `window.setimmediate` and our Webpack setup. The result is that
// one of our bundles is missing the polyfill. If we call JSZip code from within
// that bundle the polyfill is not present and we get an error.
//
// This explicit import should ensure that the polyfill is present in the
// entrypoint bundle and thus always set on `window`.
//
// We should be able to remove this once we root cause the bundling issue.
import "setimmediate";
import ReduxContextProvider from "./redux";
import { GoogleAnalytics } from "@next/third-parties/google";

View file

@ -1,4 +1,4 @@
import App from "../../../../skin-museum-client/src/App";
import App from "../../App";
import type { Metadata } from "next";
import SkinModel from "../../../data/SkinModel";
import UserContext from "../../../data/UserContext";
@ -52,5 +52,5 @@ export async function generateMetadata({ params }): Promise<Metadata> {
}
export default function Page() {
return <App next={true} />;
return <App />;
}

View file

@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
# Switch to Node 20
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm use 20
# Install dependencies
yarn install --frozen-lockfile
# Build the site
yarn run build
# Reload processes via PM2
pm2 reload ecosystem.config.js

View file

@ -64,7 +64,7 @@ function App(props) {
return (
<div>
{props.next || <Head />}
<Header next={props.next} />
<Header searchLogo={props.searchLogo} />
<div {...getRootProps()}>
{props.uploadViewOpen || isDragActive ? (
<UploadGrid

View file

@ -52,7 +52,7 @@ function useFocusOnSlash() {
return setInput;
}
function Header({ next }) {
function Header({ searchLogo }) {
const searchQuery = useSelector(Selectors.getSearchQuery);
const uploadViewOpen = useSelector(Selectors.getUploadViewOpen);
const setSearchQuery = useActionCreator(Actions.searchQueryChanged);
@ -89,7 +89,7 @@ function Header({ next }) {
transition: "opacity ease-in 300ms",
}}
>
{next || <SearchLogo />}
{searchLogo || <SearchLogo />}
</a>
<input
type="search"