@qwik.dev/router 2.0.0-beta.23 → 2.0.0-beta.25
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.
|
@@ -347,7 +347,11 @@ const deepFreeze = (obj) => {
|
|
|
347
347
|
Object.getOwnPropertyNames(obj).forEach((prop) => {
|
|
348
348
|
const value = obj[prop];
|
|
349
349
|
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
350
|
-
|
|
350
|
+
try {
|
|
351
|
+
deepFreeze(value);
|
|
352
|
+
} catch {
|
|
353
|
+
return obj;
|
|
354
|
+
}
|
|
351
355
|
}
|
|
352
356
|
});
|
|
353
357
|
return Object.freeze(obj);
|
|
@@ -426,4 +430,4 @@ const getMenuLoader = (menus, pathname) => {
|
|
|
426
430
|
}
|
|
427
431
|
};
|
|
428
432
|
|
|
429
|
-
export { CLIENT_DATA_CACHE as C, DEFAULT_LOADERS_SERIALIZATION_STRATEGY as D, Q_ROUTE as Q, isSamePath as a, isSameOrigin as b, createLoaderSignal as c, loadRoute as d, clientNavigate as e,
|
|
433
|
+
export { CLIENT_DATA_CACHE as C, DEFAULT_LOADERS_SERIALIZATION_STRATEGY as D, Q_ROUTE as Q, isSamePath as a, isSameOrigin as b, createLoaderSignal as c, loadRoute as d, clientNavigate as e, QFN_KEY as f, getClientNavPath as g, QACTION_KEY as h, isPromise as i, QDATA_KEY as j, QLOADER_KEY as k, loadClientData as l, preloadRouteBundles as p, shouldPreload as s, toUrl as t };
|
package/lib/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import { QRL } from '@qwik.dev/core';
|
|
|
12
12
|
import { QRLEventHandlerMulti } from '@qwik.dev/core';
|
|
13
13
|
import { QwikIntrinsicElements } from '@qwik.dev/core';
|
|
14
14
|
import { QwikJSX } from '@qwik.dev/core';
|
|
15
|
-
import type { ReadonlySignal } from '@qwik.dev/core';
|
|
16
15
|
import { Render } from '@qwik.dev/core/server';
|
|
17
16
|
import { RenderOptions } from '@qwik.dev/core/server';
|
|
18
17
|
import { RequestEvent } from '@qwik.dev/router/middleware/request-handler';
|
|
@@ -23,6 +22,7 @@ import { RequestEventLoader } from '@qwik.dev/router/middleware/request-handler'
|
|
|
23
22
|
import { RequestHandler } from '@qwik.dev/router/middleware/request-handler';
|
|
24
23
|
import type { ResolveSyncValue } from '@qwik.dev/router/middleware/request-handler';
|
|
25
24
|
import type { SerializationStrategy } from '@qwik.dev/core/internal';
|
|
25
|
+
import type { Signal } from '@qwik.dev/core';
|
|
26
26
|
import type * as v from 'valibot';
|
|
27
27
|
import type { ValueOrPromise } from '@qwik.dev/core';
|
|
28
28
|
import { ValueOrPromise as ValueOrPromise_2 } from '@qwik.dev/core/internal';
|
|
@@ -437,7 +437,7 @@ export declare type JSONValue = string | number | boolean | {
|
|
|
437
437
|
} | Array<JSONValue>;
|
|
438
438
|
|
|
439
439
|
/** @public */
|
|
440
|
-
declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> |
|
|
440
|
+
declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal_2<JSXChildren> | JSXNode;
|
|
441
441
|
|
|
442
442
|
/**
|
|
443
443
|
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
@@ -529,7 +529,7 @@ declare type LoaderOptions = {
|
|
|
529
529
|
};
|
|
530
530
|
|
|
531
531
|
/** @public */
|
|
532
|
-
export declare type LoaderSignal<TYPE> = (TYPE extends () => ValueOrPromise<infer VALIDATOR> ?
|
|
532
|
+
export declare type LoaderSignal<TYPE> = (TYPE extends () => ValueOrPromise<infer VALIDATOR> ? Signal<ValueOrPromise<VALIDATOR>> : Signal<TYPE>) & Pick<AsyncSignal, 'promise' | 'loading' | 'error'>;
|
|
533
533
|
|
|
534
534
|
/** @public */
|
|
535
535
|
export declare type MenuData = [pathname: string, menuLoader: MenuModuleLoader];
|
|
@@ -715,11 +715,6 @@ export declare interface QwikRouterProps {
|
|
|
715
715
|
/** @public This is a wrapper around the `useQwikRouter()` hook. We recommend using the hook instead of this component, unless you have a good reason to make your root component reactive. */
|
|
716
716
|
export declare const QwikRouterProvider: Component<QwikRouterProps>;
|
|
717
717
|
|
|
718
|
-
/** @public */
|
|
719
|
-
declare interface ReadonlySignal_2<T = unknown> {
|
|
720
|
-
readonly value: T;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
718
|
/** @public */
|
|
724
719
|
export declare type RendererOptions = Omit<RenderOptions, 'serverData'> & {
|
|
725
720
|
serverData: ServerData;
|
|
@@ -873,8 +868,16 @@ export declare const ServiceWorkerRegister: (props: {
|
|
|
873
868
|
*
|
|
874
869
|
* @public
|
|
875
870
|
*/
|
|
876
|
-
declare interface
|
|
871
|
+
declare interface Signal_2<T = any> {
|
|
872
|
+
/** Reading from this subscribes to updates; writing to this triggers updates. */
|
|
877
873
|
value: T;
|
|
874
|
+
/** Reading from this does not subscribe to updates; writing to this does not trigger updates. */
|
|
875
|
+
untrackedValue: T;
|
|
876
|
+
/**
|
|
877
|
+
* Use this to trigger running subscribers, for example when the value mutated but remained the
|
|
878
|
+
* same object.
|
|
879
|
+
*/
|
|
880
|
+
trigger(): void;
|
|
878
881
|
}
|
|
879
882
|
|
|
880
883
|
/** @public */
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from '@qwik.dev/core/jsx-runtime';
|
|
2
2
|
import { component$, useErrorBoundary, useOnWindow, $, Slot, createContextId, useContext, implicit$FirstArg, noSerialize, useVisibleTask$, useServerData, useSignal, untrack, sync$, isDev, withLocale, event$, isServer, useStyles$, useStore, isBrowser, useContextProvider, useTask$, getLocale, jsx as jsx$1, SkipRender, createElement } from '@qwik.dev/core';
|
|
3
|
-
import { g as getClientNavPath, s as shouldPreload, p as preloadRouteBundles, l as loadClientData, i as isPromise, a as isSamePath, c as createLoaderSignal, t as toUrl, b as isSameOrigin, d as loadRoute, D as DEFAULT_LOADERS_SERIALIZATION_STRATEGY, C as CLIENT_DATA_CACHE, Q as Q_ROUTE, e as clientNavigate, f as
|
|
3
|
+
import { g as getClientNavPath, s as shouldPreload, p as preloadRouteBundles, l as loadClientData, i as isPromise, a as isSamePath, c as createLoaderSignal, t as toUrl, b as isSameOrigin, d as loadRoute, D as DEFAULT_LOADERS_SERIALIZATION_STRATEGY, C as CLIENT_DATA_CACHE, Q as Q_ROUTE, e as clientNavigate, f as QFN_KEY, h as QACTION_KEY, j as QDATA_KEY } from './chunks/routing.qwik.mjs';
|
|
4
4
|
import * as qwikRouterConfig from '@qwik-router-config';
|
|
5
5
|
import { _getContextContainer, SerializerSymbol, _UNINITIALIZED, _hasStoreEffects, forceStoreEffects, _waitUntilRendered, _getContextHostElement, _getContextEvent, _serialize, _deserialize, _resolveContextWithoutSequentialScope } from '@qwik.dev/core/internal';
|
|
6
6
|
import { _asyncRequestStore } from '@qwik.dev/router/middleware/request-handler';
|
|
@@ -882,7 +882,7 @@ const useQwikRouter = (props) => {
|
|
|
882
882
|
}
|
|
883
883
|
const navigate = () => {
|
|
884
884
|
clientNavigate(window, navType, prevUrl, trackUrl, replaceState);
|
|
885
|
-
contentInternal.
|
|
885
|
+
contentInternal.trigger();
|
|
886
886
|
return _waitUntilRendered(container2);
|
|
887
887
|
};
|
|
888
888
|
const _waitNextPage = () => {
|
|
@@ -1322,7 +1322,7 @@ const serverQrl = (qrl, options) => {
|
|
|
1322
1322
|
(v2) => v2 && Object.prototype.hasOwnProperty.call(v2, "sharedMap") && Object.prototype.hasOwnProperty.call(v2, "cookie")
|
|
1323
1323
|
);
|
|
1324
1324
|
}
|
|
1325
|
-
return qrl.apply(requestEvent,
|
|
1325
|
+
return qrl.apply(requestEvent, args);
|
|
1326
1326
|
} else {
|
|
1327
1327
|
let filteredArgs = args.map((arg) => {
|
|
1328
1328
|
if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isServer } from '@qwik.dev/core/build';
|
|
2
|
-
import { i as isPromise,
|
|
2
|
+
import { i as isPromise, j as QDATA_KEY, Q as Q_ROUTE, f as QFN_KEY, k as QLOADER_KEY, h as QACTION_KEY, d as loadRoute } from '../../chunks/routing.qwik.mjs';
|
|
3
3
|
import { inlinedQrl } from '@qwik.dev/core';
|
|
4
4
|
import { _serialize, _UNINITIALIZED, _deserialize, _verifySerializable } from '@qwik.dev/core/internal';
|
|
5
5
|
import { L as LoadedRouteProp } from '../../chunks/types.qwik.mjs';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwik.dev/router",
|
|
3
3
|
"description": "The router for Qwik.",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.25",
|
|
5
5
|
"bugs": "https://github.com/QwikDev/qwik/issues",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@azure/functions": "3.5.1",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"tsm": "2.3.0",
|
|
41
41
|
"typescript": "5.9.3",
|
|
42
42
|
"uvu": "0.5.6",
|
|
43
|
-
"@qwik.dev/core": "2.0.0-beta.
|
|
43
|
+
"@qwik.dev/core": "2.0.0-beta.25"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"main": "./lib/index.qwik.mjs",
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"vite": ">=5 <8",
|
|
172
|
-
"@qwik.dev/core": "^2.0.0-beta.
|
|
172
|
+
"@qwik.dev/core": "^2.0.0-beta.25"
|
|
173
173
|
},
|
|
174
174
|
"publishConfig": {
|
|
175
175
|
"access": "public"
|