Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9fafaab
update vega to 6.x
markov00 Oct 13, 2025
237e51a
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 13, 2025
6404ed3
Merge remote-tracking branch 'upstream/main' into markov-2025_10_13-u…
mistic Oct 14, 2025
54dfc99
chore(NA): update yarn lock
mistic Oct 14, 2025
5ec7890
chore(NA): update typecheck setup
mistic Oct 14, 2025
87e4a61
[CI] Auto-commit changed files from 'ts-node .buildkite/pipeline-reso…
kibanamachine Oct 14, 2025
6a8538e
chore(NA): more changes to support workaround support
mistic Oct 14, 2025
c5000fa
Merge branch 'main' into 2025_10_13-update_vega_6
mistic Oct 14, 2025
943237b
[CI] Auto-commit changed files from 'node scripts/capture_oas_snapsho…
kibanamachine Oct 14, 2025
de28eb5
fix(NA): workarounds vega-lite validation tests by using a vm env
mistic Oct 14, 2025
9d30471
[CI] Auto-commit changed files from 'security: 3rd-party dependencies'
kibanamachine Oct 14, 2025
ca75827
Merge branch '2025_10_13-update_vega_6' of github.com:markov00/kibana…
mistic Oct 14, 2025
0c4f560
fix(NA): lint errors
mistic Oct 14, 2025
bfbfefe
fix(NA): restore removed type on base config
mistic Oct 14, 2025
d1e794b
chore(NA): setup correct vega jest setup for pre esm
mistic Oct 14, 2025
1395acb
chore(NA): remove old code
mistic Oct 14, 2025
cf24c76
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 14, 2025
5039541
Merge branch 'main' into 2025_10_13-update_vega_6
markov00 Nov 27, 2025
9a464e5
removed resolutions in package.json
markov00 Nov 27, 2025
fd08d83
Fix yarn lock
kibanamachine Nov 27, 2025
4d8ec44
Update snapshot, different error message
markov00 Dec 1, 2025
4b352b7
Improved
markov00 Dec 1, 2025
0a85a94
Use babel generators instead of @babel/plugin-syntax-import-attribute
markov00 Dec 2, 2025
b1bc6da
cleanup typo
markov00 Dec 2, 2025
1648843
add code owners
markov00 Dec 2, 2025
844317d
Add import attributes parser options for eslint
markov00 Dec 2, 2025
a120fae
re-bootstrap
jeramysoucy Dec 3, 2025
04c3583
Merge branch 'main' into 2025_10_13-update_vega_6
markov00 Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2124,8 +2124,10 @@ x-pack/platform/test/plugin_api_integration/test_suites/platform/ @elastic/kiban
/config/serverless.security.essentials.yml @elastic/security-solution @elastic/kibana-security
/config/serverless.security.complete.yml @elastic/security-solution @elastic/kibana-security
/typings/ @elastic/kibana-core
/typings/vega/ @elastic/kibana-visualizations
/src/platform/test/analytics @elastic/kibana-core
/src/platform/packages/shared/kbn-test/src/jest/setup/mocks.kbn_i18n_react.js @elastic/kibana-core
/src/platform/packages/shared/kbn-test/src/jest/setup/mocks.vega.js @elastic/kibana-visualizations
/x-pack/platform/test/saved_objects_field_count/ @elastic/kibana-core
/x-pack/platform/test/serverless/**/test_suites/saved_objects_management/ @elastic/kibana-core
/x-pack/platform/test/serverless/api_integration/test_suites/core/ @elastic/kibana-core
Expand Down
17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@
"@types/react-dom": "~18.2.0",
"@xstate5/react/**/xstate": "^5.19.2",
"apache-arrow": "20.x - 21.x",
"globby/fast-glob": "^3.3.2",
"vega-expression": "5.2.1",
"vega-interpreter": "1.2.1",
"vega-util": "1.17.4"
"globby/fast-glob": "^3.3.2"
},
"dependencies": {
"@a2a-js/sdk": "^0.3.4",
Expand Down Expand Up @@ -1446,12 +1443,12 @@
"usng.js": "^0.4.5",
"utility-types": "^3.10.0",
"uuid": "11.1.0",
"vega": "^5.33.0",
"vega-interpreter": "1.2.1",
"vega-lite": "^5.21.0",
"vega-schema-url-parser": "^2.2.0",
"vega-spec-injector": "^0.0.2",
"vega-tooltip": "^0.34.0",
"vega": "6.2.0",
"vega-interpreter": "2.2.1",
"vega-lite": "6.4.1",
"vega-schema-url-parser": "3.0.2",
"vega-spec-injector": "0.0.2",
"vega-tooltip": "1.1.0",
"vinyl": "^3.0.0",
"wellknown": "^0.5.0",
"xml-formatter": "^3.6.7",
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-babel-preset/common_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
*/

module.exports = (api) => ({
// Enables import-attributes syntax on imports
generatorOpts: {
importAttributesKeyword: 'with',
},
presets: [
// plugins always run before presets, but in this case we need the
// @babel/preset-typescript preset to run first so we have to move
Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-eslint-config/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ module.exports = {
ecmaVersion: 2018,
requireConfigFile: false,
babelOptions: {
presets: ['@kbn/babel-preset/node_preset']
presets: ['@kbn/babel-preset/node_preset'],
parserOpts: {
plugins: ['importAttributes']
}
},
},

Expand Down
6 changes: 1 addition & 5 deletions packages/kbn-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ export function getWebpackConfig(
// no parse rules for a few known large packages which have no require() statements
// or which have require() statements that should be ignored because the file is
// already bundled with all its necessary dependencies
noParse: [
/[\/\\]node_modules[\/\\]lodash[\/\\]index\.js$/,
/[\/\\]node_modules[\/\\]vega[\/\\]build-es5[\/\\]vega\.js$/,
],
noParse: [/[\/\\]node_modules[\/\\]lodash[\/\\]index\.js$/],

rules: [
{
Expand Down Expand Up @@ -299,7 +296,6 @@ export function getWebpackConfig(
extensions: ['.js', '.ts', '.tsx', '.json'],
mainFields: ['browser', 'module', 'main'],
alias: {
vega: Path.resolve(worker.repoRoot, 'node_modules/vega/build-es5/vega.js'),
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
buffer: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ export class ImportResolver {
return Path.resolve(REPO_ROOT, `node_modules/zod/v3/index.cjs`);
}

if (req.startsWith('vega-lite')) {
return Path.resolve(REPO_ROOT, `node_modules/vega-lite/build`);
}

if (req.startsWith('vega-tooltip')) {
return Path.resolve(REPO_ROOT, `node_modules/vega-tooltip/build`);
}

// turn root-relative paths into relative paths
if (
req.startsWith('src/') ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export default ({ config: storybookConfig }: { config: Configuration }) => {
},
externals,
module: {
// no parse rules for a few known large packages which have no require() statements
// or which have require() statements that should be ignored because the file is
// already bundled with all its necessary dependencies
noParse: [/[\/\\]node_modules[\/\\]vega[\/\\]build-es5[\/\\]vega\.js$/],
rules: [
{
test: /\.mjs$/,
Expand Down Expand Up @@ -60,7 +56,6 @@ export default ({ config: storybookConfig }: { config: Configuration }) => {
mainFields: ['browser', 'main'],
alias: {
core_styles: resolve(REPO_ROOT, 'src/core/public/index.scss'),
vega: resolve(REPO_ROOT, 'node_modules/vega/build-es5/vega.js'),
},
},
stats: 'errors-only',
Expand Down
3 changes: 2 additions & 1 deletion src/platform/packages/shared/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module.exports = {
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/setup/mocks.eui.js',
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/setup/react_testing_library.js',
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/setup/mocks.kbn_i18n_react.js',
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/setup/mocks.vega.js',
process.env.CI
? '<rootDir>/src/platform/packages/shared/kbn-test/src/jest/setup/disable_console_logs.js'
: [],
Expand Down Expand Up @@ -126,7 +127,7 @@ module.exports = {
transformIgnorePatterns: [
// ignore all node_modules except monaco-editor, monaco-yaml which requires babel transforms to handle dynamic import()
// since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842)
'[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|d3-interpolate|d3-color|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|eventsource-parser|fast-check|@fast-check/jest|@assemblyscript|quickselect|rbush|zod/v4))[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|d3-interpolate|d3-color|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|eventsource-parser|fast-check|@fast-check/jest|@assemblyscript|quickselect|rbush|zod/v4|vega-interpreter|vega-util|vega-tooltip))[/\\\\].+\\.js$',
'packages/kbn-pm/dist/index.js',
'[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain|zod/v4))/dist/[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain|zod/v4))/dist/util/[/\\\\].+\\.js$',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

/* eslint-env jest */

const fs = require('fs');
const vm = require('vm');
const path = require('path');

let cached = null;

const loadVegaAndVegaLite = () => {
if (cached) return cached;

const sandbox = {
window: {},
globalThis: {},
structuredClone: (obj) => JSON.parse(JSON.stringify(obj)),
};

// vega
const vegaPath = path.resolve('node_modules/vega/build/vega.min.js');
const vegaCode = fs.readFileSync(vegaPath, 'utf8');
vm.createContext(sandbox);
vm.runInContext(vegaCode, sandbox);

sandbox.window.vega = sandbox.globalThis.vega = sandbox.window.vega || sandbox.globalThis.vega;

// vega-lite
const litePath = path.resolve('node_modules/vega-lite/build/vega-lite.min.js');
const liteCode = fs.readFileSync(litePath, 'utf8');
vm.runInContext(liteCode, sandbox);

cached = {
vega: sandbox.window.vega || sandbox.globalThis.vega,
vegaLite: sandbox.window.vegaLite || sandbox.globalThis.vegaLite,
};

// both Vega and Vega-Lite
return cached;
};

jest.mock('vega', () => {
const { vega } = loadVegaAndVegaLite();
return { ...vega };
});

jest.mock('vega-lite', () => {
const { vegaLite } = loadVegaAndVegaLite();
return { ...vegaLite };
});

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

4 changes: 3 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,9 @@
"@typescript-eslint/parser": ["typings/@typescript-eslint/parser"],
"@a2a-js/sdk/server": ["typings/@a2a-js-sdk/server"],
"zod": ["typings/zod/v3"],
"zod/v4": ["typings/zod/v4"]
"zod/v4": ["typings/zod/v4"],
"vega-lite": ["typings/vega/vega_lite"],
"vega-tooltip": ["typings/vega/vega_tooltip"]
},
// Support .tsx files and transform JSX into calls to React.createElement
"jsx": "react",
Expand Down
12 changes: 12 additions & 0 deletions typings/vega/vega_lite.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

declare module 'vega-lite' {
export * from 'vega-lite/build';
}
12 changes: 12 additions & 0 deletions typings/vega/vega_tooltip.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

declare module 'vega-tooltip' {
export * from 'vega-tooltip/build';
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

import 'jest-canvas-mock';

// @ts-ignore
import { compile } from 'vega-lite/build/vega-lite';
import { compile } from 'vega-lite';

import type { EuiThemeComputed } from '@elastic/eui';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
import type { FC } from 'react';
import React, { useMemo, useEffect } from 'react';

// There is still an issue with Vega Lite's typings with the strict mode Kibana is using.
// @ts-ignore
import type { TopLevelSpec } from 'vega-lite/build/vega-lite';

// There is still an issue with Vega Lite's typings with the strict mode Kibana is using.
// @ts-ignore
import { compile } from 'vega-lite/build/vega-lite';
import type { TopLevelSpec } from 'vega-lite';
import { compile } from 'vega-lite';
import { parse, View, Warn } from 'vega';
import { expressionInterpreter } from 'vega-interpreter';
import { Handler } from 'vega-tooltip';
Expand Down
Loading