Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React v19 & その他対応 #310

Merged
merged 9 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18,003 changes: 7,627 additions & 10,376 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"concurrently": "^9.0.1",
"mzm-auth": "^1.0.1",
"mzm-frontend": "^0.0.0",
"prettier": "^3.2.5",
"vitest": "^2.1.4"
"prettier": "^3.5.1"
}
}
8 changes: 5 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"license": "MIT",
"dependencies": {
"bunyan": "^1.8.15",
"connect-redis": "^7.1.1",
"connect-redis": "^8.0.1",
"cors": "^2.8.5",
"express": "^4.21.1",
"express-session": "^1.18.1",
Expand All @@ -40,8 +40,10 @@
"@types/passport": "^1.0.17",
"@types/passport-github": "^1.1.7",
"@types/passport-twitter": "^1.0.37",
"eslint": "^9.13.0",
"eslint": "^9.20.1",
"typescript": "^5.6.3",
"typescript-eslint": "^8.12.2"
"typescript-eslint": "^8.24.0",
"vite": "^6.0.11",
"vitest": "^3.0.5"
}
}
22 changes: 7 additions & 15 deletions packages/auth/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import express, { type Request } from 'express'
import cors from 'cors'
import helmet from 'helmet'
import passport from 'passport'
import RedisStore from 'connect-redis'
import { RedisStore } from 'connect-redis'
import { Strategy as GitHubStrategy } from 'passport-github'
import { Strategy as TwitterStrategy } from 'passport-twitter'
import session from 'express-session'
Expand Down Expand Up @@ -121,13 +121,9 @@ export const createApp = ({ client }: Options) => {
wrap(authorizeHandlers.token)
)

app.get(
'/auth/twitter',
defaultHelmet,
(req, res, next) => {
oauthHandlers.oauth(passport, 'twitter')(req, res, next)
}
)
app.get('/auth/twitter', defaultHelmet, (req, res, next) => {
oauthHandlers.oauth(passport, 'twitter')(req, res, next)
})
app.get(
'/auth/twitter/callback',
defaultHelmet,
Expand All @@ -145,13 +141,9 @@ export const createApp = ({ client }: Options) => {
wrap(twitterHandlers.removeTwitter)
)

app.get(
'/auth/github',
defaultHelmet,
(req, res, next) => {
oauthHandlers.oauth(passport, 'github')(req, res, next)
}
)
app.get('/auth/github', defaultHelmet, (req, res, next) => {
oauthHandlers.oauth(passport, 'github')(req, res, next)
})
app.get(
'/auth/github/callback',
defaultHelmet,
Expand Down
8 changes: 5 additions & 3 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"mongodb": "^6.10.0",
"multer": "^1.4.2",
"node-schedule": "^2.1.0",
"undici": "^6.20.1",
"undici": "^7.3.0",
"zod": "^3.23.8"
},
"devDependencies": {
Expand All @@ -40,8 +40,10 @@
"@types/jsonwebtoken": "^9.0.7",
"@types/multer": "^1.4.12",
"@types/node-schedule": "^2.1.7",
"eslint": "^9.13.0",
"eslint": "^9.20.1",
"typescript": "^5.6.3",
"typescript-eslint": "^8.12.2"
"typescript-eslint": "^8.24.0",
"vite": "^6.0.11",
"vitest": "^3.0.5"
}
}
32 changes: 16 additions & 16 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
"license": "MIT",
"devDependencies": {
"@types/dompurify": "^3.0.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.1.5",
"@types/react": "^19.0.9",
"@types/react-dom": "^19.0.3",
"@types/validator": "^13.12.2",
"@vitejs/plugin-react": "^4.3.3",
"eslint": "^9.13.0",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.20.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0-rc-603e6108-20241029",
"globals": "^15.11.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.12.2"
"typescript-eslint": "^8.24.0",
"vite": "^6.0.11",
"vite-plugin-pwa": "^0.21.1",
"vitest": "^3.0.5"
},
"dependencies": {
"@emotion/react": "^11.13.3",
Expand All @@ -43,17 +45,15 @@
"dayjs": "^1.11.13",
"dompurify": "^3.1.7",
"highlight.js": "^11.10.0",
"jsdom": "^25.0.1",
"jotai": "^2.12.0",
"jsdom": "^26.0.0",
"jwt-decode": "^4.0.0",
"marked": "^11.0.1",
"marked-mangle": "^1.1.0",
"marked": "^15.0.6",
"marked-mangle": "^1.1.9",
"normalize.css": "^8.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0",
"recoil": "^0.7.6",
"validator": "^13.12.0",
"vite": "^5.4.10",
"vite-plugin-pwa": "^0.20.5"
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "^7.1.5",
"validator": "^13.12.0"
}
}
10 changes: 5 additions & 5 deletions packages/frontend/src/App.hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect } from 'react'
import { useLocation } from 'react-router-dom'
import { useMessageListener } from './recoil/socket/hooks'
import { useMyInfoActions } from './recoil/user/hooks'
import { useAuth, useLoginFlag } from './recoil/auth/hooks'
import { useLocation } from 'react-router'
import { useMessageListener } from './state/socket/hooks'
import { useMyInfoActions } from './state/user/hooks'
import { useAuth, useLoginFlag } from './state/auth/hooks'
import { getRoomName } from './lib/util'
import { useUiActions } from './recoil/ui/hooks'
import { useUiActions } from './state/ui/hooks'
import { logger } from './lib/logger'
import { comsumeSocket } from './lib/auth'
import { events, type MessageEvent } from './lib/events'
Expand Down
6 changes: 2 additions & 4 deletions packages/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
import { Outlet } from 'react-router-dom'
import { Outlet } from 'react-router'
import { useApp } from './App.hooks'

const App = () => {
export default function App() {
useApp()

return (
Expand All @@ -11,4 +10,3 @@ const App = () => {
</>
)
}
export default App
4 changes: 2 additions & 2 deletions packages/frontend/src/components/Header/MyInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useCallback } from 'react'
import styled from '@emotion/styled'
import Settings from '@mui/icons-material/Settings'
import { useUiActions } from '../../recoil/ui/hooks'
import { useUserIdAndAccount } from '../../recoil/user/hooks'
import { useUiActions } from '../../state/ui/hooks'
import { useUserIdAndAccount } from '../../state/user/hooks'

export const MyInfo = () => {
const { userAccount, userIconUrl } = useUserIdAndAccount()
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import styled from '@emotion/styled'
import { useUiActions } from '../../recoil/ui/hooks'
import { useUiActions } from '../../state/ui/hooks'
import { WIDTH_MOBILE } from '../../constants'
import { Link } from '../atoms/Link'
import { MobileMenuIcon } from '../atoms/MobileMenuIcon'
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from '@emotion/styled'
import Settings from '@mui/icons-material/Settings'
import { WIDTH_MOBILE } from '../constants'
import { useNumberLocalStorage } from '../lib/hooks/useLocalStorage'
import { useMenuUi, useUiActions } from '../recoil/ui/hooks'
import { useMenuUi, useUiActions } from '../state/ui/hooks'
import { ResizerX } from './atoms/ResizerX'
import { MobileMenuIcon } from './atoms/MobileMenuIcon'
import { RoomNavi } from './RoomNavi'
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/ModalUserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Clear from '@mui/icons-material/Clear'
import { ModalBase } from './atoms/Modal'
import { IconButton } from './atoms/Button'
import { WIDTH_MOBILE } from '../constants'
import { useUiActions, useUserDetailUi } from '../recoil/ui/hooks'
import { useUiActions, useUserDetailUi } from '../state/ui/hooks'

export const ModalUserProfile: React.FC = () => {
const { closeUserDetail } = useUiActions()
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/PageWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { type PropsWithChildren, type FC, type ReactNode } from 'react'
import styled from '@emotion/styled'
import { useUiActions, useMenuUi } from '../recoil/ui/hooks'
import { useUiActions, useMenuUi } from '../state/ui/hooks'
import { WIDTH_MOBILE } from '../constants'
export { Header } from './Header'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import React, {
import styled from '@emotion/styled'
import { Add } from '@mui/icons-material'
import { WIDTH_MOBILE } from '../../../../constants'
import { useCurrentRoom } from '../../../../recoil/rooms/hooks'
import { useSocketActions } from '../../../../recoil/socket/hooks'
import { useCurrentRoom } from '../../../../state/rooms/hooks'
import { useSocketActions } from '../../../../state/socket/hooks'
import { TextArea, type Props as TextAreaProps } from '../../../atoms/TextArea'
import { Button } from '../../../atoms/Button'
import { TransparentButton } from '../../../atoms/Button'
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/components/Room/InputArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import Add from '@mui/icons-material/Add'
import SendIcon from '@mui/icons-material/Send'
import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'
import { WIDTH_MOBILE } from '../../../constants'
import { useCurrentRoom } from '../../../recoil/rooms/hooks'
import { useSocketActions } from '../../../recoil/socket/hooks'
import { usePostTextArea } from '../../../recoil/postTextArea/hooks'
import { useCurrentRoom } from '../../../state/rooms/hooks'
import { useSocketActions } from '../../../state/socket/hooks'
import { usePostTextArea } from '../../../state/postTextArea/hooks'
import { Button } from '../../atoms/Button'
import { ResizerY } from '../../atoms/ResizerY'
import { TextArea } from '../../atoms/TextArea'
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/src/components/Room/Messages/Message.hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useRef, useEffect, useMemo, useCallback } from 'react'
import dayjs from 'dayjs'
import { useMessageById } from '../../../recoil/messages/hooks'
import { useUserAccount } from '../../../recoil/user/hooks'
import { usePostTextArea } from '../../../recoil/postTextArea/hooks'
import { useSocketActions } from '../../../recoil/socket/hooks'
import { useMessageById } from '../../../state/messages/hooks'
import { useUserAccount } from '../../../state/user/hooks'
import { usePostTextArea } from '../../../state/postTextArea/hooks'
import { useSocketActions } from '../../../state/socket/hooks'
import { isReplied } from '../../../lib/util'

export const useMessage = (id: string) => {
Expand Down Expand Up @@ -88,7 +88,7 @@ export const useMessage = (id: string) => {
startToEdit(id, message)
}, [id, message, startToEdit])

const prevIineRef = useRef<number>()
const prevIineRef = useRef<number | undefined>(undefined)
useEffect(() => {
prevIineRef.current = messageObj?.iine ?? undefined
})
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/Room/Messages/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const MessageElementInner: React.FC<Props> = (props) => {
startEditHandler
} = useMessage(props.id)

const firstIineRef = useRef<number>()
const firstIineRef = useRef<number | undefined>(undefined)
useEffect(() => {
firstIineRef.current = iine ?? undefined
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -85,6 +85,7 @@ const MessageElementInner: React.FC<Props> = (props) => {
className="body"
removed={removed}
message={message}
// todo: worker
html={sanitize(html)}
/>
{vote && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
Delete as DeleteIcon
} from '@mui/icons-material'
import { IconButton } from '../../atoms/Button'
import { useUiActions } from '../../../recoil/ui/hooks'
import { useUserAccount } from '../../../recoil/user/hooks'
import { useUiActions } from '../../../state/ui/hooks'
import { useUserAccount } from '../../../state/user/hooks'

type Props = {
id: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useState, useEffect } from 'react'
import styled from '@emotion/styled'
import { useSocketActions } from '../../../../recoil/socket/hooks'
import { useUserIdAndAccount } from '../../../../recoil/user/hooks'
import { useSocketActions } from '../../../../state/socket/hooks'
import { useUserIdAndAccount } from '../../../../state/user/hooks'
import {
useVoteSocket,
useVoteAnswerByIdAndIndex
} from '../../../../recoil/messages/hooks'
} from '../../../../state/messages/hooks'
import { VoteAnswerTypeEnum } from './constants'
import { VoteAnswer } from './VoteAnswer'
import { VoteAnswerBar } from './VoteAnswerBar'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import styled from '@emotion/styled'
import { VoteAnswerType } from '../../../../recoil/messages/hooks'
import { VoteAnswerType } from '../../../../state/messages/hooks'
import { VoteAnswerTypeEnum } from './constants'

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import styled from '@emotion/styled'
import { type StateMessageType } from '../../../../recoil/messages/hooks'
import { type StateMessageType } from '../../../../state/messages/hooks'
import { Question } from './Question'

type Props = {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/Room/Messages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useRef, useEffect, useMemo } from 'react'
import styled from '@emotion/styled'
import { useSocketActions } from '../../../recoil/socket/hooks'
import { useSocketActions } from '../../../state/socket/hooks'
import {
useRooms,
useCurrentRoom,
useRoomById
} from '../../../recoil/rooms/hooks'
} from '../../../state/rooms/hooks'
import { useIntersectionObserver } from '../../../lib/hooks/useIntersectionObserver'
import { MessageElement } from './Message'

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/Room/ModalUsersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect } from 'react'
import styled from '@emotion/styled'
import CancelIcon from '@mui/icons-material/Cancel'
import { ModalProps, ModalBase } from '../atoms/Modal'
import { useRoomUserActions, useGetUsersById } from '../../recoil/rooms/hooks'
import { useRoomUserActions, useGetUsersById } from '../../state/rooms/hooks'
import { useIntersectionObserver } from '../../lib/hooks/useIntersectionObserver'
import { WIDTH_MOBILE } from '../../constants'

Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/Room/RoomInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useEffect, useState } from 'react'
import styled from '@emotion/styled'
import { Home, Person, ExpandMore } from '@mui/icons-material'
import { useUiActions } from '../../recoil/ui/hooks'
import { useUiActions } from '../../state/ui/hooks'
import {
useRoomUserActions,
useRoomSettingActions,
useGetUsersById,
useOpenRoomSettingFlag,
useCurrentRoom
} from '../../recoil/rooms/hooks'
} from '../../state/rooms/hooks'
import { WIDTH_MOBILE } from '../../constants'
import { ModalUsersList } from './ModalUsersList'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
useCurrentRoom,
useRoomById,
useRoomStatusActions
} from '../../../recoil/rooms/hooks'
import { useSocketActions } from '../../../recoil/socket/hooks'
} from '../../../state/rooms/hooks'
import { useSocketActions } from '../../../state/socket/hooks'

export const SettingRoomStatus = () => {
const { currentRoomId } = useCurrentRoom()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState, useMemo, useCallback } from 'react'
import { useNavigate } from 'react-router-dom'
import { useNavigate } from 'react-router'
import {
useRoomActions,
useCurrentRoom,
useRoomById
} from '../../../recoil/rooms/hooks'
import { useSocketActions } from '../../../recoil/socket/hooks'
} from '../../../state/rooms/hooks'
import { useSocketActions } from '../../../state/socket/hooks'
import { Props as RoomInfoProps } from './RoomInfo'

export const useSettiongRooms = () => {
Expand Down
Loading
Loading