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

fix: update preview port #6330

Merged
merged 4 commits into from
Jan 16, 2022
Merged

fix: update preview port #6330

merged 4 commits into from
Jan 16, 2022

Conversation

Niputi
Copy link
Contributor

@Niputi Niputi commented Dec 30, 2021

Description

fix: #5707

port 4000 is not listed on https://support.apple.com/en-us/HT202944

have chosen 4000 as it looks nice being a 1000 more than dev

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Niputi Niputi added the p2-nice-to-have Not breaking anything but nice to have (priority) label Dec 30, 2021
@Shinigami92
Copy link
Member

At a team meeting we thought about 5173
Like 5173 in leet for Vite | V I T Ǝ | V === Roman 5

@patak-dev
Copy link
Member

At a team meeting we thought about 5173 Like 5173 in leet for Vite | V I T Ǝ | V === Roman 5

They thought 😅
I kind of prefer 4000, but we could go with any of them. Maybe we should discuss this again

@Shinigami92
Copy link
Member

Seems that @bluwy like it too ^^
And I also like the 5173 port, it will definitely conflict less with other apps and default ports
and it is remember able, beside that you just click on the link in your IDE like VSCode

@Niputi
Copy link
Contributor Author

Niputi commented Dec 31, 2021

I like typing the url in the browser and its faster to write a thousand number with zeroes

@Shinigami92
Copy link
Member

For me it just autocomplete it when I just type lo 🤔

@bluwy
Copy link
Member

bluwy commented Dec 31, 2021

Four equally-spaced odd numbers, that can be joyfully typed as hopscotch, it'll be a huge missed opportunity!

In all seriousness, I'm indifferent with either port numbers too. But it looks like a fun easter egg.

@Niputi
Copy link
Contributor Author

Niputi commented Dec 31, 2021

For me it just autocomplete it when I just type lo 🤔

yes but not if you use a different browser than usual, use incognito or have cleared history

@benmccann
Copy link
Collaborator

V -> 5 sounds like quite a leap. 4 at least is as upside down V in some sense, so I'd go with 4173 before 5173. Both sound a little hard to remember though. I suppose it's printed to the console, but I would still lean towards 4000

port 4000 is not listed on https://support.apple.com/en-us/HT202944

Neither is 5000 and it still sounds like they hijacked it. I hope they didn't grab any others that's we're unaware of 😄

@junaga
Copy link
Contributor

junaga commented Jan 2, 2022

I prefer 4173 over 5173 (It reads better)

As a normal user, I think Shinigami92 is onto something. I really love the idea of the port number being used to express branding. I also agree that most users probably just click the logged link in the console. (I know I do)

Thinking long term, having a dedicated port number (although unofficial) would just make sense for the common user. Who knows that port numbers, unlike domains, are really more of a convention, than a rule. Check out Port 4000 on Wikipedia's list of port numbers. All of this is just community conventions across the entire internet. Who cares about what corporate says, you are and should think Open Source.

Honestly guys, Vite is awesome (and has crazy potential).
One number out of the 65535 available, you should own it! Definitely deserved.

@patak-dev
Copy link
Member

We are talking about the preview server here. It looks inconsistent to me that the dev server is going to remain 3000 and the preview will now be a random looking number

@junaga
Copy link
Contributor

junaga commented Jan 2, 2022

Maybe a twitter poll? 😂
Just kidding ^^

@Shinigami92
Copy link
Member

I didn't know that it is only the preview port
From my side, the preview port is irrelevant for me, I thought it would be the dev-server port. For that one I would love to have that Vite easter-egg-port :)

@Niputi Niputi changed the title fix: update port fix: update preview port Jan 2, 2022
@dominikg
Copy link
Contributor

dominikg commented Jan 3, 2022

there is some history around using 8080 for custom http services. so what about 8050 or 5080 ? keeps the old 50 from 5000 and adds 80 to show it's http.

@junaga
Copy link
Contributor

junaga commented Jan 6, 2022

Can we close this?

(Like Shini, I also agree that the preview port doesn't matter and can be any number.)

@benmccann
Copy link
Collaborator

+1 on closing, but for the reason mentioned by @patak-dev, which is that dev and preview ports should be consistent

@patak-dev
Copy link
Member

But this PR is changing the preview port to 4000, which is consistent with the dev server at 3000. And @junaga, if we could stay at 5000, that would be great but now users in MacOS are having issues when using that port number so changing it seems correct here.

@benmccann
Copy link
Collaborator

Ah, I did not realize preview and dev use different ports today. We use 3000 for both for SvelteKit, which I think is easier to remember since you don't have to remember two different ports. Is there any reason not to use the same port for both?

@patak-dev
Copy link
Member

From what I understand, having two ports could enable you to check both the dev server and the preview server at the same time without extra configuration (in case you want to compare something between the two). It is also interesting to have different caches in the browser for each, no?

@benmccann
Copy link
Collaborator

Yeah. I've never felt the need to compare and you can override the port if you do have that need. The cache thing might be more of an issue though if you use service workers. We've had service worker caching be an issue even between different apps because all the browser sees is localhost:3000

lostmachinesxyz added a commit to lostmachinesxyz/lostmachinesxyz.github.io that referenced this pull request Jan 12, 2022
@patak-dev
Copy link
Member

We talked in the last team meeting about the port number. Looks like we are going to use 5173 for the dev server, and change 3000 to it when we release Vite 3.0 in a few months (at the end of life of Node v12). So we should change the preview server from 5000 to a number that is coherent with 5173. @Niputi, from the list you linked, it looks like 4173 is free. Would you help to confirm that this would be a good port number and update the PR if it is?

@Niputi
Copy link
Contributor Author

Niputi commented Jan 16, 2022

port number updated

@patak-dev patak-dev added this to the 2.8 milestone Jan 16, 2022
@patak-dev patak-dev merged commit 870e1c0 into vitejs:main Jan 16, 2022
@Niputi Niputi deleted the chore/update-port branch January 16, 2022 21:33
@junaga
Copy link
Contributor

junaga commented Jan 16, 2022

Just one small comment about mobile with --host.

There is this argument of not being able to quickly open the port (it has to be typed in manually). Maybe something similar like vite-plugin-qrcode could fix this. I right now use vite-plugin-qrcode in my project.

Google added the "Google Lens" icon into the Android Homescreen search bar. I open all my QR codes with it.

@patak-dev
Copy link
Member

@junaga do you suggest adding vite-plugin-qrcode to core? If that plugin is working well for you, I think it is fine to avoid having to maintain it here

@junaga
Copy link
Contributor

junaga commented Jan 16, 2022

Oh no no! That plugin is terrible, (it works). I just wanted to mention the option.

Logging a QR code when vite is run with --host. Just a modern DX design decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite not working in macOS Monterey
7 participants