Commit Graph

6 Commits

Author SHA1 Message Date
Nathan Rajlich
97eeddb6ac [cli][node] Re-apply @TooTallNate's vc dev updates (#4254)
This reverts commit 099bc6dbf6 (#4231).
2020-05-12 13:58:05 -07:00
Nathan Rajlich
099bc6dbf6 Temporarily revert @TooTallNate's now dev updates (#4231)
Needs more time for testing, and we are preparing a new stable release.

This will be un-reverted after the stable release is tagged.
2020-05-02 00:52:21 +00:00
Nathan Rajlich
7b1893b9f7 [now-node] Use project env vars in startDevServer() and respect NODEJS_HELPERS env var (#4211)
Depends on #4210.
2020-04-30 15:12:46 -07:00
Nathan Rajlich
a1a5e0ef0d [now-node] Make "without helpers" config option work as expected in startDevServer() (#4208) 2020-04-30 10:49:29 -07:00
Nathan Rajlich
8e29924165 [now-node] Add TypeScript support to startDevServer() (#4185)
Using `ts-node`, with asynchronous type checking via `tsc --no-emit`.

This also removes `ncc` of `typescript` during the build in favor of
having typescript be a regular npm "dependency".
2020-04-30 09:19:30 -04:00
Nathan Rajlich
6fd1b50924 [now dev] Add support for proxying to builder-specific dev servers (#4089)
This is an extension to the Runtime API, where a runtime can optionally define a `startDevServer()` function which is responsible for spawning a single-serve dev server for an individual HTTP request (the dev server is booted up upon receiving an HTTP request, and gets shut down by `now dev` after the HTTP request is completed). For runtimes that define this function, the `build()` function will never be executed, which avoids a lot of unnecessary processing for a dev environment.

Some things this accomplishes:

 * Retains the proper stack trace for errors.
 * Ensures that if a source code file is changed, and then an HTTP request is sent, it's guaranteed to be using the latest code (no file watching, or re-compilations).
 * Avoids creating a Lambda zip file (just to immediately unpack it for dev).
 * Avoids `@zeit/fun` completely, which loses some "correctness" (i.e. function is not frozen in between requests).
 * Backwards compatible with older Now CLIs - versions that don't know about `startDevServer()` will just invoke `build()`, and there's no version change required in the Runtime.
2020-04-17 20:55:44 +00:00