Migration from 0.23.X to 0.24.X
Wasp is now installed as a global npm package, instead of the old custom installer. To start using the new installation method, you can run our migration tool:
curl -sSL https://get.wasp.sh/installer.sh | sh -s -- migrate-to-npm
You can read more about it in the Legacy installer guide.
To install the latest Wasp version, open your terminal and run:
npm i -g @wasp.sh/wasp-cli@latest
You can install Wasp 0.24 specifically by passing the version to the install script:
npm i -g @wasp.sh/wasp-cli@0.24
What's new in 0.24.X?
Replaced Axios with ky in the client API module
The api export from wasp/client/api is now a ky instance instead of Axios. Ky is a tiny HTTP client built on fetch that provides a cleaner API with method shortcuts, automatic JSON handling, and hooks.
The Wasp TS config is now called the Wasp Spec
The Wasp TS config (main.wasp.ts) is now called the Wasp Spec, and it should import from @wasp.sh/spec instead of wasp-config. This better reflects the purpose of this file as a place to configure and customize Wasp's behavior in your project.
Ref imports in Wasp TS spec
In main.wasp.ts, you can now import app source references with with { type: "ref" } and pass imported values directly to Wasp declarations instead of using import objects like { import, from }.
import MainPage from './src/MainPage' with { type: 'ref' }
import { getTasks } from './src/operations' with { type: 'ref' }
Package.json requirements changed
Wasp now expects some project-level package.json dependencies to be explicit. vitest must be in devDependencies because Wasp runs client tests through your project-installed Vitest. @types/node must also be in devDependencies, and the local Wasp Spec package is now @wasp.sh/spec instead of wasp-config.
Stricter validation for Wasp Spec support files
Wasp now validates more of the Wasp Spec support files. It checks that package.json includes the required @types/node dev dependency, that tsconfig.wasp.json includes the required Wasp Spec options, and that tsconfig.src.json excludes Wasp Spec files.
How to migrate?
1. Bump the Wasp version
Update the version field in your Wasp config to ^0.24.0:
app MyApp {
wasp: {
version: "^0.24.0"
},
// ...
}
2. Update package.json dependencies and fields
Make the relevant package.json changes in one pass:
- Before
- After
{
"devDependencies": {
"wasp-config": "file:.wasp/wasp-config"
}
}
{
"devDependencies": {
"@types/node": "^24.0.0",
"@wasp.sh/spec": "file:.wasp/spec",
"vitest": "^4.0.16"
}
}
Add vitest to devDependencies because wasp test client now runs the Vitest package installed in your project.
Add @types/node to devDependencies because the Wasp Spec runs in a Node.js environment and Wasp now validates that the Node types are present.
Replace wasp-config with @wasp.sh/spec because the Wasp TS config package was renamed to the Wasp Spec package.
3. Update client code that uses api from wasp/client/api
If you don't use the api function from wasp/client/api directly, you can skip this step.
The api object was previously an Axios instance. It is now a ky instance with a pre-configured base URL and authentication. Update your code as follows:
- Before
- After
import { api } from 'wasp/client/api'
// Making requests
const response = await api.get('/foo/bar')
const data = response.data
// POST with body
await api.post('/foo/bar', { key: 'value' })
// Error handling
import { type AxiosError } from 'axios'
try {
await api.get('/foo/bar')
} catch (e) {
const error = e as AxiosError
console.log(error.response?.status)
}
import { api } from 'wasp/client/api'
import { isHTTPError } from 'ky'
// Making requests
const data = await api.get('/foo/bar').json()
// POST with body
await api.post('/foo/bar', { json: { key: 'value' } })
// Error handling
try {
await api.get('/foo/bar').json()
} catch (e) {
if (isHTTPError(e)) {
console.log(e.response.status)
}
}
You can also remove axios from your project's dependencies if you added it only for use with the Wasp api wrapper.
4. Update Wasp Spec support files
Make sure your tsconfig.wasp.json includes the required Wasp Spec compiler options and include entries:
{
"compilerOptions": {
// ...
"module": "esnext",
"moduleResolution": "bundler",
"jsx": "preserve",
"allowJs": true
},
"include": ["main.wasp.ts", "**/*.wasp.ts"]
}
Make sure your tsconfig.src.json excludes Wasp Spec files:
{
// ...
"include": ["src"],
"exclude": ["**/*.wasp.ts"]
}
And finally, update your main.wasp.ts to import from @wasp.sh/spec instead of wasp-config:
- Before
- After
import { ActionConfig, App, ExtImport } from "wasp-config";
const app = new App({
// ...
});
import { ActionConfig, App, ExtImport } from "@wasp.sh/spec";
const app = new App({
// ...
});
5. Enjoy your updated Wasp app
That's it!