Skip to content

Commit

Permalink
feat: always --recreate in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Nov 19, 2024
1 parent e17d58d commit 1e947dd
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .goosehints
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NOTE: ftl dev command will run things as a server so you will need to run it as

### Development Mode
```bash
ftl dev --recreate ./examples/go
ftl dev ./examples/go
```

### With OpenTelemetry
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Once the Hermit environment is activated you can type the following to start a
hot-reloading ftl agent:

```
$ ftl dev --recreate ./examples/go
$ ftl dev ./examples/go
```

## Development processes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ftl new go . alice
Start FTL in one terminal:

```sh file=test.sh region=start
ftl dev --wait-for=alice --recreate .
ftl dev .
```

Then in a second terminal run the following:
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/help/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ info: Starting FTL with 1 controller(s)
ftl: error: ERROR: relation "fsm_executions" does not exist (SQLSTATE 42P01)
```

Run again with `ftl dev --recreate`. This usually indicates that your DB has an old schema.
Run again with `ftl dev`. This usually indicates that your DB has an old schema.

This can occur when FTL has been upgraded with schema changes, making the database out of date. While in alpha we do not use schema migrations, so this won't occur once we hit a stable release.
2 changes: 1 addition & 1 deletion examples/online-boutique/Justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Start the FTL backend with hot-reloading
dev:
ftl dev --recreate --allow-origins '*'
ftl dev --allow-origins '*'

gen-mobile:
ftl schema generate mobile/templates/ online-boutique/mobile/lib/api --watch=5s
Expand Down
2 changes: 2 additions & 0 deletions frontend/cli/cmd_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func (d *devCmd) Run(
provisionerClient provisionerconnect.ProvisionerServiceClient,
) error {
startTime := time.Now()
// Dev always recreated the DB
d.ServeCmd.Recreate = true
if len(d.Build.Dirs) == 0 {
d.Build.Dirs = projConfig.AbsModuleDirs()
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/console/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const config: PlaywrightTestConfig = {
},
],
webServer: {
command: process.env.CI ? 'ftl dev --recreate -j1' : 'ftl dev --recreate',
command: process.env.CI ? 'ftl dev -j1' : 'ftl dev',
url: 'http://localhost:8892',
reuseExistingServer: !process.env.CI,
/* If the test ends up needing to pull the postgres docker image, this can take a while. Give it a few minutes. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppSettings : PersistentStateComponent<AppSettings.State> {

data class State(
@NonNls var lspServerPath: String = "ftl",
var lspServerArguments: String = "--recreate --lsp",
var lspServerArguments: String = "--lsp",
var lspServerStopArguments: String = "serve --stop",
var autoRestartLspServer: Boolean = false,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FTLSettingsConfigurable : Configurable {
override fun apply() {
val state = AppSettings.getInstance().state
state.lspServerPath = mySettingsComponent?.getLspServerPath() ?: "ftl"
state.lspServerArguments = mySettingsComponent?.getLspServerArguments() ?: " dev --recreate --lsp"
state.lspServerArguments = mySettingsComponent?.getLspServerArguments() ?: " dev --lsp"
state.lspServerStopArguments = mySettingsComponent?.getLspServerStopArguments() ?: "serve --stop"
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Configure the FTL extension by setting the following options in your Visual Stud
}
```

- `ftl.devCommandFlags`: Defines flags to pass to the FTL executable when starting the development environment. The default is ["--recreate"].
- `ftl.devCommandFlags`: Defines flags to pass to the FTL executable when starting the development environment.

```json
{
"ftl.devCommandFlags": ["--recreate", "--parallelism=4"]
"ftl.devCommandFlags": ["--parallelism=4"]
}
```

Expand Down
4 changes: 1 addition & 3 deletions frontend/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
},
"ftl.devCommandFlags": {
"type": "array",
"default": [
"--recreate"
],
"default": [],
"items": {
"type": "string"
},
Expand Down

0 comments on commit 1e947dd

Please sign in to comment.