-
Notifications
You must be signed in to change notification settings - Fork 1k
[Bug?]: Maybe Regression: cannot delete /api
directory and have the app still build
#10264
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
Comments
I created the test project and then destroyed the API side. I worked through the errors I had getting I didn't run into any directive related issues however so maybe I'm missing something. I'm not sure if we will want the PR but it's there as a starting point I guess. Fancy checking if using that branch works for building your api-less project? |
Thanks for taking this one! Here's what I see if I delete
|
Cool thanks! I'll check it out, reproduce it, and update the branch accordingly |
Your goal here was to simply not have a My branch will handle that case for your app - the What are your thoughts on build working for either:
I don't know if it'll be wise to try go through any possible partial state the |
Yep I wanted to be able to remove Those two cases sounds good to me, I definitely wasn't thinking we should try to get api to build in all possible permutations of files/directories that could be present. I would say the only cases to worry about are |
#10265) **Problem** This PR address the issue raised in #10264 which highlighted that `yarn rw build` would fail for projects that have removed the `api` directory. **Changes** 1. The `yarn rw build` command now checks for the existence of the prisma schema file. It will not generate the prisma client if the file does not exist and it will not trigger prerendering if the schema file does not exist. 2. Updates the checks performed by `yarn rw serve` to handle the case when there is not API side a little nicer. It will offer more specific error messages when you run `yarn rw serve api` without an API side and it will tell you to run `yarn rw serve web` instead of `yarn rw serve` if you have no API side. **Concerns** 1. I'm not sure about adding checks for "does the API side even exist" anywhere we previously assumed it did. For now these checks only needed to happen in 2 places so I'm not that bothered about them but I can see how it could spiral out of control.
#10265) **Problem** This PR address the issue raised in #10264 which highlighted that `yarn rw build` would fail for projects that have removed the `api` directory. **Changes** 1. The `yarn rw build` command now checks for the existence of the prisma schema file. It will not generate the prisma client if the file does not exist and it will not trigger prerendering if the schema file does not exist. 2. Updates the checks performed by `yarn rw serve` to handle the case when there is not API side a little nicer. It will offer more specific error messages when you run `yarn rw serve api` without an API side and it will tell you to run `yarn rw serve web` instead of `yarn rw serve` if you have no API side. **Concerns** 1. I'm not sure about adding checks for "does the API side even exist" anywhere we previously assumed it did. For now these checks only needed to happen in 2 places so I'm not that bothered about them but I can see how it could spiral out of control.
Uh oh!
There was an error while loading. Please reload this page.
What's not working?
Coming soon with RSC, we will no longer have an
/api
directory. I tried to see how close I could get to this future with the latest canary by deleting everything in/api
. The build would fail unless two conditions were met:db/prisma.schema
file must be presentapi/src/directives
How do we reproduce the bug?
In the latest canary, delete the
/api
directory and try toyarn rw build
What's your environment? (If it applies)
No response
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: