Skip to content
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

Allow creating dev server without opening port. #2314

Closed
wants to merge 3 commits into from

Conversation

Xiot
Copy link
Contributor

@Xiot Xiot commented Jan 16, 2021

Added a config for devOptions.server?: boolean which defaults to true;
If false, then no http(s) server will be created and it will be up to
the caller to create the initial server.

Created a stub for EsmHmrEngine that avoids any processing if HMR is disabled.

Changes

Testing

TODO: Add Tests

Docs

TODO: Update Docs

@vercel
Copy link

vercel bot commented Jan 16, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/91vqbyo3q
✅ Preview: https://snowpack-git-fork-xiot-hmr-server.pikapkg.vercel.app

@Xiot
Copy link
Contributor Author

Xiot commented Jan 16, 2021

Creates a new http(s) server for HMR if needed, using the same snowpack certificates as the main server. Fixes #2288

Allows passing devOptions.server: false to prevent the creation of a new http(s) server. Addresses #2239

@Xiot
Copy link
Contributor Author

Xiot commented Jan 16, 2021

The failed unit test is caused by another bug.
Fixed here #2328

@Xiot
Copy link
Contributor Author

Xiot commented Jan 16, 2021

Test failures are fixed in this PR #2328

Chris Thomas added 2 commits January 16, 2021 11:35
Added a config for `devOptions.server?: boolean` which defaults to `true`;
If `false`, then no http(s) server will be created and it will be up to
the caller to create the initial server.

Created a stub for EsmHmrEngine that avoids any processing if HMR is disabled.
@Xiot
Copy link
Contributor Author

Xiot commented Jan 16, 2021

rebased to keep up with @FredKSchott speedy fixes

@FredKSchott
Copy link
Owner

Fixed in #2707 by passing port = 0 (will add some docs for this).

In the next breaking change for Snowpack, I'd like to add a .listen() method to the dev server to start the actual server itself (instead of being always on by default).

Triage automation moved this from Pull Request Open to Closed Mar 15, 2021
@FredKSchott FredKSchott removed this from Closed in Triage Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants