Skip to content

Commit

Permalink
chore: remove fallback synthetic shadow import (BREAKING CHANGE) (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Jun 8, 2023
1 parent 434a43c commit 3d61d0f
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions packages/@lwc/jest-preset/src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,7 @@ if (!nativeShadow) {
'@lwc/synthetic-shadow is being loaded twice. Please examine your jest/jsdom configuration.'
);
}
try {
// Prior to @lwc/synthetic-shadow v2.45.3, calling `require('@lwc/synthetic-shadow')`
// is a no-op, and you have to directly require the file below.
// At some point (probably LWC v3.0.0), the below line should throw because the file does
// not exist anymore. See: https://github.com/salesforce/lwc/pull/3456
require('@lwc/synthetic-shadow/dist/synthetic-shadow.js');
} catch (err) {
// In newer versions of @lwc/synthetic-shadow, you can just do
// `require('@lwc/synthetic-shadow')` normally.
if (err && err.code === 'MODULE_NOT_FOUND') {
require('@lwc/synthetic-shadow');
} else {
throw err;
}
}
require('@lwc/synthetic-shadow/dist/synthetic-shadow.js');
}

// Provides temporary backward compatibility for wire-protocol reform: lwc > 1.5.0
Expand Down

0 comments on commit 3d61d0f

Please sign in to comment.