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

Question about "Interactive Development": Changes not reflected when restarting server #156

Open
fhightower opened this issue Jul 15, 2021 · 1 comment

Comments

@fhightower
Copy link

fhightower commented Jul 15, 2021

This is a question about the "Interactive Development" section of the Hello World guide. I'm new to Pedestal and relatively new to Clojure, so please pardon any ignorance on display in this question.

In the interactive development section, we add various functions (e.g. start-dev and stop-dev) to hello.clj. When I added these functions, however, it did not work as I expected and I would like to know if I did something wrong or if my expectations are wrong (or something else entirely).

I copied the whole shebang into hello.clj to make sure I had the correct content. I then started the server in clj with:

(require 'hello)
(hello/start-dev)

This starts the server as expected. I then make a change to hello.clj and run (hello/restart) in the REPL. At this point, I expected the server to restart with the changes I made to hello.clj, but it does not. It restarts the server, but does not reflect the changes I made. So every time I make changes, I need to restart the REPL every time. I'm confused because the prose under the heading here makes it sound as though we should not have to restart the REPL every time we make a change. Am I doing something wrong or are my expectations wrong (or something else entirely)?

Thanks in advanced for any insight!

@fhightower
Copy link
Author

I have an update on this (although my question still stands):

Based on my research, if you use the whole shebang and run:

(require 'hello)
(hello/start-dev)

And then make a change to hello.clj, you can reload it using:

(require :reload 'hello)
(hello/restart)

But I expected only (hello/restart) to be required to restart the server with the updated content based on the following statement here:

Now we can use start-dev, stop-dev, and restart as we make changes.

Again, my original questions still stand: Am I doing something wrong? Are my expectations wrong? Should the post be updated to clarify that (hello/restart) must be preceded with (require :reload 'hello) for it to restart the server with updated code?

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

1 participant