Skip to content

Remove most build-time require-calls from the src/display/-folder #16698

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 2 commits into from
Jul 18, 2023

Conversation

Snuffleupagus
Copy link
Collaborator

By leveraging import maps we can get rid of most of the remaining require-calls in the src/display/-folder, since we should strive to use modern import-statements wherever possible.
The only remaining cases are Node.js-specific dependencies, since those seem very difficult to convert unless we start producing a bundle specifically for Node.js environments.

@Snuffleupagus Snuffleupagus marked this pull request as draft July 16, 2023 10:15
@Snuffleupagus Snuffleupagus force-pushed the src-display-rm-require branch from 5205bad to 39b6618 Compare July 16, 2023 10:18
@mozilla mozilla deleted a comment from moz-tools-bot Jul 16, 2023
@mozilla mozilla deleted a comment from moz-tools-bot Jul 16, 2023
@Snuffleupagus Snuffleupagus marked this pull request as ready for review July 16, 2023 10:25
@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/eeb0e2a81af8612/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/eeb0e2a81af8612/output.txt

Total script time: 1.33 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/adc9fd9d9b6af13/output.txt

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

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/adc9fd9d9b6af13/output.txt

Total script time: 25.53 mins

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

Image differences available at: http://54.241.84.105:8877/adc9fd9d9b6af13/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/fb6a9af6cb633d6/output.txt

Total script time: 36.71 mins

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

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

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Jul 16, 2023

I don't know how to fix the gulp typestest failure (the initial attempt broke gulp jsdoc instead), and given how many hours I've spent (or wasted, depending on perspective) previously on type-definition related problems I really don't feel like doing that here as well.
Since we agreed, when landing the type-generation, that we'd not let the type-definitions hold back general PDF.js development I'd suggest either of the following solutions:

  • Temporarily stop running gulp typestest during the tests, and file a follow-up issue about re-enabling it; we'd really need a type-script user to help out here.
  • Just remove the SVG back-end, since it's already causing other trouble with the build-system and given that it's been deprecated for a year now.

By leveraging import maps we can get rid of *most* of the remaining `require`-calls in the `src/display/`-folder, since we should strive to use modern `import`-statements wherever possible.
The only remaining cases are Node.js-specific dependencies, since those seem very difficult to convert unless we start producing a bundle *specifically* for Node.js environments.
@Snuffleupagus Snuffleupagus force-pushed the src-display-rm-require branch from 39b6618 to d022912 Compare July 17, 2023 17:47
@calixteman
Copy link
Contributor

I don't know how to fix the gulp typestest failure (the initial attempt broke gulp jsdoc instead), and given how many hours I've spent (or wasted, depending on perspective) previously on type-definition related problems I really don't feel like doing that here as well. Since we agreed, when landing the type-generation, that we'd not let the type-definitions hold back general PDF.js development I'd suggest either of the following solutions:

* Temporarily stop running `gulp typestest` during the tests, and file a follow-up issue about re-enabling it; we'd really need a type-script user to help out here.

* Just remove the SVG back-end, since it's already causing other trouble with the build-system and given that it's been deprecated for a year now.

Maybe we should remove both... but maybe it's a bit too much.
We really need to have someone with some good skills to help us to fix such issues, that said if nobody can help then I'm really in favor of removing the ts tests until we find someone.
@codehippie1, could you help us to fix the type issues we've ?

This is necessary to unblock the previous patch, which removes more build-time `require`-calls from the `src/display/` folder.
@Snuffleupagus
Copy link
Collaborator Author

To avoid blocking this patch unnecessarily I went for the simpler approach of just disabling the test for now.

@Snuffleupagus Snuffleupagus requested a review from calixteman July 18, 2023 07:15
@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/1eda25e75dc43f8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/1eda25e75dc43f8/output.txt

Total script time: 1.43 mins

Published

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

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.

3 participants