-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[code-infra] Accept PORT
env on docs:dev
script
#19014
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
Conversation
Deploy preview: https://deploy-preview-19014--material-ui-x.netlify.app/ Bundle size report
|
You can do: ❯ pnpm start --port 3002
> @8.9.2 start /Users/belchior/Documents/mui/mui-x
> pnpm i && pnpm docs:dev --port 3002
Scope: all 27 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date
╭ Warning ───────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Ignored build scripts: core-js. │
│ Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────╯
Done in 1.1s using pnpm v10.13.1
> @8.9.2 docs:dev /Users/belchior/Documents/mui/mui-x
> pnpm --filter docs dev --port 3002
> docs@ dev /Users/belchior/Documents/mui/mui-x/docs
> next dev --port 3001 --port 3002
▲ Next.js 15.4.4
- Local: http://localhost:3002
- Network: http://192.168.2.92:3002
- Experiments (use with caution):
· esmExternals
✓ scrollRestoration
✓ Starting...
Using tsconfig file: ../tsconfig.dev.json
Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.js" https://nextjs.org/docs/messages/swc-disabled
`compiler` options in `next.config.js` will be ignored while using Babel https://nextjs.org/docs/messages/ignored-compiler-options
Considering various locales for SSR
✓ Ready in 1845ms |
I'm aware I can, but using |
If there will be a file per repo anyway, instead of I don't have a big issue with using If you feel like running |
Well put, this resonates with me. But we need to unlock this use-case. In your workflow, instead of overriding the environment, would it be possible to override the command? |
I would argue that the original code is MORE workflow dependent than the change itself. It is correcting for the possibility that we have
It doesn't, we already use I fail to see what concrete issue you are worried about here, since my change only allows for more possibilities, rather than limiting anything. Ideally we wouldn't use the |
FWIW, |
Sorry I got confused. It doesn't support PORT in the Still, for |
Yeah, that's true. I wonder if that assumption is still useful.
So we could consider removing the port override.
Great 👍
My point isn't in this change per se. It's mostly that if we're catering to one workflow, then when someone else has another workflow that clashes with this one, we'll need to handle both workflows. It's just a preventive measure.
Sure, makes sense. Also, regarding this question, wouldn't it work for your workflow?
If not, I think we can merge this and reassess the default port of 3001 if more changes are required. |
How so? If our initial state makes it work only in a specific workflow? This change only makes the project more configurable. My entire point is that the current workflow is flawed. I'm keeping the current behaviour and making it support the common behaviour of accepting I can't see any way this will clash with any workflow whatsoever since every part of this is overridable. 🤔
I can manually force the port, my point is that it is tiring. I have 3 different versions of the same repo. I have to check which one I'm in, then select the port I want to use. My local config doesn't run anything per-se. It only loads a My goal is to simply run whatever scripts I want with the configuration I provide. I'm just asking for ppl to review this at face value.
I fail to see what all the fuss is about, and if we want to discuss about removing the default port I would move it to a different PR, as that is not the goal here, but I also find that discussion has no value in itself, since everything works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate that we need to do this workaround, but if we can't remove the hardcoded 3001 port, then I'm ok with it
Another option is to run your dev command like Then you can specify whatever
I think the problem with this PR is that it's adding yet another layer of config overrides. We now have
I agree that it's "It is a one-line change" and from the perspective of an X maintainer a not so significant one. But from the code-infra perspective it's yet another layer of complexity to manage and another local breaking point to account for. From code infra perspective, the complexity compounds as each project starts adding their own overrides system. Managing complexity here means aiming at taking override layers away, and that's why I think this implementation intuitively rubs against the grain of the participants in this thread. |
This allows me to automate different ports for multiple copies of the repo.
Original behaviour should stay the same, unless you set PORT in your env for some other reason, which you probably shouldn't 🫠