Skip to content

JavaScript: Enhance dependency optimization#5276

Merged
nilmerg merged 1 commit intomainfrom
feature/enhanced-js-requirements-5275
May 4, 2026
Merged

JavaScript: Enhance dependency optimization#5276
nilmerg merged 1 commit intomainfrom
feature/enhanced-js-requirements-5275

Conversation

@nilmerg
Copy link
Copy Markdown
Member

@nilmerg nilmerg commented Oct 7, 2024

resolves #5275

@nilmerg nilmerg added enhancement New feature or improvement area/javascript Affects the javascript framework area/framework Affects third party integration/development labels Oct 7, 2024
@nilmerg nilmerg added this to the 2.12.2 milestone Oct 7, 2024
@nilmerg nilmerg self-assigned this Oct 7, 2024
@cla-bot cla-bot Bot added the cla/signed label Oct 7, 2024
@nilmerg nilmerg force-pushed the feature/enhanced-js-requirements-5275 branch from 9b18541 to 6c43d87 Compare October 7, 2024 13:42
@nilmerg nilmerg force-pushed the feature/enhanced-js-requirements-5275 branch from 6c43d87 to e2c6b39 Compare November 4, 2024 09:45
@nilmerg nilmerg modified the milestones: 2.12.2, 2.13 Nov 4, 2024
@lippserd lippserd removed this from the 2.13 milestone Mar 23, 2026
@nilmerg nilmerg force-pushed the feature/enhanced-js-requirements-5275 branch from e2c6b39 to f697cc0 Compare May 4, 2026 10:44
@nilmerg nilmerg added this to the 2.14.0 milestone May 4, 2026
@nilmerg nilmerg requested a review from Copilot May 4, 2026 10:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the Icinga\Web\JavaScript::optimizeDefine() optimizer so AMD define() dependencies can use fully qualified and more flexible relative paths (including explicit file extensions), aligning with the request in #5275.

Changes:

  • Extend dependency optimization to support relative traversal (../) and non-.js extensions when resolving local dependencies.
  • Add PHPUnit coverage for local relative dependency rewriting (with and without explicit extensions).
  • Add JS fixture files under test/config/JavaScriptTest used by the new tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
library/Icinga/Web/JavaScript.php Updates optimizeDefine() dependency resolution to handle relative prefixes and optional extensions before namespacing local dependencies.
test/php/library/Icinga/Web/JavaScriptTest.php Adds PHPUnit tests covering local dependency optimization scenarios.
test/config/JavaScriptTest/someThing.js Fixture for relative dependency without extension.
test/config/JavaScriptTest/someThing/Else.js Fixture for relative dependency using ../ and an explicit extension.
test/config/JavaScriptTest/someOther.js Fixture for a module with no dependency array.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread library/Icinga/Web/JavaScript.php
Comment thread library/Icinga/Web/JavaScript.php
Comment thread test/php/library/Icinga/Web/JavaScriptTest.php
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread library/Icinga/Web/JavaScript.php
Comment thread library/Icinga/Web/JavaScript.php
Comment thread library/Icinga/Web/JavaScript.php
@nilmerg nilmerg force-pushed the feature/enhanced-js-requirements-5275 branch from 95b034d to f4e5944 Compare May 4, 2026 14:09
@nilmerg
Copy link
Copy Markdown
Member Author

nilmerg commented May 4, 2026

Only changed what the AI review uncovered. Merging.

@nilmerg nilmerg merged commit 48f6617 into main May 4, 2026
13 checks passed
@nilmerg nilmerg deleted the feature/enhanced-js-requirements-5275 branch May 4, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/framework Affects third party integration/development area/javascript Affects the javascript framework cla/signed enhancement New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support fully qualified and any relative requirement paths of a library's JavaScript

4 participants