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

fix: storybook 바벨 이슈 수정 #139

Merged
merged 10 commits into from Oct 26, 2023

Conversation

shinhyojeong
Copy link
Member

@shinhyojeong shinhyojeong commented Oct 21, 2023

🔗 이슈 번호

⛳ 구현 사항

  • jotai 세팅중 babel.config.js에 추가된 'next/babel'에서 발생하는 이슈를 수정하기 위해 storybook 버전을 �v7로 마이그레이션 합니다.
  • 변경된 스토리 작성에 따라 스토리를 수정합니다.

📚 구현 설명

  • 버전업 한 후 type관련 버전 충돌로 인해 type을 제대로 잡지 못하는 이슈가 발생하였습니다. 해결을 위해@types/react, @types/react-dom의 버전을 고정을 위해 package.json에 resolutions를 추가하였습니다. (관련 자료)

💡 코드 리뷰 포인트

  • 스토리 마이그레이션 하면서 컨벤션을 수정했는데 관련해서 의견이 있으시면 남겨주세요 ~!

🔥 이슈와 해결 방안

babel 이슈 발생

스크린샷 2023-10-21 오후 9 04 21

시도 방법

  • storybook 내부에 storybook에만 적용되는 babel 파일 만들기
    • storybook/babel.config.js 파일을 main에 extends하여 해당 파일을 바라보게 해주려 시도했지만 계속 root 파일을 바라봄
    • babel 파일을 두개로 나누는 것이 근본적인 문제 해결 방식은 아닌 듯 해 다른 방법 서치
  • babel-loader의 버전 충돌 문제라는 이야기가 있어 이를 해결하기 위해 package.json에서 resolutions에 babel-loader 버전을 고정([관련 자료](babel-loader conflicts with create-react-app version storybookjs/storybook#5183))
    • 해당 이슈가 해결된다는 버전으로 고정해줘도 여전히 같은 이슈 발생
    • 찾은 해결 방식과 다른 next 환경이라 그런지 이슈가 해결되지 않음

해결 방법

이슈를 서치해보니 storybook v7에서는 next에 관련된 설정을 세팅해주는 plugin을 제공한다고 하여(관련 자료](storybookjs/storybook#23063)), v7로 마이그레이션해 문제를 해결 (마이그레이션 자료)

추가적인 이슈

@shinhyojeong shinhyojeong requested a review from a team October 21, 2023 12:11
@shinhyojeong shinhyojeong self-assigned this Oct 21, 2023
@shinhyojeong shinhyojeong added feat 기능 추가, 삭제, 변경 Waiting Code Review labels Oct 21, 2023
Copy link
Member

@chojooyoung chojooyoung left a comment

Choose a reason for hiding this comment

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

컨벤센 관련해서 정하고 approve 누르겠습니다!
이슈공유 감사합니다!

sonsurim
sonsurim previously approved these changes Oct 26, 2023
Copy link
Member

@sonsurim sonsurim left a comment

Choose a reason for hiding this comment

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

LGTM

@shinhyojeong shinhyojeong merged commit a8bac68 into develop Oct 26, 2023
@shinhyojeong shinhyojeong deleted the fix/#138_storybook-babel-issue branch October 26, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 추가, 삭제, 변경 Waiting Code Review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

fix: storybook 바벨 이슈 수정
3 participants