Skip to content

docs: Clarify hot restart for new endpoints and where to run commands - #947

Draft
Roxie-32 wants to merge 1 commit into
serverpod:mainfrom
Roxie-32:change---triggers
Draft

Roxie-32 wants to merge 1 commit into
serverpod:mainfrom
Roxie-32:change---triggers

Conversation

@Roxie-32

Copy link
Copy Markdown
Contributor

The problem

Builders couldn't tell what to do after making a change, or where to run Serverpod commands. While serverpod start runs, saving a file regenerates the code and hot reloads the server and the app. But the app creates its client once, at startup. So when you add a new endpoint, the running app can't call it until you press R to hot restart, and the docs didn't say so. How it works even suggested every change just works. The pages also disagreed on where to run commands: one said "anywhere inside your project folder", another said "in the server directory", and the rest said nothing. Testing showed that "anywhere" isn't true. Commands fail from folders nested too deep, so the accurate rule is "from your project's root folder or one of its package folders".

The fix

Each change is applied to Next, 4.1.0 and 4.0.0.

  • How it works: removed the "instantly … reloads your app" wording, which promised too much. Added a paragraph explaining that the app creates the client once, so you press R after adding an endpoint. It links to Running your server.
  • Running your server: added a "New endpoints" bullet to the list of what each change does. It says to press R, and that new methods and changed signatures on an existing endpoint need no extra step.
  • Working with endpoints: changed "run serverpod generate in the server directory" to "from your project's root folder or one of its package folders".
  • CLI: generate: added where to run the command, using the same wording.
  • CLI: create-migration: added where to run the command, using the same wording.
  • CLI: start: corrected "from anywhere inside your project folder" to the same wording.

@Roxie-32 Roxie-32 changed the title Clarify hot restart for new endpoints and where to run commands docs: Clarify hot restart for new endpoints and where to run commands Nov 24, 2026
@Roxie-32
Roxie-32 requested a review from a team November 24, 2026 08:53

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two comments. Otherwise it looks good!

```

This starts your server, launches your Flutter app, and watches your code. When you make a change, Serverpod instantly regenerates the client, hot reloads the server, and reloads your app.
This starts your server, launches your Flutter app, and watches your code. When you save a change, Serverpod regenerates the client, hot reloads the server, and hot reloads your app.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Doesn't this say the same thing, only more detailed?


The client handles the request, the response, and the JSON in between. Most calls follow this request-and-response shape. For live updates, Serverpod also has [streaming methods](./concepts/endpoints-and-apis/streaming) that keep a connection open so the server and app can push data to each other.

The app creates the client once, when it starts. If you add an endpoint while `serverpod start` is running, press **R** in its terminal to hot restart the app so the client includes the new endpoint. See [Running your server](./concepts/server-fundamentals/running-your-server#save-a-file-to-hot-reload) for what each kind of change needs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: This seems disruptive to the flow. Why don't we automatically hot reload the client when new endpoints are added? Could you check this with the framework team? If there is no strong reason for not hot reloading, perhaps we could add that and skip this instruction?

By default, `serverpod start` watches your project. What happens when you save depends on the file:

- **Server code:** hot reloads, and restarts the server if the reload fails.
- **New endpoints:** regenerates the client and hot reloads, but the running app keeps the client it created at startup. Press **R** to hot restart the app before calling the new endpoint. New methods and signature changes on an existing endpoint need no extra step.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment: Connected to the first question, can you validate there is a real reason it works this way before adding this instruction?

@Roxie-32
Roxie-32 marked this pull request as draft December 4, 2026 03:48

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants