@solidjs/router 2.0.0-next.28 → 2.0.0-next.29
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/data/action.js +10 -7
- package/dist/index.js +10 -5
- package/package.json +1 -1
package/dist/data/action.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { $TRACK, action as createSolidAction, createMemo, onCleanup, getOwner } from "solid-js";
|
|
2
2
|
import { isResponseEnvelope, isServer, REVALIDATE_HEADER } from "@solidjs/web";
|
|
3
3
|
import { createServerReference, decodeRedirectHeaderValue, decodeResponsePayload, parseServerFunctionActionUrl, REDIRECT_HEADER, subscribeFlightData } from "@solidjs/web/server-functions";
|
|
4
|
-
// The explicit /server specifier is safe here: the only call site is
|
|
5
|
-
// server-guarded, so client builds tree-shake the codec away.
|
|
6
|
-
import { decodeFlashCookie } from "@solidjs/web/server-functions/server";
|
|
7
4
|
import { provideFlashDecoder, provideFlightConsumer, useRouter } from "../routing.js";
|
|
8
5
|
import { setRouterFormHandler } from "./events.js";
|
|
9
6
|
import { mockBase, setFunctionName } from "../utils.js";
|
|
@@ -116,10 +113,16 @@ function installRouterIntegrations() {
|
|
|
116
113
|
return;
|
|
117
114
|
integrationsInstalled = true;
|
|
118
115
|
if (isServer) {
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
|
|
116
|
+
// The codec lives behind the runtime's SERVER entry, which must stay off
|
|
117
|
+
// the client module graph entirely — a static import here shipped it to
|
|
118
|
+
// every Vite dev page (#616; prod tree-shook it, dev doesn't shake). The
|
|
119
|
+
// decoder slot must still fill synchronously (a cold-start POST-redirect-
|
|
120
|
+
// GET reads submissions on the very first render), so install a wrapper
|
|
121
|
+
// and let the first decode pull the module: the codec is async anyway
|
|
122
|
+
// (encrypted cookie, @solidjs/web 2.0.0-rc.7+) and the seeding read
|
|
123
|
+
// already parks on the decode promise; a failed load reads as "no flash",
|
|
124
|
+
// the runtime's own malformed-cookie semantics.
|
|
125
|
+
provideFlashDecoder(cookieHeader => import("@solidjs/web/server-functions/server").then(m => m.decodeFlashCookie(cookieHeader)));
|
|
123
126
|
}
|
|
124
127
|
else {
|
|
125
128
|
setRouterFormHandler(handleFormAction);
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getOwner, runWithOwner, createMemo, createRenderEffect, onCleanup, untrack, createContext, createSignal, useContext, NotReadyError, isPending, DEV, latest, createComponent, createRoot, Show, createEffect, sharedConfig, OBSERVE, onSettled, getObserver, $TRACK, action as action$1 } from 'solid-js';
|
|
2
2
|
import { registerElementClaim, delegateEvents, isServer, getRequestEvent, hasFlashCookie, clearFlashCookie, createComponent as createComponent$1, memo, dynamic, isServerFunction, getServerFunctionMetadata, getServerFunctionRPC, isResponseEnvelope, REVALIDATE_HEADER } from '@solidjs/web';
|
|
3
3
|
import { REDIRECT_HEADER, decodeRedirectHeaderValue, subscribeFlightData, decodeResponsePayload, parseServerFunctionActionUrl, createServerReference } from '@solidjs/web/server-functions';
|
|
4
|
-
import { decodeFlashCookie } from '@solidjs/web/server-functions/server';
|
|
5
4
|
|
|
6
5
|
const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i;
|
|
7
6
|
const trimPathRegex = /^\/+|(\/)\/+$/g;
|
|
@@ -3075,10 +3074,16 @@ function installRouterIntegrations() {
|
|
|
3075
3074
|
if (integrationsInstalled) return;
|
|
3076
3075
|
integrationsInstalled = true;
|
|
3077
3076
|
if (isServer) {
|
|
3078
|
-
//
|
|
3079
|
-
//
|
|
3080
|
-
//
|
|
3081
|
-
|
|
3077
|
+
// The codec lives behind the runtime's SERVER entry, which must stay off
|
|
3078
|
+
// the client module graph entirely — a static import here shipped it to
|
|
3079
|
+
// every Vite dev page (#616; prod tree-shook it, dev doesn't shake). The
|
|
3080
|
+
// decoder slot must still fill synchronously (a cold-start POST-redirect-
|
|
3081
|
+
// GET reads submissions on the very first render), so install a wrapper
|
|
3082
|
+
// and let the first decode pull the module: the codec is async anyway
|
|
3083
|
+
// (encrypted cookie, @solidjs/web 2.0.0-rc.7+) and the seeding read
|
|
3084
|
+
// already parks on the decode promise; a failed load reads as "no flash",
|
|
3085
|
+
// the runtime's own malformed-cookie semantics.
|
|
3086
|
+
provideFlashDecoder(cookieHeader => import('@solidjs/web/server-functions/server').then(m => m.decodeFlashCookie(cookieHeader)));
|
|
3082
3087
|
} else {
|
|
3083
3088
|
setRouterFormHandler(handleFormAction);
|
|
3084
3089
|
provideFlightConsumer(setupFlightDataConsumer);
|