diff --git a/packages/react-pdf/package.json b/packages/react-pdf/package.json index 8aab9b646..bc7ba95f1 100644 --- a/packages/react-pdf/package.json +++ b/packages/react-pdf/package.json @@ -62,7 +62,7 @@ "pdfjs-dist": "3.11.174", "prop-types": "^15.6.2", "tiny-invariant": "^1.0.0", - "tiny-warning": "^1.0.0" + "warning": "^4.0.0" }, "devDependencies": { "@testing-library/dom": "^9.0.0", @@ -70,6 +70,7 @@ "@testing-library/react": "^14.0.0", "@types/node": "*", "@types/react": "*", + "@types/warning": "^3.0.0", "cpy-cli": "^5.0.0", "eslint": "^8.26.0", "eslint-config-wojtekmaj": "^0.9.0", diff --git a/packages/react-pdf/src/Document.tsx b/packages/react-pdf/src/Document.tsx index d67ea5353..09dd4d5e1 100644 --- a/packages/react-pdf/src/Document.tsx +++ b/packages/react-pdf/src/Document.tsx @@ -13,7 +13,7 @@ import makeEventProps from 'make-event-props'; import makeCancellable from 'make-cancellable-promise'; import clsx from 'clsx'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import pdfjs from './pdfjs.js'; import DocumentContext from './DocumentContext.js'; diff --git a/packages/react-pdf/src/Outline.tsx b/packages/react-pdf/src/Outline.tsx index cb62d9cb9..0d253e074 100644 --- a/packages/react-pdf/src/Outline.tsx +++ b/packages/react-pdf/src/Outline.tsx @@ -6,7 +6,7 @@ import makeCancellable from 'make-cancellable-promise'; import makeEventProps from 'make-event-props'; import clsx from 'clsx'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import OutlineContext from './OutlineContext.js'; diff --git a/packages/react-pdf/src/Page.tsx b/packages/react-pdf/src/Page.tsx index 314b067e4..d9ca45ca5 100644 --- a/packages/react-pdf/src/Page.tsx +++ b/packages/react-pdf/src/Page.tsx @@ -7,7 +7,7 @@ import makeEventProps from 'make-event-props'; import clsx from 'clsx'; import mergeRefs from 'merge-refs'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import PageContext from './PageContext.js'; diff --git a/packages/react-pdf/src/Page/AnnotationLayer.tsx b/packages/react-pdf/src/Page/AnnotationLayer.tsx index c743b7e87..a1c36f1b7 100644 --- a/packages/react-pdf/src/Page/AnnotationLayer.tsx +++ b/packages/react-pdf/src/Page/AnnotationLayer.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useMemo, useRef } from 'react'; import makeCancellable from 'make-cancellable-promise'; import clsx from 'clsx'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import pdfjs from '../pdfjs.js'; import useDocumentContext from '../shared/hooks/useDocumentContext.js'; diff --git a/packages/react-pdf/src/Page/PageCanvas.tsx b/packages/react-pdf/src/Page/PageCanvas.tsx index b47d3afd6..3304a834f 100644 --- a/packages/react-pdf/src/Page/PageCanvas.tsx +++ b/packages/react-pdf/src/Page/PageCanvas.tsx @@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useMemo, useRef } from 'react'; import mergeRefs from 'merge-refs'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import pdfjs from '../pdfjs.js'; import StructTree from '../StructTree.js'; diff --git a/packages/react-pdf/src/Page/PageSVG.tsx b/packages/react-pdf/src/Page/PageSVG.tsx index a9aa268f8..8d58eda8c 100644 --- a/packages/react-pdf/src/Page/PageSVG.tsx +++ b/packages/react-pdf/src/Page/PageSVG.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo } from 'react'; import makeCancellable from 'make-cancellable-promise'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import pdfjs from '../pdfjs.js'; import usePageContext from '../shared/hooks/usePageContext.js'; diff --git a/packages/react-pdf/src/Page/TextLayer.tsx b/packages/react-pdf/src/Page/TextLayer.tsx index cd693706c..8bffa350d 100644 --- a/packages/react-pdf/src/Page/TextLayer.tsx +++ b/packages/react-pdf/src/Page/TextLayer.tsx @@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from import makeCancellable from 'make-cancellable-promise'; import clsx from 'clsx'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import pdfjs from '../pdfjs.js'; import usePageContext from '../shared/hooks/usePageContext.js'; diff --git a/packages/react-pdf/src/StructTree.tsx b/packages/react-pdf/src/StructTree.tsx index 8e438328d..346c8fbdf 100644 --- a/packages/react-pdf/src/StructTree.tsx +++ b/packages/react-pdf/src/StructTree.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; import makeCancellable from 'make-cancellable-promise'; import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import StructTreeItem from './StructTreeItem.js'; diff --git a/packages/react-pdf/src/shared/utils.ts b/packages/react-pdf/src/shared/utils.ts index 5e5f660ac..159d800f5 100644 --- a/packages/react-pdf/src/shared/utils.ts +++ b/packages/react-pdf/src/shared/utils.ts @@ -1,5 +1,5 @@ import invariant from 'tiny-invariant'; -import warning from 'tiny-warning'; +import warning from 'warning'; import type { PDFPageProxy } from 'pdfjs-dist'; import type { PageCallback } from './types.js'; diff --git a/yarn.lock b/yarn.lock index 3ec255ca5..073b22f98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -936,6 +936,13 @@ __metadata: languageName: node linkType: hard +"@types/warning@npm:^3.0.0": + version: 3.0.3 + resolution: "@types/warning@npm:3.0.3" + checksum: 82c1235bd05d7f6940f80012404844e225d589ad338aa4585b231a2c8deacc695b683f4168757c82c10047b81854cbeaaeefd60536dd67bb48f8a65e20410652 + languageName: node + linkType: hard + "@typescript-eslint/eslint-plugin@npm:^6.0.0": version: 6.0.0 resolution: "@typescript-eslint/eslint-plugin@npm:6.0.0" @@ -3460,7 +3467,7 @@ __metadata: languageName: node linkType: hard -"loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": +"loose-envify@npm:^1.0.0, loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" dependencies: @@ -4543,6 +4550,7 @@ __metadata: "@testing-library/react": "npm:^14.0.0" "@types/node": "npm:*" "@types/react": "npm:*" + "@types/warning": "npm:^3.0.0" clsx: "npm:^2.0.0" cpy-cli: "npm:^5.0.0" eslint: "npm:^8.26.0" @@ -4559,10 +4567,10 @@ __metadata: react-dom: "npm:^18.2.0" rimraf: "npm:^3.0.0" tiny-invariant: "npm:^1.0.0" - tiny-warning: "npm:^1.0.0" typescript: "npm:^5.3.2" vitest: "npm:^1.0.2" vitest-canvas-mock: "npm:^0.2.2" + warning: "npm:^4.0.0" peerDependencies: "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5288,13 +5296,6 @@ __metadata: languageName: node linkType: hard -"tiny-warning@npm:^1.0.0": - version: 1.0.3 - resolution: "tiny-warning@npm:1.0.3" - checksum: ef8531f581b30342f29670cb41ca248001c6fd7975ce22122bd59b8d62b4fc84ad4207ee7faa95cde982fa3357cd8f4be650142abc22805538c3b1392d7084fa - languageName: node - linkType: hard - "tinybench@npm:^2.5.1": version: 2.5.1 resolution: "tinybench@npm:2.5.1" @@ -5680,6 +5681,15 @@ __metadata: languageName: node linkType: hard +"warning@npm:^4.0.0": + version: 4.0.3 + resolution: "warning@npm:4.0.3" + dependencies: + loose-envify: "npm:^1.0.0" + checksum: aebab445129f3e104c271f1637fa38e55eb25f968593e3825bd2f7a12bd58dc3738bb70dc8ec85826621d80b4acfed5a29ebc9da17397c6125864d72301b937e + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1"