JavaScript: Enhance dependency optimization#5276
Merged
Conversation
9b18541 to
6c43d87
Compare
sukhwinder33445
previously approved these changes
Oct 11, 2024
6c43d87 to
e2c6b39
Compare
e2c6b39 to
f697cc0
Compare
There was a problem hiding this comment.
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-.jsextensions when resolving local dependencies. - Add PHPUnit coverage for local relative dependency rewriting (with and without explicit extensions).
- Add JS fixture files under
test/config/JavaScriptTestused 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.
f697cc0 to
95b034d
Compare
There was a problem hiding this comment.
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.
95b034d to
f4e5944
Compare
Member
Author
|
Only changed what the AI review uncovered. Merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #5275