-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Changing the DEV_PORT doesn't update the watcher reload_port shown in terminal #1874
Comments
I just tried to recreate this, and it all seems to be working as expected...
I'm guessing where the confusion may have been is if you add your |
Should we consider fixing it? i open a older lucky project, when i start it use lucky dev, it told me, web server listen on 3000, but, try a lot times, no work. yes, there is a Can we delay the output of Thanks |
I don't know if we can fix it because these values can't be set at runtime. They have to be set before compile-time. I did notice I forgot to update the docs on this, so I added luckyframework/website#1383 |
Hi, what i thought is, this has nothing to do with when the value was set, it relates to when the port info is shown to the user. can we delay displaying this message? until runtime know the correct port? |
We might be able to, but it might require a lot of refactoring. I don't have any time to look in to it though. If you would like to open a PR and take a shot, please do 👍 Basically you would have to figure out how to delay building the Lines 220 to 222 in dd21f8b
|
I will.
Wired, i change the return string of Thanks. EDIT: never mind, i deleted the build file in the bin/, it works now. I found this issue caused by the prebuilt task |
Compared to a bit speed improvement when run I tought two solutions:
both solution are easy, perhaps you have a better way? |
I know those are easy ways, but I don't believe either of them are the correct way. I did look in to this, and I don't see any clear paths for fixing this, but I also find it a very small use case since you don't ever need to use |
What i means is, watch task still playing it role, but if it can't print the port correctly, it shouldn't print it to mislead users. private def running_at_background
extra_space_for_emoji = 1
(" " * (running_at_message.size + extra_space_for_emoji)).colorize.on_cyan
end
private def running_at
"http://#{Lucky::ServerSettings.host}:#{Lucky::ServerSettings.port}"
end
private def running_at_message
" 🎉 App running at #{running_at} "
end
private def print_running_at
STDOUT.puts ""
STDOUT.puts running_at_background
STDOUT.puts running_at_message.colorize.on_cyan.black
STDOUT.puts running_at_background
STDOUT.puts ""
end
print_running_at
app_server.listen It will always output the correct result.
Yes, actually, commenting out this task probably only add 0.5 seconds within the 2 minutes maybe, but I do think it's good to be able to save this little time is better. |
It does print it correctly if you use it correctly. If you do |
Yes, i saw luckyframework/website#1383, it's okay to fix doc for clarify this. although i consider this is still not the correct way fix this, because:
So, Dotenv is do exactly on this purpose, it never add into git, and avoid user typing it manually, but print wrong port. |
ok, that's fair. I'll open a new issue for it. |
From this comment: luckyframework/website#1180 (comment)
Basically you change
DEV_PORT
env to say 3002, but the output message still shows 3000The text was updated successfully, but these errors were encountered: