Commit Graph

327 Commits

Author SHA1 Message Date
Tim van der Meij
dacd61fede
Update dependencies to the most recent versions
There are two notable changes here:

- `dommatrix` is a major version upgrade, but looking through the commit
  history of their `package.json` file at https://github.com/thednp/dommatrix/commits/master/package.json
  (due to the lack of a changelog) I couldn't find any breaking changes.
- `es-module-shims` is a regular update, but it was previously pinned
  for causing intermittent breakage when running the unit tests in a
  browser manually. Fortunately this cannot be reproduced anymore with
  the most recent version, so we can also put the caret back now.
2022-05-01 13:08:00 +02:00
Jonas Jenwald
c727fde767 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2022-04-17 10:23:09 +02:00
Jonas Jenwald
49d1121f3c Update npm packages 2022-04-17 10:15:10 +02:00
Jonas Jenwald
b996e107c3 Update core-js to allow removing a structuredClone work-around
Because of a bug in previous `core-js` versions, which caused an Error to be thrown if its `structuredClone` polyfill was called with an *explicit* `null`/`undefined` transfer-parameter, the `LoopbackPort`-class contained a work-around.
In the latest `core-js` version this has been fixed, and we can thus simplify our code ever so slightly; please see https://github.com/zloirock/core-js/releases/tag/v3.22.0
2022-04-15 22:12:02 +02:00
Tim van der Meij
c04373dda2
Update dependencies to the most recent versions 2022-04-02 19:43:34 +02:00
Jonas Jenwald
c9f262c480 Add a <dialog> polyfill for the generic-legacy build
Please note that this patch is purposely quite basic, e.g. it doesn't add the polyfill-CSS in order to simplify the build process, and things such as `::backdrop` thus isn't working.
However, this patch does ensure that older browsers can at least still *access* all of the previous overlays and that things like e.g. opening of password-protected documents respectively printing still works.
2022-03-28 11:36:31 +02:00
Jonas Jenwald
73d2ddac0d Update npm packages
Note that the Prettier update made it possible to move a couple of comments after `default:`-cases back to their original/intended positions, please see https://prettier.io/blog/2022/03/16/2.6.0.html
2022-03-20 10:59:13 +01:00
Jonas Jenwald
502fd7c80d Stop polyfilling the CSS calc functionality
At this point in time, all browsers that we support have native support for CSS variables; please see https://developer.mozilla.org/en-US/docs/Web/CSS/calc()#browser_compatibility and https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support

We can also remove the hack introduced back in PR 11567, which was only necessary to work-around an IE 11 specific bug.
2022-03-19 14:03:19 +01:00
Jonas Jenwald
c99d558646 Replace dir-dependent margin/margin-left/margin-right with logical properties
*Please note:* This is another step in what will, time permitting, become a series of patches to simplify/modernize the viewer CSS.

Rather than having to manually specify ltr/rtl-specific margin-values in the CSS, we can use logical margin instead (and similar for some related left/right occurrences).
These logical properties depend on, among other things, the direction of the HTML document which we *always* specify in the viewer.

Given that most of these logical CSS properties are fairly new, and that cross-browser support is thus somewhat limited (see below), we need to use a couple of PostCSS plugins (see below) in order to support this in the GENERIC viewer.

 - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-start#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-end#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end#browser_compatibility

---

 - https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical
 - https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-dir-pseudo-class
2022-03-19 13:35:24 +01:00
Jonas Jenwald
6f600befdd Update TypeScript to version 4.6.2 and work-around stricter type checks
I'm guessing that we're now running into the class-related improvements mentioned in https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/#target-es2022
To unblock this update, and any future ones, this patch simply tweaks the JSDocs to get `gulp typestest` to run without errors.
2022-03-07 11:55:17 +01:00
Jonas Jenwald
b875f13b4f Update npm packages 2022-03-06 10:45:23 +01:00
Jonas Jenwald
896255e7bf Add the caniuse-lite package
Since the Autoprefixer plugin indirectly depends on this, it seems like a good idea to add this as a direct dependency in the PDF.js project to hopefully avoid having to manually update `caniuse-lite` in the future; see https://github.com/browserslist/browserslist#browsers-data-updating

