[FEATURE] Target ES5/ES6 with BokehJS
See original GitHub issueIs your feature request related to a problem? Please describe.
Yes, I am unable to use BokehJS v2.2.3 in legacy webpack projects as BokehJS makes use of the ES2020 syntax export ns from
syntax in the exported file build/js/lib/index.js
which is not widely supported. See below:
export * as embed from "./embed";
export * as protocol from "./protocol";
export * as _testing from "./testing";
Previous BokehJS version 2.0.2 did not have this issue.
Describe the solution you’d like Target a lower ECMAScript language spec when publishing BokehJS, i.e. ES5/ES6.
Describe alternatives you’ve considered I’ve considered the following:
- updating our legacy projects webpack/babel configs but this has negative impacts on other packages and tooling used in our project.
- remaining on old version 2.0.2 but our projects requires the use of bug fixes in v2.2.3.
Currently we are attempting to work around this by copying bokehjs directory out of node_modules and modifying the syntax in build/js/lib/index.js
to use the following:
import * as embed from './embed';
import * as protocol from './protocol';
import * as _testing from './testing';
export { version } from './version';
export { index } from './embed';
export { embed };
export { protocol };
export { _testing };
export { logger, set_log_level } from './core/logging';
export { settings } from './core/settings';
export { Models } from './base';
export { documents } from './document';
export { safely } from './safely';
// # sourceMappingURL=index.js.map
Obviously copying BokehJS out of node_modules this is less than ideal.
Additional context Targeting a more widely used ECMAScript standard will allow for more users to utilize BokehJS and should be easily achievable.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (3 by maintainers)
I use babel but still i get error for this:
Uncaught TypeError: Array is not a constructor
babel constructs something like this:which then causes problem when translating reset operator (…) to
new Array
Is it possible to not use Array or what is the best way to solve this issue? Has Babel some preset to fix this preset? thx
@mTymoshenko sorry I have not found a way around this. I’ve since moved our team away from Bokeh so I have not tried any of the newer versions or more creative approaches. I guess you could always fork it and fix yourself…