refactor: replace @react-pdf/pdfkit fork with upstream pdfkit - #3509
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: c0b5727 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deletes the
@react-pdf/pdfkitfork (97 files, ~12k lines) and pointsrendererandfontat upstreampdfkit, pinned to exactly0.20.1since render relies on pdfkit internals. Upstream v0.20.0/v0.20.1 landed the last two prerequisites:doc.font()accepts pre-parsed fontkit Font instances, and Node ESM imports resolve to a real Node build (native fs/zlib, self-registering standard fonts), so the BROWSER-gatedregisterStdFontsin@react-pdf/fontstays as-is — rollup treeshakes the standard-font imports out of the server bundle (verified in built output). Also removes the fork from vitest/eslint config and updates CLAUDE.md. Full suite green (224 files / 2454 tests incl. visual snapshots), lint clean; the 9 pre-existingrendertypecheck errors inaddBookmarks.tsare unrelated (reproduce without pdfkit installed).Closes #2613
Fallout for open PRs:
packages/pdfkit/object.jsclamp now belongs in foliojs/pdfkit (the throw still exists upstream); therender/renderGlyphs.tshalf still applies here (seeunsupported number: …e+21on long documents with a fixed page-number element, lineHeight is multiplied by fontSize on every pagination pass #3452)🤖 Generated with Claude Code