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

Add ProgressBarSize, ProgressBarVariant string literal type and deprecate enum #1595

Merged
merged 10 commits into from
Sep 14, 2023
Merged

Add ProgressBarSize, ProgressBarVariant string literal type and deprecate enum #1595

merged 10 commits into from
Sep 14, 2023

Conversation

Dogdriip
Copy link
Contributor

@Dogdriip Dogdriip commented Sep 5, 2023

Self Checklist

  • I wrote a PR title in English.
  • I added an appropriate label to the PR.
  • I wrote a commit message in English.
  • I wrote a commit message according to the Conventional Commits specification.
  • I added the appropriate changeset for the changes.
  • [Component] I wrote a unit test about the implementation.
  • [Component] I wrote a storybook document about the implementation.
  • [Component] I tested the implementation in various browsers.
    • Windows: Chrome, Edge, (Optional) Firefox
    • macOS: Chrome, Edge, Safari, (Optional) Firefox
  • [New Component] I added my username to the correct directory in the CODEOWNERS file.

Related Issue

Summary

  • ProgressBar 컴포넌트의 SizeProps인 ProgressBarSize, VariantProps인 ProgressBarVariant에 enum 대신 string literal type이 들어갈 수 있도록 변경하고, enum을 deprecated 처리합니다.

Details

Breaking change or not (Yes/No)

  • No
    • 향후 ProgressBarSize, ProgressBarVariant enum 사용처에서 이를 string literal로 변경해주어야 합니다.

References

@Dogdriip Dogdriip added the enhancement Issues or PR related to making existing features better label Sep 5, 2023
@Dogdriip Dogdriip self-assigned this Sep 5, 2023
@changeset-bot
Copy link

changeset-bot bot commented Sep 5, 2023

🦋 Changeset detected

Latest commit: b6ac626

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@channel.io/bezier-react Patch
bezier-figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Dogdriip Dogdriip requested a review from sungik-choi September 5, 2023 05:14
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.06% ⚠️

Comparison is base (842c80b) 87.00% compared to head (b6ac626) 86.94%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1595      +/-   ##
==========================================
- Coverage   87.00%   86.94%   -0.06%     
==========================================
  Files         281      281              
  Lines        3879     3877       -2     
  Branches      817      817              
==========================================
- Hits         3375     3371       -4     
- Misses        430      432       +2     
  Partials       74       74              
Files Changed Coverage Δ
...ct/src/components/ProgressBar/ProgressBar.types.ts 0.00% <ø> (-100.00%) ⬇️
...t/src/components/ProgressBar/ProgressBar.styled.ts 100.00% <100.00%> (ø)
...r-react/src/components/ProgressBar/ProgressBar.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Chromatic Report

🚀 Congratulations! Your build was successful!

@yangwooseong
Copy link
Collaborator

