feat: change default port to 4321#7874
Conversation
🦋 Changeset detectedLatest commit: b14a807 The changes in this PR will be included in the next version bump. 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 |
|
Would you mind adding a line about why it's changed at all? 🙂 |
delucis
left a comment
There was a problem hiding this comment.
Left a small note for the CHANGELOG. We’ll also have a bunch of places that need updating in docs: https://github.com/search?q=repo%3Awithastro%2Fdocs%20%3A3000&type=code
Have we considered what happens when the port is busy with this change? Currently, if I run astro dev, but another project is already running, Astro automatically increments the port number and uses 3001 instead (or 3002 etc. until it finds a free port). Is this now 4321, 4322, 4323?
Someone suggested the idea and it made sense for us. 4, 3, 2, 1 ... launch! Also, 3000 is often used by other frameworks. |
That logic hasn't changed. So we incrementally find free ports like you said: |
delucis
left a comment
There was a problem hiding this comment.
Thanks Ema, looks good. We could mention our motivation in relation to @fflaten's comment, e.g. adding "in order to avoid conflicts with ports used by other tools" or something to the changelog.
I've never really cared one way or the other about this change, but docs look ok to me!
bluwy
left a comment
There was a problem hiding this comment.
I think there's still more places to change when I global-search for 3000, e.g.
sandbox.config.json("port": 3000)astro.config.mjs(site: 'http://localhost:3000')- Some READMEs
Since CI doesn't run all the integration tests, it would be good to confirm if they pass too locally.
4d93acd to
5d23182
Compare
|
All README files says 4000 atm |
5d23182 to
e71027f
Compare
Cheers for the review. It should be OK now. |
e71027f to
0065905
Compare
0065905 to
9ee5f88
Compare
bluwy
left a comment
There was a problem hiding this comment.
There's more instances of 3000 in devcontainer.json:
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [3000],.gitpod.yml
ports:
- port: 3000And maybe the prefetch integration playwright.config.mjs:
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000',cec0565 to
1f960e9
Compare
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
1f960e9 to
b14a807
Compare
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Changes
Changes Astro's defualt port to
4321Testing
Current tests should pass
Docs
/cc @withastro/maintainers-docs for feedback!