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

navigator deprecated 속성 변경 및 ssr 환경 고려 #3245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wooseok123
Copy link

@wooseok123 wooseok123 commented May 18, 2024

Please check if the PR fulfills these requirements

  • It's the right issue type on the title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has a description of the breaking change

Description

  1. navigator.platform 속성은 deprecated 된 상태이기 때문에, 대체 속성인 navigator.userAgent를 사용했습니다.

  2. navigator 객체는 브라우져 속성이기 때문에, ssr 환경에서 editor를 불러오면 undefined 한 타입 에러가 납니다. 이에 앞에 브라우져 환경에서만 속성에 접근할 수 있도록 조치하였습니다.

  3. test 함수는 string 타입의 인자를 받는데, undefined한 값이 들어가면 안되기에 index로 고려하는 기능을 제안합니다. 하지만 이미 앞에서 undefined 하지 않을 경우에만 통과하기 때문에 뒤 검증 로직은 test, match, indexOf 아무거나 사용해도 무방할 것 같습니다.


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

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.

None yet

1 participant