Changelog
v0.7.0 - Beta Release!
BREAKING CHANGES
- Updates Create React App from version 4.0.3 to 5.0.1. This brings many improvements as well as downstream library updates. It also has a list of possible breaking changes: https://github.com/facebook/create-react-app/blob/main/CHANGELOG.md
- Updates Prisma from version 3.15.2 to 4.5.0. Please check out their upgrade guide: https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4 and release notes: https://github.com/prisma/prisma/releases for any possible breaking changes.
- Removes default
index.css
file that provided basicbody
defaults. Now, there is no default CSS applied. - Updates required Node LTS version from version 16 to version 18. This Node ecosystem change happened on 2022-10-25: https://github.com/nodejs/Release
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 withimport foo from "@server/foo"
(instead ofimport foo from "@ext/foo.js"
) - All client-side code must be located inside the
src/client
directory. Wasp declarations must import this code withimport foo from "@client/bar"
(instead ofimport 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
, andsrc/shared
) comes with a pregeneratedtsconfig.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 forreact-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:
-
Install the latest version of Wasp
-
Rename your project's root directory to something like
foo_old
-
Create a new project by running
wasp new foo
-
Copy all server-side code from
foo_old/ext
tofoo/src/server
-
Copy all client-side code from
foo_old/ext
tofoo/src/client
-
Copy all shared code (if any) from
foo_old/ext
tofoo/src/shared
and
adapt imports in files that reference it:- For example,
import bar from './bar.js'
becomesimport bar from "../shared/bar.js"
- For example,
-
Copy all lines you might have added to
foo_old/.gitignore
into
foo/.gitignore
-
Finally, copy
foo_old/main.wasp
tofoo/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"
. - Queries, Actions, Jobs, and the Server setup function must import their code from
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!