@solidjs/router 0.12.4 → 0.12.5

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/README.md CHANGED
@@ -59,7 +59,7 @@ This sets up a Router that will match on the url to display the desired page
59
59
 
60
60
  Solid Router allows you to configure your routes using JSX:
61
61
 
62
- 1. Add each route to a `<Router>` using the `Route` component, specifying a path and an element or component to render when the user navigates to that path.
62
+ 1. Add each route to a `<Router>` using the `Route` component, specifying a path and a component to render when the user navigates to that path.
63
63
 
64
64
  ```jsx
65
65
  import { render } from "solid-js/web";
@@ -73,9 +73,10 @@ export function cache(fn, name) {
73
73
  onCleanup(() => cached[3].count--);
74
74
  }
75
75
  if (cached &&
76
+ cached[0] &&
76
77
  (isServer ||
77
78
  intent === "native" ||
78
- (cached[0] && cached[3].count) ||
79
+ cached[3].count ||
79
80
  Date.now() - cached[0] < PRELOAD_TIMEOUT)) {
80
81
  if (tracking) {
81
82
  cached[3].count++;
package/dist/index.js CHANGED
@@ -230,7 +230,7 @@ function expandOptionals(pattern) {
230
230
  const MAX_REDIRECTS = 100;
231
231
  const RouterContextObj = createContext();
232
232
  const RouteContextObj = createContext();
233
- const useRouter = () => invariant(useContext(RouterContextObj), "Make sure your app is wrapped in a <Router />");
233
+ const useRouter = () => invariant(useContext(RouterContextObj), "<A> and 'use' router primitives can be only used inside a Route.");
234
234
  const useRoute = () => useContext(RouteContextObj) || useRouter().base;
235
235
  const useResolvedPath = path => {
236
236
  const route = useRoute();
@@ -913,7 +913,7 @@ function cache(fn, name) {
913
913
  tracking = true;
914
914
  onCleanup(() => cached[3].count--);
915
915
  }
916
- if (cached && (isServer || intent === "native" || cached[0] && cached[3].count || Date.now() - cached[0] < PRELOAD_TIMEOUT)) {
916
+ if (cached && cached[0] && (isServer || intent === "native" || cached[3].count || Date.now() - cached[0] < PRELOAD_TIMEOUT)) {
917
917
  if (tracking) {
918
918
  cached[3].count++;
919
919
  cached[3][0](); // track
package/dist/routing.js CHANGED
@@ -6,7 +6,7 @@ import { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath
6
6
  const MAX_REDIRECTS = 100;
7
7
  export const RouterContextObj = createContext();
8
8
  export const RouteContextObj = createContext();
9
- export const useRouter = () => invariant(useContext(RouterContextObj), "Make sure your app is wrapped in a <Router />");
9
+ export const useRouter = () => invariant(useContext(RouterContextObj), "<A> and 'use' router primitives can be only used inside a Route.");
10
10
  let TempRoute;
11
11
  export const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;
12
12
  export const useResolvedPath = (path) => {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "Ryan Turnquist"
7
7
  ],
8
8
  "license": "MIT",
9
- "version": "0.12.4",
9
+ "version": "0.12.5",
10
10
  "homepage": "https://github.com/solidjs/solid-router#readme",
11
11
  "repository": {
12
12
  "type": "git",