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

Figure out why frontend-js-web's Modal.js is eagerly loading, and load it lazily if possible

    Details

      Description

      As noted in this PR:

      https://github.com/liferay/liferay-js-toolkit/pull/632#issuecomment-684949352

      We can see Modal.css being loaded immediately on page load, because Modal.js is being loaded, and it inserts a "link" tag to bring in the CSS.

      As Chema Balsas comments here:

      https://github.com/liferay/liferay-js-toolkit/pull/632#issuecomment-685004014

      > I haven't checked exactly why is this loading but I presume it's because we pack Modal.js in our global or something like that for the static Liferay.Util.openModal... so maybe we could also try to defer that so Modal.js is not loaded upfront... that would be an even better improvement

      So, that's the purpose of this story: find out why we're loading eagerly, and see if we can gracefully load the JS (and therefore the CSS) lazily without any downsides (ie. we don't want to introduce lazy loading at the expense of making all modals in DXP feel sluggish; so the trade-offs will have to be carefully explored here).

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            greg.hurrell Greg Hurrell (Inactive)
            Recent user:
            Greg Hurrell (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package