solid-navigator 0.3.4 → 0.3.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/dist/dev.js +10 -6
- package/dist/dev.jsx +12 -4
- package/dist/index.js +10 -6
- package/dist/index.jsx +12 -4
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { createContext, children, createMemo, createSignal, onCleanup, batch, mergeProps, createEffect, on, useContext } from 'solid-js';
|
|
1
2
|
import { delegateEvents, createComponent, spread, template } from 'solid-js/web';
|
|
2
|
-
import { createContext, children, createMemo, createSignal, onCleanup, mergeProps, createEffect, on, useContext } from 'solid-js';
|
|
3
3
|
import { createStore, reconcile } from 'solid-js/store';
|
|
4
4
|
|
|
5
|
-
// src/
|
|
5
|
+
// src/navigator.ts
|
|
6
6
|
|
|
7
7
|
// src/utils/matcher.ts
|
|
8
8
|
function createMatcher(path, partial, matchFilters) {
|
|
@@ -152,8 +152,10 @@ function Router(props) {
|
|
|
152
152
|
});
|
|
153
153
|
const navigate = createNavigate(routes, pathname, setPathname, setHashAndSearch);
|
|
154
154
|
const onPopState = (_event) => {
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
batch(() => {
|
|
156
|
+
setPathname(location.pathname);
|
|
157
|
+
setHashAndSearch(getHashAndSearch());
|
|
158
|
+
});
|
|
157
159
|
};
|
|
158
160
|
const onClick = (event) => {
|
|
159
161
|
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
|
|
@@ -286,8 +288,10 @@ var createNavigate = (routes, pathname, setPathname, setHashAndSearch) => {
|
|
|
286
288
|
if (!isValidPath(routes, location.pathname)) {
|
|
287
289
|
console.warn("Invalid path: " + path);
|
|
288
290
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
batch(() => {
|
|
292
|
+
setPathname(location.pathname);
|
|
293
|
+
setHashAndSearch(getHashAndSearch());
|
|
294
|
+
});
|
|
291
295
|
};
|
|
292
296
|
};
|
|
293
297
|
var useNavigate = () => {
|
package/dist/dev.jsx
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
// src/navigator.ts
|
|
2
|
+
import { batch as batch2 } from "solid-js";
|
|
3
|
+
|
|
1
4
|
// src/Router.tsx
|
|
2
5
|
import {
|
|
6
|
+
batch,
|
|
3
7
|
children,
|
|
4
8
|
createContext,
|
|
5
9
|
createMemo as createMemo2,
|
|
@@ -159,8 +163,10 @@ function Router(props) {
|
|
|
159
163
|
});
|
|
160
164
|
const navigate = createNavigate(routes, pathname, setPathname, setHashAndSearch);
|
|
161
165
|
const onPopState = (_event) => {
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
batch(() => {
|
|
167
|
+
setPathname(location.pathname);
|
|
168
|
+
setHashAndSearch(getHashAndSearch());
|
|
169
|
+
});
|
|
164
170
|
};
|
|
165
171
|
const onClick = (event) => {
|
|
166
172
|
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
|
|
@@ -288,8 +294,10 @@ var createNavigate = (routes, pathname, setPathname, setHashAndSearch) => {
|
|
|
288
294
|
if (!isValidPath(routes, location.pathname)) {
|
|
289
295
|
console.warn("Invalid path: " + path);
|
|
290
296
|
}
|
|
291
|
-
|
|
292
|
-
|
|
297
|
+
batch2(() => {
|
|
298
|
+
setPathname(location.pathname);
|
|
299
|
+
setHashAndSearch(getHashAndSearch());
|
|
300
|
+
});
|
|
293
301
|
};
|
|
294
302
|
};
|
|
295
303
|
var useNavigate = () => {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { createContext, children, createMemo, createSignal, onCleanup, batch, mergeProps, createEffect, on, useContext } from 'solid-js';
|
|
1
2
|
import { delegateEvents, createComponent, spread, template } from 'solid-js/web';
|
|
2
|
-
import { createContext, children, createMemo, createSignal, onCleanup, mergeProps, createEffect, on, useContext } from 'solid-js';
|
|
3
3
|
import { createStore, reconcile } from 'solid-js/store';
|
|
4
4
|
|
|
5
|
-
// src/
|
|
5
|
+
// src/navigator.ts
|
|
6
6
|
|
|
7
7
|
// src/utils/matcher.ts
|
|
8
8
|
function createMatcher(path, partial, matchFilters) {
|
|
@@ -152,8 +152,10 @@ function Router(props) {
|
|
|
152
152
|
});
|
|
153
153
|
const navigate = createNavigate(routes, pathname, setPathname, setHashAndSearch);
|
|
154
154
|
const onPopState = (_event) => {
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
batch(() => {
|
|
156
|
+
setPathname(location.pathname);
|
|
157
|
+
setHashAndSearch(getHashAndSearch());
|
|
158
|
+
});
|
|
157
159
|
};
|
|
158
160
|
const onClick = (event) => {
|
|
159
161
|
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
|
|
@@ -284,8 +286,10 @@ var createNavigate = (routes, pathname, setPathname, setHashAndSearch) => {
|
|
|
284
286
|
history.pushState({}, "", newPath);
|
|
285
287
|
}
|
|
286
288
|
if (!isValidPath(routes, location.pathname)) ;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
batch(() => {
|
|
290
|
+
setPathname(location.pathname);
|
|
291
|
+
setHashAndSearch(getHashAndSearch());
|
|
292
|
+
});
|
|
289
293
|
};
|
|
290
294
|
};
|
|
291
295
|
var useNavigate = () => {
|
package/dist/index.jsx
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
// src/navigator.ts
|
|
2
|
+
import { batch as batch2 } from "solid-js";
|
|
3
|
+
|
|
1
4
|
// src/Router.tsx
|
|
2
5
|
import {
|
|
6
|
+
batch,
|
|
3
7
|
children,
|
|
4
8
|
createContext,
|
|
5
9
|
createMemo as createMemo2,
|
|
@@ -159,8 +163,10 @@ function Router(props) {
|
|
|
159
163
|
});
|
|
160
164
|
const navigate = createNavigate(routes, pathname, setPathname, setHashAndSearch);
|
|
161
165
|
const onPopState = (_event) => {
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
batch(() => {
|
|
167
|
+
setPathname(location.pathname);
|
|
168
|
+
setHashAndSearch(getHashAndSearch());
|
|
169
|
+
});
|
|
164
170
|
};
|
|
165
171
|
const onClick = (event) => {
|
|
166
172
|
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
|
|
@@ -287,8 +293,10 @@ var createNavigate = (routes, pathname, setPathname, setHashAndSearch) => {
|
|
|
287
293
|
}
|
|
288
294
|
if (!isValidPath(routes, location.pathname)) {
|
|
289
295
|
}
|
|
290
|
-
|
|
291
|
-
|
|
296
|
+
batch2(() => {
|
|
297
|
+
setPathname(location.pathname);
|
|
298
|
+
setHashAndSearch(getHashAndSearch());
|
|
299
|
+
});
|
|
292
300
|
};
|
|
293
301
|
};
|
|
294
302
|
var useNavigate = () => {
|