Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-135627

Remote apps client SDK is being delivered as an AMD module

    Details

      Description

      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)

      Expected:

      • ┬áNo errors in the console thrown by the app

      Observed:

      • 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:
      No __LIFERAY_REMOTE_APP_SDK__ on window

        Attachments

          Activity

            People

            Assignee:
            daniel.sanz Daniel Sanz
            Reporter:
            daniel.sanz Daniel Sanz
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Daniel Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              19 weeks, 2 days ago

                Packages

                Version Package
                7.4.2 CE GA3 DXP 7,4
                7.4.13 DXP GA1
                Master