Skip to content

Commit

Permalink
Bump jsdom to 16.7.0 (#482, #483)
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Jul 13, 2022
1 parent c49e7df commit cc7b1ff
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 180 deletions.
8 changes: 6 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"deep-equal": "^2.0.5",
"fetch-retry": "^4.1.1",
"history": "^4.7.2",
"jsdom": "^11.8.0",
"jsdom": "^16.7.0",
"material-ui": "^0.20.2",
"openseadragon": "^2.4.2",
"openseadragon-fabricjs-overlay": "https://github.com/performant-software/OpenseadragonFabricjsOverlay",
Expand Down Expand Up @@ -66,5 +66,9 @@
"not dead",
"not ie <= 11",
"not op_mini all"
]
],
"volta": {
"node": "16.16.0",
"yarn": "1.22.19"
}
}
17 changes: 7 additions & 10 deletions client/src/fabricAdapted.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
}
else {
// assume we're running under node.js when document/window are not present
fabric.document = require("jsdom")
.jsdom(
decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E")
);

if (fabric.document.createWindow) {
fabric.window = fabric.document.createWindow();
} else {
fabric.window = fabric.document.parentWindow;
}
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const dom = new JSDOM(
decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E")
);
fabric.document = dom.window.document;
fabric.window = dom.window;
}

/**
Expand Down
Loading

0 comments on commit cc7b1ff

Please sign in to comment.