-
Notifications
You must be signed in to change notification settings - Fork 8
[5주차] 이효린 미션 제출합니다. #19
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
base: main
Are you sure you want to change the base?
Conversation
jejukyj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요 효린님, 이번 주차 코드리뷰를 맡게 된 고윤정입니다!
효린님의 코드를 보면서 피드백을 한다기 보단 많이 배워가는 것 같습니다
코드에서 능숙함이 보여요..👀 많이 참고하겠습니다 ㅎㅎ
이번 미션도 고생 많으셨습니다~!
| '@typescript-eslint/no-unused-vars': 'off', | ||
| '@typescript-eslint/interface-name-prefix': 'off', | ||
| '@typescript-eslint/explicit-function-return-type': 'off', | ||
| '@typescript-eslint/explicit-module-boundary-types': 'off', | ||
| '@typescript-eslint/no-explicit-any': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이 코드 참고해서 설정해야겠어요 자잘한 오류들 스트레스..🙃
| @@ -0,0 +1,11 @@ | |||
| declare module '*.png' { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모듈들도 다 타입 지정을 해줘야하는군요..!😲 새로 배워갑니다
| <pattern | ||
| id="Home_svg__a" | ||
| width={1} | ||
| height={1} | ||
| patternContentUnits="objectBoundingBox" | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 svgr을 사용하신건가요?!? 정말 간편하고 좋네요..🥹👍
| display: flex; | ||
| flex-direction: column; | ||
| background-color: white; | ||
| word-break: break-all; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
white-space와 word-wrap은 사용해봤는데 word-break도 줄바꿈 속성이었네요! 덕분에 줄바꿈 속성 더 알고갑니다
| @@ -0,0 +1,11 @@ | |||
| import { create } from 'zustand'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zustand는 recoil과 사용법이 살짝 다르긴 하지만, recoil 만큼이나 간편해보이네요!🤩
Sieonn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
효린님 잘 봤습니다. Json 파일을 불러올 때나 폴더별로 정리해서 관리하기 편한 형태를 보고 따라하고 싶네요! 고생 많으셨고 앞으로도 화이팅입니다!! 🐻
src/components/ChatList/index.jsx
Outdated
| <PartnerMessage key={index} message={item} /> | ||
| ); | ||
| })} | ||
| {alarmOff && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 이부분 빼먹었는데 추가해야겠어요
src/App.tsx
Outdated
| import useChat from '@hooks/useChat'; | ||
| import ChatList from '@components/ChatList'; | ||
| import { useState } from 'react'; | ||
| import { chat } from '@assets/chat'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 자꾸 import할 때 @이런 식으로 불러와져서 ../ 이렇게 수정해주거든요. 이거를 뭐를 설정해줘야 저렇게 import해도 될까요?
| <App /> | ||
| </StrictMode> | ||
| ); | ||
| import moment from 'moment'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moment 사용하신거 좋네요. 저도 적용해봐야겠습니다.
src/utils/findPartnerInfo.ts
Outdated
| import chat from '@assets/chat.json'; | ||
| import userInfo from '@assets/userInfo.json'; | ||
| export function findPartnerList(myId: number) { | ||
| const partners = userInfo.filter((info: UserInfo) => info.userId !== myId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
필터를 사용하셔서 구분 하신게 효율적으로 보이네요! 👍
| { | ||
| "compilerOptions": { | ||
| "strict": true, | ||
| "allowJs": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict 옵션을 true로 설정하면 TypeScript에서 엄격한 타입 검사 모드가 활성화된다고 하는데 설정해 두신 이유가 있을까요?
| @@ -0,0 +1,15 @@ | |||
| import App from './App'; | |||
| import { ROUTE } from '@constants/index'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
화면 폴터별로 스타일과 index로 정리해두니 이렇게 호출이 가능해서 좋네요!
src/assets/chat.ts
Outdated
| ], | ||
| }, | ||
| { | ||
| roomId: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 ID로 구분했는데 방으로 구분하니까 호출하거나 작성하기 편할 것 같아요.
| resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" | ||
| integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== | ||
|
|
||
| zustand@^5.0.0-rc.2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
효린님이 전역상태관리를 이걸로 하신걸 보고 저도 찾아봤는데 귀엽지만 간편하고 성능이 좋네요. 저도 간단한 프로젝트 할 때 활용해볼게요
| const value: React.FunctionComponent<React.SVGProps<SVGSVGElement>>; | ||
| export default value; | ||
| import React = require('react'); | ||
| export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 다음 리팩토링때는 icon을 직접 불러오기보다는 svg를 더 활용해봐야겠습니다.
SVG는 웹 디자인 및 개발에서 유연성, 성능, 확장성 면에서 매우 유리한 이미지 이라고 하니 직접 png나 jpg를 사용하는 것 보다 좋겠네요!
| @@ -0,0 +1,19 @@ | |||
| import { chatAppData } from '@assets/chat'; | |||
| import { create } from 'zustand'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
관리를 이런 식으로 하는 것이군요.! 좋아요
안녕하세요 유레카 프론트엔드 1기 이효린입니다. PR 열심히 쓰고있었는데 갑자기 크롬이 렉이 걸려서 ,,,, 전부 날라가버려 처음부터 다시 쓰고있습니다 ,, 🥲 지각 제출 죄송합니다,,
저는 상태관리 라이브러리로 zustand를 사용했습니다. 이유는 로고에 있는 곰돌이가 귀여워서입니다.
📍Key question
1.SPA / MPA / CSR / SSR 이란 무엇인가요?
SPA (Single Page Application)
하나의 페이지를 활용하는 애플리케이션 방식입니다. 서버는 클라이언트에게 하나의 HTML 파일만을 보냅니다.
MPA (Multiple Page Application)
여러 개의 페이지를 활용하는 애플리케이션 방식입니다. 여러 페이지를 생성할 수 있기 때문에 많은 수의 키워드르 타겟팅 할 수 있습니다. 덕분에 SEO에 더욱 친화적입니다.
CSR (Client Side Rendering)
클라이언트단에서 렌더링을 처리하는 방식입니다. 초기 페이지 로드시 HTML을 서버로부터 제공 받고, JS 파일을 다운로드하여 브라우저에서 애플리케이션을 실행합니다. JS가 실행되면 클라이언트 측에서 HTML을 통해 DOM 트리를 구성합니다.
장점
단점
SEO 문제가 있을 수 있습니다. 초기에는 빈 화면을 가지고, JS 실행 및 DOM 트리를 생성하는 시간이 걸리기 때문에 SEO에 불리합니다.
SSR
장점
단점
2.React에서 상태는 어떻게 관리할 수 있나요?
지역 상태관리
함수형 컴포넌트에서 useState를 활용해 로컬 상태를 관리할 수 있습니다. 상태가 변경 될 때마다 컴포넌트가 리렌더링 됩니다.
상태관련 로직이 복잡하거나 상태 업데이트가 여러 단위로 이루어질 때 useReducer 훅을 사용할 수 있습니다. Redux의 리듀서와 비슷하게 동작합니다.
전역 상태 관리 라이브러리
React 내장 기능으로 전역 상태를 관리할 수 있습니다. 그러나 상태가 변경될 때마다 Context를 사용하는 모든 컴포넌트가 리렌더링 되기 때문에 성능상의 문제가 있을 수 있습니다.
Store을 사용해 모든 상태를 관리하며, action과 reducer로 관리합니다.
서버 상태 관리
Tanstack Query (구 React Query)
서버에서 데이터를 가져와 관리하는 경우 데이터 캐싱, 동기화, 백그라운드 업데이트 등의 기능을 통해 복잡한 서버 상태를 효율적으로 관리할 수 있습니다.
3.어떤 상태관리 라이브러리를 사용했고, 그것의 특징은 무엇인가요?