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

Extract document-library-preview modules css to shared component

    Details

      Description

      Different document library preview modules make use of the same styles. Existing solution is to create a <link> element via <html-top> tag in preview.jsp so that it loads the required css from document-library-web, making it available when needed. This approach has some issues:

      • Developers need to manually craft the CSS link in the JSP, which requires some portal APIs and may be error prone if not done consistently across the board (e.g. things like getCDNBaseURL(), getPathProxy() and friends may be forgotten)
      • Usage of link makes it hard to inline styles in case we prefer to it over an additional HTTP request
      • If the module serving the CSS is different from the one hosting the JSP, then we have an implicit dependency which nobody knows about
      • React apps rendered via that JSP are not importing that CSS neither declaring it as dependency, meaning that there's another hidden dependency here

      In this story we are applying a new pattern to avoid the above issues. Pattern is about

      • Creating a new bundle aimed at containing shared styles for a DXP application
      • Moving some document-library-web styles to the shared bundle, which exports them as npm package
      • Using a new tag to include the styles in the JSP (LPS-135421)
      • Make react apps to explicitly import that package

        Attachments

          Activity

            People

            Assignee:
            daniel.sanz Daniel Sanz
            Reporter:
            carlos.lancha Carlos Lancha
            Engineering Assignee:
            SE Support
            Recent user:
            Daniel Sanz
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package
                Master