Skip to content

Releases: wasp-lang/wasp

v0.14.2

09 Sep 17:39
Compare
Choose a tag to compare

Updated GPT models used in Wasp AI to latest models, since 3.5 are getting deprecated.

Default model used is now 4o (instead of old 4 + 3.5-turbo combo).

v0.14.1

27 Aug 13:01
ccc652e
Compare
Choose a tag to compare

🎉 New Features

  • Wasp now supports onBeforeLogin and onAfterLogin auth hooks! You can use these hooks to run custom logic before and after a user logs in. For example, you can use the onBeforeLogin hook to check if the user is allowed to log in.
  • OAuth refresh tokens are here. If the OAuth provider supports refresh tokens, you'll be able to use them to refresh the access token when it expires. This is useful for using OAuth provider APIs in the background e.g. accessing user's calendar events.

⚠️ Breaking Changes

  • To make the API consistent across different auth hooks, we change how the onBeforeOAuthRedirect hook receives the uniqueRequestId value to oauth.uniqueRequestId.

🐞 Bug fixes

  • Prisma file parser now allows using empty arrays as default values.

🔧 Small improvements

  • Replace oslo/password with directly using @node-rs/argon2
  • We now use websocket transport for the WebSocket client to avoid issues when deploying the server behind a load balancer.

Community contributions by @rubyisrust @santolucito @sezercik @LLxD!

v0.14.1-rc2

27 Aug 12:27
Compare
Choose a tag to compare
v0.14.1-rc2 Pre-release
Pre-release
Update 0.14.0 docs

v0.14.1-rc1

27 Aug 08:57
Compare
Choose a tag to compare
v0.14.1-rc1 Pre-release
Pre-release
Update docs

v0.14.0

17 Jul 15:10
Compare
Choose a tag to compare

0.14.0 (2024-07-17)

🎉 New Features

  • Simplified Auth User API: Introduced a simpler API for accessing user auth fields (for example username, email, isEmailVerified) directly on the user object, eliminating the need for helper functions.

  • Improved the API for calling Operations (Queries and Actions) directly on both the client and the server.

  • Improved API for calling Operations (Queries and Actions) directly.

  • Auth Hooks: you can now hook into the auth process with onBeforeSignup, onAfterSignup hooks. You can also modify the OAuth redirect URL with onBeforeOAuthRedirect hook.

    app myApp {
      ...
      auth: {
        onBeforeSignup: import { onBeforeSignup } from "...",
        onAfterSignup: import { onAfterSignup } from "...",
        onBeforeOAuthRedirect: import { onBeforeOAuthRedirect } from "...",
      },
    }
    
  • Auth: you can now use Discord as a social auth provider (by @wardbox)

  • Using the Prisma Schema file directly: define your database schema in the schema.prisma file and Wasp will use it to generate the database schema and Prisma client code.

  • Added the wasp db reset command for resetting the database.

⚠️ Breaking Changes & Migration Guide

New tsconfig.json file

Wasp 0.14.0 requires some changes to your tsconfig.json file.
Visit the migration guide for details.

Strict options when building the wasp package

The wasp package is now built with strictBindCallApply, alwaysStrict, noImplicitThis, and strictFunctionTypes.
This is a breaking change only if you have manually set your tsconfig.json's strict field to false and are relying on it being more permissive.
To fix the errors, enable the options listed above and make sure your code type checks.

This quirk is only temporary. You'll soon be able to use any tsconfig.json options you want.
Track this issue for progress: #1827

Directly calling Queries on the client

You can now call Queries directly from the client without dealing with
queryCacheKeys. Wasp takes care of it under the hood:

Now:

const doneTasks = await getTasks({ isDone: true });

Before:

const doneTasks = await getTasks(getTasks.queryCacheKey, { isDone: true });

Accessing AuthUser data

We had to make a couple of breaking changes to reach the new simpler Auth API:

  1. You don't need to use getUsername to access the username:

    • Before: Used getUsername to access the username.
    • After: Directly use user.identities.username?.id.
  2. You don't need to use getEmail to access the email:

    • Before: Used getEmail to access the email.
    • After: Directly use user.identities.email?.id.
  3. Better API for accessing providerData:

    • Before: Required complex logic to access typed provider data.
    • After: Directly use user.identities.<provider>.<value> for typed access.
  4. Better API for accessing getFirstProviderUserId:

    • Before: Used getFirstProviderUserId(user) to get the ID.
    • After: Use user.getFirstProviderUserId() directly on the user object.
  5. You don't need to use findUserIdentity any more:

    • Before: Relied on findUserIdentity to check which user identity exists.
    • After: Directly check user.identities.<provider> existence.

