@remix-run/router 0.0.0-experimental-4286521e → 0.0.0-experimental-7b1bbb00

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export type { ActionFunction, ActionFunctionArgs, AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, FormEncType, FormMethod, HTMLFormMethod, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, ParamParseKey, Params, PathMatch, PathPattern, RedirectFunction, ShouldRevalidateFunction, TrackedPromise, V7_FormMethod, } from "./utils";
2
- export { AbortedDeferredError, ErrorResponse, defer, generatePath, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, redirect, redirectDocument, resolvePath, resolveTo, stripBasename, } from "./utils";
1
+ export type { ActionFunction, ActionFunctionArgs, AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, ErrorResponse, FormEncType, FormMethod, HTMLFormMethod, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, ParamParseKey, Params, PathMatch, PathPattern, RedirectFunction, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, TrackedPromise, V7_FormMethod, } from "./utils";
2
+ export { AbortedDeferredError, defer, generatePath, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, redirect, redirectDocument, resolvePath, resolveTo, stripBasename, } from "./utils";
3
3
  export type { BrowserHistory, BrowserHistoryOptions, HashHistory, HashHistoryOptions, History, InitialEntry, Location, MemoryHistory, MemoryHistoryOptions, Path, To, } from "./history";
4
4
  export { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath, } from "./history";
5
5
  export * from "./router";
6
6
  /** @internal */
7
7
  export type { RouteManifest as UNSAFE_RouteManifest } from "./utils";
8
- export { DeferredData as UNSAFE_DeferredData, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, } from "./utils";
8
+ export { DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, } from "./utils";
9
9
  export { invariant as UNSAFE_invariant, warning as UNSAFE_warning, } from "./history";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v0.0.0-experimental-4286521e
2
+ * @remix-run/router v0.0.0-experimental-7b1bbb00
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1469,7 +1469,7 @@ const redirectDocument = (url, init) => {
1469
1469
  * @private
1470
1470
  * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies
1471
1471
  */
1472
- class ErrorResponse {
1472
+ class ErrorResponseImpl {
1473
1473
  constructor(status, statusText, data, internal) {
1474
1474
  if (internal === void 0) {
1475
1475
  internal = false;
@@ -1486,6 +1486,9 @@ class ErrorResponse {
1486
1486
  }
1487
1487
  }
1488
1488
 
1489
+ // We don't want the class exported since usage of it at runtime is an
1490
+ // implementation detail, but we do want to export the shape so folks can
1491
+ // build their own abstractions around instances via isRouteErrorResponse()
1489
1492
  /**
1490
1493
  * Check if the given error is an ErrorResponse generated from a 4xx/5xx
1491
1494
  * Response thrown from an action/loader
@@ -3966,7 +3969,7 @@ async function callLoaderOrAction(type, request, match, matches, manifest, mapRo
3966
3969
  if (resultType === ResultType.error) {
3967
3970
  return {
3968
3971
  type: resultType,
3969
- error: new ErrorResponse(status, result.statusText, data),
3972
+ error: new ErrorResponseImpl(status, result.statusText, data),
3970
3973
  headers: result.headers
3971
3974
  };
3972
3975
  }
@@ -4245,7 +4248,7 @@ function getInternalRouterError(status, _temp4) {
4245
4248
  errorMessage = "Invalid request method \"" + method.toUpperCase() + "\"";
4246
4249
  }
4247
4250
  }
4248
- return new ErrorResponse(status || 500, statusText, new Error(errorMessage), true);
4251
+ return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true);
4249
4252
  }
4250
4253
 
4251
4254
  // Find any returned redirect errors, starting from the lowest match
@@ -4540,12 +4543,12 @@ function getDoneFetcher(data) {
4540
4543
 
4541
4544
  exports.AbortedDeferredError = AbortedDeferredError;
4542
4545
  exports.Action = Action;
4543
- exports.ErrorResponse = ErrorResponse;
4544
4546
  exports.IDLE_BLOCKER = IDLE_BLOCKER;
4545
4547
  exports.IDLE_FETCHER = IDLE_FETCHER;
4546
4548
  exports.IDLE_NAVIGATION = IDLE_NAVIGATION;
4547
4549
  exports.UNSAFE_DEFERRED_SYMBOL = UNSAFE_DEFERRED_SYMBOL;
4548
4550
  exports.UNSAFE_DeferredData = DeferredData;
4551
+ exports.UNSAFE_ErrorResponseImpl = ErrorResponseImpl;
4549
4552
  exports.UNSAFE_convertRoutesToDataRoutes = convertRoutesToDataRoutes;
4550
4553
  exports.UNSAFE_getPathContributingMatches = getPathContributingMatches;
4551
4554
  exports.UNSAFE_invariant = invariant;