Foren
Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Damien Guillermet, geändert vor 7 Jahren.
Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Junior Member Beiträge: 44 Beitrittsdatum: 09.07.15 Neueste Beiträge
Hello,
I have included the Vis.js library in a Liferay Faces portlet like outputscript resource example (except that I loaded the vis.min.js file via <header-portlet-javascript> tag in liferay-portlet.xml). Since I upgraded from Liferay 6.2.4 GA6 to 7.0 GA3 I'm not able to use it anymore: a JS error is raised in web browser console (vis is not defined) although the script seems to be loaded.
The Vis.js script is compatible with ES6 module system. I'm not sure if this matter concerns Liferay Faces or how Liferay 7 manages JS resources.
I can provide a sample to reproduce if it's necessary (implementing a vis.js basic usage).
Best regards,
Damien.
I have included the Vis.js library in a Liferay Faces portlet like outputscript resource example (except that I loaded the vis.min.js file via <header-portlet-javascript> tag in liferay-portlet.xml). Since I upgraded from Liferay 6.2.4 GA6 to 7.0 GA3 I'm not able to use it anymore: a JS error is raised in web browser console (vis is not defined) although the script seems to be loaded.
The Vis.js script is compatible with ES6 module system. I'm not sure if this matter concerns Liferay Faces or how Liferay 7 manages JS resources.
I can provide a sample to reproduce if it's necessary (implementing a vis.js basic usage).
Best regards,
Damien.
Juan Gonzalez, geändert vor 7 Jahren.
RE: Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Damien.
You're basically reproducing a known problems with amd-loader and js files that aren't ready for that.
Please read here: https://web.liferay.com/community/forums/-/message_boards/message/81981433 to know about the possible solution. Create two js files, one to be included before disabling amd loader, then other one for enabling it after your included js file.
More info: http://stackoverflow.com/questions/34269886/amd-loader-disable-enable-in-theme
You're basically reproducing a known problems with amd-loader and js files that aren't ready for that.
Please read here: https://web.liferay.com/community/forums/-/message_boards/message/81981433 to know about the possible solution. Create two js files, one to be included before disabling amd loader, then other one for enabling it after your included js file.
More info: http://stackoverflow.com/questions/34269886/amd-loader-disable-enable-in-theme
Damien Guillermet, geändert vor 7 Jahren.
RE: Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Junior Member Beiträge: 44 Beitrittsdatum: 09.07.15 Neueste Beiträge
Hello Juan and thank you again I'll read that ;)
Sorry for posting this subject in Liferay Faces forum it was not the appropriate location!
EDIT: I followed you advice and it works like a charm.
Sorry for posting this subject in Liferay Faces forum it was not the appropriate location!
EDIT: I followed you advice and it works like a charm.
Chema Balsas, geändert vor 7 Jahren.
RE: Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Regular Member Beiträge: 127 Beitrittsdatum: 25.02.13 Neueste Beiträge
Hey Damien, just FYI, we've worked on https://issues.liferay.com/browse/LPS-68298 to allow hiding the loader behind a namespace with just a simple system setting.
Once this is merged and gets to your liferay distribution, you should be able to simply configure the loader to be hidden and get rid of the workaround.
Hope that helps!
Once this is merged and gets to your liferay distribution, you should be able to simply configure the loader to be hidden and get rid of the workaround.
Hope that helps!
Damien Guillermet, geändert vor 7 Jahren.
RE: Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Junior Member Beiträge: 44 Beitrittsdatum: 09.07.15 Neueste Beiträge
Hello Chema,
yes i read that issue thank you for your great work
I'm impatient to use it in the next Liferay release!
Damien.
yes i read that issue thank you for your great work
I'm impatient to use it in the next Liferay release!
Damien.
Chema Balsas, geändert vor 7 Jahren.
RE: Trouble with included vis.js library - ES6 script - Liferay 7.0 GA3
Regular Member Beiträge: 127 Beitrittsdatum: 25.02.13 Neueste Beiträge
Thanks a lot for the kind words and understanding, Damien, and sorry about the current inconveniences this is causing you.
The code for this is finalized and backported, so it shouldn't be long now until it ends up in a FixPack
Please, let us know if you still have some other issues with this!
The code for this is finalized and backported, so it shouldn't be long now until it ends up in a FixPack
Please, let us know if you still have some other issues with this!