This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the problem with that. It feels a lot cleaner to me.
Well, the main point of this refactoring was to get rid of this insane collection of locally scoped variables and functions that were really difficult to follow along. I wouldn't mind moving requireNative back outside, but I don't see the advantage, can you explain?
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
felixge, "native" modules - the ones in lib/ are special in that they don't need the big require() function given to external modules. They can be bootstrapped with requireNative.
herby, sorry - we should have run this by you first.
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware of that. I just don't get how this logic would not be part of the responsibility of the "module" module. Or at the very least it should be wrapped into a "NativeModule" class / module.
Again, my main problem was the fact that the "node.js" file was full of various scopes and local variables / functions, that would be referenced hundreds of lines apart.
By grouping those functions and variables into "class methods / properties", it becomes much easier to understand what the code is doing. If you want the "requireNative" functionality in it's own module, I can provide a patch for that.
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, so if I provide a patch that pulls out requireNative into it's own unit, we're all happy? : )
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of my last two comments, I'm still agreeing with you : ).
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a plan, I'll prepare a patch.
2e5dfaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
herby, what do you think about this?
felixge@fa1c644