Skip to content

Commit

Permalink
Replace the DOMMatrix polyfill, used with Node.js, with the one fro…
Browse files Browse the repository at this point in the history
…m `node-canvas`

Fewer dependencies shouldn't be a bad idea in general, and given that the `node-canvas` package already include a `DOMMatrix` polyfill we can simply use that one instead.
  • Loading branch information
Snuffleupagus committed Sep 27, 2022
1 parent 5675a6e commit c894be9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ function packageJson() {
bugs: DIST_BUGS_URL,
license: DIST_LICENSE,
dependencies: {
dommatrix: "^1.0.3",
canvas: "^2.10.1",
"web-streams-polyfill": "^3.2.1",
},
browser: {
Expand Down
35 changes: 17 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"core-js": "^3.25.1",
"cross-env": "^7.0.3",
"dialog-polyfill": "^0.5.6",
"dommatrix": "^1.0.3",
"es-module-shims": "1.4.7",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
Expand Down
4 changes: 1 addition & 3 deletions src/shared/compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ if (
if (globalThis.DOMMatrix || !isNodeJS) {
return;
}
globalThis.DOMMatrix = __non_webpack_require__(
"dommatrix/dist/dommatrix.js"
);
globalThis.DOMMatrix = __non_webpack_require__("canvas").DOMMatrix;
})();

// Support: Node.js
Expand Down

0 comments on commit c894be9

Please sign in to comment.