본문 바로가기

2022/07

(37)
리액트 프로젝트의 결합도를 관리하는 방법 리액트 프로젝트의 결합도와 응집도를 관리하는 방법에 대해 알아봅니다. 결합도 분석 단위는 모듈(폴더, 패키지)이라 볼 수 있습니다. 응집도 분석 단위는 라인 입니다. 같이 보면 좋은 글 ! https://itchallenger.tistory.com/644 리액트 컴포넌트의 응집도를 관리하는 방법 같이 보면 좋은 글! : https://itchallenger.tistory.com/646 리액트 프로젝트의 결합도를 관리하는 방법 원문 : https://betterprogramming.pub/coupling-cohesion-552b022492b2 Organizing Modules in React Pro.. itchallenger.tistory.com https://ui.toast.com/weekly-pick/..
리액트 컴포넌트의 응집도를 관리하는 방법 리액트 컴포넌트의 응집도를 관리하는 방법을 알아봅니다. 같이 보면 좋은 글! : https://itchallenger.tistory.com/646 리액트 프로젝트의 결합도를 관리하는 방법 원문 : https://betterprogramming.pub/coupling-cohesion-552b022492b2 Organizing Modules in React Project — Low Coupling and High Cohesion Design robust applications betterprogramming.pub 서로 분리되.. itchallenger.tistory.com 해당 강연의 스크립트 정리 노트입니다 : https://youtu.be/aSAGOH2u2rs TLDR 응집도는 변화를 유발하는 원인이..
리액트 Concurrent UI Pattern - Scheduling in React 원문 : https://philippspiess.com/scheduling-in-react/ Scheduling in React In modern applications, user interfaces often have to juggle multiple tasks at the same time. For example, a search component might need to respond to user… philippspiess.com 현재는 아래 방법과 다르게 suspense / useTransition을 사용하는 방법으로 변경되었습니다만, 개념을 이해하는데는 아주 좋은 리소스라 생각해서 번역 및 정리하였습니다. 아래의 컨셉을 실제로 프로젝트에 적용하는 방식에 대해서는 아래 두 게시물을 참고해 주세요..
리액트 점진적으로(일부만) 도입하기 (제이쿼리와 함께 쓸수 있을까?): ReactDOMServer TLDR : ReactDOMServer을 사용하면 리액트를 일부분만 string으로 변환하여 도입, 사용할 수 있다. 현재 프로젝트에서 해당 라이브러리를 사용하고 있습니다. https://nhn.github.io/tui.calendar/latest/ https://nhn.github.io/tui.calendar/latest/ A JavaScript calendar that is full featured. Now your service just got the customizable calendar. 🚩 Table of Contents 📙 Documents Collect statistics on the use of open source TOAST UI Calendar applies Google Analyti..
타입스크립트 : React.FC는 그만! children 타이핑 올바르게 하기 참고자료 : https://stackoverflow.com/questions/65548388/react-propswithchildren-with-no-props-other-than-children React.PropsWithChildren with no props other than `children`? I have a component with no props other than children, i.e.: function Foo({ children }: React.PropsWithChildren) {} React.PropsWithChildren requires an argument. If I do React.PropsWithChil... stackoverflow.com 리액트에는 React.Props..
리액트 테스트 : Context API 테스트와 커스텀 렌더 함수 사용하기 TLDR : UI 사용자가 관심 없는 건 구현 상세입니다. 컨텍스트를 사용하는 컴포넌트를 테스트하려면 wrapper가 필요합니다. (ThemeProvider, Router, Authentication) 우리가 UI를 테스트 하는 이유는, bad ux(사용자 관점 버그)를 막기 위함입니다. 따라서 테스트 코드는 UI적인 관점만 드러나면 좋습니다. 코드가 아닌 사용자의 행동으로 UI가 변해야 하는 경우 act 함수를 통해 명시한 것도 비슷한 맥락입니다. 따라서, render 관련한 함수도, 유틸로 분리합니다. 테마를 테스트 하는 코드 얼핏 보면 렌더가 뭔가 이상합니다. 이는 컨텍스트를 테스트의 관심사에서 제외해 버렸기 때문입니다. 대신 테스트 자체에 좀 더 집중할 수 있습니다. (테마의 변경) https:..
[짤막글] 언제 context API를 사용하고 언제 zustand나 redux를 사용할까요? TLDR : (!트리_아래_업데이트 && context) || zustand 긴말 필요없이 아래 트윗을 인용합니다. (Tanner Linsley === 리액트 쿼리 메인테이너, 창시자) https://twitter.com/tannerlinsley/status/1293640999533568000?lang=en 트위터에서 즐기는 Tanner Linsley “I'm using #ReactQuery with Zustand and really liking the pairing. It's a super tiny, very flexible, no-nonsense client-state solution for React. If I were to write a client-state solution from scratc..
리액트 테스트 : 브라우저 API와 서드파티 모듈 mocking 배경 mocking을 이용하면 software가 어떻게 사용되는지(how)를 명시적으로 테스트 할 수 있습니다. 이전 시간에 HTTP 요청을 모킹해 보았는데요, 때로는 모킹해야 하는 전체 브라우저 API 또는 모듈이 있습니다. 코드의 가짜 버전을 만들 때마다 "현실에 구멍을 뚫고" 결과적으로 자신감을 잃게 됩니다(이것이 E2E 테스트가 중요한 이유입니다). 테스트 더블은 실제 현실의 코드와 차이가 있고, 이는 테스트 용이성과 안정성의 tradeoff입니다. 모킹의 장점? 테스트가 소프트웨어 사용 방식과 유사할수록 더 많은 자신감을 얻을 수 있습니다. - 나 The Merits of Mocking The Merits of Mocking What are you doing when you mock someth..