-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(remix-server-runtime): RRR 1.3 / 1.4 - handleDocumentRequest (#4385
) test: update test to be more reliable chore: be more protective when accessing route module test: stop compiler test from logging feat: disambiguate catch/error boundary responses fix: ensure route modules are loaded regardless of error state test: make fetcher tests more reliable feat: Change missing loader from 405 -> 400 error Co-authored-by: Matt Brophy <[email protected]>
- Loading branch information
1 parent
70784af
commit 9f3bfe4
Showing
18 changed files
with
1,625 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
"@remix-run/server-runtime": patch | ||
--- | ||
|
||
fix: Properly categorize internal framework-thrown error Responses as error boundary errors | ||
|
||
Previously there was some ambiguity around _"thrown Responses go to the `CatchBoundary`"_. | ||
The `CatchBoundary` exists to give the _user_ a place to handle non-happy path code flows | ||
such that they can throw Response instances from _their own code_ and handle them in a | ||
`CatchBoundary`. However, there are a handful of framework-internal errors that make | ||
sense to have a non-500 status code, and the fact that these were being thrown as Responses | ||
was causing them to go into the CatchBoundary, even though they were not user-thrown. | ||
|
||
With this change, anything thrown by the framework itself (`Error` or `Response`) will | ||
go to the `ErrorBoundary`, and any user-thrown `Response` instances will go to the | ||
`CatchBoundary`. Thereis one exception to this rule, which is that framework-detected | ||
404's will continue to go to the `CatchBoundary` since users should have one single | ||
location to handle 404 displays. | ||
|
||
The primary affected use cases are scenarios such as: | ||
|
||
* HTTP `OPTIONS` requests (405 Unsupported Method ) | ||
* `GET` requests to routes without loaders (400 Bad Request) | ||
* `POST` requests to routes without actions (405 Method Not Allowed) | ||
* Missing route id in `_data` parameters (403 Forbidden) | ||
* Non-matching route id included in `_data` parameters (403 Forbidden) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.