-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Remove SystemJS usage from the development viewer and the unit-tests #12527
Remove SystemJS usage from the development viewer and the unit-tests #12527
Conversation
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/cd3297cbd7c6178/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/cd3297cbd7c6178/output.txt Total script time: 3.98 mins Published |
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/a0cfe7c2310bddf/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/a0cfe7c2310bddf/output.txt Total script time: 3.41 mins
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with these comments addressed. Nice to see yet another part of SystemJS go!
…xport` statements While the *built* `pdf.worker.js` file still works correctly with these changes, despite these two files being excluded by Babel[1], the development viewer does not because of issues with SystemJS[2] and/or its Babel-plugin (both of which are old). Furthermore, note also that excluding these two files from Babel-processing isn't *generally* necessary since e.g. the `gulp mozcentral` command works anyway. The explanation is rather that it's actually the source-map generation which fails for these huge sequences when building the `pdf.worker.js` file. However, not using standard `import`/`export` statements in all files means we also need to use SystemJS when e.e. running the unit-tests. This is very unfortunate, since SystemJS (or its old Babel-version) doesn't support modern ECMAScript features such as e.g. optional chaining and nullish coalescing. Unfortunately it also seems that https://bugzilla.mozilla.org/show_bug.cgi?id=1247687, which tracks the implementation of worker-modules in Firefox, has stalled since there hasn't been any updates for six months now. To hopefully address all of the above, this patch is the first in a series that attempts to further reduce our reliance on SystemJS. --- [1] The only difference being how the dependencies are handled, in the Webpack-bundled file. [2] Parsing takes way too long and consumes too much memory, thus rendering the development viewer essentially unusable.
…ormat `src/core/{glyphlist, unicode}.js` *Please note:* Once https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 is implemented, and we've removed SystemJS completely, this entire patch can (and even should) be reverted. This is similar to the existing `getLookupTableFactory` helper function, but is implemented as outlined in issue 6774. The re-formatting of the tables were done automatically, by using find-and-replace with regular expressions. For reasons that I don't even pretend to understand, using this particular structure for these *very* long lookup tables allow SystemJS to process the files correctly/quickly and the development viewer thus works as intended.
…ding of `pdf.worker.js`, when source-maps are enabled This produces a slightly smaller built `pdf.worker.js` file, for e.g. the `gulp mozcentral` build-target.
…port` This removes the last SystemJS usage from both the API and the default viewer.
Since we no longer use SystemJS to load the unit-tests, there's now nothing that prevents us from using optional chaining and nullish coalescing in the `src/display/` directory.
68d6c7c
to
c293fc2
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/ae70f6cbfa48198/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/ae70f6cbfa48198/output.txt Total script time: 24.81 mins
Image differences available at: http://54.67.70.0:8877/ae70f6cbfa48198/reftest-analyzer.html#web=eq.log |
…hared/` folder Given that this code is used on the worker-thread, where SystemJS is still used during development, we need to (for now) handle this folder the same way as the `src/core/` one.
Nice work! |
Please refer to the individual commit messages for additional details.
It's highly recommended to review this one commit at a time, perhaps also ignoring whitespace-only changes where appropriate.
The second commit is probably more-or-less impossible to actually review, so we're probably going to have to trust our test-suite and that I wrote proper regular expressions.
This still leaves SystemJS usage in the font-tests, however fixing that will require larger changes and it thus seemed best to defer that to later since this PR is already very large.