Skip to content
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

Delay when portlet in liferay is loaded #5

Open
OliverDamm opened this issue Dec 14, 2016 · 11 comments
Open

Delay when portlet in liferay is loaded #5

OliverDamm opened this issue Dec 14, 2016 · 11 comments

Comments

@OliverDamm
Copy link

Comment from #3:

We want to send your add-on to production environment but we have a problem. When the liferay portlet is loaded, it delays more than 5 seconds (I believe is because all angular.js is loaded). Any idea how can I reduce this delay time (i.e., Vaadin takes 0.5 or less to load)

@OliverDamm
Copy link
Author

Is it really loading time? The size of Angular is about 130k. Maybe it is a problem of browser performance executing JavaScript.

What browser do you use? Any chance to debug the problem in the browser dev tools?

@rlhLegoSoft
Copy link

I tested with:

  • Chrome version 54 (64 bit). It takes more than 5 seconds.
  • Safari 10.0.1. It takes 3 seconds.
  • Firefox version 50.1. Less than two seconds
    Maybe you are right since between browsers the loading time changes a lot. I will debug it. Thanks

@OliverDamm
Copy link
Author

Hmm, didn't expect Chrome is the browser with the worst performance.

Did you measured where the time is lost? Network, JavaScript or something else?

@rlhLegoSoft
Copy link

rlhLegoSoft commented Dec 22, 2016 via email

@rlhLegoSoft
Copy link

Back again. We could migrate many Vaadin addons to Liferay DXP (e.g., Scaladin addon). The work was to change de .jars file to OSGi (i.e, modify the MANIFEST)
The problem with Vaangular is its dependency with JavascriptPlus for Vaadin that algo has a dependency with com.google.gwt.core.client and Liferay DXP complains about it: vaadin-client-7.7.6.jar does not come with these classes (no idea why).

Any idea to run Vaangular with Liferay DXP?

@sebastianrothbucher
Copy link
Contributor

My guess would be: you don't need vaadin-client after widgetset compile is done, so you could exclude the dependency per se and only include it for the widgetset-compile

@rlhLegoSoft
Copy link

The Liferay DXP OSGi class loader sends me an error because JavascriptPlus (i.e., JavascriptPlusConnectorHelper) has a dependency with com.google.gwt.core.client.JavaScriptObject. Searching for this class it is declared in a jar .m2/repository/com/vaadin/external/gwt/gwt-user/2.7.0vaadin4.jar, and this jar is not OSGi.
The release notes for Vaadin 7.7.4 and above (I´m using Vaadin 7.7.6) they said that GWT dependencies were changed as externals and you cannot use vaadin-client with OSGi. See https://vaadin.com/download/release/7.7/7.7.6/release-notes.html#gwtdep

Any idea to do some work around)

@rlhLegoSoft
Copy link

After several hours I could make it work "partially" over Liferay DXP: It is was partially solved because for now I take out the JavascriptPlusConnectorHelper class (just for now).
Another change I had to do was in the NgTemplatePlus because you open the .html file using the "File" class. This does not work with OSGi standard, so I change it for OSGi standard that is use the Bundle class to getResource().
For now it works partially. I will try to solve the gwt problem mention above (i.e., 2.7.0vaadin4.jar) and include de JavascriptPlus add on again.

Any hint will be useful.

@sebastianrothbucher
Copy link
Contributor

I'd try a different classpath for the widgetset compilation which includes non-OSGI components...

@rlhLegoSoft
Copy link

So far I could OSgi 2.7.0vaadin4.jar with its dependencies. And could include the JavascripPlus. Everything work ok and your weather example widget works ok. The problem is between Vaadin and AngularJS communication (i.e, onChange method, deferred variable). I believe it is because I´m not using JavascriptPlus widgetset.
I´m working on Liferay DXP to know how can I use a different widgetset from the Vaadin DefaultWidgetset. It seem that Liferray DXP with its OSgi approach does not use the html/VAADIN path.
Also even if with your JavascriptPlus.jar has inside the widgetset, Liferay DXP ignores it.
Still working... any help is welcome (There is a lot talk between Liferay DXP and Vaadin addons with widgetset or themes).

@rlhLegoSoft
Copy link

Sebastian:
! Finally it works! My problem was that I was using the SAMPSA SOHLMAN compatibility package in order to use Vaadin 7.7.6 with LifeRay DXP (https://web.liferay.com/web/sampsa.sohlman/blog/-/blogs/double-seven-vaadin-7-with-liferay-2).
Sampsa utilizes the web resource in other path, so I include JavascripPlus widgetset in his Web Resources bundles and it works.
If you need the final code I will be glad to share with you. But now I can say that I can use Vaangula with LiferRay DXP and Vaadin 7.7.6.
Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants