Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
19Qingfeng authored Jun 1, 2023
2 parents 031ee5b + 08aedc4 commit 488763b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 52 deletions.
10 changes: 5 additions & 5 deletions docs/guides/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,11 @@ Now we can tell it which files to generate classes from:
import type { Config } from "tailwindcss";

export default {
content: ["./app/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
content: ["./app/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
} satisfies Config;
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"patch-package": "^6.5.0",
"prettier": "2.7.1",
"prettier": "^2.7.1",
"prompt-confirm": "^2.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"happy-dom": "^2.49.0",
"msw": "^0.39.2",
"npm-run-all": "^4.1.5",
"prettier": "2.6.0",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.8",
"prisma": "^3.11.0",
"start-server-and-test": "^1.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"postcss-discard-duplicates": "^5.1.0",
"postcss-load-config": "^4.0.1",
"postcss-modules": "^6.0.0",
"prettier": "2.7.1",
"prettier": "^2.7.1",
"pretty-ms": "^7.0.1",
"proxy-agent": "^5.0.0",
"react-refresh": "^0.14.0",
Expand Down
26 changes: 8 additions & 18 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as React from "react";
import type {
AgnosticDataRouteMatch,
UNSAFE_DeferredData as DeferredData,
ErrorResponse,
Navigation,
TrackedPromise,
} from "@remix-run/router";
Expand Down Expand Up @@ -174,23 +173,14 @@ export function RemixRouteError({ id }: { id: string }) {
}

if (isRouteErrorResponse(error)) {
let tError = error as any;
if (
tError?.error instanceof Error &&
tError.status !== 404 &&
ErrorBoundary
) {
let tError = error;
if (!!tError?.error && tError.status !== 404 && ErrorBoundary) {
// Internal framework-thrown ErrorResponses
return <ErrorBoundary error={tError.error} />;
}
if (CatchBoundary) {
// User-thrown ErrorResponses
return (
<RemixCatchBoundary
component={CatchBoundary!}
catch={error as ErrorResponse}
/>
);
return <RemixCatchBoundary catch={error} component={CatchBoundary} />;
}
}

Expand Down Expand Up @@ -222,11 +212,11 @@ export interface RemixNavLinkProps extends NavLinkProps {
}

interface PrefetchHandlers {
onFocus?: FocusEventHandler<Element>;
onBlur?: FocusEventHandler<Element>;
onMouseEnter?: MouseEventHandler<Element>;
onMouseLeave?: MouseEventHandler<Element>;
onTouchStart?: TouchEventHandler<Element>;
onFocus?: FocusEventHandler;
onBlur?: FocusEventHandler;
onMouseEnter?: MouseEventHandler;
onMouseLeave?: MouseEventHandler;
onTouchStart?: TouchEventHandler;
}

function usePrefetchBehavior(
Expand Down
30 changes: 9 additions & 21 deletions packages/remix-react/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,20 @@ import {
*/
export type AppData = any;

export function isCatchResponse(response: any): boolean {
return (
response instanceof Response &&
response.headers.get("X-Remix-Catch") != null
);
export function isCatchResponse(response: Response): boolean {
return response.headers.get("X-Remix-Catch") != null;
}

export function isErrorResponse(response: any): boolean {
return (
response instanceof Response &&
response.headers.get("X-Remix-Error") != null
);
export function isErrorResponse(response: Response): boolean {
return response.headers.get("X-Remix-Error") != null;
}

export function isRedirectResponse(response: any): boolean {
return (
response instanceof Response &&
response.headers.get("X-Remix-Redirect") != null
);
export function isRedirectResponse(response: Response): boolean {
return response.headers.get("X-Remix-Redirect") != null;
}

export function isDeferredResponse(response: any): boolean {
return (
response instanceof Response &&
!!response.headers.get("Content-Type")?.match(/text\/remix-deferred/)
);
export function isDeferredResponse(response: Response): boolean {
return !!response.headers.get("Content-Type")?.match(/text\/remix-deferred/);
}

export async function fetchData(
Expand Down Expand Up @@ -106,7 +94,7 @@ export async function parseDeferredReadableStream(

deferredData = deferredData || {};

deferredData[eventKey] = new Promise<any>((resolve, reject) => {
deferredData[eventKey] = new Promise((resolve, reject) => {
deferredResolvers[eventKey] = {
resolve: (value: unknown) => {
resolve(value);
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11115,11 +11115,6 @@ prelude-ls@~1.1.2:
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=

[email protected]:
version "2.7.1"
resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==

prettier@^2.7.1:
version "2.8.1"
resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz"
Expand Down

0 comments on commit 488763b

Please sign in to comment.