Skip to content

fix: backward-compat for ESM etherpad#110

Merged
SamTV12345 merged 1 commit into
mainfrom
fix/esm-compat
May 25, 2026
Merged

fix: backward-compat for ESM etherpad#110
SamTV12345 merged 1 commit into
mainfrom
fix/esm-compat

Conversation

@SamTV12345
Copy link
Copy Markdown
Member

This PR makes the plugin backward-compatible with the upcoming ESM etherpad branch (ether/etherpad#7605).

Change: Remove trailing slash from require("ep_etherpad-lite/node/eejs/")require("ep_etherpad-lite/node/eejs")

The trailing-slash form breaks under Node's strict ESM exports map resolution. This change is backward-compatible with the current CJS etherpad release.

- Drop trailing slash on ep_etherpad-lite/node/eejs/ require

Backward-compatible with current CJS etherpad release; also
compatible with the upcoming ESM etherpad branch which has stricter
exports map resolution.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Remove trailing slash for ESM etherpad compatibility

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Remove trailing slash from eejs require path
• Ensures compatibility with upcoming ESM etherpad
• Maintains backward compatibility with current CJS
• Bump version to 0.2.54
Diagram
flowchart LR
  A["require with trailing slash"] -- "breaks ESM exports" --> B["ESM etherpad incompatible"]
  C["require without trailing slash"] -- "works with both" --> D["CJS and ESM compatible"]

Loading

File Changes

1. eejs.js 🐞 Bug fix +1/-1

Remove trailing slash from eejs require

• Remove trailing slash from ep_etherpad-lite/node/eejs/ require statement
• Change from require('ep_etherpad-lite/node/eejs/') to require('ep_etherpad-lite/node/eejs')
• Fixes strict ESM exports map resolution compatibility

eejs.js


2. package.json ⚙️ Configuration changes +1/-1

Bump version for release

• Increment version from 0.2.53 to 0.2.54

package.json


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented May 25, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1)

Grey Divider


Action required

1. No regression test added 📘 Rule violation ☼ Reliability
Description
The PR changes production code in eejs.js but does not add or update any automated regression test
in the same commit. This risks the ESM/CJS compatibility fix regressing without detection.
Code

eejs.js[3]

Evidence
PR Compliance ID 1 requires that each bug fix include a regression test in the same commit. The diff
shows a production code change to the require('ep_etherpad-lite/node/eejs') import path, but no
test additions/updates are present in the PR diff.

AGENTS.md: Every bug fix must include a regression test in the same commit
eejs.js[3-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A production bug fix was made (changing the `require()` path for `eejs`) without adding/updating a regression test in the same commit.

## Issue Context
The fix is intended to be backward-compatible and to work under Node's strict ESM exports map resolution; a test should fail with the trailing-slash path and pass with the new path.

## Fix Focus Areas
- eejs.js[3-3]
- (add) a new or updated test file under the project's existing test location (e.g., `static/tests/` or the plugin’s test harness) that exercises loading `eejs` and would have failed before this change

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread eejs.js
'use strict';

const eejs = require('ep_etherpad-lite/node/eejs/');
const eejs = require('ep_etherpad-lite/node/eejs');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. No regression test added 📘 Rule violation ☼ Reliability

The PR changes production code in eejs.js but does not add or update any automated regression test
in the same commit. This risks the ESM/CJS compatibility fix regressing without detection.
Agent Prompt
## Issue description
A production bug fix was made (changing the `require()` path for `eejs`) without adding/updating a regression test in the same commit.

## Issue Context
The fix is intended to be backward-compatible and to work under Node's strict ESM exports map resolution; a test should fail with the trailing-slash path and pass with the new path.

## Fix Focus Areas
- eejs.js[3-3]
- (add) a new or updated test file under the project's existing test location (e.g., `static/tests/` or the plugin’s test harness) that exercises loading `eejs` and would have failed before this change

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@SamTV12345 SamTV12345 merged commit aa28e0e into main May 25, 2026
5 of 6 checks passed
@SamTV12345 SamTV12345 deleted the fix/esm-compat branch May 25, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant