fix: backward-compat for ESM etherpad#110
Conversation
- 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 reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoRemove trailing slash for ESM etherpad compatibility
WalkthroughsDescription• 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 Diagramflowchart 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"]
File Changes1. eejs.js
|
Code Review by Qodo
1. No regression test added
|
| 'use strict'; | ||
|
|
||
| const eejs = require('ep_etherpad-lite/node/eejs/'); | ||
| const eejs = require('ep_etherpad-lite/node/eejs'); |
There was a problem hiding this comment.
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
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.