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

Polyfill structuredClone with core-js (PR 13948 follow-up) #14392

Merged
merged 3 commits into from
Jan 27, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Dec 22, 2021

This allows us to remove the manually implemented structuredClone polyfill, thus reducing the maintenance burden for the LoopbackPort class; refer to https://github.com/zloirock/core-js#structuredclone

Please note: While structuredClone support landed already in Firefox 94, Google Chrome only added it in version 98 (currently in Beta). However, given that the LoopbackPort will only be used together with fake workers in browsers this shouldn't be too much of a problem.[1]
For Node.js environments, where fake workers are unfortunately necessary, using a legacy/-build is already required which thus guarantees that the structuredClone polyfill is available.

Also, the patch updates core-js to the latest version since that one includes structuredClone improvements; please see https://github.com/zloirock/core-js/releases/tag/v3.20.3


[1] Given that we only support browsers with proper worker support, if fake workers are being used that essentially indicates a configuration problem/error.

@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@Snuffleupagus Snuffleupagus force-pushed the polyfill-structuredClone branch from ed6f055 to 1e91551 Compare December 28, 2021 19:48
@Snuffleupagus Snuffleupagus force-pushed the polyfill-structuredClone branch 2 times, most recently from 5160659 to 414eaea Compare January 14, 2022 11:37
@Snuffleupagus Snuffleupagus force-pushed the polyfill-structuredClone branch from 414eaea to bdcb8d3 Compare January 18, 2022 12:10
@mozilla mozilla deleted a comment from pdfjsbot Jan 18, 2022
@mozilla mozilla deleted a comment from pdfjsbot Jan 18, 2022
@mozilla mozilla deleted a comment from pdfjsbot Jan 18, 2022
@mozilla mozilla deleted a comment from pdfjsbot Jan 18, 2022
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/22f4af683838d4e/output.txt

@pdfjsbot
Copy link

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

@Snuffleupagus Snuffleupagus marked this pull request as ready for review January 18, 2022 12:35
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

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

Total script time: 22.57 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/22f4af683838d4e/output.txt

Total script time: 60.00 mins

@mozilla mozilla deleted a comment from pdfjsbot Jan 19, 2022
@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/58f997861b35adf/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/58f997861b35adf/output.txt

Total script time: 60.00 mins

@Snuffleupagus Snuffleupagus force-pushed the polyfill-structuredClone branch from bdcb8d3 to 8e66d5b Compare January 19, 2022 11:16
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/5272a7d9ed34645/output.txt

Total script time: 22.91 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

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

Total script time: 23.73 mins

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

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

src/shared/compatibility.js Outdated Show resolved Hide resolved
gulpfile.js Show resolved Hide resolved
@mozilla mozilla deleted a comment from pdfjsbot Jan 24, 2022
@mozilla mozilla deleted a comment from pdfjsbot Jan 24, 2022
@mozilla mozilla deleted a comment from pdfjsbot Jan 24, 2022
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/32281eb30afd1d5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

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

Total script time: 23.66 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/32281eb30afd1d5/output.txt

Total script time: 23.70 mins

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

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

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

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

r=me with the final comment addressed and a follow-up issue created for re-enabling Chrome on the Windows bot; thanks!

package.json Outdated Show resolved Hide resolved
Note in particular https://github.com/puppeteer/puppeteer/releases/tag/v13.1.0 which includes an update to Chromium 98, which adds support for `structuredClone` in the browser.
This allows us to remove the manually implemented `structuredClone` polyfill, thus reducing the maintenance burden for the `LoopbackPort` class; refer to https://github.com/zloirock/core-js#structuredclone

*Please note:* While `structuredClone` support landed already in Firefox 94, Google Chrome only added it in version 98 (currently in Beta). However, given that the `LoopbackPort` will only be used together with *fake workers* in browsers this shouldn't be too much of a problem.[1]
For Node.js environments, where *fake workers* are unfortunately necessary, using a `legacy/`-build is already required which thus guarantees that the `structuredClone` polyfill is available.

Also, the patch updates core-js to the latest version since that one includes `structuredClone` improvements; please see https://github.com/zloirock/core-js/releases/tag/v3.20.3

---
[1] Given that we only support browsers with proper worker support, if *fake workers* are being used that essentially indicates a configuration problem/error.
… bot

Either the latest Chromium update, the latest Puppeteer update, or a combination of them both are now causing the Windows bot to timeout during the browser-tests.
To unblock both the updates and other improvements (i.e. the `structuredClone` polyfill), let's simply disable the problematic configuration for now since this a Mozilla project after all.
@Snuffleupagus Snuffleupagus force-pushed the polyfill-structuredClone branch from fcbd839 to d476186 Compare January 27, 2022 20:11
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/8839b6e13915d40/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/6fb540e5cf13d51/output.txt

Total script time: 22.98 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/8839b6e13915d40/output.txt

Total script time: 23.50 mins

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

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

@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/9d8007d898e46bd/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/9d8007d898e46bd/output.txt

Total script time: 2.84 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

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

Total script time: 5.46 mins

  • Unit Tests: Passed

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