refactor(engine-java): remove unused toJSNode/transformToJsNode methods#643
Open
refactor(engine-java): remove unused toJSNode/transformToJsNode methods#643
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes legacy code from the Handlebars (HBS) era that was used to convert JCR nodes into plain JavaScript objects. With the migration to React, the codebase now directly uses Java objects, making these transformation methods obsolete.
Changes:
- Removed three methods from
JSNodeMapperthat converted JCR nodes to JavaScript objects (toJSNode,toJSNodeProperties,toJSNodePropertyValue) - Removed the
transformToJsNodemethod fromRenderHelperthat wrapped the conversion functionality - Updated class documentation to accurately reflect the current purpose of
JSNodeMapper(mapping JSON structures to virtual JCR nodes for React's<Render>component) - Applied consistent code formatting improvements (line wrapping)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| javascript-modules-engine-java/src/main/java/org/jahia/modules/javascript/modules/engine/jsengine/JSNodeMapper.java | Removed 3 unused methods related to JCR-to-JS conversion, updated documentation, and improved formatting |
| javascript-modules-engine-java/src/main/java/org/jahia/modules/javascript/modules/engine/js/server/RenderHelper.java | Removed unused transformToJsNode method that was a wrapper for the deleted functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ne-java/src/main/java/org/jahia/modules/javascript/modules/engine/jsengine/JSNodeMapper.java
Outdated
Show resolved
Hide resolved
...ne-java/src/main/java/org/jahia/modules/javascript/modules/engine/jsengine/JSNodeMapper.java
Outdated
Show resolved
Hide resolved
dgriffon
approved these changes
Feb 24, 2026
Member
Author
|
This is not part of the documented API, we can safely remove it as "legacy implementation detail" We can always revert the deletion in case this assumption is wrong |
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.
Description
A leftover from the HBS era: we no longer need to manipulate plain JS objects in React, we can use Java objects
Checklist
Source code
Tests
Tip
Documentation to guide the reviews: How to do a code review