@tanstack/router-core 0.0.1-beta.1 → 0.0.1-beta.3
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/build/cjs/packages/router-core/src/router.js +3 -3
- package/build/cjs/packages/router-core/src/router.js.map +1 -1
- package/build/esm/index.js +3 -3
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +132 -132
- package/build/types/index.d.ts +2 -2
- package/build/umd/index.development.js +3 -3
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +6 -9
package/build/types/index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ interface RouterOptions<TRouteConfig extends AnyRouteConfig> {
|
|
|
102
102
|
route: AnyRoute;
|
|
103
103
|
router: Router<any, any>;
|
|
104
104
|
}) => void;
|
|
105
|
-
createElement?: (element: GetFrameworkGeneric<'
|
|
105
|
+
createElement?: (element: GetFrameworkGeneric<'SyncOrAsyncElement'>) => Promise<GetFrameworkGeneric<'Element'>>;
|
|
106
106
|
}
|
|
107
107
|
interface Action<TPayload = unknown, TResponse = unknown> {
|
|
108
108
|
submit: (submission?: TPayload) => Promise<TResponse>;
|
|
@@ -158,7 +158,7 @@ interface PendingState {
|
|
|
158
158
|
location: Location;
|
|
159
159
|
matches: RouteMatch[];
|
|
160
160
|
}
|
|
161
|
-
declare type Listener = () => void;
|
|
161
|
+
declare type Listener = (router: Router<any, any>) => void;
|
|
162
162
|
declare type ListenerFn = () => void;
|
|
163
163
|
interface BuildNextOptions {
|
|
164
164
|
to?: string | number | null;
|
|
@@ -1684,9 +1684,9 @@
|
|
|
1684
1684
|
|
|
1685
1685
|
var _window$document;
|
|
1686
1686
|
// Detect if we're in the DOM
|
|
1687
|
-
const isServer =
|
|
1687
|
+
const isServer = typeof window === 'undefined' || !((_window$document = window.document) != null && _window$document.createElement); // This is the default history object if none is defined
|
|
1688
1688
|
|
|
1689
|
-
const createDefaultHistory = () =>
|
|
1689
|
+
const createDefaultHistory = () => isServer ? createMemoryHistory() : createBrowserHistory();
|
|
1690
1690
|
|
|
1691
1691
|
function createRouter(userOptions) {
|
|
1692
1692
|
var _userOptions$stringif, _userOptions$parseSea;
|
|
@@ -1745,7 +1745,7 @@
|
|
|
1745
1745
|
isPreloading: Object.values(router.matchCache).some(d => d.match.isFetching && !router.state.matches.find(dd => dd.matchId === d.match.matchId))
|
|
1746
1746
|
});
|
|
1747
1747
|
cascadeLoaderData(router.state.matches);
|
|
1748
|
-
router.listeners.forEach(listener => listener());
|
|
1748
|
+
router.listeners.forEach(listener => listener(router));
|
|
1749
1749
|
},
|
|
1750
1750
|
mount: () => {
|
|
1751
1751
|
const next = router.__.buildLocation({
|