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

feat: search suggestion api #48

Merged
merged 19 commits into from
Jul 8, 2024
Merged

feat: search suggestion api #48

merged 19 commits into from
Jul 8, 2024

Conversation

poiu694
Copy link
Member

@poiu694 poiu694 commented Jul 5, 2024

Issue Number

#47

Description

구현 내용 및 작업한 내용

  • 자동완성 api 연동
  • bound를 전달하는 방법으로 일단 세션 및 스토리지 설정
  • gps 거리계산

image

Checklist

PR 등록 전 확인한 것

  • 올바른 타켓 브랜치를 설정하였는가
  • PR 제목은 포맷과 내용 둘 다 알맞게 작성되었는가 (e.g., feat: add login page)
  • Description에 PR을 구체적으로 설명했는가

Copy link

github-actions bot commented Jul 5, 2024

The latest updates on your projects. Preview: https://vitamin-c-176e3fssn-poiu694s-projects.vercel.app

Name Status Preview Updated
VitaminC_Web ✅ Ready Visit Preview 2024-07-05T08:48:13Z

Copy link

github-actions bot commented Jul 5, 2024

The latest updates on your projects. Preview: https://vitamin-c-fues29y2h-poiu694s-projects.vercel.app

Name Status Preview Updated
VitaminC_Web ✅ Ready Visit Preview 2024-07-05T08:50:44Z

Copy link
Member

@hee-suh hee-suh left a comment

Choose a reason for hiding this comment

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

예상한대로 잘 작동하는지, 논리 연산이나 조건문이 잘 처리되고 있는지 위주로 확인했습니다! 자동 완성 아주 깔꼬롬하니 넘 좋네요 🤩

image

src/utils/api/api-client-factory.ts Outdated Show resolved Hide resolved
src/app/search/suggest-place-list.tsx Outdated Show resolved Hide resolved
src/components/place/place-auto-search-item.tsx Outdated Show resolved Hide resolved
src/app/search/suggest-place-list.tsx Outdated Show resolved Hide resolved
src/components/place/place-auto-search-item.tsx Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

P3: SessionStorageManager와 LocalStorageManager 모두가 extend 할 수 있는 storage.ts를 만들어서 관리하는 것도 좋을 것 같네요!

Copy link
Member Author

Choose a reason for hiding this comment

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

두 역할이 다른 것 같아서 빼긴 했는데! 합치는게 좋을까요?

두 인터페이스가 같아서 나중이나 리팩터링할 때 abstract class 를 storage.ts 에 넣는 느낌으로 생각하긴 했어용

Copy link
Member

@hee-suh hee-suh Jul 6, 2024

Choose a reason for hiding this comment

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

인터페이스가 같기도 하기도 하고, Window.sessionStorageWindow.localStorage 모두 Storage object 인스턴스를 리턴하고 있으니까 비슷한 느낌으로 가려면 합치는게 좋을 것 같다고 생각했었어요! 생각해두신대로 나중에 리팩토링 가시죠~!

Cf. https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

router.push(`${pathname}?${createQueryString('search', '')}`)
}

useIsomorphicLayoutEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

react.dev에서 useLayoutEffect 사용을 지양하라고 해서, 언제 사용해야 성능 이슈보다 이점이 더 클지 잘 감이 안 오더라구요 useLayoutEffect 사용 기준을 따로 갖고 계신지 궁금합니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

useLayoutEffect는 레이아웃 관련 작업이나 깜박임 또는 레이아웃이 깨지는 문제를 방지할 때 말고 잘 안쓰긴 했는데, 여기선 Next라 useIsomorphicLayoutEffect로 넣긴 했네요!

Copy link
Member

Choose a reason for hiding this comment

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

결국 useIsomorphicLayoutEffect를 쓴다는 건 client side에서 useLayoutEffect를 사용하겠다는 건데, 사용했을 때 깜빡임이 확실하게 사라지거나 더 빠르게 그려지는게 확실하지 않다보니, 성능 이슈를 고려해서 사용 기준을 명확하게 정해보는 것도 좋을 것 같아요!

Copy link

github-actions bot commented Jul 6, 2024

The latest updates on your projects. Preview: https://vitamin-c-2ldfuieti-poiu694s-projects.vercel.app

Name Status Preview Updated
VitaminC_Web ✅ Ready Visit Preview 2024-07-06T06:26:10Z

@poiu694 poiu694 merged commit b1445e9 into main Jul 8, 2024
3 checks passed
@poiu694 poiu694 deleted the feature/search-api branch July 8, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants