Affects Version/s: Master
Component/s: JS APIs and Utilities
A remote web app is unable to utilize the client SDK we provide. Root cause is that file with the SDK we package in remote-app-client-js bundle is being bundled by the npm-bundler.
In this case, we don't want that behavior because file is aimed at being consumed by a remote app which expects to receive a plain JS function, not a Liferay.loader.define()'d one. Note this file could as well be hosted outside Liferay (e.g. in CDN) but in any case, Liferay server should serve it as a simple JS function.
Steps to reproduce:
- Create a remote web app from the Global Apps menu.
- Provide some URL which hosts a remote app making use of the client SDK. Provide a name. At the time of this writing, there are 2 options available for the URL:
- Create a new widget page
- Hit F12 to open dev tools in the browser, make sure console is visible
- Add the widget created for the remote web app (search widgets by the name given 2 steps above)
- No errors in the console thrown by the app
- App can't use the client SDK, so it warns about this fact in the console. For the case of the 2 apps above, one can see a message like this: