Skip to content

fix: backward-compat for ESM etherpad#89

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

fix: backward-compat for ESM etherpad#89
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 from eejs require for ESM compatibility

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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"]

Loading

File Changes

1. static/js/help_bubbles.js 🐞 Bug fix +5/-5

Remove trailing slash from eejs require paths

• Removed trailing slash from 5 occurrences of require('ep_etherpad-lite/node/eejs/') calls
• Changed to require('ep_etherpad-lite/node/eejs') for strict ESM exports map compatibility
• Affects eejsBlock_scripts, eejsBlock_styles, and eejsBlock_editbarMenuRight hook handlers

static/js/help_bubbles.js


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

Increment version for ESM compatibility fix

• Bumped version from 1.1.61 to 1.1.62

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 for eejs require 📘 Rule violation ☼ Reliability
Description
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.
Code

static/js/help_bubbles.js[R4-9]

Evidence
PR Compliance ID 1 requires every bug fix to include a regression test in the same commit. The diff
shows a functional compatibility fix in static/js/help_bubbles.js (changing the require()
target), but there are no accompanying test additions/updates in the provided PR diff.

AGENTS.md: Every Bug Fix Must Include a Regression Test in the Same Commit
static/js/help_bubbles.js[4-9]

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 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


Grey Divider

Qodo Logo

Comment thread static/js/help_bubbles.js
Comment on lines +4 to 9
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');
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 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

@SamTV12345 SamTV12345 merged commit b25fb94 into main May 25, 2026
3 checks passed
@SamTV12345 SamTV12345 deleted the fix/esm-compat branch May 25, 2026 14:54
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