Skip to content
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

Use a standard export statement in the web/pdfjs.js file #17052

Merged
merged 1 commit into from Oct 1, 2023

Conversation

Snuffleupagus
Copy link
Collaborator

This removes the only remaining old and non-standard handling of exports in the web/-folder, since some initial attempts at outputting JavaScript modules in the builds have identified this file as a potential problem.
While this uses a hard-coded list, for overall simplicity, I don't believe that that's a big problem since:

  • Generating this file automatically would require a bunch more parsing every single time that the library is built.
  • The official API-surface doesn't change often enough for this to really impede development in any significant way.
  • The added unit-test helps ensure that this list cannot accidentally become outdated.

This removes the only remaining old and non-standard handling of exports in the `web/`-folder, since some initial attempts at outputting JavaScript modules in the builds have identified this file as a potential problem.
While this uses a hard-coded list, for overall simplicity, I don't believe that that's a big problem since:
 - Generating this file automatically would require a bunch more parsing *every single time* that the library is built.
 - The official API-surface doesn't change often enough for this to really impede development in any significant way.
 - The added unit-test helps ensure that this list cannot accidentally become outdated.
@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/518d02d79a59a0d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/518d02d79a59a0d/output.txt

Total script time: 1.43 mins

Published

@Snuffleupagus
Copy link
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/4d8a6174e51e460/output.txt

@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/30b9b37432b164b/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/30b9b37432b164b/output.txt

Total script time: 27.65 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 18
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/30b9b37432b164b/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/4d8a6174e51e460/output.txt

Total script time: 28.22 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 26

Image differences available at: http://54.193.163.58:8877/4d8a6174e51e460/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 71bffcc into mozilla:master Oct 1, 2023
3 checks passed
@timvandermeij
Copy link
Contributor

Thanks!

@Snuffleupagus Snuffleupagus deleted the web-pdfjsLib-export branch October 1, 2023 10:42
@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Oct 1, 2023

Note that I have WIP patches that convert our builds to output JavaScript modules, and to my surprise this actually seems to work quite well in browsers; see master...Snuffleupagus:pdf.js:output-modules
The built viewer seems to work just as before and all test-suites (unit, reference, and integration) also seem to pass as intended.

However, as expected, getting Node.js to work is turning out to be more of a challenge unfortunately :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants