Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay JS Portlet Extender / js_loader_modules / Angular
Hi all...
Im trying to follow the Angular Deduplication examples and got a few questions....
Case 1:
The Context:
Using the yeoman generator-liferay-bundle, create two angular portlet with deduplication mode (Shared packages bundle a.k.a. provider & Angular based portlet a.k.a consumer).
The consumer portlet don't start because it ask for osgi com.liferay.frontend.js.portlet.extender@1.1.0
There is a Liferay
JS Portlet Extender 1.0.0 in LPKG file at the marketplace
(inside it, is the 1.0.5)
At the maven repo its the 1.0.6, so i downloaded and installed that one
The question:
Do i need the 1.1.0 version, and if so... where can i find it?
Case 2:
All the npm dependencies are registered on the js_loader_modules, this file its quite big,
i saw a resolve issue about it, and install the FP6
an the results (attached npmDeduplicationMinifiedOutTheBox.PNG & npmDeduplicationSample.PNG):
A consumer portlet with a minified version of js_loader_module with register dependencies (Angular) on it from provider module.
Browser transfer info of js_loader_module: 2mb@1.55s
The question:
How to control the size of js_loader_modules when we register common dependencies and it gets even bigger?
Im using:
DXP 7.1 with FP6
Tomcat bundle with hsql
Many thanks
Regards.
Hi Armando:
1) We need to release version 1.1.0 of the extender. Meanwhile, generate your projects without settings configuration support which is the culprit of the need for 1.1.0 (see this link on how the bundler decides which version to require).
2) We are already working in a big change in the loader to avoid the need for the js_loader_modules file. All module resolutions will take place in the server so that the loader doesn't need to know anything about the modules that are installed in the served. However, that will take time and may not be available in older versions of the portal so, in the meantime, we recommend to activate the GZipFilter so that the js_loader_modules is compressed (it will be highly compressed because it's mainly redundant text). That should make the trick until the other feature arrives.
Hope that helps :-),
Ivan
Powered by Liferay™