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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server doesn't seem to start until something in site-src is touched #4

Closed
eneroth opened this issue Jan 7, 2021 · 5 comments
Closed

Comments

@eneroth
Copy link

eneroth commented Jan 7, 2021

localhost:5760 doesn't seem to be available until something in site-src is touched.

Teething problems or feature? 馃檪

@avocade
Copy link

avocade commented Jan 7, 2021

Same issue here.

@eneroth
Copy link
Author

eneroth commented Jan 7, 2021

Discovered that this is a feature.

@eneroth eneroth closed this as completed Jan 7, 2021
@metasoarous
Copy link
Owner

Hey; Thanks for posting.

Actually, for me the server/browser-tab opens immediately on calling build!, though this may only be the case if there is already content in the :from directory, or perhaps if :lazy-build? true is set. I could see an argument for making sure this always happens though. Can you please share why you decided not doing so is a feature?

Thanks

@avocade
Copy link

avocade commented Jan 8, 2021

For me it usually takes at least 5 seconds for it to open up in the browser (I'm on a MBP15 from 2017) after I start the build!. Sometimes it doesn't launch at all. But it always seems to require me to at least save/touch a file in site_src before the compilation starts, even with lazy? turned off.

From my POV it would be great if it always rendered everything in site_src/ every time you run build!, even if there's already content in the build/ folder. Often it happens that I edit the clj/md files without the server active, and it's confusing to see an old version of the rendered files after I start up the server.

@metasoarous
Copy link
Owner

Thanks for the update.

This is actually how build! is supposed to behave if lazy? is false. I remember there had been a bug with this, and I thought I had fixed it, but may not have. I'll take another look at this.

The 5 second pause is there because it takes some time for the sente websockets connection to get established, and messages that get sent before the connection is established fail to reach the client. A smarter thing to do would be to have the client submit a heartbeat message on connection (which might be a little tricky, because I think the client has the same problem) so that the server knows when the client is ready for messages. If nothing is showing up after 5 secs though, that would be a bug (unless the socket is taking that long to set up, which seems unlikely). So please let me know if you continue to see this. I haven't personally had problems with it, but there may be something specific going on.

Thanks again

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

No branches or pull requests

3 participants