Skip to content

Conversation

@keemhyunseok
Copy link
Contributor

Related Issue

Describe your changes

  • Promise.withResolvers 폴리필 주입을 위한 코드 추가

  • ios특정버전 미만에서(16.6.1 버전이상에서는 정상동작 확인) react-pdf 에러가 발생하는 문제의 원인으로 추정중. (테스트 필요)

Request

@keemhyunseok keemhyunseok self-assigned this Nov 25, 2025
@keemhyunseok keemhyunseok requested a review from a team as a code owner November 25, 2025 09:56
@npayfebot
Copy link
Collaborator

npayfebot commented Nov 25, 2025

✅ Changeset detected

Latest commit: d9c7c06

@naverpay/react-pdf 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.

This PR includes changesets to release 1 package
Name Type
@naverpay/react-pdf 🐛 Patch
powered by: naverpay changeset detect-add actions

@yceffort-naver
Copy link
Contributor

여기 배포 세팅안했던거같은데

@npayfebot
Copy link
Collaborator

npayfebot commented Nov 25, 2025

NPM Packages

📦 @naverpay/react-pdf

Total Sizes: 22 kB

Total Changes: +69 B (0%)

File Status Previous Size Updated Size Changed
/dist/esm/index.mjs 🛠️ 310 B 342 B +32 B (+10%)
/dist/cjs/index.js 🛠️ 406 B 443 B +37 B (+9%)
ℹ️ View Unchanged Files
File Status Previous Size Updated Size Changed
/dist/esm/utils/text.mjs - 567 B 567 B -
/dist/esm/utils/pdf.mjs - 1.21 kB 1.21 kB -
/dist/esm/utils/link-service.mjs - 843 B 843 B -
/dist/esm/utils/debounce.mjs - 148 B 148 B -
/dist/esm/hooks/usePdfViewerPageWidth.mjs - 439 B 439 B -
/dist/esm/hooks/useIsomorphicLayoutEffect.mjs - 136 B 136 B -
/dist/esm/hooks/useInfiniteScroll.mjs - 303 B 303 B -
/dist/esm/contexts/pdf.mjs - 308 B 308 B -
/dist/esm/contexts/page.mjs - 447 B 447 B -
/dist/esm/components/PdfViewer.module.mjs - 116 B 116 B -
/dist/esm/components/PdfViewer.mjs - 1.25 kB 1.25 kB -
/dist/esm/components/Pages.mjs - 902 B 902 B -
/dist/esm/components/page/Canvas.mjs - 579 B 579 B -
/dist/esm/components/layer/Text.module.mjs - 108 B 108 B -
/dist/esm/components/layer/Text.mjs - 1.25 kB 1.25 kB -
/dist/esm/components/layer/Annotation.module.mjs - 505 B 505 B -
/dist/esm/components/layer/Annotation.mjs - 1.01 kB 1.01 kB -
/dist/cjs/utils/text.js - 630 B 630 B -
/dist/cjs/utils/pdf.js - 1.28 kB 1.28 kB -
/dist/cjs/utils/link-service.js - 845 B 845 B -
/dist/cjs/utils/debounce.js - 211 B 211 B -
/dist/cjs/hooks/usePdfViewerPageWidth.js - 440 B 440 B -
/dist/cjs/hooks/useIsomorphicLayoutEffect.js - 192 B 192 B -
/dist/cjs/hooks/useInfiniteScroll.js - 300 B 300 B -
/dist/cjs/contexts/pdf.js - 375 B 375 B -
/dist/cjs/contexts/page.js - 516 B 516 B -
/dist/cjs/components/PdfViewer.module.js - 206 B 206 B -
/dist/cjs/components/PdfViewer.js - 1.31 kB 1.31 kB -
/dist/cjs/components/Pages.js - 978 B 978 B -
/dist/cjs/components/page/Canvas.js - 645 B 645 B -
/dist/cjs/components/layer/Text.module.js - 118 B 118 B -
/dist/cjs/components/layer/Text.js - 1.33 kB 1.33 kB -
/dist/cjs/components/layer/Annotation.module.js - 673 B 673 B -
/dist/cjs/components/layer/Annotation.js - 1.08 kB 1.08 kB -

powered by: naverpay size-action

@keemhyunseok
Copy link
Contributor Author

바로 리얼배포 들어가보겠습니다

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.

상남자식 배포

@@ -1,3 +1,7 @@
// pdfjs-dist에서 Promise.withResolvers를 사용하므로 polyfill 주입을 위해 호출
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
Promise.withResolvers
Copy link
Contributor

Choose a reason for hiding this comment

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

// polyfill 바닐라로 구현해서 넣기
if (typeof Promise.withResolvers !== 'function') {
  Promise.withResolvers = function <T>() {
    let resolve: (value: T | PromiseLike<T>) => void
    let reject: (reason?: unknown) => void
    const promise = new Promise<T>((res, rej) => {
      resolve = res
      reject = rej
    })
    return { promise, resolve: resolve!, reject: reject! }
  }
}
import 'core-js/actual/promise/with-resolvers'

https://app.unpkg.com/[email protected]/files/actual/promise/with-resolvers.js

둘중 하나가 맞을듯..

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.

5 participants