bigtestjs / server

All BigTest development has moved to https://github.com/thefrontside/bigtest
https://github.com/thefrontside/bigtest
2 stars 1 forks source link

Agent process #26

Closed jnicklas closed 4 years ago

jnicklas commented 4 years ago

Since the state of the process PR is a bit unclear and I didn't know what else to work on, I played around with our idea of running parcel in an isolated process, but as a library, and with an ability to communicate with the main process. Seems to work rather well. Node's handling of forked processes is really nice.

There are a few problems though:

1) How do we specify the path to the module for the parcel server? Given that our source is in TS but we'll need to run this post-compilation as well, it gets a bit complicated.

2) Does this work on windows at all?

cowboyd commented 4 years ago
  1. How do we specify the path to the module for the parcel server? Given that our source is in TS but we'll need to run this post-compilation as well, it gets a bit complicated.

I think the easiest approach is going to be to add a bin directive to our package manifest. I believe that when you run the node process, certainly through either npm run or yarn run all of those executables will be in your path. So if we name it bigtest-parcel-server and then explicitly add it to our manifest, it should work. Of course, we'll need to bootstrap ts-node in that script. Which does beg the question, do we want to do on-the-fly compilation of TS or an ahead of time compilation since this will drastically reduce startup times. 🤔

  1. Does this work on windows at all?

All of the caveats in the ChildProcess docs related to Windows don't mention it, so I hope and pray 🙏 😆