vega / vega

A visualization grammar.

Home Page:https://vega.github.io/vega

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ES5 build broken in 5.23 (is actually ES7)

jdlrobson opened this issue · comments

The file node_modules/vega/build-es5/vega-core.js contains async functions which are not supported in ES5 e.g. async function load$1 and async function sanitize

This last seemed to worked in 5.22.1 .

The ES5 build is important to @wikimedia as it is blocking us migrating to Vega 5 for the MediaWiki Graph extension and we currently support users who are still on ES6. An ES6 build would also work for us.

Let me know if I can provide any further information.

shouldn't this be handled by Babel?

I am not sure I understand your question. It looks like Vega uses Rollup which should be able to handle transpiling. I suspect something went wrong in the configuration after 5.22.1 release. However the released version provides an ES5 version of the library which is using ES7 syntax which seems wrong to me.

The issue is in https://github.com/vega/vega/blob/main/rollup.config.mjs. We use "defaults" which used to include IE but maybe doesn't anymore.

I do think we may want to just remove the es5 builds since we use browserlists and not real es versions. We should do this in the next version bump. Until then, we can fix this by changing the browserlists to something that describes es5.

I think what @nyurik means is that maybe your build process would use the module files which you would need to transpile using babel.

There is no es5 browserlists. What is the list of browsers you support? We could use the es2015 babel preset but I think a borwserlists is safer.

I sent #3725 which fixes IE support. Is that sufficient for you?

https://github.com/vega/vega#es5-support is this part of the README outdated then?

This is not really about browser support. We have a minifier that cannot minify anything beyond ES6 code. We can run a build process ourselves to handle the syntax yes and we are planning to this but I am mostly raising this ticket because of the misleading README.

Yeah, it's not in sync with the code. Thanks for raising the issue.

Does my pull request address the issue in your build process, though?

I'm also seeing https://vega.github.io/vega/usage/ suggests that the library should support ES6 compliant browsers, but that doesn't seem to be the case?

I imagine your patch would help as IE11 does support ES5 so presumably that would make things work, yes.

FWIW We don't support IE11 so you could also add a browser that is ES6 compliant e.g. Edge 15 and achieve the same result.

Yeah, we should update the docs to say that we have bundle for modern browsers and a legacy bundle.

Is there any chance #3725 and a release could happen this weekend? I'm about to write some code our side to workaround this so we can upgrade to Vega 5 next week, but wanted to check in before doing that to see if I can use the time for other things.

That's up to @jheer.

I wonder, does your application not bundle Vega itself and depend on released bundles only?

@domoritz the MediaWiki graph extension hasn't been maintained for some time. We are currently depending on released bundles, but are working towards bundling Vega ourselves.

Was just hoping for a quick short term solution here while we do that.

That I would really like to let @jheer or @domoritz to do... in part due to not having NPM access :)

cc @arvind as well

Only @jheer and @arvind have npm access.

one option would be to add NPM credentials to the github secret store - this way an automated github action can push code to NPM on release. But this is a separate task