fix: backward-compat for ESM etherpad#89
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 from eejs require for ESM compatibility
WalkthroughsDescription• Remove trailing slash from eejs require path • Ensures compatibility with ESM etherpad exports map • Maintains backward compatibility with current CJS release • Bump version to 1.1.62 Diagramflowchart LR
A["ep_etherpad-lite/node/eejs/"] -->|"Remove trailing slash"| B["ep_etherpad-lite/node/eejs"]
B -->|"Compatible with"| C["ESM etherpad branch"]
B -->|"Compatible with"| D["Current CJS release"]
File Changes1. static/js/help_bubbles.js
|
Code Review by Qodo
1. No regression test for eejs require
|
| args.content += require('ep_etherpad-lite/node/eejs') | ||
| .require('ep_help_bubbles/static/js/Bubble.js'); | ||
| args.content += require('ep_etherpad-lite/node/eejs/') | ||
| args.content += require('ep_etherpad-lite/node/eejs') | ||
| .require('ep_help_bubbles/static/js/jquery.grumble.js'); | ||
| args.content += require('ep_etherpad-lite/node/eejs/') | ||
| args.content += require('ep_etherpad-lite/node/eejs') | ||
| .require('ep_help_bubbles/static/js/help_bubbles_function.js'); |
There was a problem hiding this comment.
1. No regression test for eejs require 📘 Rule violation ☼ Reliability
This PR changes runtime module resolution behavior (removing the trailing slash in
require('ep_etherpad-lite/node/eejs')) but does not add or update an automated regression test to
prevent the bug from reappearing. This increases the risk of the ESM compatibility issue being
reintroduced without detection.
Agent Prompt
## Issue description
A bug fix was made to module resolution (`require('ep_etherpad-lite/node/eejs')` path change) without adding a regression test that would fail before the fix and pass after it.
## Issue Context
The PR claims the trailing-slash form breaks under strict ESM exports map resolution. A regression test should exercise loading/including the plugin assets in a way that would catch a reintroduction of the trailing slash (or other incompatible import path changes).
## Fix Focus Areas
- static/js/help_bubbles.js[4-9]
ⓘ 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.