@remix-run/router 1.9.0-pre.1 → 1.9.0-pre.2
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/CHANGELOG.md +6 -0
- package/dist/history.d.ts +4 -4
- package/dist/router.cjs.js +12 -11
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +8 -8
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +12 -11
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +1 -1
- package/dist/router.umd.min.js.map +1 -1
- package/dist/utils.d.ts +9 -9
- package/history.ts +5 -5
- package/package.json +1 -1
- package/utils.ts +24 -17
package/dist/router.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v1.9.0-pre.
|
|
2
|
+
* @remix-run/router v1.9.0-pre.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
*/
|
|
62
62
|
/**
|
|
63
63
|
* Describes a location that is the destination of some navigation, either via
|
|
64
|
-
* `history.push` or `history.replace`.
|
|
65
|
-
* URL path.
|
|
64
|
+
* `history.push` or `history.replace`. This may be either a URL or the pieces
|
|
65
|
+
* of a URL path.
|
|
66
66
|
*/
|
|
67
67
|
/**
|
|
68
68
|
* A history is an interface to the navigation stack. The history serves as the
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
try {
|
|
325
325
|
// Welcome to debugging history!
|
|
326
326
|
//
|
|
327
|
-
// This error is thrown as a convenience so you can more easily
|
|
327
|
+
// This error is thrown as a convenience, so you can more easily
|
|
328
328
|
// find the source for a warning that appears in the console by
|
|
329
329
|
// enabling "pause on exceptions" in your JavaScript debugger.
|
|
330
330
|
throw new Error(message);
|
|
@@ -606,6 +606,7 @@
|
|
|
606
606
|
|
|
607
607
|
// TODO: (v7) Change the defaults from any to unknown in and remove Remix wrappers:
|
|
608
608
|
// ActionFunction, ActionFunctionArgs, LoaderFunction, LoaderFunctionArgs
|
|
609
|
+
// Also, make them a type alias instead of an interface
|
|
609
610
|
/**
|
|
610
611
|
* Arguments passed to loader functions
|
|
611
612
|
*/
|
|
@@ -689,7 +690,7 @@
|
|
|
689
690
|
*/
|
|
690
691
|
|
|
691
692
|
// Attempt to parse the given string segment. If it fails, then just return the
|
|
692
|
-
// plain string type as a default fallback. Otherwise return the union of the
|
|
693
|
+
// plain string type as a default fallback. Otherwise, return the union of the
|
|
693
694
|
// parsed string literals that were referenced as dynamic segments in the route.
|
|
694
695
|
/**
|
|
695
696
|
* The parameters that were parsed from the URL path.
|
|
@@ -701,7 +702,7 @@
|
|
|
701
702
|
return route.index === true;
|
|
702
703
|
}
|
|
703
704
|
|
|
704
|
-
// Walk the route tree generating unique IDs where necessary so we are working
|
|
705
|
+
// Walk the route tree generating unique IDs where necessary, so we are working
|
|
705
706
|
// solely with AgnosticDataRouteObject's within the Router
|
|
706
707
|
function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) {
|
|
707
708
|
if (parentPath === void 0) {
|
|
@@ -802,7 +803,7 @@
|
|
|
802
803
|
let path = joinPaths([parentPath, meta.relativePath]);
|
|
803
804
|
let routesMeta = parentsMeta.concat(meta);
|
|
804
805
|
|
|
805
|
-
// Add the children before adding this route to the array so we traverse the
|
|
806
|
+
// Add the children before adding this route to the array, so we traverse the
|
|
806
807
|
// route tree depth-first and child routes appear before their parents in
|
|
807
808
|
// the "flattened" version.
|
|
808
809
|
if (route.children && route.children.length > 0) {
|
|
@@ -870,15 +871,15 @@
|
|
|
870
871
|
let result = [];
|
|
871
872
|
|
|
872
873
|
// All child paths with the prefix. Do this for all children before the
|
|
873
|
-
// optional version for all children so we get consistent ordering where the
|
|
874
|
+
// optional version for all children, so we get consistent ordering where the
|
|
874
875
|
// parent optional aspect is preferred as required. Otherwise, we can get
|
|
875
876
|
// child sections interspersed where deeper optional segments are higher than
|
|
876
|
-
// parent optional segments, where for example, /:two would
|
|
877
|
+
// parent optional segments, where for example, /:two would explode _earlier_
|
|
877
878
|
// then /:one. By always including the parent as required _for all children_
|
|
878
879
|
// first, we avoid this issue
|
|
879
880
|
result.push(...restExploded.map(subpath => subpath === "" ? required : [required, subpath].join("/")));
|
|
880
881
|
|
|
881
|
-
// Then if this is an optional value, add all child versions without
|
|
882
|
+
// Then, if this is an optional value, add all child versions without
|
|
882
883
|
if (isOptional) {
|
|
883
884
|
result.push(...restExploded);
|
|
884
885
|
}
|
|
@@ -1066,7 +1067,7 @@
|
|
|
1066
1067
|
regexpSource += "\\/*$";
|
|
1067
1068
|
} else if (path !== "" && path !== "/") {
|
|
1068
1069
|
// If our path is non-empty and contains anything beyond an initial slash,
|
|
1069
|
-
// then we have _some_ form of path in our regex so we should expect to
|
|
1070
|
+
// then we have _some_ form of path in our regex, so we should expect to
|
|
1070
1071
|
// match only if we find the end of this path segment. Look for an optional
|
|
1071
1072
|
// non-captured trailing slash (to match a portion of the URL) or the end
|
|
1072
1073
|
// of the path (if we've matched to the end). We used to do this with a
|