Skip to content

Commit ebe96ba

Browse files
legregoNicholasPeretti
authored andcommitted
Remove core-js polyfills from Kibana's server (elastic#238318)
## Summary Removes `core-js/stable` polyfills from the Kibana server. The only notable usage seems to have been `structuredClone`, which is now provided by the node.js runtime natively. This also removes `core-js` polyfills from jest configs used to test server-side code, since all of these tests should be able to run without polyfills. Important: `core-js` is still used to polyfill client-side code. Resolves elastic#238657
1 parent d2656f7 commit ebe96ba

File tree

5 files changed

+2
-12
lines changed

5 files changed

+2
-12
lines changed

packages/kbn-eslint-plugin-i18n/jest.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ module.exports = {
1111
preset: '@kbn/test/jest_node',
1212
rootDir: '../..',
1313
roots: ['<rootDir>/packages/kbn-eslint-plugin-i18n'],
14-
globals: {
15-
structuredClone: {},
16-
},
1714
};

src/platform/packages/shared/kbn-test/jest-preset.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,6 @@ module.exports = {
146146

147147
resolver: '<rootDir>/src/platform/packages/shared/kbn-test/src/jest/resolver.js',
148148

149-
// Workaround to "TypeError: Cannot assign to read only property 'structuredClone' of object '[object global]'"
150-
// This happens when we run jest tests with --watch after node20+
151-
globals: {
152-
structuredClone: {},
153-
},
154-
155149
testResultsProcessor:
156150
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/result_processors/logging_result_processor.js',
157151
};

src/platform/packages/shared/kbn-test/jest_integration_node/jest-preset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = {
6060
: ['html', 'text'],
6161

6262
snapshotSerializers: [],
63-
setupFiles: ['<rootDir>/src/setup_node_env/polyfill.ts'],
63+
setupFiles: [],
6464
haste: {
6565
...preset.haste,
6666
throwOnModuleCollision: true,

src/platform/packages/shared/kbn-test/jest_node/jest-preset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ delete presetClone.testEnvironment; // simply redefining as `testEnvironment: 'n
1717
module.exports = {
1818
...presetClone,
1919
snapshotSerializers: [],
20-
setupFiles: ['<rootDir>/src/setup_node_env/polyfill.ts'],
20+
setupFiles: [],
2121
haste: {
2222
...preset.haste,
2323
throwOnModuleCollision: true,

src/setup_node_env/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ require('./setup_env');
1414
require('./dns_ipv4_first');
1515

1616
require('@kbn/babel-register').install();
17-
require('./polyfill');
1817

1918
require('@kbn/security-hardening');

0 commit comments

Comments
 (0)