Repository: remix-run/react-router
File: packages/react-router/lib/router/router.ts (TypeScript)

Code before:
   * also adds SSR-specific information such as the statusCode and headers
   * from action/loaders Responses.
   *
   * It _should_ never throw and should report all errors through the
   * returned handlerContext.errors object, properly associating errors to
   * their error boundary.  Additionally, it tracks _deepestRenderedBoundaryId
   * which can be used to emulate React error boundaries during SSR by performing
   * a second pass only down to the boundaryId.
   *
   * The one exception where we do not return a StaticHandlerContext is when a
   * redirect response is returned or thrown from any action/loader.  We
   * propagate that out and return the raw Response so the HTTP server can
   * return it directly.
   *
   * - `opts.requestContext` is an optional server context that will be passed
   *   to actions/loaders in the `context` parameter
   * - `opts.skipLoaderErrorBubbling` is an optional parameter that will prevent
   *   the bubbling of errors which allows single-fetch-type implementations
   *   where the client will handle the bubbling and we may need to return data
   *   for the handling route
   */
  async function query(
    request: Parameters<StaticHandler["query"]>[0],
    {
      requestContext,
      filterMatchesToLoad: filterMatchesToLoadBase,
      skipLoaderErrorBubbling,
      skipRevalidation,
      dataStrategy,
      unstable_generateMiddlewareResponse: generateMiddlewareResponse,
    }: Parameters<StaticHandler["query"]>[1] = {},
  ): Promise<StaticHandlerContext | Response> {
    let url = new URL(request.url);
    let method = request.method;
    let location = createLocation("", createPath(url), null, "default");
    let matches = matchRoutes(dataRoutes, location, basename);
    requestContext =
      requestContext != null
        ? requestContext
        : new unstable_RouterContextProvider();

    // SSR supports HEAD requests while SPA doesn't
    if (!isValidMethod(method) && method !== "HEAD") {
      let error = getInternalRouterError(405, { method });
      let { matches: methodNotAllowedMatches, route } =
        getShortCircuitMatches(dataRoutes);
      let staticContext: StaticHandlerContext = {
        basename,
        location,
        matches: methodNotAllowedMatches,
        loaderData: {},

Review comment (suggestion):
This can be reverted now I think?

```suggestion
      filterMatchesToLoad,
```

Code after:
   * also adds SSR-specific information such as the statusCode and headers
   * from action/loaders Responses.
   *
   * It _should_ never throw and should report all errors through the
   * returned handlerContext.errors object, properly associating errors to
   * their error boundary.  Additionally, it tracks _deepestRenderedBoundaryId
   * which can be used to emulate React error boundaries during SSR by performing
   * a second pass only down to the boundaryId.
   *
   * The one exception where we do not return a StaticHandlerContext is when a
   * redirect response is returned or thrown from any action/loader.  We
   * propagate that out and return the raw Response so the HTTP server can
   * return it directly.
   *
   * - `opts.requestContext` is an optional server context that will be passed
   *   to actions/loaders in the `context` parameter
   * - `opts.skipLoaderErrorBubbling` is an optional parameter that will prevent
   *   the bubbling of errors which allows single-fetch-type implementations
   *   where the client will handle the bubbling and we may need to return data
   *   for the handling route
   */
  async function query(
    request: Parameters<StaticHandler["query"]>[0],
    {
      requestContext,
      filterMatchesToLoad,
      skipLoaderErrorBubbling,
      skipRevalidation,
      dataStrategy,
      unstable_generateMiddlewareResponse: generateMiddlewareResponse,
    }: Parameters<StaticHandler["query"]>[1] = {},
  ): Promise<StaticHandlerContext | Response> {
    let url = new URL(request.url);
    let method = request.method;
    let location = createLocation("", createPath(url), null, "default");
    let matches = matchRoutes(dataRoutes, location, basename);
    requestContext =
      requestContext != null
        ? requestContext
        : new unstable_RouterContextProvider();

    // SSR supports HEAD requests while SPA doesn't
    if (!isValidMethod(method) && method !== "HEAD") {
      let error = getInternalRouterError(405, { method });
      let { matches: methodNotAllowedMatches, route } =
        getShortCircuitMatches(dataRoutes);
      let staticContext: StaticHandlerContext = {
        basename,
        location,
        matches: methodNotAllowedMatches,
        loaderData: {},