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

Sign up form/#7 #50

Merged
merged 50 commits into from
Mar 27, 2024
Merged

Sign up form/#7 #50

merged 50 commits into from
Mar 27, 2024

Conversation

seonghunYang
Copy link
Collaborator

@seonghunYang seonghunYang commented Mar 17, 2024

πŸ“Œ μž‘μ—… λ‚΄μš©

κ΅¬ν˜„ λ‚΄μš© 및 μž‘μ—… ν–ˆλ˜ λ‚΄μ—­

  • server action을 μ‚¬μš©ν•˜μ—¬ νšŒμ›κ°€μž… 둜직 κ΅¬ν˜„
  • zodλ₯Ό μ‚¬μš©ν•˜μ—¬ νšŒμ›κ°€μž… μœ νš¨μ„± 검사 둜직 κ΅¬ν˜„
  • useFunnel을 μ΄μš©ν•œ Funnel ꡬ쑰의 νšŒμ›κ°€μž… 절차 κ΅¬ν˜„
  • storybook ν™˜κ²½μ—μ„œ ν…ŒμŠ€νŠΈ 진행을 μœ„ν•œ μž‘μ—…(msw μ„€μ •, test-runner μ„€μ •)
  • mocking λ‘œμ§μ„ μž‘μ„±ν•  수 μžˆλ„λ‘ μž¬κ΅¬μ‘°ν™” 및 λͺ¨λ“ˆν™”
  • http 였λ₯˜ 처리λ₯Ό μœ„ν•œ ν•Έλ“€λŸ¬ 개발
  • 폴더 ꡬ쑰λ₯Ό λ³€κ²½ν•˜λ©΄μ„œ 파일 변경이 λ§Žμ•„μ‘ŒμŠ΅λ‹ˆλ‹€. μ–‘ν•΄ λΆ€νƒλ“œλ¦½λ‹ˆλ‹€!

