---
sidebar_label: "Wasp TS Config"
comments: true
last_checked_with_versions:
Wasp: 0.24
---
# Migrating from the Wasp TS Config
The first version of configuring Wasp in TypeScript used a **class-based API**: you created an `App` instance with `new App(...)` and registered declarations with mutating method calls like `app.page(...)` and `app.query(...)`. We called this the **TS Config**.
Starting with Wasp 0.24, the TS Config is now retired in favor of the [Wasp Spec](../../general/spec.md): a **function-based API** where you call `app({ ... })` once and list everything in a `spec` property.
:::tip Upgrading from Wasp 0.23 to 0.24?
The conversion below is mechanical, so you can let an LLM do the heavy lifting instead. The [migration guide](../../migration-guide.md#use-an-agent-to-do-it-for-you) has a copyable prompt bundling this guide, the Wasp Spec docs, and the shared migration steps. Once your config is converted, return to the [migration guide](../../migration-guide.md) for the remaining shared steps.
:::
## New features
### Reference imports
In the TS Config you could only reference your code with import objects (`{ import, from }`). The Wasp Spec also supports **reference imports**: import the value with the regular `import` syntax and pass it directly to a specification constructor.
```ts title="main.wasp.ts"
const mainPage = app.page("MainPage", {
component: { importDefault: "MainPage", from: "@src/MainPage" },
});
app.query("getTasks", {
fn: { import: "getTasks", from: "@src/queries" },
});
```
```ts title="main.wasp.ts"
import MainPage from "./src/MainPage" with { type: "ref" };
import { getTasks } from "./src/queries" with { type: "ref" };
export default app({
// ...
spec: [
route("MainRoute", "/", page(MainPage)),
query(getTasks),
],
});
```
Import objects still work through the `ref(...)` helper, so you can migrate gradually. See the [Wasp Spec documentation](../../general/spec.md#referencing-your-apps-code) for the supported patterns and their limitations.
### Multiple files
The TS Config required your entire configuration to live in a single `main.wasp.ts`. The Wasp Spec lets you split it across multiple `*.wasp.ts` files and import specifications between them, so you can keep large apps organized (for example, a separate `auth.wasp.ts` or `cards.wasp.ts` next to the feature it configures).
See the [Wasp Spec documentation](../../general/spec.md#splitting-your-spec-into-multiple-files) for details.
## Changes
### Overview
| What | Before | After |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Creating an app | `new App(name, { ... });` | `app({ name, ..., spec: [...] });` |
| Configuring the app | `app.auth(...);` `app.server(...);` `app.client(...);` `app.db(...);` `app.emailSender(...);` `app.webSocket(...);` |