Skip to content

[editor] Use the fit-curve package (issue 15004) #15142

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
Jul 7, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

Rather than including all of this external code in the PDF.js repository, we should be using the npm package instead.
Unfortunately this is slightly more complicated than you'd hope, since the fit-curve package (which is older) isn't directly compatible with modern JavaScript modules.
In particular, the following cases needed to be considered:

  • For the development viewer (i.e. gulp server) and the unit-tests, we thus need to build a fitCurve-bundle that can be directly imported.
  • For the actual PDF.js build-targets, we can slightly reduce the sizes by depending on the "raw" fit-curve source-code.
  • For the Node.js unit-tests, the fit-curve package can be used as-is.

Rather than including all of this external code in the PDF.js repository, we should be using the npm package instead.
Unfortunately this is slightly more complicated than you'd hope, since the `fit-curve` package (which is older) isn't directly compatible with modern JavaScript modules.
In particular, the following cases needed to be considered:
 - For the development viewer (i.e. `gulp server`) and the unit-tests, we thus need to build a fitCurve-bundle that can be directly `import`ed.
 - For the actual PDF.js build-targets, we can slightly reduce the sizes by depending on the "raw" `fit-curve` source-code.
 - For the Node.js unit-tests, the `fit-curve` package can be used as-is.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2022

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/94bafc0854d0b97/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/94bafc0854d0b97/output.txt

Total script time: 2.71 mins

Published

@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2022

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

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/6245336fd11487c/output.txt

@Snuffleupagus Snuffleupagus linked an issue Jul 7, 2022 that may be closed by this pull request
@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2022

From: Bot.io (Linux m4)


Failed

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

Total script time: 25.77 mins

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

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

@pdfjsbot
Copy link

pdfjsbot commented Jul 7, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/6245336fd11487c/output.txt

Total script time: 29.16 mins

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

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

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.

I tested in local dev environment and with a local build of Firefox and in both cases, it works well.
Thank you.

@calixteman
Copy link
Contributor

Rather than including all of this external code in the PDF.js repository, we should be using the npm package instead. Unfortunately this is slightly more complicated than you'd hope, since the fit-curve package (which is older) isn't directly compatible with modern JavaScript modules.

Would you mind to file a bug upstream in order to modernize the package ?

@Snuffleupagus
Copy link
Collaborator Author

Rather than including all of this external code in the PDF.js repository, we should be using the npm package instead. Unfortunately this is slightly more complicated than you'd hope, since the fit-curve package (which is older) isn't directly compatible with modern JavaScript modules.

Would you mind to file a bug upstream in order to modernize the package ?

Yes, it's already on my TODO list :-)

@Snuffleupagus Snuffleupagus merged commit 7f160d4 into mozilla:master Jul 7, 2022
@Snuffleupagus Snuffleupagus deleted the fitCurve branch July 7, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Editor] Remove external/fit_curve and use the npm package
3 participants