Ugprade Remix deps

This commit is contained in:
Kalle 2023-01-22 14:32:18 +02:00
parent f0f6b14f58
commit 318f7a5043
6 changed files with 745 additions and 103 deletions

View File

@ -30,7 +30,7 @@ import { Label } from "~/components/Label";
import { Ability } from "~/components/Ability";
import { damageTypeTranslationString } from "~/utils/i18next";
import { useSetTitle } from "~/hooks/useSetTitle";
import type { ShouldReloadFunction } from "@remix-run/react";
import type { ShouldRevalidateFunction } from "@remix-run/react";
import { Toggle } from "~/components/Toggle";
import { useObjectDamage } from "../calculator-hooks";
import { type DamageType, possibleApValues } from "~/features/build-analyzer";
@ -38,7 +38,7 @@ import type { DamageReceiver } from "../calculator-types";
export const CURRENT_PATCH = "2.1";
export const unstable_shouldReload: ShouldReloadFunction = () => false;
export const shouldRevalidate: ShouldRevalidateFunction = () => false;
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: styles }];

View File

@ -11,8 +11,8 @@ import {
Meta,
Outlet,
Scripts,
type ShouldRevalidateFunction,
useLoaderData,
type ShouldReloadFunction,
} from "@remix-run/react";
import * as React from "react";
import commonStyles from "~/styles/common.css";
@ -41,9 +41,9 @@ import { isTheme } from "./modules/theme/provider";
import { useIsMounted } from "./hooks/useIsMounted";
import invariant from "tiny-invariant";
export const unstable_shouldReload: ShouldReloadFunction = ({ url }) => {
// reload on language change so the selected language gets set into the cookie
const lang = url.searchParams.get("lng");
export const shouldRevalidate: ShouldRevalidateFunction = ({ nextUrl }) => {
// // reload on language change so the selected language gets set into the cookie
const lang = nextUrl.searchParams.get("lng");
return Boolean(lang);
};

View File

@ -4,7 +4,7 @@ import type {
MetaFunction,
SerializeFrom,
} from "@remix-run/node";
import type { ShouldReloadFunction } from "@remix-run/react";
import type { ShouldRevalidateFunction } from "@remix-run/react";
import { Link, useLoaderData, useSearchParams } from "@remix-run/react";
import * as React from "react";
import { useCopyToClipboard } from "react-use";
@ -39,8 +39,8 @@ import {
const AMOUNT_OF_MAPS_IN_MAP_LIST = stageIds.length * 2;
export const unstable_shouldReload: ShouldReloadFunction = ({ url }) => {
const searchParams = new URL(url).searchParams;
export const shouldRevalidate: ShouldRevalidateFunction = ({ nextUrl }) => {
const searchParams = new URL(nextUrl).searchParams;
// Only let loader reload data if we're not currently editing the map pool
// and persisting it in the search params.
return searchParams.has("readonly");

View File

@ -4,7 +4,7 @@ import type {
MetaFunction,
} from "@remix-run/node";
import { json } from "@remix-run/node";
import type { ShouldReloadFunction } from "@remix-run/react";
import type { ShouldRevalidateFunction } from "@remix-run/react";
import { Link, Outlet, useLoaderData, useSearchParams } from "@remix-run/react";
import clsx from "clsx";
import invariant from "tiny-invariant";
@ -138,9 +138,9 @@ export interface PlusSuggestionsLoaderData {
suggestedForTiers: number[];
}
export const unstable_shouldReload: ShouldReloadFunction = ({ submission }) => {
export const shouldRevalidate: ShouldRevalidateFunction = ({ formMethod }) => {
// only reload if form submission not when user changes tabs
return Boolean(submission);
return Boolean(formMethod && formMethod !== "get");
};
export const loader: LoaderFunction = async ({ request }) => {

814
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -35,9 +35,9 @@
"@faker-js/faker": "^7.6.0",
"@headlessui/react": "^1.7.7",
"@popperjs/core": "^2.11.6",
"@remix-run/node": "^1.9.0",
"@remix-run/react": "^1.9.0",
"@remix-run/serve": "^1.9.0",
"@remix-run/node": "^1.11.1",
"@remix-run/react": "^1.11.1",
"@remix-run/serve": "^1.11.1",
"@tldraw/tldraw": "^1.27.0",
"aws-sdk": "^2.1299.0",
"better-sqlite3": "^8.0.1",
@ -75,8 +75,8 @@
},
"devDependencies": {
"@playwright/test": "^1.29.2",
"@remix-run/dev": "^1.9.0",
"@remix-run/eslint-config": "^1.9.0",
"@remix-run/dev": "^1.11.1",
"@remix-run/eslint-config": "^1.11.1",
"@types/better-sqlite3": "^7.6.3",
"@types/i18next-fs-backend": "^1.1.2",
"@types/node-cron": "^3.0.7",