Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a46b1e

Browse files
authored
chore: remove swr and dead code (coder#3495)
1 parent010f64e commit0a46b1e

File tree

5 files changed

+9
-53
lines changed

5 files changed

+9
-53
lines changed

‎site/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"react-markdown":"8.0.3",
5050
"react-router-dom":"6.3.0",
5151
"sourcemapped-stacktrace":"1.1.11",
52-
"swr":"1.2.2",
5352
"tzdata":"1.0.30",
5453
"uuid":"8.3.2",
5554
"xstate":"4.32.1",

‎site/src/app.tsx

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import CssBaseline from "@material-ui/core/CssBaseline"
22
importThemeProviderfrom"@material-ui/styles/ThemeProvider"
33
import{FC}from"react"
44
import{BrowserRouterasRouter}from"react-router-dom"
5-
import{SWRConfig}from"swr"
65
import{AppRouter}from"./AppRouter"
76
import{ErrorBoundary}from"./components/ErrorBoundary/ErrorBoundary"
87
import{GlobalSnackbar}from"./components/GlobalSnackbar/GlobalSnackbar"
@@ -13,34 +12,15 @@ import { XServiceProvider } from "./xServices/StateContext"
1312
exportconstApp:FC=()=>{
1413
return(
1514
<Router>
16-
<SWRConfig
17-
value={{
18-
// This code came from the SWR documentation:
19-
// https://swr.vercel.app/docs/error-handling#status-code-and-error-object
20-
fetcher:async(url:string)=>{
21-
constres=awaitfetch(url)
22-
23-
// By default, `fetch` won't treat 4xx or 5xx response as errors.
24-
// However, we want SWR to treat these as errors - so if `res.ok` is false,
25-
// we want to throw an error to bubble that up to SWR.
26-
if(!res.ok){
27-
consterr=newError((awaitres.json()).error?.message||res.statusText)
28-
throwerr
29-
}
30-
returnres.json()
31-
},
32-
}}
33-
>
34-
<ThemeProvidertheme={dark}>
35-
<CssBaseline/>
36-
<ErrorBoundary>
37-
<XServiceProvider>
38-
<AppRouter/>
39-
<GlobalSnackbar/>
40-
</XServiceProvider>
41-
</ErrorBoundary>
42-
</ThemeProvider>
43-
</SWRConfig>
15+
<ThemeProvidertheme={dark}>
16+
<CssBaseline/>
17+
<ErrorBoundary>
18+
<XServiceProvider>
19+
<AppRouter/>
20+
<GlobalSnackbar/>
21+
</XServiceProvider>
22+
</ErrorBoundary>
23+
</ThemeProvider>
4424
</Router>
4525
)
4626
}

‎site/src/util/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export*from"./array"
2-
export*from"./swr"

‎site/src/util/swr.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎site/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13113,11 +13113,6 @@ svgo@^2.7.0:
1311313113
picocolors "^1.0.0"
1311413114
stable "^0.1.8"
1311513115

13116-
swr@1.2.2:
13117-
version "1.2.2"
13118-
resolved "https://registry.yarnpkg.com/swr/-/swr-1.2.2.tgz#6cae09928d30593a7980d80f85823e57468fac5d"
13119-
integrity sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw==
13120-
1312113116
symbol-tree@^3.2.4:
1312213117
version "3.2.4"
1312313118
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp