Skip to content

Conversation

@izaera
Copy link
Collaborator

@izaera izaera commented Dec 9, 2025

Resend of brianchandotcom#168320 with extra code to avoid breaking changes due to .js files not being translated for portlets.

izaera added 11 commits December 9, 2025 16:11
…r internal ESM files

We need to use language labels modules for caching to be feasible so we will split .js modules in
two parts: code itself and labels in a different file, thus we don't need the LanguageFilter to kick
in any more.

This will make the use of ETags for .js files not necessary any more.

Note however that legacy /combo URLs are still routed through the filter. In any case this should
only be used for YUI code, not for ESM.
We will integrate all resources managed by frontend-js-web in a single
filter that will delegate to request helpers in the next commit.

This is to be able to centralize all frontend resources management (CSS,
JS, source maps, etc) in one place and reuse strategies for serving them.
… changes

Since portlet JS files are not intended to be ESM format and outside of
that context we cannot use the new translation architecture based on all.js
files, I'm putting back again portlet JS files translation. It essentially
works the same as tokenized CSS files.

Note that translated JS files will not be infinitely cacheable but
time-based, for obvious reasons.
This need was discovered (for JS files) while implementing the previous
commit so I'm adding it for CSS files too.
…rces any more

We never published anything related to supporting it, so it can be
considered an internal.
@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

Test suite sf has been triggered on http://test-1-32

@gemini-code-assist
Copy link

Summary of Changes

Hello @izaera, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors Liferay's frontend resource handling to introduce a robust mechanism for translating JavaScript files, particularly for portlets. It moves away from an older servlet-based system to a more integrated resource handler approach, ensuring that JavaScript assets can be localized and efficiently cached. The changes also include updates to the build process to incorporate content hashing for better cache invalidation and new configuration options for fine-tuning caching behavior of translated modules.

Highlights

  • Language Request Handler Introduction: A new dedicated language request handler has been introduced to manage language-specific JavaScript resources, replacing the previous servlet-based approach.
  • JavaScript Translation for Portlets: JavaScript files used by portlets can now be properly translated, addressing a potential breaking change and ensuring internationalization support for frontend resources.
  • Enhanced Caching Configuration: New caching configuration properties (labelsModulesMaxAge and sendNoCacheForLabelsModules) have been added to control the caching behavior of translated JavaScript modules.
  • Build Process Update for Cache Busting: The build process for the AMD loader now includes MD5 hashes in the filenames of loader.js and loader.js.map, improving cache busting for these critical frontend assets.
  • Refactored Resource Handling: The nocombo: prefix logic has been removed, and the FrontendJsWebLanguageServlet has been deprecated and removed, streamlining frontend resource management.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@izaera izaera requested a review from dsanz December 9, 2025 15:13
@izaera
Copy link
Collaborator Author

izaera commented Dec 9, 2025

ci:test:relevant

@liferay-continuous-integration
Copy link
Collaborator

Test suite relevant has been triggered on http://test-1-35

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and well-architected refactoring of how JavaScript language translations are handled. The shift from a dedicated servlet to a more flexible filter-and-handler mechanism is a great improvement. The new capability to automatically translate JavaScript files containing Liferay.Language.get by adding request parameters is a clean solution. The changes are extensive, touching build scripts, configuration, core portal logic, and tests, and they appear to be moving in a very positive direction. I've identified a few potential issues in the implementation that should be addressed to ensure correctness and robustness. My comments highlight a bug in the Gradle build script, a potential for silent failures in resource loading, and a logic issue in handling multiple portlet resource bundles.

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 5 minutes

Ran com.liferay.source.formatter at released version 1.0.1554.
*The latest version has not been released.

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 177df92a0d21814f6f213d33739608d7f287866b

Sender Branch:

Branch Name: LPD-52709-6
Branch GIT ID: f12c4bede98d5989bda3e2339d0db85b96b09535

1 out of 1 jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 12 out of 12 jobs passed

❌ ci:test:relevant - 19 out of 50 jobs passed in 2 hours 32 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 177df92a0d21814f6f213d33739608d7f287866b

Upstream Comparison:

Branch GIT ID: 975925f19730f06edb987e17df2fd656e6393736
Jenkins Build URL: EE Development Acceptance (master) - 281 - 2025-11-24[08:37:41]

ci:test:stable - 12 out of 12 jobs PASSED
12 Successful Jobs:
    ci:test:relevant - 19 out of 50 jobs PASSED

    31 Failed Jobs:

    19 Successful Jobs:
      For more details click here.

      Failures unique to this pull:

      1. modules-integration-postgresql163/0/11
        [beanshell] 
        [beanshell] Executing commands: git branch | grep \*
        [beanshell] Executing commands: git for-each-ref refs/heads --format="%(refname)"
        [beanshell] Executing commands: git branch | grep \*
        [beanshell] Executing commands: git branch -D -f master-temp-1765291587184
        [beanshell] Executing commands: git for-each-ref refs/heads --format="%(refname)"
        [beanshell] Deleted local branches:
        [beanshell]     master-temp-1765291587184
        [beanshell] Executing commands: git log -n 1
        [beanshell] Executing commands: git clean -dfx
        [beanshell] Executing commands: git log -n 1
        [beanshell] 
        [beanshell] commit 5bb9022606ebef6785458d77a633653ff45ced24
        [beanshell] Author: Liferay Continuous Integration <[email protected]>
        [beanshell] Date:   Sun Dec 7 02:41:07 2025 -0800
        [beanshell] 
        [beanshell]     Commit cache
        [beanshell] 
        [beanshell] 
        [beanshell] commit eef8f68f6d4cb9607a6c7047ec3eae8eaebc2363
        [beanshell] Author: Liferay Continuous Integration <[email protected]>
        [beanshell] Date:   Tue Dec 2 18:47:20 2025 -0800
        [beanshell] 
        [beanshell]     subrepo:ignore Update 'modules/dxp/apps/osb/osb-asah/.gitrepo'.
        [beanshell] 
        [beanshell] Executing commands: git clean -dfx
        [beanshell] Executing commands: git branch | grep \*
        [beanshell] Executing commands: git for-each-ref refs/heads --format="%(refname)"
        [beanshell] Executing commands: git log -n 1
        [beanshell] 
        [beanshell] commit 3274ff03d23ada9bded2d522bbdc6cfedad1358f
        [beanshell] Author: shuyangzhou <[email protected]>
        [beanshell] Date:   Tue Dec 2 11:54:54 2025 -0800
        [beanshell] 
        [beanshell]     LPD-73164 Apply index cache to DLFileEntryImpl
        [beanshell] 
        [beanshell] Executing commands: git branch | grep \*
        [beanshell] Executing commands: git for-each-ref refs/heads --format="%(refname)"
        [beanshell] Executing commands: git branch -D -f master-temp-1765291573874
        [beanshell] Deleted local branches:
        [beanshell]     master-temp-1765291573874
        [beanshell] Executing commands: git log -n 1
        [beanshell] 
        [beanshell] commit 177df92a0d21814f6f213d33739608d7f287866b
        [beanshell] Author: Liferay Translation <[email protected]>
        [beanshell] Date:   Tue Dec 9 10:09:30 2025 +0000
        [beanshell] 
        [beanshell]     LPS-77699 Update Translations
        [beanshell] 
        [beanshell] ParallelExecutor 1 - tearDown completed 15 tasks in 10 seconds averaging 2 seconds per task. 
        [stopwatch] [stop.current.job: 15.301 sec]
        

        BUILD SUCCESSFUL
        Total time: 17 seconds

        • echo 'Exit shell.'
          Exit shell.
          Finished: FAILURE
      2. semantic-versioning/0/0

        Please fix semantic versioning on izaera/LPD-52709-6

             [exec]   PACKAGE_NAME                                       DELTA      CUR_VER    BASE_VER   REC_VER    WARNINGS
        [exec] = ================================================== ========== ========== ========== ========== ==========
        [exec] * com.liferay.portal.kernel.frontend.esm MINOR 2.0.0 2.0.0 2.1.0 VERSION INCREASE REQUIRED
        [exec] < class com.liferay.portal.kernel.frontend.esm.FrontendESMUtil
        [exec] + method isInternalESMRequest(java.lang.String)
        [exec] + access static
        [exec] + return boolean
        [exec] [Baseline Warning] Bundle Version Change Recommended: 177.1.0
        [exec] [Baseline Report] Mode: diff (persisted)
        [exec] Semantic versioning is incorrect while checking /opt/dev/projects/github/liferay-portal/portal-kernel/portal-kernel.jar against /opt/dev/projects/github/liferay-portal/.gradle/caches/modules-2/files-2.1/com.liferay.portal/com.liferay.portal.kernel/177.0.0/58e45ddcc412e998213b86e8ce0fb8799ea130bc/com.liferay.portal.kernel-177.0.0.jar

        1. com.liferay.jenkins.Jenkins
      3. ...

      For upstream results, click here.

      Test bundle downloads:

      @liferay-continuous-integration
      Copy link
      Collaborator

      @izaera
      Copy link
      Collaborator Author

      izaera commented Dec 10, 2025

      ci:report:385769796

      @liferay-continuous-integration
      Copy link
      Collaborator

      Test suite default has been triggered on http://test-1-37

      @liferay-continuous-integration
      Copy link
      Collaborator

      Build completed.

      Testray CSV has been generated successfully for testrayBuildID: 385769796.

      Job Link: generate-testray-csv

      Testray CSV Link: testray-results-385769796.csv

      Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

      Projects

      None yet

      Development

      Successfully merging this pull request may close these issues.

      2 participants