Skip to content

refactor: rewrite NodeHelper as an ES6 class#4147

Open
KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO:nodehelper-class
Open

refactor: rewrite NodeHelper as an ES6 class#4147
KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO:nodehelper-class

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

@KristjanESPERANTO KristjanESPERANTO commented May 7, 2026

This PR rewrites node_helper.js to use a native ES6 class instead of Class.extend() - a manual inheritance helper from 2008, written back when class syntax didn't exist yet. Node.js has supported native classes since v6, so there's no reason to keep the workaround around.

The public API is unchanged - module authors still write the same NodeHelper.create({...}) they always have.

Outcome: same behavior, normal modern JavaScript, better stack traces, and node_helper.js no longer pulls in class.js on the server side. Removing class.js altogether is a follow-up (it's still used on browser side).

Replaces the legacy Class.extend() inheritance pattern with a native ES6
class. NodeHelper.create() remains the public API and is fully compatible
with all third-party modules.
@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator Author

The failed Node 26 test seems unrelated to the changes to me. It hangs at the MM installation step; at that point, the modified code is irrelevant.

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