Skip to content

[api-minor] Attempt to improve support for using the PDF.js builds with Vite #19733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2025

Conversation

Snuffleupagus
Copy link
Collaborator

Similar to Webpack there's apparently other bundlers that will not leave import-calls alone unless magic comments are used. Hence we extend the builder to also append /* @vite-ignore */ comments to import-calls, in order to attempt to improve support for using the PDF.js builds together with Vite.

This patch also renames __non_webpack_import__ to __raw_import__ since the functionality is no longer bundler-specific.

PLEASE NOTE: This patch is provided as-is, and it does not mean that the PDF.js project can/will provide official support for Vite.

…th Vite

Similar to Webpack there's apparently other bundlers that will not leave `import`-calls alone unless magic comments are used.
Hence we extend the builder to also append `/* @vite-ignore */` comments to `import`-calls, in order to attempt to improve support for using the PDF.js builds together with Vite.

This patch also renames `__non_webpack_import__` to `__raw_import__` since the functionality is no longer bundler-specific.

***PLEASE NOTE:*** This patch is provided as-is, and it does *not* mean that the PDF.js project can/will provide official support for Vite.
@Snuffleupagus Snuffleupagus added other release-blocker Blocker for the upcoming release labels Mar 28, 2025
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/15fa058066e6b0a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/15fa058066e6b0a/output.txt

Total script time: 0.86 mins

Published

@Snuffleupagus
Copy link
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/20011b242d969e1/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 2

Live output at: http://54.193.163.58:8877/ca4edb1bf11d431/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/20011b242d969e1/output.txt

Total script time: 29.66 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/ca4edb1bf11d431/output.txt

Total script time: 60.02 mins

@timvandermeij timvandermeij merged commit 1ccc82b into mozilla:master Mar 30, 2025
9 checks passed
@timvandermeij
Copy link
Contributor

Looks good to me; thanks!

@Snuffleupagus
Copy link
Collaborator Author

@timvandermeij As always, thanks for the reviews!

It might be a good idea to go back to our "usual" release schedule now (i.e. at the end of the month); would you have time to create a new release?
So far there's been one fairly serious regression found in the previous release, see issue #19676, and just recently a bunch of old soft-mask and path-rendering bugs have been fixed.

@timvandermeij
Copy link
Contributor

Yes, I'll create a new release later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other release-blocker Blocker for the upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants