-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support vega-lite v5 #2717
Comments
I'm still working on this but wanted to summarize some of what I've found so far. Actual
|
// Optional Chaining proposal is stage 3 (https://github.com/tc39/proposal-optional-chaining) | |
// Need this since we are using TypeScript 3.7+ | |
require.resolve('@babel/plugin-proposal-optional-chaining'), | |
// Nullish coalescing proposal is stage 3 (https://github.com/tc39/proposal-nullish-coalescing) | |
// Need this since we are using TypeScript 3.7+ | |
require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), |
That preset is included by the webpack_preset
require('./common_preset'), |
Which is used by the webpack config in osd-optimizer
:
OpenSearch-Dashboards/packages/osd-optimizer/src/worker/webpack.config.ts
Lines 206 to 217 in 28c3df3
{ | |
test: /\.(js|tsx?)$/, | |
exclude: /node_modules/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
babelrc: false, | |
envName: worker.dist ? 'production' : 'development', | |
presets: [BABEL_PRESET_PATH], | |
}, | |
}, | |
}, |
Currently Dashboards has a hard dependency on vega-lite v4. v5 was released in early 2021 and provides a lot of functionality and simplicity improvements related to interactivity on the charts using parameters.
Upgrading will provide a lot of benefits:
vega
pluginI've tried to get a v5 version of vega-lite working in Dashboards, but have run into some issues:
To address this, I've tried to follow guidance here to use babel for transpiling the files into an ES5 bundle. I've played around with changing the webpack config for the osd-optimizer package to specifically transpile the vega-lite package before bundling:
noParse
arg herevega-lite
node_module here so it would use the default babel loadervega-lite
npm package, and trying different babel loaders (@babel/preset-env
, the defaultBABEL_PRESET_PATH
)However, even when getting to transpile, it still seems to find non-ES5 code:
This seems to be a known issue - see vega/vega-lite#7759, vega/vega-lite#7595 (comment)
From the comment here it should be possible to configure the bundler to point to a correct target that will work, but I was unable to resolve the nullish operator error shown above.
The text was updated successfully, but these errors were encountered: