Граф коммитов

218 Коммитов

Автор SHA1 Сообщение Дата
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 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
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
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
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
Jonas Jenwald c93958f901 Update npm packages 2021-05-16 10:05:58 +02: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 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
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
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
Tim van der Meij 62d5b15a24
Allow minor and patch versions for the `webpack-stream` dependency again
Fixes #11996.
2021-02-21 15:13:41 +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 `export`s 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
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 e15c63abc7 Update `npm` packages 2020-11-29 09:43:20 +01: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 de628cec59 Some `hasJSActions`, and general annotation-code, related cleanup in the viewer and API
- Add support for logical assignment operators, i.e. `&&=`, `||=`, and `??=`, with a Babel-plugin. Given that these required incrementing the ECMAScript version in the ESLint and Acorn configurations, and that platform/browser support is still fairly limited, always transpiling them seems appropriate for now.

 - Cache the `hasJSActions` promise in the API, similar to the existing `getAnnotations` caching. With this implemented, the lookup should now be cheap enough that it can be called unconditionally in the viewer.

 - Slightly improve cleanup of resources when destroying the `WorkerTransport`.

 - Remove the `annotationStorage`-property from the `PDFPageView` constructor, since it's not necessary and also brings it more inline with the `BaseViewer`.

 - Update the `BaseViewer.createAnnotationLayerBuilder` method to actaually agree with the `IPDFAnnotationLayerFactory` interface.[1]

 - Slightly tweak a couple of JSDoc comments.

---
[1] We probably ought to re-factor both the `IPDFTextLayerFactory` and `IPDFAnnotationLayerFactory` interfaces to take parameter objects instead, since especially the `IPDFAnnotationLayerFactory` one is becoming quite unwieldy. Given that that would likely be a breaking change for any custom viewer-components implementation, this probably requires careful deprecation.
2020-11-14 13:58:35 +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