breaking change 를 발생시키면 메이저 버전을 올려야 해서, enum과 union type 을 동시에 지원하되 enum type 을 deprecated 시키고 사용할 때 경고를 띄워주면 어떨까요? (# 참고). semver 를 지키려면 메이저 버전 올릴 때까지 breaking change 가 없는게 좋을 것 같습니다

@yangwooseong
Copy link
Collaborator

yangwooseong commented Sep 8, 2023

minor version bump 를 위한 changset 은 필요할 것 같습니다! codemod 까지 포함하는 pr 이 될까요? 아니라면 제목에서 [WIP]은 없애도 될듯 합니다!

@Dogdriip
Copy link
Contributor Author

Dogdriip commented Sep 8, 2023

breaking change 를 발생시키면 메이저 버전을 올려야 해서, enum과 union type 을 동시에 지원하되 enum type 을 deprecated 시키고 사용할 때 경고를 띄워주면 어떨까요? (#1562 (review) 참고). semver 를 지키려면 메이저 버전 올릴 때까지 breaking change 가 없는게 좋을 것 같습니다

레거시 대응도 했어야 하는데 생각치 못했네요... 👍 우선 enum과 string literal 타입 둘 다 사용할 수 있도록 두고, enum에 @deprecated 달아두었습니다.

minor version bump 를 위한 changset 은 필요할 것 같습니다! codemod 까지 포함하는 pr 이 될까요? 아니라면 제목에서 [WIP]은 없애도 될듯 합니다!

codemod 구현 후 changeset 추가해서 WIP 뗄 예정이었습니다 😅 우선 draft로 돌려두겠습니다!

@Dogdriip Dogdriip marked this pull request as draft September 8, 2023 02:44
@sungik-choi
Copy link
Contributor

breaking change 를 발생시키면 메이저 버전을 올려야 해서, enum과 union type 을 동시에 지원하되 enum type 을 deprecated 시키고 사용할 때 경고를 띄워주면 어떨까요? (# 참고). semver 를 지키려면 메이저 버전 올릴 때까지 breaking change 가 없는게 좋을 것 같습니다

#1602

@Dogdriip Dogdriip marked this pull request as ready for review September 13, 2023 10:50
@Dogdriip Dogdriip changed the title [WIP] Change ProgressBarSize, ProgressBarVariant from enum to types Change ProgressBarSize, ProgressBarVariant from enum to string literal Sep 13, 2023
@Dogdriip
Copy link
Contributor Author

codemod 구현 후 changeset 추가해서 WIP 뗄 예정이었습니다 😅 우선 draft로 돌려두겠습니다!

codemod는 후속 PR에서 enum -> string literal을 제너릭하게 사용할 수 있도록 작성하겠습니다.

breaking change 를 발생시키면 메이저 버전을 올려야 해서, enum과 union type 을 동시에 지원하되 enum type 을 deprecated 시키고 사용할 때 경고를 띄워주면 어떨까요? (# 참고). semver 를 지키려면 메이저 버전 올릴 때까지 breaking change 가 없는게 좋을 것 같습니다

#1602

  • 런타임에서 특정 string이 enum member인지 / string literal인지 구분할 수 있는 방법이 없어서 (있다면 코멘트 주시면 감사하겠습니다...)
  • (+ 특정 Enum이 import되었는지 확인하는 건 더 어려워서)

우선은 deprecated 태그만 달아두겠습니다. 🥲

@sungik-choi
Copy link
Contributor

codemod 구현 후 changeset 추가해서 WIP 뗄 예정이었습니다 😅 우선 draft로 돌려두겠습니다!

codemod는 후속 PR에서 enum -> string literal을 제너릭하게 사용할 수 있도록 작성하겠습니다.

breaking change 를 발생시키면 메이저 버전을 올려야 해서, enum과 union type 을 동시에 지원하되 enum type 을 deprecated 시키고 사용할 때 경고를 띄워주면 어떨까요? (# 참고). semver 를 지키려면 메이저 버전 올릴 때까지 breaking change 가 없는게 좋을 것 같습니다

#1602

  • 런타임에서 특정 string이 enum member인지 / string literal인지 구분할 수 있는 방법이 없어서 (있다면 코멘트 주시면 감사하겠습니다...)
  • (+ 특정 Enum이 import되었는지 확인하는 건 더 어려워서)

우선은 deprecated 태그만 달아두겠습니다. 🥲

Enum은 deprecated 표시가 명확히 잘 되어서, 그거로도 충분할 거 같습니다 👍

.changeset/lucky-hairs-nail.md Outdated Show resolved Hide resolved
@Dogdriip Dogdriip changed the title Change ProgressBarSize, ProgressBarVariant from enum to string literal Add ProgressBarSize, ProgressBarVariant string literal type and deprecate enum Sep 14, 2023
@sungik-choi sungik-choi merged commit dbb115b into channel-io:main Sep 14, 2023
sungik-choi pushed a commit that referenced this pull request Sep 18, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @channel.io/bezier-react@1.13.0

### Minor Changes

- Add `preventHideOnOutsideClick` property to `Modal` component
([#1617](#1617)) by
@yangwooseong

### Patch Changes

- Fixes an issue where the height of `TextArea` component is not
specified correctly. Modify the build settings to match the package.json
exports fields change in 8.5.0 of `react-textarea-autosize`.
([#1637](#1637)) by
@sungik-choi

- Add `ProgressBarSize`, `ProgressBarVariant` string literal type and
deprecate enum
([#1595](#1595)) by
@Dogdriip

## bezier-figma-plugin@0.4.1

### Patch Changes

-   Updated dependencies
    -   @channel.io/bezier-react@1.13.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues or PR related to making existing features better
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants