fix(package.json): Bump WADO Image Loader dependency, remove unnecessary worker and codec paths (#727)
Note: had to disable sourcemaps for commonjs modules. This seems to be the only way to prevent memory issues on CircleCI.
This commit is contained in:
1 parent
e73d009c21
commit
a4112c46a5
22 files changed
+16
-67
No files matched your search
+1
-5
@@ -105,7 +105,6 @@ function makeAbsoluteIfNecessary(url, base_url) {
|
||||
class App extends Component {
|
||||
static propTypes = {
|
||||
routerBasename: PropTypes.string.isRequired,
|
||||
relativeWebWorkerScriptsPath: PropTypes.string.isRequired,
|
||||
servers: PropTypes.object.isRequired,
|
||||
oidc: PropTypes.array,
|
||||
whiteLabelling: PropTypes.object,
|
||||
@@ -142,10 +141,7 @@ class App extends Component {
|
||||
);
|
||||
}
|
||||
handleServers(this.props.servers);
|
||||
initWebWorkers(
|
||||
this.props.routerBasename,
|
||||
this.props.relativeWebWorkerScriptsPath
|
||||
);
|
||||
initWebWorkers();
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -11,7 +11,6 @@ export { App };
|
||||
window.config = window.config || {};
|
||||
const applicationDefaults = {
|
||||
routerBasename: '/',
|
||||
relativeWebWorkerScriptsPath: '',
|
||||
};
|
||||
const applicationProps = Object.assign({}, applicationDefaults, window.config);
|
||||
const app = React.createElement(App, applicationProps, null);
|
||||
|
||||
@@ -1,32 +1,12 @@
|
||||
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} baseDirectory
|
||||
* @param {String} webWorkScriptsPath
|
||||
*/
|
||||
export default function initWebWorkers(
|
||||
baseDirectory = '/',
|
||||
webWorkScriptsPath = ''
|
||||
) {
|
||||
let scriptsPath = `${window.location.protocol}//${
|
||||
window.location.host
|
||||
}${baseDirectory}${webWorkScriptsPath}`;
|
||||
|
||||
// Ensure the last character is a slash
|
||||
if (scriptsPath[scriptsPath.length - 1] !== '/') {
|
||||
scriptsPath += '/';
|
||||
}
|
||||
|
||||
export default function initWebWorkers() {
|
||||
const config = {
|
||||
maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1),
|
||||
startWebWorkersOnDemand: true,
|
||||
webWorkerPath: `${scriptsPath}cornerstoneWADOImageLoaderWebWorker.min.js`,
|
||||
taskConfiguration: {
|
||||
decodeTask: {
|
||||
loadCodecsOnStartup: true,
|
||||
initializeCodecsOnStartup: false,
|
||||
codecsPath: `${scriptsPath}cornerstoneWADOImageLoaderCodecs.min.js`,
|
||||
usePDFJS: false,
|
||||
strict: false,
|
||||
},
|
||||
|
||||
@@ -3,10 +3,7 @@ import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
|
||||
|
||||
describe('initWebWorkers', () => {
|
||||
it("initializes cornerstoneWADOImageLoader's web workers", () => {
|
||||
const basePath = '/';
|
||||
const relativeWebWorkerScriptsPath = '';
|
||||
|
||||
initWebWorkers(basePath, relativeWebWorkerScriptsPath);
|
||||
initWebWorkers();
|
||||
|
||||
expect(
|
||||
cornerstoneWADOImageLoader.webWorkerManager.initialize
|
||||
|
||||
Reference in new issue
Block a user