jgraph / mxgraph

mxGraph is a fully client side JavaScript diagramming library
Other
6.82k stars 2.06k forks source link

Synchronous XMLHttpRequest on the main thread is deprecated #74

Closed enriquecorp closed 7 years ago

enriquecorp commented 7 years ago

Hello everybody,

I'm starting to use mxgraph, but since the first day in all my tests and in my prototype I see this anoying warning:

mxClient.js:115 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.  Debuging the code I have found the problem is how ajax is used in order to retrieve these files:

Using this line on mxXmlRequest :
this.request.open(this.method, this.url, this.async, this.username, this.password);

Do you think it is a real problem? I mean How can I explain this issue to my final users? if they are aware and concern about our app performance Is there a way to disable this warning? as far as I see it is not possible but please let me know it it is possible Are there plans for replace this synchronous call with another asynchronous?

Thank you for your time ​

alderg commented 7 years ago

Use mxLoadResources = false and load the files as shown here: https://github.com/jgraph/mxgraph/blob/v3.7.2/javascript/examples/grapheditor/www/index.html#L85

coreybutler commented 7 years ago

@alderg - Perhaps this should be the default (i.e. no need to set mxLoadResources, given all browsers have deprecated synchronous XHR?