πŸ€” κ³ λ―Ό ν–ˆλ˜ λΆ€λΆ„

  • 'sign-up-form' μ»΄ν¬λ„ŒνŠΈλ₯Ό ν…ŒμŠ€νŠΈν•˜λ € ν–ˆμœΌλ‚˜, jest ν™˜κ²½μ—μ„œ 'useFormState'λ₯Ό 찾지 λͺ»ν•˜λŠ” μ—λŸ¬κ°€ μ§€μ†μ μœΌλ‘œ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.
    • κ΄€λ ¨ν•΄μ„œ μ‘°μ‚¬ν•œ κ²°κ³Ό, μ΅œκ·Όμ— 저와 λΉ„μŠ·ν•œ μ΄μŠˆκ°€ λ°œμƒν•˜κ³  μžˆμŒμ„ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 아직 해결책이 μ œμ‹œλ˜μ§€ μ•Šμ€ μƒνƒœμž…λ‹ˆλ‹€.
    • 제 좔츑에 λ”°λ₯΄λ©΄, 'useFormState'κ°€ μ„œλ²„μ™€ ν΄λΌμ΄μ–ΈνŠΈ μ–‘μͺ½μ—μ„œ μž‘λ™ν•˜λŠ” 훅이기 λ•Œλ¬Έμ—, jestμ—μ„œλŠ” λΈŒλΌμš°μ € ν™˜κ²½λ§Œ μ‹€ν–‰λ˜μ–΄ μ„œλ²„ μΈ‘μ—μ„œ 'useFormState'λ₯Ό μ‹€ν–‰ν•˜κ³  λ“±λ‘ν•˜λŠ” 과정이 μƒλž΅λ˜μ–΄ λ¬Έμ œκ°€ λ°œμƒν•œ κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€.
    • 이 λ¬Έμ œλŠ” μ•„λ§ˆλ„ jestκ°€ React-18의 μ‹€ν—˜μ μΈ κ°œλ…(μ„œλ²„μ—μ„œ λ™μž‘ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈμ™€ ν›…)을 아직 μ§€μ›ν•˜μ§€ μ•Šμ•„μ„œ λ°œμƒν•œ 것 κ°™μŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ 이 문제λ₯Ό jestλ₯Ό 톡해 ν•΄κ²°ν•˜λ €λŠ” μ‹œλ„λŠ” μ–΄λ €μšΈ κ²ƒμœΌλ‘œ νŒλ‹¨λ©λ‹ˆλ‹€.
    • λ‹€λ₯Έ 해결책을 κ³ λ €ν•œ κ²°κ³Ό, μŠ€ν† λ¦¬λΆμ€ playwrightλ₯Ό ν†΅ν•œ μƒν˜Έμž‘μš© ν…ŒμŠ€νŠΈλ₯Ό μ§€μ›ν•˜λ©°, μ΄λŠ” E2E ν…ŒμŠ€νŠΈ ν™˜κ²½κ³Ό μœ μ‚¬ν•˜λ―€λ‘œ ν…ŒμŠ€νŠΈκ°€ κ°€λŠ₯ν•  κ²ƒμœΌλ‘œ κ²°λ‘ μ§€μ—ˆμŠ΅λ‹ˆλ‹€(μ‹€μ œλ‘œ Next 곡식 λ¬Έμ„œμ—μ„œλ„ λ‹¨μœ„ ν…ŒμŠ€νŠΈλ³΄λ‹€λŠ” E2Eν…ŒμŠ€νŠΈλ₯Ό ꢌμž₯ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‚˜μ˜¨μ§€ 1년이 λ„˜μ—ˆλŠ”λ°, μ–Έμ œ μ―€ μ§€μ›ν• κΉŒμš”..?)
    • λ”°λΌμ„œ μŠ€ν† λ¦¬λΆ 기반으둜 ν…ŒμŠ€νŠΈλ₯Ό 진행할 수 μžˆλ„λ‘ 섀정을 μ§„ν–‰ν–ˆκ³ , μ„±κ³΅μ μœΌλ‘œ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. κ°œλ…μ μœΌλ‘œ E2E ν…ŒμŠ€νŠΈμ΄κΈ΄ ν•˜μ§€λ§Œ, jestμ—μ„œ μ§„ν–‰ν•˜λŠ” ν…ŒμŠ€νŠΈμ™€ λ™μΌν•œ μˆ˜μ€€μ˜ 톡합 ν…ŒμŠ€νŠΈλ‘œ λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.
    • λŠλ‚€ 점은, React와 Next의 μƒˆλ‘œμš΄ κΈ°λŠ₯을 μ§€μ›ν•˜μ§€ μ•ŠλŠ” 곳이 λ§Žμ•„, μ˜ˆμƒλ³΄λ‹€ λ§Žμ€ 어렀움이 λ°œμƒν•˜μ˜€μŠ΅λ‹ˆλ‹€. μ•žμœΌλ‘œλ„ 이런 κ²½μš°κ°€ 생길 수 μžˆμ„ 것 같은데, 그럴 λ•ŒλŠ” μŠ€ν† λ¦¬λΆμ„ 톡해 ν…ŒμŠ€νŠΈλ₯Ό μž‘μ„±ν•˜λŠ” λ°©λ²•μœΌλ‘œ 보완해야 ν•  것 κ°™μŠ΅λ‹ˆλ‹€.
  • Storybook의 MSW μ• λ“œμ˜¨μ΄ MSW 1.0을 μ§€μ›ν•˜λ―€λ‘œ, 저희와 ν˜Έν™˜λ˜μ§€ μ•ŠλŠ” λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. κΈ°μ‘΄ ν•Έλ“€λŸ¬λ₯Ό μž¬μ‚¬μš©ν•  수 μžˆλ„λ‘ MSW 2.0을 μ§€μ›ν•˜λŠ” 베타 버전을 ν™œμš©ν–ˆμŠ΅λ‹ˆλ‹€.
  • Mocking을 더 ν™œμš©ν•˜κΈ° μœ„ν•΄ μž¬κ΅¬μ‘°ν™” 및 λͺ¨λ“ˆν™”λ₯Ό μ§„ν–‰ν–ˆμŠ΅λ‹ˆλ‹€. μœ νš¨μ„± κ²€μ‚¬λŠ” ν•Έλ“€λŸ¬μ—μ„œ μ²˜λ¦¬ν•˜κ³ , μ‹€μ œ λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ€ mock-dbμ—μ„œ λͺ¨ν‚Ήν•˜λ©΄ λ©λ‹ˆλ‹€.
  • Funnel UI νŒ¨ν„΄ ꡬ쑰λ₯Ό κ΄€λ¦¬ν•˜κΈ° μœ„ν•œ useFunnel을 μƒμ„±ν–ˆμŠ΅λ‹ˆλ‹€. μš°μ„  λΌμš°ν„°μ™€ μ—°κ³„ν•˜μ—¬ νžˆμŠ€ν† λ¦¬λ₯Ό 관리할 ν•„μš”λŠ” μ—†λ‹€κ³  νŒλ‹¨ν•˜μ—¬, νλ¦„λ§Œ μ œμ–΄ν•˜λŠ” μ •λ„λ‘œ κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€.
  • 전에 λ§μ”€λ“œλ Έλ˜ 것 처럼 Server Actionsλ₯Ό μ‚¬μš©ν•˜μ—¬ ν™”μ›κ°€μž… λ‘œμ§μ„ κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€. κ·Έ μ΄μœ λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.
    • λ³΄μ•ˆ: Server ActionsλŠ” POST μš”μ²­, μ•”ν˜Έν™”λœ ν΄λ‘œμ €, μ—„κ²©ν•œ μž…λ ₯ κ²€ν† , 였λ₯˜ λ©”μ‹œμ§€ ν•΄μ‹±, 호슀트 μ œν•œ λ“± λ‹€μ–‘ν•œ λ³΄μ•ˆ μ†”λ£¨μ…˜μ„ μ§€μ›ν•˜λ©°, Next.js 곡식 λ¬Έμ„œμ—μ„œλ„ μ•ˆμ „ν•œ 폼 처리 λ°©μ‹μœΌλ‘œ ꢌμž₯ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ†”μ§νžˆ 말해 μ΄λŸ¬ν•œ λͺ¨λ“  λ³΄μ•ˆ 사항을 μ™„λ²½νžˆ μ΄ν•΄ν•˜κ³  μžˆλŠ” 것은 μ•„λ‹ˆμ§€λ§Œ, ν΄λΌμ΄μ–ΈνŠΈ μΈ‘μ—μ„œ λ―Όκ°ν•œ 데이터λ₯Ό 닀루지 μ•ŠλŠ”λ‹€λŠ” μ λ§ŒμœΌλ‘œλ„ λ³΄μ•ˆμƒ 더 μ•ˆμ „ν•œ 방법이라고 μƒκ°ν–ˆμŠ΅λ‹ˆλ‹€.
    • λ„€μ΄ν‹°λΈŒμ— 가깝고, Zodμ™€μ˜ ν˜Έν™˜μ„±λ„ λ›°μ–΄λ‚©λ‹ˆλ‹€.

πŸ”Š 도움이 ν•„μš”ν•œ λΆ€λΆ„

  • HTTP μ—λŸ¬λ₯Ό μ²˜λ¦¬ν•˜κΈ° μœ„ν•΄, μ—λŸ¬λ₯Ό μ„œλΈŒν΄λž˜μ‹±ν•˜λŠ” ν•Έλ“€λŸ¬λ₯Ό μƒμ„±ν–ˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ fetchμ—μ„œ Network error와 TimeoutError(abort)λ₯Ό μ²˜λ¦¬ν•˜λ„λ‘ μ„€μ •ν–ˆκΈ° λ•Œλ¬Έμ—, λͺ¨λ“  μ—λŸ¬λ₯Ό μ„œλΈŒν΄λž˜μ‹± ν•˜μ§€ λͺ»ν•˜λŠ”κ²Œ μ•„μ‰½λ„€μš”. 이 λΆ€λΆ„κ³Ό ν•¨κ»˜, 인터셉터가 μ—†μ–΄ ν•Έλ“€λŸ¬λ₯Ό 어디에 λΆ™μ—¬μ•Ό μž¬μ‚¬μš© κ°€λŠ₯ν•˜λ„λ‘ λ§Œλ“€μ§€μ— λŒ€ν•œ 고민이 ν•„μš”ν•΄ λ³΄μž…λ‹ˆλ‹€.

리뷰 이후 μž‘μ—…

  • useFunnel에 λŒ€ν•œ κ°œμ„  μž‘μ—…μ„ μ§„ν–‰ν–ˆμ–΄μš”. 이 뢀뢄에 λŒ€ν•΄ λ‹€μ‹œ ν•œλ²ˆ μžμ„Ένžˆ 리뷰 λΆ€νƒλ“œλ €μš”.
  • μ•„λž˜ 링크λ₯Ό μ°Έμ‘°ν•˜μ—¬ useSearchParamsλ₯Ό μ‚¬μš©ν•œ μ»΄ν¬λ„ŒνŠΈλ₯Ό Suspense둜 κ°μ‹Έμ£Όμ—ˆμŠ΅λ‹ˆλ‹€.
  • 그런데, 개발 λͺ¨λ“œμ—μ„œλŠ” Suspense의 fallback이 보이지 μ•Šμ•˜μŠ΅λ‹ˆλ‹€.
  • λΉŒλ“œ ν›„ μ‹€ν–‰ν•˜λ©΄ λ³΄μ΄λŠ” 것을 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.
  • μ™œ κ·ΈλŸ°μ§€ κ³ λ―Όν•΄ λ΄€λŠ”λ°, μ•„λ§ˆ 정적 λ Œλ”λ§μ΄ 개발 λͺ¨λ“œμ—μ„œλŠ” μ μš©λ˜μ§€ μ•Šμ•„μ„œ 그런 것 κ°™μŠ΅λ‹ˆλ‹€.

gahyuun
gahyuun previously approved these changes Mar 18, 2024
Copy link
Member

@gahyuun gahyuun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€!
error handler에 λŒ€ν•΄μ„œλŠ” 잘 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€:) ν˜„μž¬λŠ” fetch μ—μ„œ responseλ₯Ό λ°›μ•„μ˜¨ ν›„ ν•¨μˆ˜λ₯Ό ν†΅ν•΄μ„œ μ²˜λ¦¬ν•΄μ£ΌλŠ”λ° fetchλ₯Ό custom ν•˜λ©΄ fetch λ‚΄λΆ€μ—μ„œ μ²˜λ¦¬ν•΄μ£Όλ©΄ 쒋을 것 κ°™λ„€μš”!
이 뢀뢄에 λŒ€ν•΄μ„œλŠ” fetch custom ν•  λ•Œ 더 κ³ λ―Όν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€!
계측에 따라 error handling을 ν•΄μ£ΌλŠ” 뢀뢄도 쒋은 것 κ°™μŠ΅λ‹ˆλ‹€!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

router둜 λ”°λ‘œ κ΄€λ¦¬ν•˜μ§€ μ•ŠκΈ° λ•Œλ¬Έμ— νšŒμ›κ°€μž… νΌμ—μ„œ λ’€λ‘œκ°€κΈ° λ²„νŠΌ 클릭 μ‹œ μ•½κ΄€ λͺ¨λ‹¬μ΄ λ‚˜μ˜€μ§€ μ•ŠλŠ” κ±Έ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€!
λ”°λ‘œ μ΄μœ κ°€ μžˆμ„κΉŒμš©?

Copy link
Collaborator Author

@seonghunYang seonghunYang Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 였늘 μ‹œκ°„μ΄ μ’€ μƒκ²¨μ„œ historyλ₯Ό 관리할 수 있게 κ°œμ„ ν•΄λ΄€μ–΄μš”. 이 뢀뢄에 λŒ€ν•΄ λ‹€μ‹œ ν•œλ²ˆ μžμ„Ένžˆ 리뷰 λΆ€νƒλ“œλ €μš”.
  • PR λ©”μ‹œμ§€μ— μž‘μ—… 쀑 λ°œμƒν•œ μ΄μŠˆλ“€λ„ 기둝해 λ‘μ—ˆμœΌλ‹ˆ 확인 λΆ€νƒν•΄μš”.
  • e5a783d
  • fa2a5ad

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ν™•μΈν–ˆκ΅¬ 리뷰 λ‚¨κ²ΌμŠ΅λ‹ˆλ‹€!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sign-up-successλž‘ sign-up-terms κ°€ νŽ˜μ΄μ§€ μ»΄ν¬λ„ŒνŠΈμ— μžˆλŠ” μ΄μœ κ°€ 데이터가 μœ μ € 도메인에 μ˜μ‘΄ν•˜κΈ° 보단 νŽ˜μ΄μ§€μ— μ˜μ‘΄ν•΄μ„œκ°€ λ§žμ„κΉŒμš”!?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 저도 사싀 μ•½κ΄€μ˜ λ‚΄μš©μ΄ μœ μ € 도메인에 μ†ν•˜λŠ” 것이 λ§žκΈ°μ— 이 뢀뢄에 λŒ€ν•΄μ„œ 고민을 μ’€ ν–ˆμŠ΅λ‹ˆλ‹€.
  • μ£Όμš” μŸμ μ€ λ‚΄μš©μ„ λ°μ΄ν„°λ‚˜ μƒνƒœλ‘œ κ΄€λ¦¬ν•˜μ§€ μ•Šκ³  정적 ν…μŠ€νŠΈλ‘œ κ΄€λ¦¬ν•˜λŠ” κ²½μš°μ—λ„ 도메인 μ»΄ν¬λ„ŒνŠΈλ‘œ λ³Ό 것인지 μ΄μ—ˆλŠ”λ°μš”.
  • λ§Œμ•½ μ•½κ΄€ λ‚΄μš©μ΄ λ°μ΄ν„°λ² μ΄μŠ€μ— μ €μž₯λ˜κ±°λ‚˜ ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ μƒνƒœλ‘œ κ΄€λ¦¬ν•œλ‹€λ©΄ 도메인 μ»΄ν¬λ„ŒνŠΈλ‘œ λΆ„λ¦¬ν•˜λŠ”κ²Œ λ§žμœΌλ‚˜, ν˜„μž¬μ²˜λŸΌ 정적 ν…μŠ€νŠΈλ‘œ μ²˜λ¦¬ν•œλ‹€λ©΄ νŽ˜μ΄μ§€ μ»΄ν¬λ„ŒνŠΈλ‘œ κ΅¬μ„±ν•˜κΈ°λ‘œ κ²°μ •ν–ˆμŠ΅λ‹ˆλ‹€.
  • μ•žμœΌλ‘œ λΉ„μŠ·ν•œ 상황에도 이 μ»¨λ²€μ…˜μ„ μœ μ§€ν•  것 κ°™μ•„μš”.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ €λŠ” type 을 type 폴더에 λΆ„λ¦¬ν–ˆλŠ”λ° business 폴더에 λΆ„λ¦¬ν•˜μ‹  μ΄μœ κ°€ μžˆμ„κΉŒμš”!?
