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

use Vite defaults for port and strictPort #5392

Merged
merged 1 commit into from Jul 8, 2022
Merged

Conversation

Rich-Harris
Copy link
Member

These made sense when we were using svelte-kit dev etc, but I'm not sure they do any more

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Jul 6, 2022

🦋 Changeset detected

Latest commit: 4076d49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benmccann
Copy link
Member

strictPort probably makes sense to remove

The Vite default port is insane though. 4173 or something like that and I think it's different between dev and preview making it even more confusing

@benmccann
Copy link
Member

See vitejs/vite#6330 and vitejs/vite#8148 for the port defaults

@Conduitry
Copy link
Member

I'm torn. Yeah, those defaults are insane. Maybe as a compromise we could drop the default overrides from Kit itself, but re-add the same 3000 defaults to the starter templates?

@dominikg
Copy link
Member

dominikg commented Jul 7, 2022

They chose unique ports to be associated with vite.
Different ports for dev and preview can make sense to recognize which mode it is in the url bar and also to run them in parallel.

It should be possible to provide other ports/overrides from the config hook of kit vite plugin

@bluwy
Copy link
Member

bluwy commented Jul 7, 2022

Yeah 5173 and 4173 both represent VITE so there's a correlation, but one of the reasons why the port number doesn't matter is that users would just ctrl-click the url from the terminal to open up, or the browser already autocompletes it, so you won't always be typing that out.

I think if SvelteKit is truly a Vite plugin now, it make sense to use Vite's default config for it.

@benmccann
Copy link
Member

I've literally never ctrl+clicked the URL in the terminal and din't know you could until now. Even knowing that you can, I don't think I'd do it as it'll open as a new tab in whatever window I last used, which isn't necessarily where I want to open it. I agree putting the port in the template might be better than putting it in the plugin at least though

@Rich-Harris
Copy link
Member Author

I don't know why we'd want to override the default in the template. Is it a weird default? Maybe. Will people get used to it? Yes. Is it hard to change? No. Just feels like an unnecessary distinction from every other Vite app

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

5 participants