wasp

The fastest way to develop full-stack web apps with React & Node.js.

MIT License

Stars
12K
Committers
81

Bot releases are visible (Hide)

wasp - v0.14.1-rc1 Latest Release

Published by github-actions[bot] about 2 months ago

wasp - v0.14.0

Published by github-actions[bot] 3 months ago

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: https://github.com/wasp-lang/wasp/issues/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.
wasp - v0.14.0-rc2

Published by github-actions[bot] 3 months ago

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

wasp - v0.14.0-rc1

Published by github-actions[bot] 4 months ago

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

wasp - v0.13.2

Published by github-actions[bot] 6 months ago

0.13.2 (2024-04-11)

🐞 Bug fixes

  • Fixed problems with Wasp's type inference in projects created using Wasp 0.13.1.
wasp - v0.13.1

Published by github-actions[bot] 7 months ago

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",
        // ...
      }
      // ...
    }
    
wasp - v0.13.0

Published by github-actions[bot] 7 months ago

⚠️ 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.
wasp - v0.13.0-rc2

Published by github-actions[bot] 7 months ago

wasp - v0.13.0-rc1

Published by github-actions[bot] 7 months ago

wasp - v0.12.4

Published by github-actions[bot] 7 months ago

🐞 Bug fixes

  • Projects that import wasp/auth/types no longer fail when building the web app.
wasp - v0.12.3

Published by github-actions[bot] 8 months ago

0.12.3

πŸŽ‰ New features

  • Wasp AI switched from GPT 3.5 Turbo 0613 to GPT 3.5 Turbo 0125, which gives it bigger context, ensuring generation doesn't fail for bigger apps, while also being cheaper.
wasp - v0.12.2

Published by github-actions[bot] 8 months ago

0.12.2

🐞 Bug fixes

  • We were adding Crypto polyfill even when not needed (when node > 18), which was then causing an error. Now polyfill is added only if needed.
wasp - v0.12.1

Published by github-actions[bot] 8 months ago

0.12.1

🐞 Bug fixes

  • Reverted Wasp AI to using GPT3.5-Turbo-0613 instead of new GPT3.5-Turbo-0125 since 0125 would often return code that is missing newlines.
wasp - v0.12.0

Published by github-actions[bot] 8 months ago

This is a big update, introducing major changes that span the entirety of Wasp, specifically the new project structure and new Auth.

⚠️ Breaking changes

If your project is using an older version of Wasp, you will want to check out the detailed migration instructions at https://wasp-lang.dev/docs/migrate-from-0-11-to-0-12 .

New project structure

The output of wasp new myProject before 0.12.0:

.
β”œβ”€β”€ .gitignore
β”œβ”€β”€ main.wasp
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ client
β”‚   β”‚   β”œβ”€β”€ Main.css
β”‚   β”‚   β”œβ”€β”€ MainPage.jsx
β”‚   β”‚   β”œβ”€β”€ react-app-env.d.ts
β”‚   β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”‚   └── waspLogo.png
β”‚   β”œβ”€β”€ server
β”‚   β”‚   └── tsconfig.json
β”‚   β”œβ”€β”€ shared
β”‚   β”‚   └── tsconfig.json
β”‚   └── .waspignore
└── .wasproot

The output of wasp new myProject with 0.12.0:

.
β”œβ”€β”€ .gitignore
β”œβ”€β”€ main.wasp
β”œβ”€β”€ package.json
β”œβ”€β”€ public
β”‚   └── .gitkeep
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ Main.css
β”‚   β”œβ”€β”€ MainPage.jsx
β”‚   β”œβ”€β”€ queries.ts
β”‚   β”œβ”€β”€ vite-env.d.ts
β”‚   β”œβ”€β”€ .waspignore
β”‚   └── waspLogo.png
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ vite.config.ts
└── .wasproot

The main differences are:

  • Your project now has a package.json file.
  • tsconfig.json, vite.config.ts, and public/ moved to the top dir.
  • The server/client code separation is no longer necessary. You can now organize your code however you want, as long as it's inside the src/ directory.
  • All external imports in your Wasp file now must have paths starting with @src (e.g., import foo from '@src/MainPage.jsx'). The paths can no longer start with @server or @client.

New Auth

Before 0.12.0, authentication in Wasp was based on the User model which the developer needed to set up properly and take care of the auth fields like email or password.

With 0.12.0, authentication is based on the auth models which are automatically set up by Wasp. You don't need to take care of the auth fields anymore, be it by adding them to the User model or by adding whole new entities like SocialLogin.

The User model is now just a business logic model and you use it for storing the data that is relevant for your app.

In the background, Wasp is now using Lucia as the core auth library.

Naming requirements

Operation (i.e., Queries and Actions) and Job names in .wasp files must now begin with a lowercase letter: query getTasks {...}, job sendReport {...}.

Entity names in .wasp files must now begin with an uppercase letter: entity Foo {...}.

Regression Notes
  • Multiple auth methods per single user are not allowed anymore (while before a user could first sign up with a social account and then add email/pass to it).
  • Auth field customization is no longer possible using the _waspCustomValidations on the User entity.
    These are both temporary regressions and will be replaced with better mechanisms in the future.

πŸŽ‰ [New Feature] Wasp now works with any Node version >= 18

So far, Wasp required a specific Node version that is compatible with the latest LTS Node (lately that was 18).

We relaxed that constraint so it now works with any Node version equal to or newer than the oldest LTS version that Wasp supports, meaning that now Wasp works with any Node version >= 18.

πŸŽ‰ [New Feature] Wasp AI in the CLI (wasp new:ai)

While so far it was available only through the https://usemage.ai , Wasp AI is now also available via the wasp CLI, enabling you to create a new Wasp app from nothing more than a title and a short description.

You can run it by picking AI as an option in the wasp new wizard, or via wasp new:ai which allows you to provide all the details via the command line (useful for more programmatic usage).

You need to provide your own OpenAI API token, but that also means you can choose which model to use for the code generation: e.g. you can use GPT-4 all the way, instead of the default GPT-4 + GPT-3 combo that https://usemage.ai uses.

πŸŽ‰ [New Feature] New template: Open Saas

Wasp now comes with a new template for kickstarting your apps, specifically SaaS apps: https://opensaas.sh/ .

This is the richest template for Wasp so far, with features like Stripe integration, admin dashboard, file uploading, blog (Astro), ...

You can choose it from the wasp new's wizard.

wasp - v0.12.0-rc4

Published by github-actions[bot] 8 months ago

wasp - v0.12.0-rc3

Published by github-actions[bot] 8 months ago

wasp - v0.12.0-rc2

Published by github-actions[bot] 8 months ago

wasp - v0.12.0-rc

Published by github-actions[bot] 9 months ago

Brings Wasp AI from the CLI, new Auth, and big changes in the project structure (restructuring).

Check out https://github.com/wasp-lang/wasp/tree/8e8f61073c42af5741ef9d404824ec1d7b7f3d96/waspc/examples/todo-typescript for an example of an app that works with it.

Docs, Wasp AI, starter templates, ... -> these all still need updating.

wasp - v0.12.0-rc1

Published by github-actions[bot] 9 months ago

0.12 with new auth and AI, no restructuring yet, also not well tested.

wasp - v0.11.8

Published by github-actions[bot] 11 months ago

πŸŽ‰ [New Feature] Serving the Client From a Subdirectory

You can now serve the client from a subdirectory. This is useful if you want to serve the client from a subdirectory of your domain, e.g. https://example.com/my-app/.

To do this, you need to add the client.baseDir property to your .wasp file:

app todoApp {
  // ...
  client: {
    baseDir: "/my-app",
  },
}

🐞 Bug fixes / πŸ”§ small improvements

  • Changed the minimum number of machines that a server app is using when deployed to Fly.io from 0 to 1. This prevents the server app from shutting down when there are no requests to it. There might be some other work that the server is doing e.g. running periodic Jobs or sending e-mails, so we want to make sure that the server is always running.
  • Fixes a bug where copying of migrations dir failed due to a missing migrations dir.
  • Fixes a regression where a missing DB on the DB server would prevent project from running. Now, Wasp will tolerate the missing DB error and rely on Prisma to create the DB for you (like before).
  • Fixes an issue on Linux where running Prisma migration command fails when a project has a path that has spaces in it.
Package Rankings
Top 5.63% on Proxy.golang.org
Badges
Extracted from project README
Discord
Related Projects