npm react-pdf 10.0.0
v10.0.0

latest releases: 10.1.0, 10.0.1
2 months ago

See Upgrade guide from version 9.x to 10.x.

After more than a year since our last major release, we're thrilled to bring you React-PDF 10.

This update includes a major PDF.js upgrade, new features to make your life easier, improved stability, and some important breaking changes.

👀 Want to see exciting features more often? Consider sponsoring React-PDF.

❗️ = breaking change

What's new?

  • ❗️ Dropped CommonJS build, making the package ESM-only. Chances are you're not going to be affected by this change at all, as all common bundlers support ESM out of the box.
    • However, you may encounter issues running unit tests using Jest. Consider migrating to Vitest.
  • Updated PDF.js to 5.3.31.
    • Performance boosts: Key rendering routines refactored to cut memory usage and speed up page loading.
    • JPEG2000 downscaling: Automatic downscale of large JPEG2000 images during decoding to improve render times.
    • CMYK JPEG fix: Correct handling of the alpha channel when WebAssembly is disabled.
    • Viewer stability: Better handling of missing/invalid Content-Range headers.
    • API cleanup: Removed deprecated options, adopted parameter objects for core methods, and introduced private class fields for cleaner code.
  • Added support for scale prop in Document component, allowing you to set the scale for the entire document.
  • Reexported some commonly used types from pdfjs-dist, such as StructTreeNode, TextContent, TextItem, and TextMarkedContent, making it easier to work with PDF.js-provided types in your application.

What's changed?

  • ❗️ Dropped support for older browsers and Node.js versions. Please note that following PDF.js's lead, React-PDF will now guarantee to support only the latest versions of all major modern browsers.
  • Improved, cleaned up documentation.
  • We're now testing React-PDF with Vitest Browser Mode, ensuring better compatibility with modern browsers.

Don't miss a new react-pdf release

NewReleases is sending notifications on new releases.