Also, slightly tweaks the Autoprefixer config for GENERIC-builds of the PDF.js library; note that this change doesn't affect the contents of the *built* `web/viewer.js` file.
2022-02-27 11:39:33 +01:00
Jonas Jenwald
55b78bb240 Update npm packages 2022-02-20 10:08:23 +01:00
dependabot[bot]
a26ac162b6
Bump simple-get from 3.1.0 to 3.1.1
Bumps [simple-get](https://github.com/feross/simple-get) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/feross/simple-get/releases)
- [Commits](https://github.com/feross/simple-get/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: simple-get
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-06 12:14:16 +00:00
Jonas Jenwald
38f6e675bc Update the @javascript-obfuscator/escodegen package to the latest version
The only changes are support for [Class static initialization blocks](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Class_static_initialization_blocks), and the diff for the `node_modules\@javascript-obfuscator\escodegen\escodegen.js` file contains only:
```diff
@@ -1506,6 +1506,13 @@
             return result;
         },

+        StaticBlock: function (stmt, flags) {
+            return [
+                'static' + space,
+                this.BlockStatement(stmt, flags)
+            ];
+        },
+
         ThrowStatement: function (stmt, flags) {
             return [join(
                 'throw',
```
2022-02-06 11:26:07 +01:00
Jonas Jenwald
5f7b96c957 Update npm packages 2022-02-06 11:24:14 +01:00
Jonas Jenwald
6b9cc24d49
Merge pull request #14508 from mozilla/dependabot/npm_and_yarn/nanoid-3.2.0
Bump nanoid from 3.1.30 to 3.2.0
2022-01-28 09:40:13 +01:00
dependabot[bot]
244efd9353
Bump nanoid from 3.1.30 to 3.2.0
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-27 21:38:28 +00:00
dependabot[bot]
1c08f55d3b
Bump copy-props from 2.0.4 to 2.0.5
Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/gulpjs/copy-props/releases)
- [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5)

---
updated-dependencies:
- dependency-name: copy-props
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-27 21:37:54 +00:00
Jonas Jenwald
7cc761a8c0 Polyfill structuredClone with core-js (PR 13948 follow-up)
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.
2022-01-27 21:11:42 +01:00
Jonas Jenwald
2fcd07f400 Update Puppeteer to version 13.1.2
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.
2022-01-27 21:10:46 +01:00
Jonas Jenwald
1ed27965d1 Update npm packages 2022-01-23 10:58:15 +01:00
Jonas Jenwald
457ff0d54a Update Jasmine to version 4
For the unit-tests that were updated in this patch, note that I settled on simply using `toEqual` comparisons rather than updating the custom matchers (since those don't seem necessary any more).

Please refer to the following resources for additional information:
 - https://github.com/jasmine/jasmine/blob/main/release_notes/4.0.0.md
 - https://github.com/jasmine/jasmine-npm/blob/main/release_notes/4.0.0.md
 - https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0
2022-01-09 11:32:34 +01:00
Jonas Jenwald
38e574f1d5 Update npm packages 2022-01-09 10:49:21 +01:00
Jonas Jenwald
69f14b1ee9 Update npm packages 2021-12-26 11:09:29 +01:00
Jonas Jenwald
e0dba504d2 Fix broken/missing JSDocs and typedefs, to allow updating TypeScript to the latest version (issue 14342)
This patch circumvents the issues seen when trying to update TypeScript to version `4.5`, by "simply" fixing the broken/missing JSDocs and `typedef`s such that `gulp typestest` now passes.
As always, given that I don't really know anything about TypeScript, I cannot tell if this is a "correct" and/or proper way of doing things; we'll need TypeScript users to help out with testing!

*Please note:* I'm sorry about the size of this patch, but given how intertwined all of this unfortunately is it just didn't seem easy to split this into smaller parts.
However, one good thing about this TypeScript update is that it helped uncover a number of pre-existing bugs in our JSDocs comments.
2021-12-15 23:14:25 +01:00
Tim van der Meij
da2b3dd3be
Upgrade to Puppeteer 13.0.0 2021-12-12 19:52:11 +01:00
Tim van der Meij
2757000bb2
Fix some dependency vulnerabilities reported by npm audit
This is done automatically using the `npm audit fix` command.
2021-12-11 19:44:52 +01:00
Tim van der Meij
d3d8141372
Update packages to the most recent versions 2021-12-11 19:44:48 +01:00
Tim van der Meij
d5b5b665e4
Upgrade to Puppeteer 12 2021-11-28 19:24:11 +01:00
Tim van der Meij
96bb3c6217
Convert package-lock.json to lock file version 2
Since NPM 7, which is over a year old now since it released in October
2020, NPM automatically transforms lock files from version 1 to version
2. In the NPM 7 release notes they reported:

"One change to take note of is the new lockfile format, which is
backwards compatible with npm 6 users. The lockfile v2 unlocks the
ability to do deterministic and reproducible builds to produce a
package tree."

Not only is this change backwards compatible (so older versions of NPM
will still be able to install everything as expected), reproducability
is also a nice property to have and modern NPM versions will otherwise
constantly do the conversion anyway, causing contributors to explicitly
have to revert the change. Therefore, I believe we should do this now
since it doesn't break backwards compatibility for consumers of this
file. It only means that producers of this file (i.e., us contributors)
need to use at least NPM 7 or higher (as of writing NPM 8 is even
available). According to https://nodejs.org/en/download/releases/ this
means contributors should at least run Node.js 15.0.0, while 17.1.0 is
the most recent as of writing, so to me that sounds reasonable to ask.
2021-11-28 19:23:25 +01:00
Jonas Jenwald
d62f847db2 Update Stylelint to version 14 (along with related packages)
Based on https://github.com/stylelint/stylelint/blob/14.0.0/docs/migration-guide/to-14.md none of the changes look directly relevant for us.
2021-11-28 12:36:16 +01:00
Jonas Jenwald
fdf3f03985 Update the eslint-plugin-unicorn package to the latest version
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v39.0.0
2021-11-28 11:14:02 +01:00
Jonas Jenwald
0c301dfa8b Update the dommatrix package to the latest version 2021-11-28 11:14:02 +01:00
Jonas Jenwald
cfc55b044e Update npm packages 2021-11-28 11:13:58 +01:00
Jonas Jenwald
04bdc26d3a Update the eslint-plugin-unicorn package to the latest version 2021-11-14 10:27:29 +01:00
Jonas Jenwald
1dd74efb0f Update the eslint-plugin-no-unsanitized package to the latest version 2021-11-14 10:24:41 +01:00
Jonas Jenwald
bd1e140e2a Update the dommatrix package to the latest version 2021-11-14 10:20:54 +01:00
Jonas Jenwald
9f6d37263c Update npm packages 2021-11-14 10:17:30 +01:00
Jonas Jenwald
a8abdfb3bb Update npm packages 2021-10-31 09:38:18 +01:00
Tim van der Meij
0aaa4e3dbe
Merge pull request #14156 from Snuffleupagus/escodegen-fork
Add support for modern ECMAScript `class` features
2021-10-23 19:12:44 +02:00
Jonas Jenwald
2c27f54e4e Update the browserslist database
Following https://github.com/browserslist/browserslist#browsers-data-updating, since very recently warnings started to appear when running various gulp-tasks.
2021-10-23 10:07:18 +02:00
Jonas Jenwald
00f8fab8a5 Add support for modern ECMAScript class features
With ESLint 8 we should now finally be able to start using modern `class` features, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

However, while both ESLint and Acorn now support this, it unfortunately turns out that Escodegen (which we use during building) still lack the necessary support. Looking at https://github.com/estools/escodegen there's not been any updates since last year, and there's also open PRs adding support for these new `class` features.

To avoid blocking usage of these `class` features in the PDF.js code-base, in particular *private* fields/methods, this patch thus proposes that we (hopefully temporarily) switch to an `escodegen` fork that has the necessary support; please see https://www.npmjs.com/package/@javascript-obfuscator/escodegen

While I have no reason to doubt the security of the `escodegen` fork, this patch nonetheless pins the version number. Furthermore, I've also diffed the output of the two `.js`-files in this forked package against the original files without finding anything that looks immediately "dangerous".
2021-10-22 22:01:17 +02:00
Jonas Jenwald
b0affcd87c Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2021-10-17 11:47:09 +02:00
Jonas Jenwald
a712b601ee Update ESLint to version 8
Please refer to https://eslint.org/docs/8.0.0/user-guide/migrating-to-8.0.0

Given that this is a major version increase it also required updating ESLint plugins, see https://github.com/sindresorhus/eslint-plugin-unicorn/releases and https://github.com/jrdrg/eslint-plugin-sort-exports/releases
2021-10-17 11:42:09 +02:00
Jonas Jenwald
7746732934 Update the stylelint-config-prettier package to the latest version
Please refer to https://github.com/prettier/stylelint-config-prettier/releases
2021-10-17 11:37:40 +02:00
Jonas Jenwald
decd585579 Update npm packages 2021-10-17 11:33:19 +02:00
Jonas Jenwald
de18c35c9b Update the es-module-shims package to the latest version
Please refer to https://github.com/guybedford/es-module-shims/blob/main/CHANGELOG.md
2021-10-03 08:30:20 +02:00
Jonas Jenwald
ff271f2cff Update npm packages 2021-10-03 08:30:18 +02:00
Jonas Jenwald
a09d7797fb Update the eslint-plugin-unicorn package to the latest version
Please refer to https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v36.0.0
2021-09-19 09:39:56 +02:00
Jonas Jenwald
57734b11f6 Update the es-module-shims package to the latest version
Please refer to https://github.com/guybedford/es-module-shims/blob/main/CHANGELOG.md
2021-09-19 09:33:05 +02:00
Jonas Jenwald
8679bb7aab Update npm packages 2021-09-19 09:31:42 +02:00
Jonas Jenwald
4bd1d51970 Update the webpack-stream package to the latest version 2021-09-05 09:58:59 +02:00
Jonas Jenwald
adb17bafa4 Update the needle package to the latest version 2021-09-05 09:56:50 +02:00
Jonas Jenwald
6adecdda80 Update the eslint-plugin-prettier package to the latest version
Please refer to https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v400-2021-08-30
2021-09-05 09:54:18 +02:00
Jonas Jenwald
91bc559f3c Update npm packages 2021-09-05 09:47:57 +02:00
dependabot[bot]
e1c2151a03
Bump tar from 4.4.15 to 4.4.19
Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.15...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 16:39:41 +00:00
Jonas Jenwald
a24702b942 Update npm packages 2021-08-22 10:38:52 +02:00
dependabot[bot]
91ef2e19aa
Bump path-parse from 1.0.5 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 18:23:47 +00:00
Jonas Jenwald
d0c87e13ce Update the eslint-plugin-unicorn package to the latest version
Also enables the `no-useless-spread` rule, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md, which didn't require any code changes.
2021-08-08 10:49:57 +02:00
Jonas Jenwald
014d00e4fb Update npm packages 2021-08-08 10:45:36 +02:00
dependabot[bot]
81a6ade590
Bump tar from 4.4.8 to 4.4.15
Bumps [tar](https://github.com/npm/node-tar) from 4.4.8 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.8...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-03 19:41:11 +00:00
Jonas Jenwald
2a667b92d8 Update npm packages 2021-07-25 10:24:10 +02:00
Jonas Jenwald
46b6e57b7c Update the eslint-plugin-unicorn package to the latest version 2021-07-11 12:21:29 +02:00
Jonas Jenwald
689e5c54a7 Update the es-module-shims package to the latest version 2021-07-11 12:16:47 +02:00
Jonas Jenwald
a926976e4d Update npm packages 2021-07-11 12:14:47 +02:00
Jonas Jenwald
e4adde3462 Remove the version field from the package.json file
According to https://docs.npmjs.com/cli/v7/configuring-npm/package-json#version, the "version" field is not required[1]:
> If you don't plan to publish your package, the name and version fields are optional.

Hence it shouldn't be necessary to have a "dummy" `version` field in the `package.json` file, and it seems quite unfortunate to have an essentially meaningless entry in that file.[2]
Furthermore, I'd even go as far as suggesting that it's actually doing more harm than good in practice, since it's not uncommon for people to open issues where they simply quote the `package.json`-entry when filling out the ISSUE_TEMPLATE thus causing confusion as to which *exact* version is actually used.

Unless I'm misremembering, I believe that the only reason for adding the `version` field was that is was necessary in order for things to work back when testing was run on Travis.
Now we're using GitHub Actions instead, where things seem to work just find even without a `version` field; hence why I think it makes sense to remove this.

---
[1] Please note that this patch doesn't affect the `pdfjs-dist` package, since the `package.json` file used there is created in `gulpfile.js` during building.

[2] Trying to, automatically, update the `version` field on *every* commit really doesn't seem worth it to me.
2021-07-03 16:46:28 +02:00
Jonas Jenwald
b146c597b0 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2021-06-27 10:29:39 +02:00
Jonas Jenwald
e79ed27f2f Update the es-module-shims package to the latest version 2021-06-27 10:27:02 +02:00
Jonas Jenwald
f03d5b3ee7 Update npm packages 2021-06-27 10:25:40 +02:00
dependabot[bot]
f40c59c7b4
Bump color-string from 1.5.3 to 1.5.5
Bumps [color-string](https://github.com/Qix-/color-string) from 1.5.3 to 1.5.5.
- [Release notes](https://github.com/Qix-/color-string/releases)
- [Changelog](https://github.com/Qix-/color-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Qix-/color-string/commits/1.5.5)

---
updated-dependencies:
- dependency-name: color-string
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 07:59:39 +00:00
Jonas Jenwald
1cfaf07b82 Add basic linting of JSON files using eslint-plugin-json
By adding basic linting of JSON files, we can ensure that they're actually valid and prevent e.g. test-failures caused by *accidental* errors when editing the `test/test_manifest.json` file (something that I've done *many* times myself).

For now this simply uses the `recommended` configuration, but we can obviously tweak this later if/when needed. Please find additional information at https://github.com/azeemba/eslint-plugin-json
2021-06-15 12:19:01 +02:00
Jonas Jenwald
014148b28a Update the eslint-plugin-unicorn package to the latest version 2021-06-13 10:35:58 +02:00
Jonas Jenwald
99dc7af590 Update npm packages 2021-06-13 09:59:44 +02:00
Jonas Jenwald
26011c65f4 Add a DOMMatrix polyfill for Node.js environments (PR 13361 follow-up)
Given that `DOMMatrix` is, unsurprisingly, not supported in Node.js the `createMatrix` helper function in `src/display/pattern_helper.js` is most likely broken in Node.js environments. It will obviously try to fallback to the `DOMSVGFactory`, however that isn't intended for Node.js usage and errors will be thrown.

Rather than trying to implement a `NodeSVGFactory`, this patch takes the easier route of just adding a `DOMMatrix` polyfill using: https://www.npmjs.com/package/dommatrix
This isn't done only for simplicity, but it'll become necessary anyway since the `createMatrix` helper function is only temporary and will be removed in the future.
2021-06-10 21:08:23 +02:00
dependabot[bot]
0fad999fc9
Bump trim-newlines from 3.0.0 to 3.0.1
Bumps [trim-newlines](https://github.com/sindresorhus/trim-newlines) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sindresorhus/trim-newlines/releases)
- [Commits](https://github.com/sindresorhus/trim-newlines/commits)

---
updated-dependencies:
- dependency-name: trim-newlines
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 08:11:20 +00:00
Jonas Jenwald
bc17ac5a2f Update Puppeteer to version 10
Hopefully the updated Chromium-version might help reduce the number of intermittent test failures.

Please find additional information at https://github.com/puppeteer/puppeteer/releases/tag/v10.0.0
2021-06-01 15:11:02 +02:00
dependabot[bot]
03d826affa
Bump ws from 7.4.5 to 7.4.6
Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-30 10:58:18 +00:00
Jonas Jenwald
4ef538b19a Update the yargs package to the latest version 2021-05-30 07:51:30 +02:00
Jonas Jenwald
e7ab2d6eb5 Update the eslint-plugin-unicorn package to the latest version 2021-05-30 07:50:12 +02:00
Jonas Jenwald
fd6d60935b Update npm packages 2021-05-30 07:43:13 +02:00
dependabot[bot]
4f853f7669
Bump browserslist from 4.16.3 to 4.16.6
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.16.3...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 20:40:00 +00:00
Jonas Jenwald
c93958f901 Update npm packages 2021-05-16 10:05:58 +02:00
dependabot[bot]
83aa847e21
Bump hosted-git-info from 2.6.0 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.6.0 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.6.0...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 18:43:06 +00:00
dependabot[bot]
e361341449
Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 10:54:18 +00:00
Jonas Jenwald
01e01e6389 Update the eslint-plugin-unicorn package to the latest version 2021-05-02 09:31:44 +02:00
Jonas Jenwald
d1a18e84ea Update npm packages 2021-05-02 09:30:09 +02:00
Jonas Jenwald
8538cdf845
Update Puppeteer to version 9 (#13282)
* Update Puppeteer to version 9

Hopefully the updated Chromium-version might help reduce the number of intermittent test failures.

Please find additional information at https://github.com/puppeteer/puppeteer/releases/tag/v9.0.0

* Update the `eslint-plugin-sort-exports`/`eslint-plugin-unicorn"` packages to their latest versions

Both of these ESLint plugins have increased their version numbers, however `npm update` doesn't handle this automatically.

https://www.npmjs.com/package/eslint-plugin-sort-exports
https://www.npmjs.com/package/eslint-plugin-unicorn
2021-04-22 11:35:16 +02:00
Jonas Jenwald
cfa42cb0f2 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2021-04-18 11:05:52 +02:00
Jonas Jenwald
fc007028a2 Update npm packages 2021-04-18 11:02:42 +02:00
Jonas Jenwald
c988712bc5 Update the yargs package to the latest version
While I wasn't able to figure out *exactly* why the old format didn't work, re-factoring the `parseOptions` function to use `yargs` differently "just worked" so that's hopefully good enough here.
With these changes everything related to a *particular* option now appears in one place, rather than being spread out, which aids readability in my opinion. Also, the options are now sorted alphabetically, to make it easier to find a particular one.

https://www.npmjs.com/package/yargs
2021-04-16 12:04:35 +02:00
Tim van der Meij
eddb9087a1
Merge pull request #13240 from Snuffleupagus/update-eslint-helpers
Update `eslint-config-prettier`/`eslint-plugin-unicorn` packages to their latest versions
2021-04-14 20:36:45 +02:00
Tim van der Meij
b9d87b8c0d
Merge pull request #13244 from Snuffleupagus/update-postcss-calc
Update the `postcss-calc` package to the latest version
2021-04-14 20:35:51 +02:00
Jonas Jenwald
3e113cd38f Update the es-module-shims package to the latest version
Beside the unit/font-test suites, this is primarily used in the development viewer (i.e. `gulp server`).

https://www.npmjs.com/package/es-module-shims
2021-04-14 15:40:41 +02:00
Jonas Jenwald
da93bd18cc Update the postcss-calc package to the latest version
I've successfully run `gulp mozcentral` and `gulp generic` locally, with/without this patch and diff-ed the *built* `web/viewer.css` files. There were no changes, in the build-output, caused by this update.

https://www.npmjs.com/package/postcss-calc
2021-04-14 15:32:38 +02:00
Jonas Jenwald
f2156fc0cf Update eslint-config-prettier/eslint-plugin-unicorn packages to their latest versions
Both of these ESLint "helpers" has increased their *major* version numbers, which `npm update` doesn't handle automatically (since that could cause errors), hence this patch which updates them manually.

https://www.npmjs.com/package/eslint-config-prettier
https://www.npmjs.com/package/eslint-plugin-unicorn
2021-04-14 12:46:57 +02:00
Jonas Jenwald
f4727f0fec Update npm packages 2021-04-04 10:53:29 +02:00
dependabot[bot]
9e2572e4f8
Bump y18n from 3.2.1 to 3.2.2
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-30 11:50:58 +00:00
Jonas Jenwald
3eb7a6b66f Update npm packages 2021-03-21 11:00:02 +01:00
Jonas Jenwald
75eb2aedaa Update npm packages 2021-03-07 12:00:57 +01:00
dependabot[bot]
6312a321df
Bump pug-code-gen from 2.0.1 to 2.0.3
Bumps [pug-code-gen](https://github.com/pugjs/pug) from 2.0.1 to 2.0.3.
- [Release notes](https://github.com/pugjs/pug/releases)
- [Commits](https://github.com/pugjs/pug/compare/pug-code-gen@2.0.1...pug@2.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-03 02:28:49 +00:00
Jonas Jenwald
bb155cea5d Update Puppeteer to version 8
Hopefully the updated Chromium-version might help reduce the number of intermittent test failures.

Please find additional information at https://github.com/puppeteer/puppeteer/releases/tag/v8.0.0
2021-02-26 12:08:02 +01:00
Jonas Jenwald
385bf67bc9 Update npm packages 2021-02-21 11:52:55 +01:00
Jonas Jenwald
70b62eec82 Update npm packages 2021-02-07 12:04:22 +01:00
Jonas Jenwald
fd4e76a7e3 Update Puppeteer to version 7
Please see:
 - https://github.com/puppeteer/puppeteer/releases/tag/v7.0.1
 - https://github.com/puppeteer/puppeteer/releases/tag/v7.0.0
2021-02-04 18:03:11 +01:00
Jonas Jenwald
003965e1e8 Update Puppeteer to version 6 (issue 12945)
Please see https://github.com/puppeteer/puppeteer/releases/tag/v6.0.0
2021-02-02 13:18:22 +01:00
Jonas Jenwald
619e1d8bcf Stop polyfilling CSS variables in GENERIC builds
At this point in time, all browsers that we support have native support for CSS variables; please see https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#browser_compatibility and 9af8501e6c/gulpfile.js (L79-L91)

This reduces the size of the *built* `viewer.css` file, in GENERIC builds, from `93 814` to `55 285` bytes (~41 percent).
2021-01-30 15:38:07 +01:00
Jonas Jenwald
bc32515507 Update the eslint-plugin-unicorn package to the latest version
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v27.0.0 for additional details.
2021-01-24 08:38:38 +01:00
Jonas Jenwald
fea6d2fd34 Update npm packages 2021-01-24 08:34:00 +01:00
Jonas Jenwald
0e23b8b6ce Update the eslint-plugin-unicorn package to the latest version
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v25.0.0 for additional details.
2021-01-10 13:34:49 +01:00
Jonas Jenwald
e14db97740 Update npm packages 2021-01-10 13:34:35 +01:00
Jonas Jenwald
81525fd446 Use ESLint to ensure that exports are sorted alphabetically
There's built-in ESLint rule, see `sort-imports`, to ensure that all `import`-statements are sorted alphabetically, since that often helps with readability.
Unfortunately there's no corresponding rule to sort `export`-statements alphabetically, however there's an ESLint plugin which does this; please see https://www.npmjs.com/package/eslint-plugin-sort-exports

The only downside here is that it's not automatically fixable, but the re-ordering is a one-time "cost" and the plugin will help maintain a *consistent* ordering of `export`-statements in the future.
*Note:* To reduce the possibility of introducing any errors here, the re-ordering was done by simply selecting the relevant lines and then using the built-in sort-functionality of my editor.
2021-01-09 20:37:51 +01:00
Jonas Jenwald
94dfb46091 Update npm packages 2020-12-27 11:11:18 +01:00
Jonas Jenwald
e09f2a462d Update npm packages 2020-12-13 11:38:37 +01:00
dependabot[bot]
7a0d89b3c0
Bump ini from 1.3.5 to 1.3.7
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-10 20:48:56 +00:00
Jonas Jenwald
1f29d27474 Change how we're passing pdf.sandbox.js-specific options to createWebpackConfig in gulpfile.js
Given the somewhat "specialized" nature of the `pdf.sandbox.js` building, it ought to be possible to re-factor how some of the options are handled.
Note in particular that the `gulp-strip-comments` dependency seems somewhat unncessary, since the *main* source of comments are just the default license header. Hence I seems much more reasonable to simply not include that to begin with, rather than removing it after the fact (the few remaining Webpack-related should be few/small enough to not really matter much in practice).

This way we're able to further reduce the special-casing related to the `pdf.sandbox.js`-building, which will make future changes/maintenance easier by bringing this code more in-line with existing patterns in `gulpfile.js`.

(If we really want to reduce the filesize, we might want to consider always minifying the `GENERIC`-build of the `pdf.sandbox.js` file.)
2020-12-05 22:44:48 +01:00
Jonas Jenwald
58f865404c Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2020-11-29 09:47:33 +01:00
Jonas Jenwald
e15c63abc7 Update npm packages 2020-11-29 09:43:20 +01:00
dependabot[bot]
b6fdade6c6
Bump highlight.js from 9.13.1 to 9.18.5
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.13.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.13.1...9.18.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-24 23:29:33 +00:00
Tim van der Meij
a936f1f70c
Update Puppeteer to version 5.5.0 2020-11-22 14:26:49 +01:00
Calixte Denizet
c7974e9996 JS -- Add a sandbox based on quickjs
* quickjs-eval.js has been generated using https://github.com/mozilla/pdf.js.quickjs/
 * lazy load of sandbox code
 * Rewrite tests to use the sandbox
 * Add a task `watch-sandbox` which update bundle pdf.sandbox.js on change in the sandbox code
2020-11-19 13:40:46 +01:00
Jonas Jenwald
e1f43907d2 Update npm packages 2020-11-15 13:57:28 +01:00
Jonas Jenwald
75af932b79 Update npm packages 2020-11-01 10:04:57 +01:00
Jonas Jenwald
641ad1c3a0 Update npm packages 2020-10-18 10:57:52 +02:00
Jonas Jenwald
666dd73ce8 Upgrade webpack to version 5
The only noticeable changes are that the built files are now *slightly* smaller, and that Webpack now supports optional chaining and nullish coalescing without the need for Babel plugins.
2020-10-11 10:23:38 +02:00
Jonas Jenwald
3461eac7b8 Upgrade terser to version 5
The only significant change is that the `minify` command is now asynchronous, which we can handle easily by simply making the containing functions `async`.
Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#Browser_compatibility, using `async`/`await` in the gulpfile should no longer be an issue as far as I can tell.
2020-10-07 14:38:17 +02:00
Jonas Jenwald
bc036c05bd Upgrade acorn to version 8
I've run `gulp mozcentral`, `gulp generic`, and `gulp generic-es5` with `master` respectively this patch and then diffed the build output. With the (obvious) exception of increased version/build numbers, there were no actual changes from the updated Acorn version.
2020-10-06 13:53:08 +02:00
Tim van der Meij
505f14e816
Upgrade minor/major versions of dependencies that don't require code changes
The changelogs of those dependencies showed no breaking changes for us.
Most of the time the major version bump was done to remove compatibility
with very outdated Node.js versions.

Only for `autoprefixer` and `gulp-postcss` a change was required, which
is including `postcss` in our `package.json` explicitly since it's now
a peer dependency of those packages.

Now only `acorn`,`systemjs`, `terser` and `yargs` are not the latest
versions because they require more work.
2020-10-04 20:26:59 +02:00
Jonas Jenwald
082e7b5200 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2020-10-04 15:30:24 +02:00
Jonas Jenwald
522c93b916 Update npm packages 2020-10-04 15:30:23 +02:00
Tim van der Meij
c10aac9a1d
Upgrade Puppeteer to version 5.3.1 2020-10-03 23:06:31 +02:00
Jonas Jenwald
5107259176 Update escodegen to version 2.0
This release contains support for additional modern ECMAScript features, such as e.g. the nullish coalescing operator `??` and the optional chaining operator `?.`.
2020-09-29 15:56:24 +02:00
Jonas Jenwald
3e9c489b8b Update the webpack-stream dependency (issue 11996)
Given that the long-standing `webpack-stream` issue 201 was recently fixed in PR 207, and a new version released, we should now finally be able to update the dependency.
However, depending on if/when `webpack-stream` gets support for Webpack 5 (which is currently in beta) we may still want remove our `webpack-stream` dependency.
2020-09-20 15:35:56 +02:00
Jonas Jenwald
4dcedeb98e Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2020-09-20 11:40:20 +02:00
Jonas Jenwald
36b8d5e72d Update npm packages 2020-09-20 11:34:24 +02:00
Jonas Jenwald
0aef40f897 Update npm packages 2020-09-06 11:49:49 +02:00
Jonas Jenwald
7b5a540a52 Add (basic) support for Stylelint, to allow linting of CSS files
This is *similar* to the existing linting for JavaScript files, but covers CSS files instead.
While there's a lot of rules that could potentially be used, the main advantage of using Stylelint is that it has Prettier integration which means that we can automatically enforce a *consistent* style for our CSS files as well.

As a proof of concept, this patch is purposely limited to:
 - Adding a simple rule, here `block-no-empty` is chosen; see https://stylelint.io/user-guide/rules/block-no-empty
 - Adding Prettier integration, to unify the style of our CSS files.

Please find additional information at https://stylelint.io/
2020-08-30 21:48:35 +02:00
Jonas Jenwald
cb27999681 Update npm packages 2020-08-23 10:08:45 +02:00
Jonas Jenwald
c1253fd2d9 Update npm packages 2020-08-09 11:03:07 +02:00
Tim van der Meij
00a8b42e67
Merge pull request #12102 from ineiti/add_types_annotations
Add types annotations
2020-08-02 16:45:37 +02:00
Tim van der Meij
c53e403049
Update Jasmine to version 3.6.1
This is possible now that most intermittent unit test failures have been
resolved by other patches. There is only one remaining, but it's very
rare and doesn't have to block this update anymore.
2020-08-01 21:12:26 +02:00
Linus Gasser
f1bbfdc16d Add typescript definitions
This PR adds typescript definitions from the JSDoc already present.
It adds a new gulp-target 'types' that calls 'tsc', the typescript
compiler, to create the definitions.

To use the definitions, users can simply do the following:

```
import {getDocument, GlobalWorkerOptions} from "pdfjs-dist";
import pdfjsWorker from "pdfjs-dist/build/pdf.worker.entry";
GlobalWorkerOptions.workerSrc = pdfjsWorker;

const pdf = await getDocument("file:///some.pdf").promise;
```

Co-authored-by: @oBusk
Co-authored-by: @tamuratak
2020-07-30 11:10:37 +02:00
Tim van der Meij
c7c6c90062
Limit the allowed versions for Jasmine and Puppeteer
Jasmine >= 3.6.0 causes intermittent test failures because of random
task abortions.

Puppeteer >= 4.0.0 causes ENOTEMPTY/EBUSY errors during shutdown on the
Windows bot.

Moreover, `jasmine-core` is a dependency of `jasmine` so it doesn't have
to be required separately.
2020-07-26 20:40:55 +02:00
Jonas Jenwald
47ab676225 Update npm packages 2020-07-26 11:18:41 +02:00
Jonas Jenwald
20ad4337ac Fix *most* vulnerabilities reported by npm audit
This was automatically, by using the `npm audit fix` command.
2020-07-13 11:06:47 +02:00
Jonas Jenwald
fac5b5ff0c Update npm packages 2020-07-13 11:05:50 +02:00
dependabot[bot]
82b1930452
Bump npm from 6.14.5 to 6.14.6
Bumps [npm](https://github.com/npm/cli) from 6.14.5 to 6.14.6.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.14.5...v6.14.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-07 19:25:19 +00:00
Jonas Jenwald
ff3fbb91b9 Fix *most* vulnerabilities reported by npm audit
This was automatically, by using the `npm audit fix` command.
2020-06-27 11:32:51 +02:00
Jonas Jenwald
1d6d1c78ae Update npm packages 2020-06-27 11:30:30 +02:00
Dylan Lacey
f2b295882f Update Needle to 2.5.0 or greater.
Versions of `needle` prior to `2.5.0` cannot cope with redirects (as documented: https://github.com/tomas/needle/issues/312).

This prevents prebuilt `canvas` binaries from being downloaded on MacOS,
requiring the global install of its dependencies.

Updating Needle restores it to functionality, addressing this.  It also avoids
the need to add `request` to `package.json`; it also obsoletes https://github.com/mozilla/pdf.js/pull/12018.
2020-06-25 13:54:54 +10:00