Skip to content

Releases: wasp-lang/wasp

v0.7.2

13 Dec 16:05
Compare
Choose a tag to compare

Bug fixes

  • Fixed Dockerfile generated with wasp build -> Prisma would break due to unsupported version of openssl.
    #877

v0.7.1

01 Dec 01:29
Compare
Choose a tag to compare

v0.7.1

Bug fixes

  • Fixed a bug that was causing Wasp to forget about compiling backend code before running it in production

v0.7.0

26 Nov 21:04
Compare
Choose a tag to compare

Changelog

v0.7.0 - Beta Release!

BREAKING CHANGES

Significant changes to Wasp project structure

This was the file tree of a newly generated project in the previous version of Wasp (i.e., this was what you used to get by running wasp new project):

.
├── ext
│   ├── Main.css
│   ├── MainPage.js
│   ├── .waspignore
│   └── waspLogo.png
├── .gitignore
├── main.wasp
└── .wasproot

This is the file tree of a newly generated project in the newest release of Wasp (i.e., this is what you will get by running wasp new project from this point onwards):

.
├── .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

Main differences:

  • All server-side code must be located inside the src/server directory. Wasp declarations must import this code with import foo from "@server/foo" (instead of import foo from "@ext/foo.js")
  • All client-side code must be located inside the src/client directory. Wasp declarations must import this code with import foo from "@client/bar" (instead of import bar from "@ext/bar.js")
  • All shared code (i.e., used on both the client and the server) must be located inside the src/shared and imported where needed through a relative import.
  • Each of these subdirectories (i.e., src/server, src/client, and src/shared) comes with a pregenerated tsconfig.json file. This file helps with IDE support (e.g., jumping to definitions, previewing types, etc.) and you shouldn't delete it. The same goes for react-app-env.d.ts

The new structure is fully reflected in our docs, but we'll also provide a quick guide for migrating existing projects.

Migrating an existing Wasp project to the new structure

You can easily migrate your old Wasp project to the new structure by following a series of steps. Assuming you have a project called foo inside the directory foo, you should:

  1. Install the latest version of Wasp

  2. Rename your project's root directory to something like foo_old

  3. Create a new project by running wasp new foo

  4. Copy all server-side code from foo_old/ext to foo/src/server

  5. Copy all client-side code from foo_old/ext to foo/src/client

  6. Copy all shared code (if any) from foo_old/ext to foo/src/shared and
    adapt imports in files that reference it:

    • For example, import bar from './bar.js' becomes import bar from "../shared/bar.js"
  7. Copy all lines you might have added to foo_old/.gitignore into
    foo/.gitignore

  8. Finally, copy foo_old/main.wasp to foo/main.wasp and correct external
    imports:

    • Queries, Actions, Jobs, and the Server setup function must import their code from @server
    • Pages and the Client setup function must import their code from @client

    For example, if you previously had something like:

    page LoginPage {
      // This previously resolved to ext/LoginPage.js
      component: import Login from "@ext/LoginPage.js"
    }
    
    // ...
    
    query getTasks {
      // This previously resolved to ext/queries.js
      fn: import { getTasks } from "@ext/queries.js",
    }

    You should change it to:

    page LoginPage {
      // This resolves to src/client/LoginPage.js
      component: import Login from "@client/LoginPage"
    }
    
    // ...
    
    query getTasks {
      // This resolves to src/server/queries.js
      fn: import { getTasks } from "@server/queries",
    }

    Do this for all external imports in your .wasp file. After you're done, there shouldn't be any occurences of the string "@ext".

That's it! You should now have a fully working Wasp project in the foo directory.

[NEW FEATURE] TypeScript support

Wasp now allows you to write TS and TSX files. Some (but not all) Wasp features come with type definitions. Except more type definitions and even better integration with TypeScript in future versions!

[NEW FEATURE] Dockerfile customization

You can now customize the default Wasp Dockerfile by either extending/replacing our build stages or using your own custom logic. To make use of this feature, simply add a Dockerfile to the root of your project and it will be appended to the bottom of the existing Wasp Dockerfile.

[NEW FEATURE] Tailwind CSS support

You can now use the Tailwind CSS framework in your project by simply adding two config files. Check out the Integrations section of our Docs for more!

v0.7.0-rc2

25 Nov 19:26
5da642e
Compare
Choose a tag to compare
v0.7.0-rc2 Pre-release
Pre-release
TypeScript fixes before Beta (#831)

* Change typescript modules to esnext

* Fix tsconfigs and use recommended settings

* Fix server not loading env variables

* Fix TS output overwriting error

* Fix wrong types

* Change MainPage.tsx to MainPage.jsx

* Remove duplication for Node tsconfig

* Update e2e tests for TS fixes

* Fix formatting

v0.7.0-rc1

24 Nov 14:20
24fb75f
Compare
Choose a tag to compare
v0.7.0-rc1 Pre-release
Pre-release
Update e2e tests after supporting TypeScript (#828)

v0.7.0-rc

22 Nov 18:42
Compare
Choose a tag to compare
v0.7.0-rc Pre-release
Pre-release
fixed e2e tests, fixed release script.

v0.6.0.0

29 Sep 10:17
Compare
Choose a tag to compare

v0.6.0.0 (2022/09/29)

BREAKING CHANGES

  • The EmailAndPassword auth method has been renamed usernameAndPassword to better reflect the current usage. Email validation will be addressed in the future.
    • This means the auth.userEntity model should now have field called username (instead of email, as before).
      • If you'd like to treat the old email field as username, you can create a migration file like so:
        $ cd migrations
        $ mkdir "migrations/`date -n +%Y%m%d%H%M%S`_some_name" && touch $_/migration.sql
        You can then add contents like the following:
          -- Drop the old index (NOTE: name may vary based on Prisma version)
        DROP INDEX "User_email_key";
        
        -- Alter the table to rename the column, thus preserving the data
        ALTER TABLE "User"
        RENAME COLUMN "email" TO "username";
        
        -- Create a new index
        CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
        • NOTE: If you simply changed email to username in your .wasp file, Prisma will try to drop the table and recreate it, which is likely not what you want if you have data you want to preserve.
      • If you would like to add a new username column and keep email as is, be sure to add a calculated value in the migration (perhaps a random string, or something based on the email). The username column should remain NOT NULL and UNIQUE.
  • WASP_WEB_CLIENT_URL is now a required environment variable to improve CORS security. It is set by default in development. In production, this should point to the URL where your frontend app is being hosted.
  • The generated Dockerfile has been updated from node:14-alpine to node:16-alpine.
  • Wasp Jobs callback function arguments have been updated to the following: async function jobHandler(args, context). Jobs can now make use of entities, accessed via context, like Operations. Additionally, the data passed into the Job handler function are no longer wrapped in a data property, and are now instead accessed exactly as they are supplied via args.
  • React got updated to React 17.

[NEW FEATURE] Google is now a supported authentication method!

You can now offer your users the ability to sign in with Google! Enabling it is just a few lines and offers a fast, easy, and secure way to get users into your app! We also have a comprehensive setup guide for creating a new app in the Google Developer Console.

Stay tuned, as more external auth methods will be added in the future. Let us know what you'd like to see support for next!

[NEW FEATURE] Wasp Language Server

Now, your installation of Wasp also brings Wasp language server with it! This means live error reporting in Wasp files in supported IDEs (currently only VSCode).

Make sure to update your Wasp VSCode extension to get the benefits of Wasp Language Server.

[NEW FEATURE] Optimistic updates via useAction hook

We added useAction hook to our JS API, which allows you to specify optimistic update details for an Action.
This means that, if you have a good idea of how an Action will affect the state on the client, you can perform those changes immediatelly upon its call (instead of waiting for Action to finish), by modifying what specific Queries currently return.
Once Action is actually done, related Queries will be unvalidated as usual and therefore fetch the real result, but in the meantime the changes you specified via optimistic updates will be visible.

This is great for apps where there is a lot of interactivity and you want the UI to update instantly with your changes, even as they are still being saved to the server.

Check out https://wasp-lang.dev/docs/language/features#the-useaction-hook for more details.

Bug fixes

  • Works around a sodium-native bug (used by a Wasp dependency, secure-password) that caused signup/login runtime issues with Heroku deployments by downgrading it from v3.4.1 to v3.3.0 via a package.json override. Ref: https://github.com/sodium-friends/sodium-native/issues/160
  • Improved warnings by Wasp to do database migration -> now there are less false positives.

v0.5.2.1

14 Jul 21:15
Compare
Choose a tag to compare

v0.5.2.1 (2022/07/14)

Bug fixes

  • Made wasp CLI more robust regarding encoding used on the machine.
  • Worked around the bug in latest npm, so that Wasp now again supports latest LTS npm version.

v0.5.2.0

23 Jun 12:49
Compare
Choose a tag to compare

v0.5.2.0 (2022/06/23)

Upgraded Prisma to latest version (13.15.2)

Among various other things, this brins support for OpenSSL3. So if you couldn't run Wasp on your operating system due to Prisma not supporting OpenSSL3, those days are over!

v0.5.1.0

17 Jun 15:26
Compare
Choose a tag to compare

[NEW FEATURES]

  • There is now app.client.setup function in .wasp that you can use to define custom setup you want to do on client before on its initialization.
  • You can now configure the React Query's QueryClient by calling special function exposed by Wasp in your JS (in app.client.setup).

Various improvements and bug fixes

  • Limited Wasp node version to <=16.15.0 for now, since there is a problem with later versions and how Wasp uses npx.
  • Reduced some of the redundant warning messages in Wasp CLI.
  • Fixed unresponsive UI on server reload.