These changes improve code readability and lower the complexity of accessing user's auth fields. Follow the detailed migration steps to update your project to 0.14.0.

Using the Prisma Schema file

Wasp now uses the schema.prisma file to generate the database schema and Prisma client code. This means that you should move your database schema from the main.wasp file to the schema.prisma file.

This means that this entity in main.wasp:

entity Task {=psl
  id          Int @id @default(autoincrement())
  description String
  isDone      Boolean
  userId      Int
  user        User @relation(fields: [userId], references: [id])
psl=}

will move to the schema.prisma file:

model Task {
  id          Int @id @default(autoincrement())
  description String
  isDone      Boolean
  userId      Int
  user        User @relation(fields: [userId], references: [id])
}

Read more about the migration steps in the migration guide.

Note on Auth Helper Functions (getUsername, getEmail etc.)

These changes only apply to getting auth fields from the user object you receive from Wasp, for example in the authRequired enabled pages or context.user on the server. If you are fetching the user and auth fields with your own queries, you can keep using most of the helpers. Read more about using the auth helpers.

🐞 Bug fixes

  • Updated the tsconfig.json to make sure IDEs don't underline import.meta.env when users use client env vars.
  • Fixed netlify.toml to include the correct build path for the client app.
  • Fixed the client router to ensure that user defined routes don't override Wasp defined routes by moving the user defined routes to the end of the route list.
  • Fixed the CRUD client helpers to accept the same params as the useQuery and useAction hooks.

🔧 Small improvements

  • Improved the default loading spinner while waiting for the user to be fetched.
  • Hided Prisma update message to avoid confusion since users shouldn't update Prisma by themselves.
  • When an unknown OAuth error happens, Wasp now logs the error on the server to help with debugging.
  • Improved default gitignore to more tightly target dotenv files and to allow for example dotenv files and .env.client.
  • Improved the type signature of client auth helpers (e.g. getEmail) to make them accept the minimal required user object.
  • Improved the documentation and added extra TypeScript content.
  • Improved RPC type inference.

v0.14.0-rc2

15 Jul 13:08
5a92e37
Compare
Choose a tag to compare
v0.14.0-rc2 Pre-release
Pre-release

Read the pre-release docs here: https://wasp-docs-on-main.pages.dev/

v0.14.0-rc1

03 Jul 12:53
8ead2e0
Compare
Choose a tag to compare
v0.14.0-rc1 Pre-release
Pre-release

Read the pre-release docs here: https://wasp-docs-on-main.pages.dev/

v0.13.2

11 Apr 16:45
Compare
Choose a tag to compare

0.13.2 (2024-04-11)

🐞 Bug fixes

  • Fixed problems with Wasp's type inference in projects created using Wasp 0.13.1.

v0.13.1

04 Apr 17:33
Compare
Choose a tag to compare

0.13.1 (2024-04-04)

🐞 Bug fixes

  • Vite HMR now works correctly with Wasp's new project structure (no more full-page reloads).
  • Keycloak UI helpers are now correctly exported.

🔧 Small improvements

  • Improved how IDE auto-imports symbols from the wasp package. If you have an existing project, add these lines to your tsconfig.json to getter better IDE support:

    {
      "compilerOptions" {
        "target": "esnext",
        "moduleResolution": "bundler",
        // ...
      }
      // ...
    }
    

v0.13.0

20 Mar 09:45
f255fb8
Compare
Choose a tag to compare

⚠️ Breaking changes

Wasp 0.13.0 switches away from using Passport for our OAuth providers in favor of Arctic from the Lucia ecosystem. This change simplifies the codebase and makes it easier to add new OAuth providers in the future.

This however, means that there are breaking changes in the way you define OAuth providers in your Wasp project.

Read the migration guide at https://wasp-lang.dev/docs/migrate-from-0-12-to-0-13 for more details.

🎉 New features

  • Wasp adds support for Keycloak as an OAuth provider.
  • Wasp now supports defining the WASP_SERVER_URL environment variable and exposes it as serverUrl in the server config which can be imported from wasp/server.

🐞 Bug fixes

  • Projects that import wasp/auth/types no longer fail when building the web app.
  • Wasp now displays OAuth related errors in the browser instead of redirecting to the login page.

🔧 Small improvements

  • Wasp uses Oslo for handling JWTs.