-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
[WIP] Next major spawn-wrap version #77
Closed
Closed
Conversation
This file contains 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
demurgos
force-pushed
the
next
branch
3 times, most recently
from
November 25, 2018 21:19
bf5a2e5
to
d63d71b
Compare
demurgos
force-pushed
the
next
branch
8 times, most recently
from
May 10, 2019 15:39
26dfe11
to
4728c78
Compare
Open
This is a large change to introduce a proper separation between the creation of the shim directory and the wrapped functions. It is the first stepped to support local wrapping. Notable changes: - Creation of an additional Windows cmd shim if the base name of the executable is not `node`. - Expose object-based API as `spawnWrap.wrapGlobal` - The shim root is now a proper directory, not a "prefix"
The new wrapper API replaces the possibility of setting `args` and `env` with a `wrapper` path and `data` object. It also exposes a new wrapper mode enabling spawning the child process in its own subprocess.
Also rename `applyContextOnGlobal` to `patchInternalsWithContext`
- Use `shimScript` in Node munger (instead of `shimExecutable`). - Wait for the streams to close before ending the TCP sockets used for observable spawns.
The lib was accidentally using `fromArray` instead of `from`.
I'm unsure if anything from this PR is not already merged but I'm closing as I think any changes still required would need to be submitted as separate PR's. |
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.
While working on code coverage, I updated
spawn-wrap
to be more reliable, easier to use and provide more features.This PR corresponds to the end result I reached. It is not intended to be merged immediately but should serve as a reference point. I'll break it down to smaller PRs and send them progressively.
Highlights:
The lib no longer requires to globally patch the internals. It's still available but discouraged: you can use an isolated
child_process
API with wrappers. This allows to run multiple processes concurrently with different wrappers.The API was simplified to easily use a wrapper main module and pass some data to it. I checked all the dependent packages to see how the lib is used: this is basically what it boils down to. You can still pass arbitrary flags or environment variables but it's no longer the default API.
Various refactoring to simplify the code: less mutations, newer syntax, type annotations (catched a few bugs).