refactor: rewrite NodeHelper as an ES6 class#4147
Open
KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
Open
refactor: rewrite NodeHelper as an ES6 class#4147KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
Conversation
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR rewrites
node_helper.jsto use a native ES6classinstead ofClass.extend()- a manual inheritance helper from 2008, written back whenclasssyntax 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.jsno longer pulls inclass.json the server side. Removingclass.jsaltogether is a follow-up (it's still used on browser side).