Skip to main content
Version: Next

Migration from 0.16.X to 0.17.X

What's new in 0.17.0?

The login function parameters changed (username & password only)

info

This change only affects you if you're using username and password authentication with custom auth UI. If you're using email authentication, social authentication, or our premade Auth UI components, you don't need to take any action.

The login function, as imported from wasp/client/auth, has changed the way of calling it:

import { login } from 'wasp/client/auth'

await login(usernameValue, passwordValue)

This is to make it consistent with the login and signup calls in other authentication methods, which were already using this convention.

How to migrate?

To migrate your Wasp app from 0.16.X to 0.17.X, follow these steps:

1. Change the parameters to the login function (username & password only)

info

This change only affects you if you're using username and password authentication with custom auth UI. If you're using email authentication, social authentication, or our premade Auth UI components, you don't need to take any action.

If you were using the login function (imported from wasp/client/auth), change its parameters from login(usernameValue, passwordValue) to login({ username: usernameValue, password: passwordValue }).

src/components/MyLoginForm.tsx
import { login } from 'wasp/client/auth'

export const MyLoginForm = () => {
const [usernameValue, setUsernameValue] = useState('')
const [passwordValue, setPasswordValue] = useState('')

const handleSubmit = async (e) => {
e.preventDefault()
await login(usernameValue, passwordValue)
// ...
}

return <form onSubmit={handleSubmit}>{/* ... */}</form>
}

It is possible that you were not using this function in your code. If you're instead using the <LoginForm> component, this change is already handled for you.

2. Update your tsconfig.json

To ensure your project works correctly with Wasp 0.17.0, you must also update your tsconfig.json file.

If you haven't changed anything in your project's tsconfig.json file (this is the case for most users), just replace its contents with the new version shown below.

If you have made changes to your tsconfig.json file, we recommend taking the new version of the file and reapplying them.

Here's the new version of tsconfig.json:

// =============================== IMPORTANT =================================
// This file is mainly used for Wasp IDE support.
//
// Wasp will compile your code with slightly different (less strict) compilerOptions.
// You can increase the configuration's strictness (e.g., by adding
// "noUncheckedIndexedAccess": true), but you shouldn't reduce it (e.g., by
// adding "strict": false). Just keep in mind that this will only affect your
// IDE support, not the actual compilation.
//
// Full TypeScript configurability is coming very soon :)
{
"compilerOptions": {
"module": "esnext",
"composite": true,
"target": "esnext",
"moduleResolution": "bundler",
"jsx": "preserve",
"strict": true,
"esModuleInterop": true,
"isolatedModules": true,
"moduleDetection": "force",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"skipLibCheck": true,
"allowJs": true,
"outDir": ".wasp/out/user"
},
"include": [
"src"
]
}

3. Tell Wasp about jest-dom types

If you're using (or planning to use) Wasp's client tests with jest-dom, update your src/vite-env.d.ts file:

/// <reference types="vite/client" />

// This is needed to properly support Vitest testing with jest-dom matchers.
// Types for jest-dom are not recognized automatically and Typescript complains
// about missing types e.g. when using `toBeInTheDocument` and other matchers.
// Reference: https://github.com/testing-library/jest-dom/issues/546#issuecomment-1889884843
import '@testing-library/jest-dom'

4. Enjoy your updated Wasp app

That's it!

You should now be able to run your app with the new Wasp 0.17.0.