New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node-compatible process module #10782
Conversation
|
e305f1e
to
a14bdf7
Compare
d3983e3
to
36d4bb8
Compare
Add most of node API for global process object. Add 'events' module, make global process object an instance of EventEmitter. Fixes TIMOB-26571
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.
Just a minor note regarding formatting of a doc block. Approving nonetheless, since the rest looks good!
@@ -0,0 +1,15 @@ | |||
/** | |||
* @param {*} arg passed in argument value |
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.
Remove indentation to match other doc blocks.
process.noDeprecation = false; | ||
process.pid = 0; | ||
// FIXME: Should we try and adopt 'windowsphone'/'windowsstore' to 'win32'? | ||
// FIXME: Should we try and adopt 'ipad'/'iphone' to 'darwin'? or 'ios'? |
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.
Again, yes, please! :)
@sgtcoolguy i think it should somehow be configurable what node shims we load since there are some node modules out there that change behavior depending on availability of certain built-in node modules. The popular axios http client for example tries to load the We either need some documentation that describes these gotchas and how to workaround them or a way to disable the shims if a user does not need them anyway. |
manually merged |
@janvennemann Yeah I'm not sure how to handle "partial" node API support. To some degree we may be able to make use of browserify to shim the ones we haven't gotten to, but for example We could use some sort of property/build flag to toggle the extensions altogether or maybe using some pattern matching or something? It's difficult, because even something like trying to get our test suite to use the "out of the box" mocha with these shims keeps exposing more subtle API differences we need to fix. Some of which are much larger architectural issues (like how Android's |
JIRA: https://jira.appcelerator.org/browse/TIMOB-26571
Description:
This is an attempt to expand the global process object to be more compatible with Node when possible.
What's missing?
warning
anduncaughtException
. A number of them don't apply, but I think perhapsbeforeExit
may make sense to hook to our Ti.App event forclose
.