Skip to content

Conversation

@keemhyunseok
Copy link
Contributor

Related Issue

Describe your changes

image
  • browserslist패키지의 deps에 있는 caniuse-lite 버전을 로그로 노출합니다

Request

@npayfebot
Copy link
Contributor

npayfebot commented Feb 26, 2025

✅ Changeset detected

Latest commit: 63bfb2a

@naverpay/pite package have detected changes.

If no version change is needed, please add skip-detect-change to the label.

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

powered by: naverpay changeset detect-add actions

Copy link
Member

@2-one-week 2-one-week left a comment

Choose a reason for hiding this comment

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

프린트!

@@ -0,0 +1,14 @@
/* eslint-disable no-console */
import packageJsonContent from 'browserslist/package.json' with {type: 'json'}
Copy link
Contributor

Choose a reason for hiding this comment

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

요거 버전 지원만 한번 확인 부탁드립니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

파폭에서는 불가능하고,, node는 20.10.0 부터 사용가능합니다

Copy link
Contributor Author

@keemhyunseok keemhyunseok Feb 27, 2025

Choose a reason for hiding this comment

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

TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///Users/USER/Workspace/npay/pie/node_modules/.pnpm/browserslist@4.24.4/node_modules/browserslist/package.json" needs an import attribute of "type: json"

으음.. 지금 방식으로는 이 에러가 발생하네요

정식으로(?) import하는게 아니라 강제로 파일을 읽어와 파싱하는 형태로 해야할 것 같습니다

"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-polyfill-corejs3": "^0.11.0",
"browserslist": "^4.24.2",
"browserslist": "4.24.4",
Copy link
Contributor

@yujeong-jeon yujeong-jeon Feb 27, 2025

Choose a reason for hiding this comment

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

혹시 요거 궁금한게 있는데 사용처의 pkg 내부의 browserslist가 아니라 pite의 browserslist/caniuse-lite 의 버전을 바라보는걸까요~?

궁금했던 게 만약 outdated되면 pite를 주기적으로 업데이트해줘야 하는 구조인가 싶어서 여쭙습니다..!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

원래 의도했던건 pite 빌드시 참고하는 caniuse-lite버전을 알려주고, 사용처에서는 사용처가 참고하는 버전을 알아서 획득(?)해 버전을 맞추는 것을 생각했습니다. 제작자(우리)의 타겟과 사용처의 타겟이 다를 수 있으니 우리가 작업하며 의도했던 타겟에 대한 힌트를 제공하는 정도의 기능을 생각했습니다.

궁금했던 게 만약 outdated되면 pite를 주기적으로 업데이트해줘야 하는 구조인가 싶어서 여쭙습니다..!

그래서 꼭 주기적으로 업데이트할 필요는 없고 지금 설치한 pite가 어떤 버전을 타겟으로 작업되었나 참고하고 필요하다면 업데이트 하는 그림을 생각했습니다. 어차피 사용처의 caniuse-lite버전 따라서 빌드될테니 크게 중요한 정보가 아니기도 하구요..!

그런데 말씀주신거 생각해보니 뭔가 로그가 사용처의 caniuse-lite버전을 알려주는 것으로 보일 것 같아서,, 사용처의 정보도 함께 로그에 보여주는 식으로 방향을 조금 바꿔야하나 고민이 되는군요..

Copy link
Contributor

@yujeong-jeon yujeong-jeon Feb 27, 2025

Choose a reason for hiding this comment

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

아하 그러면 pite로 코드를 빌드하는 시점에는 pite > browserslist > caniuse-lite 버전을 쓰는 게 아니라 사용처에 browerslist가 따로 설치되어 있다면 그 버전을 쓰는거죠~?? (즉, 사용처의 caniuse-lite 버전에 따라 browserslistToEsbuild(browserslist)로 타겟 결정됨)
뭔가 browserslist가 peerDeps가 아니라 deps라서 제가 햇갈렸던거 같습니다 😅

@keemhyunseok keemhyunseok marked this pull request as draft February 27, 2025 11:44
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.

8 participants