λ§žμΆ”λ©΄ 쒋을 것 κ°™μ•„μš”!

Copy link
Collaborator Author

@seonghunYang seonghunYang Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 뢀뢄에 λŒ€ν•΄μ„œλŠ” 두 가지 μ΄μœ κ°€ μžˆμŠ΅λ‹ˆλ‹€.

  1. μš°μ„ , μ €λŠ” 기본적으둜 κ·Όμ ‘ν•œ μ½”λ“œλ₯Ό 같은 μœ„μΉ˜μ— λ‘λŠ” 'colocate' 방식을 μ„ ν˜Έν•©λ‹ˆλ‹€.
    • https://koenvangilst.nl/blog/code-colocation-is-king
    • μœ„ λ§ν¬μ—μ„œ 'κ·Όμ ‘μ„±'μ΄λž€ ν•¨κ»˜ λ³€ν•˜λŠ” μ„±μ§ˆμ„ μ˜λ―Έν•©λ‹ˆλ‹€. κ·Έλž˜μ„œ 'colocate' 방식이 맀λ ₯적인데, μ΄λŠ” μ½”λ“œμ˜ μœ„μΉ˜ κ²°μ •λ₯Ό κ²°μ •ν•˜λŠ” μ—¬λŸ¬ 방법 쀑 κ°€μž₯ 변화에 κ°•ν•˜λ‹€κ³  λŠκ»΄μ§‘λ‹ˆλ‹€.
  2. 두 번째 μ΄μœ λŠ” '일반 νƒ€μž…'인지 'Response νƒ€μž…'인지에 λŒ€ν•œ λ¬Έμ œμž…λ‹ˆλ‹€.
    • μ €λŠ” μ„œλ²„κ°€ λ³΄λ‚΄λŠ” μš”μ²­μ΄λ‚˜ 응닡에 λͺ¨λ‘ 'Request'λ‚˜ 'Response'λΌλŠ” 접두사λ₯Ό λΆ™μž…λ‹ˆλ‹€.
    • 예λ₯Ό λ“€μ–΄ 'TakenLectures'의 경우 'TakenLecturesResponse'κ°€ 되겠죠?
    • μ΄λ ‡κ²Œ ν•˜λŠ” μ΄μœ λŠ”, μ„œλ²„μ—μ„œ λ°”λ‘œ λ³΄λ‚΄μ£ΌλŠ” 데이터λ₯Ό 기반으둜 'TakenLectures' νƒ€μž…μ„ λ§Œλ“€κ³  이λ₯Ό μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©ν•  경우, μ„œλ²„μ—μ„œ λ³΄λ‚΄μ£ΌλŠ” 데이터가 변경될 λ•Œ μ»΄ν¬λ„ŒνŠΈκΉŒμ§€ λ³€κ²½λ˜μ–΄μ•Ό ν•˜λŠ” λ¬Έμ œκ°€ μƒκΉλ‹ˆλ‹€.
    • κ·Έλž˜μ„œ, μ„œλ²„μ—μ„œ λ³΄λ‚΄λŠ” μ‘λ‹΅κ°’μ—λŠ” 'Response'λ₯Ό 뢙이고, μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©ν•˜λŠ” λ°μ΄ν„°λŠ” 'TakenLectures'둜 μ§€μ •ν•˜μ—¬ λ‘˜μ„ λΆ„λ¦¬ν•©λ‹ˆλ‹€.
    • μ•„ν‚€ν…μ²˜ ꡬ쑰 상 'TakenLectures'λ₯Ό λ”°λ‘œ λ§Œλ“€μ§€ μ•Šκ³  'TakenLecturesResponse'λ₯Ό λ°”λ‘œ μ‚¬μš©ν•  μˆ˜λ„ μžˆμ§€λ§Œ(ν˜„μž¬ 우리의 ꡬ쑰가 μ΄λ ‡μŠ΅λ‹ˆλ‹€), μ΅œμ†Œν•œ ν‘œκΈ°λ₯Ό 톡해 λ°μ΄ν„°μ˜ 좜처λ₯Ό 밝히고 λ³€κ²½μœΌλ‘œ μΈν•œ λ¬Έμ œκ°€ μžˆμ„ 수 μžˆμŒμ„ λ“œλŸ¬λ‚΄λŠ” νš¨κ³Όκ°€ μžˆμŠ΅λ‹ˆλ‹€.
    • BEμ—μ„œ λ…Όμ˜λ˜λŠ” 맀핑에 λŒ€ν•œ λ…Όμ˜μ™€ λΉ„μŠ·ν•œ 츑면이 μžˆλŠ” 것 κ°™λ„€μš”. λ¬Όλ‘  typescriptλŠ” 덕 타이핑이기 λ•Œλ¬Έμ— λ§€ν•‘μ—μ„œ μ’€ 더 자유둭긴 ν•˜μ§€λ§Œ, 변경에 λŒ€ν•œ λ¦¬μŠ€ν¬λŠ” μ—¬μ „νžˆ μ‘΄μž¬ν•©λ‹ˆλ‹€.

μ •λ¦¬ν•˜λ©΄, μ œκ°€ μ •μ˜ν•œ νƒ€μž… νŒŒμΌμ€ μ„œλ²„μ˜ μš”μ²­κ³Ό 응닡에 λŒ€ν•œ νƒ€μž…μ΄λ©°, μ΄λŠ” query λ˜λŠ” command와 κ°•ν•˜κ²Œ μ—°κ²°λ˜μ–΄ μžˆμœΌλ―€λ‘œ 'colocate' 철학에 따라 같은 폴더에 μœ„μΉ˜ν•˜λŠ” 것이 μ’‹λ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'TakenLectures' νƒ€μž…μ„ λ§Œλ“€κ³  이λ₯Ό μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©ν•  경우, μ„œλ²„μ—μ„œ λ³΄λ‚΄μ£ΌλŠ” 데이터가 변경될 λ•Œ μ»΄ν¬λ„ŒνŠΈκΉŒμ§€ λ³€κ²½λ˜μ–΄μ•Ό ν•˜λŠ” λ¬Έμ œκ°€ μƒκΉλ‹ˆλ‹€.

κ²°κ΅­ type에 λŒ€ν•œ 변경이 μΌμ–΄λ‚¬μ„λ•Œ TakenLecturesResponse의 변경은 ν•„μˆ˜μ μ΄λ©°, 연결을 μœ„ν•œ 계측이 ν•˜λ‚˜ 더 μƒμ„±λ˜λŠ” κ²ƒμ΄λ―€λ‘œ μ»΄ν¬λ„ŒνŠΈμ—μ„œ 직접 λ³€κ²½ν•˜λŠ” 것과 λΉ„κ΅ν•΄μ„œ λͺ…ν™•ν•˜κ²Œ μž₯점으둜 λ“œλŸ¬λ‚˜λŠ”μ§€μ— λŒ€ν•œ 곡감은 λ“€μ§€μ•ŠμŠ΅λ‹ˆλ‹€. κ°œκ°œμΈμ— λ”°λΌμ„œ 계측이 ν•˜λ‚˜ μΆ”κ°€λœλ‹€λŠ” 것에 λŒ€ν•΄ λΆˆνŽΈν•˜λ‹€λŠ” 의견이 μ‘΄μž¬ν•  수 μžˆμ„ 것 κ°™μ•„μš”.

ν•˜μ§€λ§Œ μ»΄ν¬λ„ŒνŠΈμ˜ μ•ˆμ •μ„±μ„ 높일 수 μžˆλ‹€λŠ” μ˜κ²¬μ— λ™μ˜ν•˜μ—¬ ν•΄λ‹Ή ꡬ쑰λ₯Ό μ±„νƒν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€. λ”λΆˆμ–΄ μ•ˆμ •μ„± 및 μœ μ—°μ„±μ„ λͺ©μ μœΌλ‘œ μ‚¬μš©ν•˜λŠ” 만큼 colocate방식을 ν†΅ν•œ response type관리가 μœ μš©ν•  것 κ°™λ‹€λŠ” μ˜κ²¬μ—λ„ λ™μ˜ν•©λ‹ˆλ‹€.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

응닡값 νƒ€μž…μ— Responseλ₯Ό λΆ™μ΄λŠ” 것과 ν•¨κ»˜ λ³€ν•˜λŠ” 것에 λŒ€ν•΄ κ·Όμ ‘ν•˜κ²Œ λ‘λŠ” 것 쒋은 것 κ°™μŠ΅λ‹ˆλ‹€!
λ‹€λ§Œ, μ„œλ²„μ—μ„œ λ³΄λ‚΄μ£ΌλŠ” 데이터 νƒ€μž…κ³Ό μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©ν•˜λŠ” 데이터 νƒ€μž…μ„ λΆ„λ¦¬ν–ˆμ„ λ•Œ ( λ‘˜μ˜ νƒ€μž…μ΄ κ°™λ‹€λŠ” κ°€μ • ν•˜ )μ„œλ²„μ—μ„œ λ³΄λ‚΄μ£ΌλŠ” 데이터가 변경될 λ•Œ μ»΄ν¬λ„ŒνŠΈκΉŒμ§€ λ³€κ²½λ˜μ–΄μ•Ό ν•˜λŠ” λ¬Έμ œκ°€ μƒκΈ°λŠ” κ±Έ λ°©μ§€ν•˜κ³  μ•ˆμ •μ„±μ΄ λ†’μ•„μ§„λ‹€λŠ” 것에 곡감이 μ•ˆλ˜λŠ”λ° 이 뢀뢄에 λŒ€ν•΄μ„œ μŠ€ν”„λ¦°νŠΈ νšŒμ˜λ•Œ 쑰금 더 μ„€λͺ…ν•΄μ£Όμ‹€ 수 μžˆλ‚˜μš”??

@@ -1,7 +1,12 @@
import type { Preview } from '@storybook/react';
import '../app/globals.css';

import { initialize, mswDecorator } from 'msw-storybook-addon';

initialize();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://storybook.js.org/addons/msw-storybook-addon
parameters λŒ€μ‹  initializeμ—μ„œ ν•œ λ²ˆμ— handlers λ₯Ό 섀정해쀄 수 μžˆμ„ 것 κ°™μ•„μš”!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9c49969
μ’‹λ„€μš”. κ³ λ§ˆμ›Œμš”

await delay(500);

if (!isSuccess) {
return HttpResponse.json({ status: 400, message: '이미 κ°€μž…λœ ν•™λ²ˆμž…λ‹ˆλ‹€.' }, { status: 400 });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ν˜Ήμ‹œ status:400 객체λ₯Ό 또 μ „λ‹¬ν•˜λŠ” μ΄μœ κ°€ λ”°λ‘œ μžˆμ„κΉŒμš©?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ν›„μžμ˜ statusλŠ” MSW의 응닡을 κ²°μ •ν•˜λŠ” 것이고,
  • μ „μžλŠ” μ‘ΈλΆ€μ˜ μ‹€μ œ 응닡을 λͺ¨λ°©ν•œ κ²ƒμž…λ‹ˆλ‹€.
  • μ‘ΈλΆ€ APIλ₯Ό ν™•μΈν•΄λ³΄λ‹ˆ, μ‹€νŒ¨ μ‹œ dataμ—λŠ” μ €λ ‡κ²Œ λ³΄λ‚΄μ£ΌλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. 'status'λΌλŠ” μ΄λ¦„λ§Œ 같을 뿐, μ•„λ§ˆ μ‹€μ œ μ‘λ‹΅μ½”λ“œλž‘ λ³„κ°œμΈ 것 κ°™μŠ΅λ‹ˆλ‹€.

Copy link
Member

@yougyung yougyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μˆ˜κ³ ν•˜μ…¨μŠ΅λ‹ˆλ‹€ !

app/business/user/user.command.ts Outdated Show resolved Hide resolved
app/hooks/useFunnel.tsx Outdated Show resolved Hide resolved
experimental: {
serverActions: {
// https://github.com/vercel/next.js/issues/58295
allowedOrigins: ['localhost:3000', 'ideal-waddle-5xwrj5ppjvxhvq7x-3000.app.github.dev'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이슈λ₯Ό ν™•μΈν•΄λ³΄μ•˜μ§€λ§Œ λͺ…ν™•ν•˜κ²Œ μ–΄λ–€ μ΄μœ μ—μ„œ μΆ”κ°€ 된 섀정인지 λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€. μ„€λͺ…을 덧뢙여주싀 수 μžˆμ„κΉŒμš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • μ œκ°€ μ‚¬μš©ν•˜λŠ” codespaceμ—μ„œλŠ” λ‘œμ»¬μ—μ„œ ν˜ΈμŠ€νŒ…ν•˜λŠ” 것이 μ•„λ‹ˆλΌ λ‹€λ₯Έ 도메인에 ν”„λ‘μ‹œλ₯Ό μ—°κ²°ν•˜μ—¬ ν˜ΈμŠ€νŒ…ν•©λ‹ˆλ‹€. 즉, localhost:3000을 ideal-waddle-5xwrj5ppjvxhvq7x-3000.appμ—μ„œ μ‹€ν–‰ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.
  • κ·ΈλŸ¬λ‚˜ μ΄λ ‡κ²Œ ν•˜λ©΄ μ„œλ²„ μ•‘μ…˜μ΄ cors 였λ₯˜λ‘œ 인해 λ°œμƒν•˜λ―€λ‘œ, ν—ˆμš© 도메인을 μΆ”κ°€ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
  • 제 개발 ν™˜κ²½μ—μ„œ λ™μž‘ν•˜κΈ° μœ„ν•΄ μ„€μ •ν•œ κ²ƒμœΌλ‘œ μ΄ν•΄ν•˜μ‹œλ©΄ λ©λ‹ˆλ‹€.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

κ·Έλ ‡κ΅°μš”. λ‘œμ»¬μ—μ„œ ν˜ΈμŠ€νŒ…ν•˜λŠ” 것이 μ•„λ‹ˆλΌ λ‹€λ₯Έ 도메인에 ν”„λ‘μ‹œλ₯Ό μ—°κ²°ν•˜μ—¬ ν˜ΈμŠ€νŒ…ν•˜μ‹œλŠ” μ΄μœ λŠ” 무엇인지 κΆκΈˆν•©λ‹ˆλ‹€!

@seonghunYang
Copy link
Collaborator Author

seonghunYang commented Mar 19, 2024

μˆ˜κ³ ν•˜μ…¨μŠ΅λ‹ˆλ‹€ !

  • defaultState 였λ₯˜ 남긴거 μˆ˜μ •ν–ˆμ–΄μš”. κ³ λ§ˆμ›Œμš”.
  • 73f94bc
  • 이후에 defaultStepμ΄λž€ 더 μ μ ˆν•œ 이름이 λ– μ˜¬λΌμ„œ μˆ˜μ •ν–ˆμ–΄μš”
  • 9353625

yougyung
yougyung previously approved these changes Mar 20, 2024
gahyuun
gahyuun previously approved these changes Mar 20, 2024

const stepQueryKey = options?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY;

const step = searchParams.get(stepQueryKey) as Steps | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

단언을 해주지 μ•ŠμœΌλ©΄ step이 null λ˜λŠ” string νƒ€μž…μΈ κ±Έ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€ ! μ΄λ•Œ undefined λ‘œλ„ 단언해주신 μ΄μœ κ°€ κΆκΈˆν•©λ‹ˆλ‹€!

@seonghunYang seonghunYang dismissed stale reviews from gahyuun and yougyung via f6e7028 March 27, 2024 10:15
Copy link

@seonghunYang seonghunYang merged commit e44512e into main Mar 27, 2024
3 checks passed
@seonghunYang seonghunYang deleted the sign-up-form/#7 branch March 27, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants