-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructuring prototype RFC #1584
Conversation
8298f5f
to
3da3f52
Compare
optimizeDeps: { | ||
exclude: ['@wasp'] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vite's dependency optimization was causing weird bugs.
Todo: describe
@infomiho knows what's up. @Martinsos take my word for it for now, I'll update the comment in a bit.
@@ -0,0 +1,20 @@ | |||
{ | |||
"name": "core", | |||
"type": "module", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will make an md file documenting the new structure.
4e7be10
to
a5a7382
Compare
f967599
to
a5a7382
Compare
Fixes: #1426
Instructions for looking at the RFC
This PR includes (almost**) all necessary changes to run a project that follows the new structure. It also includes an example of one such project (the prototype).
Here's how I recommend you approach the RFC:
** Details why almost are explained in the comments.
A reminder on the new structure
How does the new structure look like?
Wasp users write User code.
Wasp generates Generated Code. The Generated Code is split into:
Here's an illustration of how the new structure looks like in the file system.
Running the prototype
The prototype is a Wasp application that's organized according to the new structure and can run using an adopted version of
waspc
(the one in this branch).Here's how to run it:
waspc/examples/todo-typescript
.cabal run wasp-cli clean && cabal run wasp-cli start
and wait for the app to start (i.e., stops outputting new text). You'll see a white screen in the browser (this is normal).start
command../migrate
from the project root directory.cabal run wasp-cli start
againChanges in this PR
These are the changes that were necessary to get the prototype working.
.wasp/out/{server,client}
(framework code) to various packages in the scopenode_modules/@wasp/
. Each package also includes whatever was necessary to make it work with Wasp.@wasp
user imports now look a little different (the final form of SDK imports is still open to discussion).node_modules/@wasp
has been edited (i.e., not only copy-pasted) to allow for a more ergonomic organization and cleaner imports. You don't need to be aware of these changes, they'll become obvious during the implementation. Still, I commented on some of the changes for discussion purposes..wasp/out/{server,client}
. Instead, the framework code (i.e., code inside.wasp/out/{server,client}
) now imports the user code directly. It does this using relative imports.waspc/examples
directory now contains an extra app which acts as a prototype (waspc/examples/todo-typescript
).PR comments explore each change and decision in more detail, so let's discuss them there. If I missed something, feel free to start a new thread on the appropriate code segment.