lit-ui-router-ssr 0.3.0 → 0.4.0
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/adopt-context.d.ts +0 -8
- package/dist/adopt-context.d.ts.map +1 -1
- package/dist/adopt-context.js.map +1 -1
- package/dist/client.d.ts +0 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/dev-gate.d.ts +2 -0
- package/dist/dev-gate.d.ts.map +1 -0
- package/dist/dev-gate.js +2 -0
- package/dist/dev-gate.js.map +1 -0
- package/dist/dev-gate.node.d.ts +2 -0
- package/dist/dev-gate.node.d.ts.map +1 -0
- package/dist/dev-gate.node.js +2 -0
- package/dist/dev-gate.node.js.map +1 -0
- package/dist/dev-warn.d.ts.map +1 -1
- package/dist/dev-warn.js +1 -0
- package/dist/dev-warn.js.map +1 -1
- package/dist/development/adopt-context.js.map +1 -1
- package/dist/development/client.js +4 -0
- package/dist/development/client.js.map +1 -1
- package/dist/development/dev-gate.js +2 -0
- package/dist/development/dev-gate.js.map +1 -0
- package/dist/development/dev-gate.node.js +2 -0
- package/dist/development/dev-gate.node.js.map +1 -0
- package/dist/development/dev-warn.js +3 -0
- package/dist/development/dev-warn.js.map +1 -1
- package/dist/development/index.js.map +1 -1
- package/dist/development/prerender.js +5 -1
- package/dist/development/prerender.js.map +1 -1
- package/dist/development/served-view.js +2 -1
- package/dist/development/served-view.js.map +1 -1
- package/dist/development/shared/dev-gate.js +2 -0
- package/dist/development/shared/dev-gate.js.map +1 -0
- package/dist/development/shared/dev-gate.node.js +2 -0
- package/dist/development/shared/dev-gate.node.js.map +1 -0
- package/dist/development/signature.js +1 -1
- package/dist/development/signature.js.map +1 -1
- package/dist/development/ui-view-renderer.js +2 -0
- package/dist/development/ui-view-renderer.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prerender.d.ts.map +1 -1
- package/dist/prerender.js +1 -0
- package/dist/prerender.js.map +1 -1
- package/dist/served-view.d.ts +0 -10
- package/dist/served-view.d.ts.map +1 -1
- package/dist/served-view.js +1 -0
- package/dist/served-view.js.map +1 -1
- package/dist/shared/dev-gate.d.ts +8 -0
- package/dist/shared/dev-gate.d.ts.map +1 -0
- package/dist/shared/dev-gate.js +2 -0
- package/dist/shared/dev-gate.js.map +1 -0
- package/dist/shared/dev-gate.node.d.ts +8 -0
- package/dist/shared/dev-gate.node.d.ts.map +1 -0
- package/dist/shared/dev-gate.node.js +2 -0
- package/dist/shared/dev-gate.node.js.map +1 -0
- package/dist/signature.d.ts +0 -2
- package/dist/signature.d.ts.map +1 -1
- package/dist/signature.js +1 -1
- package/dist/signature.js.map +1 -1
- package/dist/ui-view-renderer.d.ts +0 -2
- package/dist/ui-view-renderer.d.ts.map +1 -1
- package/dist/ui-view-renderer.js +1 -0
- package/dist/ui-view-renderer.js.map +1 -1
- package/package.json +20 -2
- package/src/adopt-context.ts +0 -8
- package/src/client.ts +10 -26
- package/src/dev-gate.node.ts +1 -0
- package/src/dev-gate.ts +1 -0
- package/src/dev-warn.ts +6 -4
- package/src/index.ts +3 -1
- package/src/prerender.ts +8 -6
- package/src/served-view.ts +2 -11
- package/src/signature.ts +0 -2
- package/src/ui-view-renderer.ts +3 -4
package/dist/adopt-context.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import type { Context } from "lit-ui-router/context";
|
|
|
3
3
|
/**
|
|
4
4
|
* The identity of {@link adoptUiViewContext}: a plain object, so the key is
|
|
5
5
|
* unique under `===` and readable in a debugger.
|
|
6
|
-
*
|
|
7
|
-
* @category client
|
|
8
6
|
*/
|
|
9
7
|
export interface AdoptUiViewContextKey {
|
|
10
8
|
/** Names the key for a debugger; identity, not this string, is what matches. */
|
|
@@ -13,8 +11,6 @@ export interface AdoptUiViewContextKey {
|
|
|
13
11
|
/**
|
|
14
12
|
* The waking `<ui-view>` as an adopter sees it: the element holding the served
|
|
15
13
|
* nodes, with the template and render options a hydrate reads.
|
|
16
|
-
*
|
|
17
|
-
* @category client
|
|
18
14
|
*/
|
|
19
15
|
export interface AdoptableView extends HTMLElement {
|
|
20
16
|
/** The routed template the served nodes came from. */
|
|
@@ -26,8 +22,6 @@ export interface AdoptableView extends HTMLElement {
|
|
|
26
22
|
* The adopt-view context key's type — {@link AdoptUiViewContextKey} branded
|
|
27
23
|
* with the adopter function, so `@consume({ context: adoptUiViewContext })`
|
|
28
24
|
* infers it.
|
|
29
|
-
*
|
|
30
|
-
* @category client
|
|
31
25
|
*/
|
|
32
26
|
export type AdoptUiViewContext = Context<AdoptUiViewContextKey, (view: AdoptableView) => void>;
|
|
33
27
|
/**
|
|
@@ -50,8 +44,6 @@ export type AdoptUiViewContext = Context<AdoptUiViewContextKey, (view: Adoptable
|
|
|
50
44
|
* adopt(view),
|
|
51
45
|
* );
|
|
52
46
|
* ```
|
|
53
|
-
*
|
|
54
|
-
* @category client
|
|
55
47
|
*/
|
|
56
48
|
export declare const adoptUiViewContext: AdoptUiViewContext;
|
|
57
49
|
//# sourceMappingURL=adopt-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adopt-context.d.ts","mappings":"AACA,cAAc,qBAAqB;AACnC,cAAc,eAAe
|
|
1
|
+
{"version":3,"file":"adopt-context.d.ts","mappings":"AACA,cAAc,qBAAqB;AACnC,cAAc,eAAe;;;;;AAM7B,iBAAiB,sBAAsB;;UAE5B,MAAM;AACjB;;;;;AAMA,iBAAiB,sBAAsB,YAAY;;CAGjD;;UAES,eAAe;AAC1B;;;;;;AAOA,YAAY,qBAAqB,QAC/B,wBACC,MAAM;;;;;;;;;;;;;;;;;;;;;;AAyBT,OAAO,cAAM,oBAAoB","names":[],"ignoreList":[],"sources":["../src/adopt-context.ts"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adopt-context.js","mappings":"
|
|
1
|
+
{"version":3,"file":"adopt-context.js","mappings":"AAyDA,OAAO,MAAM,qBAAyC,OAAO,OAAO,EAClE,MAAM,0CACR,CAAC","names":[],"ignoreList":[],"sources":["../src/adopt-context.ts"]}
|
package/dist/client.d.ts
CHANGED
|
@@ -12,21 +12,15 @@ export type { HydrationSignature } from "./signature.js";
|
|
|
12
12
|
* into, or was lost; the view dropped the served interior and rendered cold.
|
|
13
13
|
* - `none`: nothing to adopt — an empty served pair, the address no state
|
|
14
14
|
* routed, or a view the document served no markers for.
|
|
15
|
-
*
|
|
16
|
-
* @category client
|
|
17
15
|
*/
|
|
18
16
|
export type AdoptOutcome = "adopted" | "fell-back" | "none";
|
|
19
17
|
/**
|
|
20
18
|
* The name of the event a served `<ui-view>` dispatches once its wake's
|
|
21
19
|
* outcome is known, in the `ui-view:` house style of the served markers.
|
|
22
|
-
*
|
|
23
|
-
* @category client
|
|
24
20
|
*/
|
|
25
21
|
export declare const uiViewAdoptEventName: "ui-view:adopt";
|
|
26
22
|
/**
|
|
27
23
|
* The detail of {@link UiViewAdoptEvent}.
|
|
28
|
-
*
|
|
29
|
-
* @category client
|
|
30
24
|
*/
|
|
31
25
|
export interface UiViewAdoptDetail {
|
|
32
26
|
/** What the wake came to. */
|
|
@@ -37,21 +31,15 @@ export interface UiViewAdoptDetail {
|
|
|
37
31
|
/**
|
|
38
32
|
* Dispatched from a served `<ui-view>` at its wake, once per view, bubbling and
|
|
39
33
|
* composed, in production as in development.
|
|
40
|
-
*
|
|
41
|
-
* @category client
|
|
42
34
|
*/
|
|
43
35
|
export type UiViewAdoptEvent = CustomEvent<UiViewAdoptDetail>;
|
|
44
36
|
/**
|
|
45
37
|
* Receives each served view's outcome, as {@link HydrateRootOptions.onAdopt}.
|
|
46
|
-
*
|
|
47
|
-
* @category client
|
|
48
38
|
*/
|
|
49
39
|
export type AdoptReporter = (view: Element, outcome: AdoptOutcome, error?: unknown) => void;
|
|
50
40
|
/**
|
|
51
41
|
* {@link hydrateRoot}'s options: lit's render options, plus the outcome
|
|
52
42
|
* callback.
|
|
53
|
-
*
|
|
54
|
-
* @category client
|
|
55
43
|
*/
|
|
56
44
|
export interface HydrateRootOptions extends RenderOptions {
|
|
57
45
|
/**
|
|
@@ -86,8 +74,6 @@ declare global {
|
|
|
86
74
|
* ```ts
|
|
87
75
|
* html`<ui-router .uiRouter=${router}><ui-view>${uiViewSlot()}</ui-view></ui-router>`;
|
|
88
76
|
* ```
|
|
89
|
-
*
|
|
90
|
-
* @category client
|
|
91
77
|
*/
|
|
92
78
|
export declare const uiViewSlot: typeof renderLight;
|
|
93
79
|
/**
|
|
@@ -118,8 +104,6 @@ export declare const uiViewSlot: typeof renderLight;
|
|
|
118
104
|
* @param container - the element the server's markup was written into
|
|
119
105
|
* @returns the signature, or `null` when the container holds none, or one that
|
|
120
106
|
* does not parse to an object with a string `version`
|
|
121
|
-
*
|
|
122
|
-
* @category client
|
|
123
107
|
*/
|
|
124
108
|
export declare function readHydrationSignature(container: ParentNode): HydrationSignature | null;
|
|
125
109
|
/**
|
|
@@ -186,8 +170,6 @@ export declare function readHydrationSignature(container: ParentNode): Hydration
|
|
|
186
170
|
* @param value - the same template the server rendered, with every `<ui-view>` hole empty
|
|
187
171
|
* @param options - lit render options, passed on to `hydrate()`, and `onAdopt`
|
|
188
172
|
* @returns the function that releases the provider, or `false`, over an emptied container, when there is nothing to adopt — no signature, as on a cold client render or a dev server, one from another release line, or one no render marker follows
|
|
189
|
-
*
|
|
190
|
-
* @category client
|
|
191
173
|
*/
|
|
192
174
|
export declare function hydrateRoot(container: HTMLElement, value: unknown, options?: HydrateRootOptions): false | (() => void);
|
|
193
175
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","mappings":"AAOA,SAAS,mBAAmB;AAI5B,cAAyB,qBAAqB;AAW9C,cAAc,0BAA0B;AAExC,SACE,yBACK,oBACA,yBACA,6BACA;AAEP,SACE,wBACK,mBACA,yBACL,iBACA,wBACK;AAEP,cAAc,0BAA0B;;;;;;;;;;AAcxC,YAAY,eAAe,YAAY,cAAc;;;;;AAMrD,OAAO,cAAM,sBAAuB;;;;AAKpC,iBAAiB,kBAAkB;;UAExB,SAAS;;UAET;AACX;;;;;AAMA,YAAY,mBAAmB,YAAY;;;;AAK3C,YAAY,iBACV,MAAM,SACN,SAAS,cAET;;;;;AAOF,iBAAiB,2BAA2B,cAAc;;;;;;CAMxD,UAAU;AACZ;eAEe;WACH,oBAAoB;;EAE5B,iBAAiB;CACnB;AACF;;;;;;;;;;;;;;;;;;;;;AAgEA,OAAO,cAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmVhC,OAAO,iBAAS,uBACd,WAAW,aACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4IH,OAAO,iBAAS,YACd,WAAW,aAEX,gBACA,UAAS,qBACR","names":[],"ignoreList":[],"sources":["../src/client.ts"]}
|
package/dist/client.js
CHANGED
|
@@ -6,6 +6,7 @@ import { directive } from "lit/directive.js";
|
|
|
6
6
|
import { getDirectiveClass } from "lit/directive-helpers.js";
|
|
7
7
|
import { provideContext } from "lit-ui-router/context";
|
|
8
8
|
import { UiView } from "lit-ui-router/pure";
|
|
9
|
+
import "#dev-gate";
|
|
9
10
|
import { adoptUiViewContext } from "./adopt-context.js";
|
|
10
11
|
import { servedMarkerPrefix } from "./served-markers.js";
|
|
11
12
|
import { packageVersion, signatureSelector } from "./signature.js";
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","mappings":"AAMA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAE5B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAE1B,S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AAO;EACd,QAAQ;EACR,SAAS,SAAS;EAClB,MAAM;CACR;CAGA,KAAK,MAAM,WAAW,UAAU,iBAAiB,IAAI,MAAM,EAAE,GAC3D,IAAI,EAAE,mBAAmB,SAAS,QAAQ,gBAAgB,KAAK;CAGjE,OAAO;AACT","names":[],"ignoreList":[],"sources":["../src/client.ts"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.d.ts","mappings":"AAAA,SAAS,eAAe","names":[],"ignoreList":[],"sources":["../src/dev-gate.ts"]}
|
package/dist/dev-gate.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.js","mappings":"AAAA,SAAS,eAAe","names":[],"ignoreList":[],"sources":["../src/dev-gate.ts"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.node.d.ts","mappings":"AAAA,SAAS,eAAe","names":[],"ignoreList":[],"sources":["../src/dev-gate.node.ts"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.node.js","mappings":"AAAA,SAAS,eAAe","names":[],"ignoreList":[],"sources":["../src/dev-gate.node.ts"]}
|
package/dist/dev-warn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-warn.d.ts","mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dev-warn.d.ts","mappings":";;;;;;;;;;;AAeA,OAAO,iBAAS,0BAA0B,SAAS;;;;;;;;;;;;;AA6BnD,OAAO,iBAAS,uBAAuB,SAAS","names":[],"ignoreList":[],"sources":["../src/dev-warn.ts"]}
|
package/dist/dev-warn.js
CHANGED
package/dist/dev-warn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-warn.js","mappings":"
|
|
1
|
+
{"version":3,"file":"dev-warn.js","mappings":"AAEA,OAAwB;AAaxB,OAAO,SAAS,0BAA0B,SAAwB,CAOlE;AAsBA,OAAO,SAAS,uBAAuB,SAAwB,CAc/D","names":[],"ignoreList":[],"sources":["../src/dev-warn.ts"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adopt-context.js","mappings":"
|
|
1
|
+
{"version":3,"file":"adopt-context.js","mappings":"AAyDA,OAAO,MAAM,qBAAyC,OAAO,OAAO,EAClE,MAAM,0CACR,CAAC","names":[],"ignoreList":[],"sources":["../../src/adopt-context.ts"]}
|
|
@@ -6,6 +6,7 @@ import { directive } from "lit/directive.js";
|
|
|
6
6
|
import { getDirectiveClass } from "lit/directive-helpers.js";
|
|
7
7
|
import { provideContext } from "lit-ui-router/context";
|
|
8
8
|
import { UiView } from "lit-ui-router/pure";
|
|
9
|
+
import { devGate } from "#dev-gate";
|
|
9
10
|
import { adoptUiViewContext } from "./adopt-context.js";
|
|
10
11
|
import { servedMarkerPrefix } from "./served-markers.js";
|
|
11
12
|
import { packageVersion, signatureSelector } from "./signature.js";
|
|
@@ -59,6 +60,7 @@ const report = (view, reporter, outcome, cause) => {
|
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
62
|
const warnMismatch = (view, cause) => {
|
|
63
|
+
if (!devGate()) return;
|
|
62
64
|
console.warn("lit-ui-router-ssr: this element could not adopt the server render, so it rendered over it instead. One static document answers a whole family of urls, so a client that boots into another state reaches this legitimately.", view.localName, cause, ...view instanceof UiView && view.viewContext ? [] : ["lit-ui-router-ssr: this view had no routed component to adopt against, which is also what a router that never started, or whose first transition was not awaited, looks like: call router.start(), await its first successful transition, then hydrateRoot()."]);
|
|
63
65
|
};
|
|
64
66
|
const isComment = (node) => node?.nodeType === Node.COMMENT_NODE;
|
|
@@ -163,9 +165,11 @@ const releaseLine = (version) => {
|
|
|
163
165
|
return major === "0" ? `0.${minor}` : major;
|
|
164
166
|
};
|
|
165
167
|
const warnVersionSkew = (served) => {
|
|
168
|
+
if (!devGate()) return;
|
|
166
169
|
console.warn("lit-ui-router-ssr: this document was prerendered by a release line this client does not adopt, so hydrateRoot() left it to a cold render. Prerender it again with the version the client ships. Prerendered by, then client:", served, packageVersion);
|
|
167
170
|
};
|
|
168
171
|
const warnMarkersStripped = () => {
|
|
172
|
+
if (!devGate()) return;
|
|
169
173
|
console.warn("lit-ui-router-ssr: this document carries a hydration signature but no lit-part marker follows it, so hydrateRoot() left it to a cold render. hydrate() reads html comments: serve prerendered pages without stripping them.");
|
|
170
174
|
};
|
|
171
175
|
const isAdoptable = (container) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","mappings":"AAMA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAE5B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAE1B,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAEnC,SAAS,0BAA0B;AACnC,SAAS,gBAAgB,yBAAyB;AAGlD,SACE,0BAIK;AAEP,SACE,mBAGA,iBACA,wBACK;AAKP,MAAM,QAAQ;AAiBd,OAAO,MAAM,uBAAuB;AAiDpC,MAAM,uBAAuB,kBAAkB,YAAY,CAAC;AAG5D,MAAM,4BAA4B,qBAAqB;CASrD,YAAY,MAAgB;EAC1B,MAAM,IAAI;EAGV,MAAM,OAAQ,KAAmB;EAEjC,IAAI,EAAE,gBAAgB,UAAU;EAGhC,IAAI,WAAW,IAAI,GAAG,WAAW,MAAM,YAAY;EAEnD,IAAI,KAAK,aAAa,KAAK,GAAG,KAAK,gBAAgB,KAAK;CAC1D;CAGA,SAA0B;EACxB,OAAO;CACT;CAIA,OAAgB,MAA0B;EAExC,MAAM,OAAO,KAAK;EAElB,OAAO,WAAW,KAAK,WAAW,IAAI,KAAK,YAAY,IAAI;CAC7D;AACF;AAsBA,OAAO,MAAM,aAAiC,UAAU,mBAAmB;AAG3E,IAAI;AAGJ,MAAM,YAC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"ignoreList":[],"sources":["../../src/dev-gate.ts"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.node.js","mappings":"AAAA,SAAS,eAAe","names":[],"ignoreList":[],"sources":["../../src/dev-gate.node.ts"]}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { devGate } from "#dev-gate";
|
|
1
2
|
export function warnDeferredWithoutClient(element) {
|
|
3
|
+
if (!devGate()) return;
|
|
2
4
|
console.warn("lit-ui-router-ssr: this <ui-view> woke from defer-hydration and nothing answered its adoptUiViewContext request, so its held nodes were dropped and it rendered cold. Provide an adopter before the wake.", element);
|
|
3
5
|
}
|
|
4
6
|
const warnedNeverWoken = new WeakSet();
|
|
5
7
|
export function warnDeferredNeverWoken(element) {
|
|
8
|
+
if (!devGate()) return;
|
|
6
9
|
if (warnedNeverWoken.has(element)) return;
|
|
7
10
|
warnedNeverWoken.add(element);
|
|
8
11
|
console.warn("lit-ui-router-ssr: this <ui-view> is still asleep after the task it connected in, because nothing removed defer-hydration. It renders nothing and holds the served markup as it stands. Usual causes: a clone of a served view, which copies the attribute but not the hydrate walk that clears it, and a document whose hydrate walk threw before reaching this view or never ran. Hydrate the document, or remove defer-hydration from the clone.", element);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-warn.js","mappings":"
|
|
1
|
+
{"version":3,"file":"dev-warn.js","mappings":"AAEA,SAAS,eAAe;AAaxB,OAAO,SAAS,0BAA0B,SAAwB;CAEhE,IAA4B,CAAC,QAAQ,GAAG;CACxC,QAAQ,KACN,6MACA,OACF;AACF;AAQA,MAAM,mBAAmB,IAAI,QAAiB;AAc9C,OAAO,SAAS,uBAAuB,SAAwB;CAE7D,IAA4B,CAAC,QAAQ,GAAG;CAExC,IAAI,iBAAiB,IAAI,OAAO,GAAG;CACnC,iBAAiB,IAAI,OAAO;CAC5B,QAAQ,KACN,ubAKA,OACF;AACF","names":[],"ignoreList":[],"sources":["../../src/dev-warn.ts"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","mappings":"AAMA,SAGE,iBAMK;AAEP,SAAS,cAAkC;AAE3C,SAAS,sBAAsB","names":[],"ignoreList":[],"sources":["../../src/index.ts"]}
|
|
@@ -3,6 +3,7 @@ import { collectResultSync } from "@lit-labs/ssr/lib/render-result.js";
|
|
|
3
3
|
import { provideRouter, withRouterSync } from "lit-ui-router/context";
|
|
4
4
|
import { DefType, isFunction, isString } from "@uirouter/core";
|
|
5
5
|
import { createServerRouter } from "ui-router-server";
|
|
6
|
+
import { devGate } from "#dev-gate";
|
|
6
7
|
import { packageVersion, signatureAttribute } from "./signature.js";
|
|
7
8
|
import { UiViewRenderer } from "./ui-view-renderer.js";
|
|
8
9
|
const NODE_FS = "node:fs/promises";
|
|
@@ -59,9 +60,11 @@ export const renderPage = (body, router, root, elementRenderers) => signatureBlo
|
|
|
59
60
|
deferHydration: true
|
|
60
61
|
})));
|
|
61
62
|
const warnUnclaimed = (path) => {
|
|
63
|
+
if (!devGate()) return;
|
|
62
64
|
console.warn("lit-ui-router-ssr: no route matched this path and its mount declares no otherwise projection, so no page was emitted for it:", path);
|
|
63
65
|
};
|
|
64
66
|
const warnStrictSlash = async (resolver, path) => {
|
|
67
|
+
if (!devGate()) return;
|
|
65
68
|
const slashed = await resolver.resolve(`${path}/`);
|
|
66
69
|
if (slashed.kind === "shell" && slashed.status === void 0) return;
|
|
67
70
|
console.warn("lit-ui-router-ssr: this page is written as <subpath>/index.html, which static hosts serve by redirecting <subpath> to <subpath>/, and its mount rejects the trailing slash. Pass `config: { strict: false }` on the mount and call `router.urlService.config.strictMode(false)` on the client:", path);
|
|
@@ -106,6 +109,7 @@ const resolverOf = (options) => {
|
|
|
106
109
|
return createServerRouter({ mounts: options.mounts });
|
|
107
110
|
};
|
|
108
111
|
const warnUnregistered = () => {
|
|
112
|
+
if (!devGate()) return;
|
|
109
113
|
if (globalThis.customElements?.get("ui-view")) return;
|
|
110
114
|
console.warn("lit-ui-router-ssr: <ui-view> is not defined on the current customElements registry, so every <ui-view> on these pages renders empty. The DOM shim replaces the registry when it finishes installing: load lit-ui-router-ssr/register by dynamic import after the shim, or preload the shim with node --import.");
|
|
111
115
|
};
|
|
@@ -147,7 +151,7 @@ export async function prerender(options) {
|
|
|
147
151
|
if (verdict.kind === "shell") {
|
|
148
152
|
const subpath = subpathIn(verdict.mount, path);
|
|
149
153
|
tally.shell += 1;
|
|
150
|
-
if (!slashProbed && wantsSlashProbe(verdict, path, subpath)) {
|
|
154
|
+
if (devGate() && !slashProbed && wantsSlashProbe(verdict, path, subpath)) {
|
|
151
155
|
slashProbed = true;
|
|
152
156
|
await warnStrictSlash(resolver, path);
|
|
153
157
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.js","mappings":"AACA,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAGlC,SAAS,eAAe,sBAAsB;AAC9C,SAAS,SAAS,YAAY,gBAAgB;AAC9C,SAAS,0BAA0B;
|
|
1
|
+
{"version":3,"file":"prerender.js","mappings":"AACA,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAGlC,SAAS,eAAe,sBAAsB;AAC9C,SAAS,SAAS,YAAY,gBAAgB;AAC9C,SAAS,0BAA0B;AAEnC,SAAS,eAAe;AAExB,SAAS,gBAAgB,0BAA0B;AACnD,SAAS,sBAAsB;AAmK/B,MAAM,UAAU;AAEhB,MAAM,yBAAyB;AAG/B,MAAM,gBAAgB;AAEtB,MAAM,UAAU,IAAI,YAAY;AAEhC,MAAM,YAAY,KAAa,SAC7B,QAAQ,KAAK,OAAO,GAAG,IAAI,QAAQ,QAAQ,EAAE,EAAE,GAAG;AAEpD,MAAM,SAAS,SAAyB;CACtC,MAAM,MAAM,KAAK,YAAY,GAAG;CAEhC,OAAO,QAAQ,KAAK,KAAK,KAAK,MAAM,GAAG,GAAG;AAC5C;AAWA,MAAM,YAA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;GACjC,MAAM,KAAK,SAAS,OAAO,UAAU,QAAQ,OAAO,KAAK,GAAG,IAAI;EAClE;CACF,UAAU;EACR,UAAU;CACZ;CAEA,MAAM,QAAQ,CAAC,GAAG,YAAY,GAAG,SAAS;CAE1C,IAAI,CAAC,QAAQ,MAAM,WAAW,OAAO,OAAO,OAAO,MAAM;CAEzD,OAAO;EAAE;EAAO;EAAO,OAAO;EAAO;EAAU;CAAK;AACtD","names":[],"ignoreList":[],"sources":["../../src/prerender.ts"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { noChange } from "lit";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
3
|
import { requestContext } from "lit-ui-router/context";
|
|
4
|
+
import { devGate } from "#dev-gate";
|
|
4
5
|
import { adoptUiViewContext } from "./adopt-context.js";
|
|
5
6
|
import { warnDeferredNeverWoken, warnDeferredWithoutClient } from "./dev-warn.js";
|
|
6
7
|
import _decorate from "@oxc-project/runtime/helpers/decorate";
|
|
@@ -27,7 +28,7 @@ export const withServedRender = (Base) => {
|
|
|
27
28
|
super.connectedCallback();
|
|
28
29
|
if (this.deferHydration) {
|
|
29
30
|
this.deferredAtConnect = true;
|
|
30
|
-
setTimeout(() => {
|
|
31
|
+
if (devGate()) setTimeout(() => {
|
|
31
32
|
if (this.isConnected && this.deferHydration && !this.hasUpdated) warnDeferredNeverWoken(this);
|
|
32
33
|
}, 0);
|
|
33
34
|
} else if (this.deferredAtConnect) this.requestUpdate();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"served-view.js","mappings":"AACA,SAAS,gBAAgB;AAEzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;
|
|
1
|
+
{"version":3,"file":"served-view.js","mappings":"AACA,SAAS,gBAAgB;AAEzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAE/B,SAAS,eAAe;AAExB,SAAS,0BAA0B;AACnC,SACE,wBACA,iCACK;;AAGP,MAAM,QAAQ;AAGd,MAAM,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M,OAAO,SAAS,WAAW,UAAU,eAAe,KAAK,CAAC;GAEhE,IAAI,OAAO,GAAG;GAGd,KAAK,MAAM,SAAS,SAAS,MAAM,IAAI,GAAG,MAAM,SAAS;EAC3D;EAGA,cAA+B;GAC7B,OAAO;EACT;CACF;YApGG,SAAS;EAAE,MAAM;EAAS,WAAW;CAAM,CAAC;CAsG/C,OAAO;AACT","names":[],"ignoreList":[],"sources":["../../src/served-view.ts"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.js","mappings":"AAMA,OAAO,MAAM,gBAAyB","names":[],"ignoreList":[],"sources":["../../../../shared/dev-gate/src/dev-gate.ts"],"sourcesContent":["/**\n * Whether development warnings fire off node: always, since only a node\n * runtime can say it is production.\n *\n * @internal\n */\nexport const devGate = (): boolean => true;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.node.js","mappings":"AASA,OAAO,MAAM,gBAAyB,QAAQ,IAAI,aAAa","names":[],"ignoreList":[],"sources":["../../../../shared/dev-gate/src/dev-gate.node.ts"],"sourcesContent":["// The one `process` read a package ships: its #dev-gate import reaches this file under the `node` condition only.\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Whether development warnings fire under node: unless `NODE_ENV` is\n * `production`, read at each call so a test can set it.\n *\n * @internal\n */\nexport const devGate = (): boolean => process.env.NODE_ENV !== 'production';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const signatureAttribute = "data-lit-ui-router-ssr";
|
|
2
2
|
export const signatureSelector = `script[type="application/json"][${signatureAttribute}]`;
|
|
3
|
-
export const packageVersion = "0.
|
|
3
|
+
export const packageVersion = "0.4.0";
|
|
4
4
|
//# sourceMappingURL=signature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","mappings":"
|
|
1
|
+
{"version":3,"file":"signature.js","mappings":"AA0BA,OAAO,MAAM,qBAAqB;AAOlC,OAAO,MAAM,oBAA4B,mCAAmC,mBAAmB;AAO/F,OAAO,MAAM","names":[],"ignoreList":[],"sources":["../../src/signature.ts"]}
|
|
@@ -4,6 +4,7 @@ import { renderValue } from "@lit-labs/ssr/lib/render-value.js";
|
|
|
4
4
|
import { applyPairs, ResolveContext, Transition, isString } from "@uirouter/core";
|
|
5
5
|
import { LitViewConfig, isRoutedLitElement } from "lit-ui-router/pure";
|
|
6
6
|
import { getScopedRouter } from "lit-ui-router/context";
|
|
7
|
+
import { devGate } from "#dev-gate";
|
|
7
8
|
import { servedMarkerPrefix } from "./served-markers.js";
|
|
8
9
|
const TAG = "ui-view";
|
|
9
10
|
const DEFAULT_VIEW = "$default";
|
|
@@ -17,6 +18,7 @@ const prefixInterior = (markup) => {
|
|
|
17
18
|
};
|
|
18
19
|
const escapeAttribute = (value) => value.replace(/&/g, "&").replace(/"/g, """);
|
|
19
20
|
const warnElementComponent = (fqn) => {
|
|
21
|
+
if (!devGate()) return;
|
|
20
22
|
console.warn("lit-ui-router-ssr: this view is a RoutedLitElement class, which has no server render, so the part was left empty for the client to fill:", fqn);
|
|
21
23
|
};
|
|
22
24
|
export class UiViewRenderer extends ElementRenderer {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-view-renderer.js","mappings":"AACA,SAAS,uBAAuB;AAGhC,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SACE,YACA,gBACA,YACA,gBACK;AAEP,SAAS,eAAe,0BAA0B;AAKlD,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AAGnC,MAAM,MAAM;AAGZ,MAAM,eAAe;AAGrB,IAAI,gBAAgB;AAGpB,MAAM,YAA8B,CAAC;AAWrC,MAAM,kBAAkB,WAA2B;CAEjD,MAAM,OAAO,OAAO,QAAQ,KAAK,IAAI;CACrC,MAAM,QAAQ,OAAO,SAAS;CAG9B,MAAM,WAAW,OACd,MAAM,MAAM,KAAK,CAAC,CAClB,WAAW,gBAAgB,OAA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,CAC7B,CAAC,CAAC,CACD,OAAO,YAAY,CAAC,CAId;GACP,YAAY,SAAS,IAAgB,UAAU;EACjD;CACF;CAGA,YACE,YACiC;EACjC,MAAM,SAAS,gBAAgB;EAE/B,IAAI,CAAC,QAAQ,OAAO;EACpB,MAAM,aAAa,KAAK,SAAS,MAAM;EACvC,MAAM,SAAS,KAAK;EAGpB,MAAM,aAAa,QAAQ,SAAQ,EAC/B;EAEJ,IAAI,CAAC,UAAU,CAAC,WAAW;GACzB,WAAW;GAEX;EACF;EAEA,IAAI,mBAAmB,SAAS,GAAG;GACjC,qBAAqB,KAAK,KAAM,GAAG;GACnC,WAAW;GAEX;EACF;EAEA,MAAM,QAAQ,UAAU,KAAK,MAAM,QAAQ,MAAM,CAAC;EAElD,OAAO,OACC;GACJ,UAAU,KAAK,IAAI;GAEnB,IAAI;IAEF,OAAO,eACL,kBAAkB,YAAY,OAAO,UAAU,CAAC,CAClD;GACF,UAAU;IACR,UAAU,IAAI;IACd,WAAW;GACb;EACF,CACF;CACF;AACF","names":[],"ignoreList":[],"sources":["../../src/ui-view-renderer.ts"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* The server half: `prerender()` emits a static site from a `ui-router-server`
|
|
3
|
+
* mount table, and `UiViewRenderer` draws `<ui-view>` inside the `@lit-labs/ssr` render.
|
|
4
|
+
*
|
|
2
5
|
* @module
|
|
3
|
-
* @mergeModuleWith <project>
|
|
4
6
|
*/
|
|
5
7
|
export { type EmittedPage, type FileWriter, prerender, type PrerenderOptions, type PrerenderResult, type PrerenderTally, type RedirectLine, type RenderContext } from "./prerender.js";
|
|
6
8
|
export { settle, type SettleOptions } from "./settle.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","mappings":";;;;;;AAMA,cACO,kBACA,YACL,gBACK,uBACA,sBACA,qBACA,mBACA,qBACA;AAEP,SAAS,aAAa,qBAAqB;AAE3C,SAAS,sBAAsB","names":[],"ignoreList":[],"sources":["../src/index.ts"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","mappings":"AAMA,SAGE,iBAMK;AAEP,SAAS,cAAkC;AAE3C,SAAS,sBAAsB","names":[],"ignoreList":[],"sources":["../src/index.ts"]}
|
package/dist/prerender.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.d.ts","mappings":"AAEA,cAAc,kBAAkB;AAEhC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AAIjC,cAAc,aAAa,cAAc,eAAe;;
|
|
1
|
+
{"version":3,"file":"prerender.d.ts","mappings":"AAEA,cAAc,kBAAkB;AAEhC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AAIjC,cAAc,aAAa,cAAc,eAAe;;AAOxD,iBAAiB,YAAY;;CAE3B;;CAEA;;CAEA,SAAS;;CAET;AACF;;AAGA,iBAAiB,aAAa;;CAE5B;;CAEA;;CAEA;AACF;;AAGA,iBAAiB,cAAc;;CAE7B;;CAEA;;CAEA;;CAEA,MAAM;AACR;;;;;;AAOA,YAAY,cAAc,cAAc,wBAAwB;;AAGhE,iBAAiB,iBAAiB;;CAEhC,SAAS,eAAe;;CAExB,WAAW;;;;;;CAMX,QAAQ;;CAER,OAAO,mBAAmB;;CAE1B;;;;;;;CAOA,cACE,SAAS,QAAQ,SAAS;EAAE,MAAM;CAAQ,IAC1C,SAAS,kBACN,0BAA0B,QAAQ;;;;;;CAMvC,YAAY,cAAc,SAAS,2BAA2B;;;;;;CAM9D,WACI,QACA;;EAEE;;;;;;;EAOA;CACF;;;;;;;CAOJ,QACI,eACA,WACE,OAAO,0BAA0B;;CAEvC,aAAa;;;;;;;;;;CAUb,gBAAgB,SAAS;;;;;;;;CAQzB,OAAO;;;;;;;CAOP,mBAAmB,WAAW;;CAE9B,QAAQ;;CAER;AACF;;AAGA,iBAAiB,eAAe;;CAE9B;;CAEA;;CAEA;;CAEA;AACF;;AAGA,iBAAiB,gBAAgB;;CAE/B,OAAO;;CAEP,OAAO;;CAEP,OAAO;;CAEP;;CAEA,MAAM;AACR;;UAwFU,iBAAiB;UAChB;UACA;UACA,QAAQ,SAAS;AAC5B;;AAGA,OAAO,cAAM,cAAe,QAAQ,gBAAc;;;;;;AAoBlD,OAAO,cAAM,iBAAkB,WAAW;;;;;;;AAc1C,OAAO,cAAM,aACX,MAAM,gBACN,QAAQ,aACR,MAAM,aACN,kBAAkB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsK/B,OAAO,iBAAe,UACpB,SAAS,mBACR,QAAQ","names":[],"ignoreList":[],"sources":["../src/prerender.ts"]}
|
package/dist/prerender.js
CHANGED
|
@@ -3,6 +3,7 @@ import { collectResultSync } from "@lit-labs/ssr/lib/render-result.js";
|
|
|
3
3
|
import { provideRouter, withRouterSync } from "lit-ui-router/context";
|
|
4
4
|
import { DefType, isFunction, isString } from "@uirouter/core";
|
|
5
5
|
import { createServerRouter } from "ui-router-server";
|
|
6
|
+
import "#dev-gate";
|
|
6
7
|
import { packageVersion, signatureAttribute } from "./signature.js";
|
|
7
8
|
import { UiViewRenderer } from "./ui-view-renderer.js";
|
|
8
9
|
const NODE_FS = "node:fs/promises";
|
package/dist/prerender.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.js","mappings":"AACA,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAGlC,SAAS,eAAe,sBAAsB;AAC9C,SAAS,SAAS,YAAY,gBAAgB;AAC9C,SAAS,0BAA0B;
|
|
1
|
+
{"version":3,"file":"prerender.js","mappings":"AACA,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAGlC,SAAS,eAAe,sBAAsB;A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AAO,OAAO;EAAO;EAAU;CAAK;AACtD","names":[],"ignoreList":[],"sources":["../src/prerender.ts"]}
|
package/dist/served-view.d.ts
CHANGED
|
@@ -4,14 +4,10 @@ import { UiView } from "lit-ui-router/pure";
|
|
|
4
4
|
* Brands the served class, so a second copy of this package recognises the one
|
|
5
5
|
* already registered. `customElements` identity cannot: two copies build two
|
|
6
6
|
* classes.
|
|
7
|
-
*
|
|
8
|
-
* @category client
|
|
9
7
|
*/
|
|
10
8
|
export declare const servedViewBrand: unique symbol;
|
|
11
9
|
/**
|
|
12
10
|
* A `<ui-view>` that owns its side of a server render.
|
|
13
|
-
*
|
|
14
|
-
* @category client
|
|
15
11
|
*/
|
|
16
12
|
export interface ServedUiView extends UiView {
|
|
17
13
|
/**
|
|
@@ -28,8 +24,6 @@ export interface ServedUiView extends UiView {
|
|
|
28
24
|
/**
|
|
29
25
|
* The class {@link withServedRender} produces: a `<ui-view>` constructor,
|
|
30
26
|
* branded.
|
|
31
|
-
*
|
|
32
|
-
* @category client
|
|
33
27
|
*/
|
|
34
28
|
export interface ServedUiViewConstructor {
|
|
35
29
|
/** Builds one served view; the element takes no constructor arguments. */
|
|
@@ -42,8 +36,6 @@ export interface ServedUiViewConstructor {
|
|
|
42
36
|
* another copy's.
|
|
43
37
|
*
|
|
44
38
|
* @param constructor - the class a registry holds for a tag
|
|
45
|
-
*
|
|
46
|
-
* @category client
|
|
47
39
|
*/
|
|
48
40
|
export declare const isServedViewClass: (constructor: CustomElementConstructor | undefined) => boolean;
|
|
49
41
|
/**
|
|
@@ -78,8 +70,6 @@ export declare const isServedViewClass: (constructor: CustomElementConstructor |
|
|
|
78
70
|
*
|
|
79
71
|
* customElements.define('app-view', withServedRender(UiView));
|
|
80
72
|
* ```
|
|
81
|
-
*
|
|
82
|
-
* @category client
|
|
83
73
|
*/
|
|
84
74
|
export declare const withServedRender: (Base: typeof UiView) => ServedUiViewConstructor & typeof UiView;
|
|
85
75
|
//# sourceMappingURL=served-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"served-view.d.ts","mappings":"AACA,SAAS,gBAAgB;AAIzB,SAAS,cAAc
|
|
1
|
+
{"version":3,"file":"served-view.d.ts","mappings":"AACA,SAAS,gBAAgB;AAIzB,SAAS,cAAc;;;;;;AAgCvB,OAAO,cAAM;;;;AAOb,iBAAiB,qBAAqB,OAAO;;;;;CAK3C;;;;;CAKA,sBAAsB;AACxB;;;;;AAMA,iBAAiB,wBAAwB;;SAE/B;;WAEE,kBAAkB;AAC9B;;;;;;;AAQA,OAAO,cAAM,oBACX,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCf,OAAO,cAAM,mBACX,aAAa,WACZ,iCAAiC","names":[],"ignoreList":[],"sources":["../src/served-view.ts"]}
|
package/dist/served-view.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { noChange } from "lit";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
3
|
import { requestContext } from "lit-ui-router/context";
|
|
4
|
+
import "#dev-gate";
|
|
4
5
|
import { adoptUiViewContext } from "./adopt-context.js";
|
|
5
6
|
import { warnDeferredWithoutClient } from "./dev-warn.js";
|
|
6
7
|
import _decorate from "@oxc-project/runtime/helpers/decorate";
|
package/dist/served-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"served-view.js","mappings":"AACA,SAAS,gBAAgB;AAEzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;
|
|
1
|
+
{"version":3,"file":"served-view.js","mappings":"AACA,SAAS,gBAAgB;AAEzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAE/B,OAAwB;AAExB,SAAS,0BAA0B;AACnC,SAEE,iCACK;;AAGP,MAAM,QAAQ;AAGd,MAAM,eAAe;AAMrB,MAAM,kBAAkB,SAAoC;CAC1D,IAAI,CAAC,QAAQ,KAAK,aAAa,cAAc,OAAO;CAEpD,MAAM,EAAE,SAAS;C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reList":[],"sources":["../src/served-view.ts"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.d.ts","mappings":";;;;;;AAMA,OAAO,cAAM","names":[],"ignoreList":[],"sources":["../../../shared/dev-gate/src/dev-gate.ts"],"sourcesContent":["/**\n * Whether development warnings fire off node: always, since only a node\n * runtime can say it is production.\n *\n * @internal\n */\nexport const devGate = (): boolean => true;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.js","mappings":"AAMA,OAAO,MAAM,gBAAyB","names":[],"ignoreList":[],"sources":["../../../shared/dev-gate/src/dev-gate.ts"],"sourcesContent":["/**\n * Whether development warnings fire off node: always, since only a node\n * runtime can say it is production.\n *\n * @internal\n */\nexport const devGate = (): boolean => true;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.node.d.ts","mappings":";;;;;;AASA,OAAO,cAAM","names":[],"ignoreList":[],"sources":["../../../shared/dev-gate/src/dev-gate.node.ts"],"sourcesContent":["// The one `process` read a package ships: its #dev-gate import reaches this file under the `node` condition only.\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Whether development warnings fire under node: unless `NODE_ENV` is\n * `production`, read at each call so a test can set it.\n *\n * @internal\n */\nexport const devGate = (): boolean => process.env.NODE_ENV !== 'production';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-gate.node.js","mappings":"AASA,OAAO,MAAM,gBAAyB,QAAQ,IAAI,aAAa","names":[],"ignoreList":[],"sources":["../../../shared/dev-gate/src/dev-gate.node.ts"],"sourcesContent":["// The one `process` read a package ships: its #dev-gate import reaches this file under the `node` condition only.\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Whether development warnings fire under node: unless `NODE_ENV` is\n * `production`, read at each call so a test can set it.\n *\n * @internal\n */\nexport const devGate = (): boolean => process.env.NODE_ENV !== 'production';\n"]}
|
package/dist/signature.d.ts
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
* `prerender()` writes `state` as the name of the state the router stood on and
|
|
7
7
|
* `params` as an object of that state's url parameters, each encoded by its
|
|
8
8
|
* type as the url spells it. Narrow both before use.
|
|
9
|
-
*
|
|
10
|
-
* @category client
|
|
11
9
|
*/
|
|
12
10
|
export interface HydrationSignature {
|
|
13
11
|
/** The `lit-ui-router-ssr` version that drew the document. */
|
package/dist/signature.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","mappings":"
|
|
1
|
+
{"version":3,"file":"signature.d.ts","mappings":";;;;;;;;;AAWA,iBAAiB,mBAAmB;;UAEzB;;UAEA;;UAEA;AACX;;;;;;;AAQA,OAAO,cAAM,qBAAqB;;;;;;AAOlC,OAAO,cAAM;;;;;;AAOb,OAAO,cAAM","names":[],"ignoreList":[],"sources":["../src/signature.ts"]}
|
package/dist/signature.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const signatureAttribute = "data-lit-ui-router-ssr";
|
|
2
2
|
export const signatureSelector = `script[type="application/json"][${signatureAttribute}]`;
|
|
3
|
-
export const packageVersion = "0.
|
|
3
|
+
export const packageVersion = "0.4.0";
|
|
4
4
|
//# sourceMappingURL=signature.js.map
|
package/dist/signature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","mappings":"
|
|
1
|
+
{"version":3,"file":"signature.js","mappings":"AA0BA,OAAO,MAAM,qBAAqB;AAOlC,OAAO,MAAM,oBAA4B,mCAAmC,mBAAmB;AAO/F,OAAO,MAAM","names":[],"ignoreList":[],"sources":["../src/signature.ts"]}
|
|
@@ -37,8 +37,6 @@ import type { ThunkedRenderResult } from "@lit-labs/ssr/lib/render-result.js";
|
|
|
37
37
|
* const page = (router: UIRouterLit) =>
|
|
38
38
|
* html`<ui-router .uiRouter=${router}><ui-view>${uiViewSlot()}</ui-view></ui-router>`;
|
|
39
39
|
* ```
|
|
40
|
-
*
|
|
41
|
-
* @category server
|
|
42
40
|
*/
|
|
43
41
|
export declare class UiViewRenderer extends ElementRenderer {
|
|
44
42
|
/** Answers for `<ui-view>`, whatever class the tag is registered with. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-view-renderer.d.ts","mappings":"AACA,SAAS,uBAAuB;AAChC,cAAc,kBAAkB;AAChC,cAAc,2BAA2B
|
|
1
|
+
{"version":3,"file":"ui-view-renderer.d.ts","mappings":"AACA,SAAS,uBAAuB;AAChC,cAAc,kBAAkB;AAChC,cAAc,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGzC,OAAO,cAAM,uBAAuB,gBAAgB;;CAElD,gBAAgB,aACd,iBAAiB,aACjB;;CAMF,iBAAiB;CAEjB,QAAQ;CAER,QAAQ;;CAGR,SAAS,aAAa,cAAc;;CAKpC,SAAS,oBAAoB;;CAO7B,YAAY;;CAQZ,QAAQ;CAMR,QAAQ;;CAuBR,QAAQ;;CA2BR,SAAS,YACP,YAAY,aACX;AA0CL","names":[],"ignoreList":[],"sources":["../src/ui-view-renderer.ts"]}
|
package/dist/ui-view-renderer.js
CHANGED
|
@@ -4,6 +4,7 @@ import { renderValue } from "@lit-labs/ssr/lib/render-value.js";
|
|
|
4
4
|
import { applyPairs, ResolveContext, Transition, isString } from "@uirouter/core";
|
|
5
5
|
import { LitViewConfig, isRoutedLitElement } from "lit-ui-router/pure";
|
|
6
6
|
import { getScopedRouter } from "lit-ui-router/context";
|
|
7
|
+
import "#dev-gate";
|
|
7
8
|
import { servedMarkerPrefix } from "./served-markers.js";
|
|
8
9
|
const TAG = "ui-view";
|
|
9
10
|
const DEFAULT_VIEW = "$default";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-view-renderer.js","mappings":"AACA,SAAS,uBAAuB;AAGhC,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,S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AAU,CAAC,CACX,QAAQ,UAAU,SAAS,KAAK,CAAC,CAAC,CAClC,KAAK,UAAU,QAAQ,cAAc,KAAK,CAAC,CAAC,CAC5C,QACE,eACC,WAAW,YACX,QAAQ,UAAU,UAAU,CAAC,CAAC,UAAU,QAC5C,CAAC,CACA,KAAK,EAAE,YAAkD,CACxD,OACA,SAAS,IAAa,KAAK,CAC7B,CAAC,CAAC,CACD,OAAO,YAAY,CAAC,CAId;GACP,YAAY,SAAS,IAAgB,UAAU;EACjD;CACF;CAGA,YACE,YACiC;EACjC,MAAM,SAAS,gBAAgB;EAE/B,IAAI,CAAC,QAAQ,OAAO;EACpB,MAAM,aAAa,KAAK,SAAS,MAAM;EACvC,MAAM,SAAS,KAAK;EAGpB,MAAM,aAAa,QAAQ,SAAQ,EAC/B;EAEJ,IAAI,CAAC,UAAU,CAAC,WAAW;GACzB,WAAW;GAEX;EACF;EAEA,IAAI,mBAAmB,SAAS,GAAG;GACjC,KAA0B,KAAM;GAChC,WAAW;GAEX;EACF;EAEA,MAAM,QAAQ,UAAU,KAAK,MAAM,QAAQ,MAAM,CAAC;EAElD,OAAO,OACC;GACJ,UAAU,KAAK,IAAI;GAEnB,IAAI;IAEF,OAAO,eACL,kBAAkB,YAAY,OAAO,UAAU,CAAC,CAClD;GACF,UAAU;IACR,UAAU,IAAI;IACd,WAAW;GACb;EACF,CACF;CACF;AACF","names":[],"ignoreList":[],"sources":["../src/ui-view-renderer.ts"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lit-ui-router-ssr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Static prerendering for lit-ui-router: mount verdicts in, an emitted site out",
|
|
5
5
|
"homepage": "https://lit-ui-router.dev/packages/ssr",
|
|
6
6
|
"bugs": {
|
|
@@ -26,15 +26,30 @@
|
|
|
26
26
|
"main": "./dist/index.js",
|
|
27
27
|
"module": "./dist/index.js",
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
|
+
"imports": {
|
|
30
|
+
"#dev-gate": {
|
|
31
|
+
"types": "./src/dev-gate.ts",
|
|
32
|
+
"production": "./dist/dev-gate.js",
|
|
33
|
+
"deno": "./dist/dev-gate.js",
|
|
34
|
+
"node": "./dist/dev-gate.node.js",
|
|
35
|
+
"default": "./dist/dev-gate.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
29
38
|
"exports": {
|
|
30
39
|
".": {
|
|
31
40
|
"types": "./dist/index.d.ts",
|
|
32
41
|
"development": "./dist/development/index.js",
|
|
42
|
+
"production": "./dist/index.js",
|
|
43
|
+
"deno": "./dist/index.js",
|
|
44
|
+
"node": "./dist/development/index.js",
|
|
33
45
|
"default": "./dist/index.js"
|
|
34
46
|
},
|
|
35
47
|
"./client": {
|
|
36
48
|
"types": "./dist/client.d.ts",
|
|
37
49
|
"development": "./dist/development/client.js",
|
|
50
|
+
"production": "./dist/client.js",
|
|
51
|
+
"deno": "./dist/client.js",
|
|
52
|
+
"node": "./dist/development/client.js",
|
|
38
53
|
"default": "./dist/client.js"
|
|
39
54
|
},
|
|
40
55
|
"./dist/*": "./dist/*",
|
|
@@ -42,6 +57,9 @@
|
|
|
42
57
|
"./register": {
|
|
43
58
|
"types": "./dist/register.d.ts",
|
|
44
59
|
"development": "./dist/development/register.js",
|
|
60
|
+
"production": "./dist/register.js",
|
|
61
|
+
"deno": "./dist/register.js",
|
|
62
|
+
"node": "./dist/development/register.js",
|
|
45
63
|
"default": "./dist/register.js"
|
|
46
64
|
}
|
|
47
65
|
},
|
|
@@ -54,7 +72,7 @@
|
|
|
54
72
|
"@uirouter/core": "^6.0.8",
|
|
55
73
|
"lit": "^3.1.2",
|
|
56
74
|
"lit-ui-router": "^1.16.1",
|
|
57
|
-
"ui-router-server": "^0.2.0 || ^0.3.0"
|
|
75
|
+
"ui-router-server": "^0.2.0 || ^0.3.0 || ^0.4.0"
|
|
58
76
|
},
|
|
59
77
|
"peerDependenciesMeta": {
|
|
60
78
|
"@lit-labs/ssr-client": {
|
package/src/adopt-context.ts
CHANGED
|
@@ -5,8 +5,6 @@ import type { Context } from 'lit-ui-router/context';
|
|
|
5
5
|
/**
|
|
6
6
|
* The identity of {@link adoptUiViewContext}: a plain object, so the key is
|
|
7
7
|
* unique under `===` and readable in a debugger.
|
|
8
|
-
*
|
|
9
|
-
* @category client
|
|
10
8
|
*/
|
|
11
9
|
export interface AdoptUiViewContextKey {
|
|
12
10
|
/** Names the key for a debugger; identity, not this string, is what matches. */
|
|
@@ -16,8 +14,6 @@ export interface AdoptUiViewContextKey {
|
|
|
16
14
|
/**
|
|
17
15
|
* The waking `<ui-view>` as an adopter sees it: the element holding the served
|
|
18
16
|
* nodes, with the template and render options a hydrate reads.
|
|
19
|
-
*
|
|
20
|
-
* @category client
|
|
21
17
|
*/
|
|
22
18
|
export interface AdoptableView extends HTMLElement {
|
|
23
19
|
/** The routed template the served nodes came from. */
|
|
@@ -31,8 +27,6 @@ export interface AdoptableView extends HTMLElement {
|
|
|
31
27
|
* The adopt-view context key's type — {@link AdoptUiViewContextKey} branded
|
|
32
28
|
* with the adopter function, so `@consume({ context: adoptUiViewContext })`
|
|
33
29
|
* infers it.
|
|
34
|
-
*
|
|
35
|
-
* @category client
|
|
36
30
|
*/
|
|
37
31
|
export type AdoptUiViewContext = Context<
|
|
38
32
|
AdoptUiViewContextKey,
|
|
@@ -59,8 +53,6 @@ export type AdoptUiViewContext = Context<
|
|
|
59
53
|
* adopt(view),
|
|
60
54
|
* );
|
|
61
55
|
* ```
|
|
62
|
-
*
|
|
63
|
-
* @category client
|
|
64
56
|
*/
|
|
65
57
|
// SAFETY: the adopter brand is type-only; the frozen key object is the whole runtime value.
|
|
66
58
|
export const adoptUiViewContext: AdoptUiViewContext = Object.freeze({
|
package/src/client.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* The client half: `hydrateRoot()` hydrates the prerendered root, and each
|
|
3
|
+
* served `<ui-view>` the walk wakes adopts its markup through `uiViewSlot`.
|
|
4
|
+
*
|
|
2
5
|
* @module
|
|
3
|
-
* @mergeModuleWith <project>
|
|
4
6
|
*/
|
|
5
|
-
// The adopt half: one `hydrate()` on the root, and the adopter each served `<ui-view>` the walk wakes requests to take its markup.
|
|
6
7
|
import { hydrate } from '@lit-labs/ssr-client';
|
|
7
8
|
import { renderLight } from '@lit-labs/ssr-client/directives/render-light.js';
|
|
8
9
|
import type { RenderLightHost } from '@lit-labs/ssr-client/directives/render-light.js';
|
|
@@ -14,6 +15,7 @@ import type { PartInfo } from 'lit/directive.js';
|
|
|
14
15
|
import { getDirectiveClass } from 'lit/directive-helpers.js';
|
|
15
16
|
import { provideContext } from 'lit-ui-router/context';
|
|
16
17
|
import { UiView } from 'lit-ui-router/pure';
|
|
18
|
+
import { devGate } from '#dev-gate';
|
|
17
19
|
import { adoptUiViewContext } from './adopt-context.js';
|
|
18
20
|
import type { AdoptableView } from './adopt-context.js';
|
|
19
21
|
import { servedMarkerPrefix } from './served-markers.js';
|
|
@@ -48,23 +50,17 @@ const DEFER = 'defer-hydration';
|
|
|
48
50
|
* into, or was lost; the view dropped the served interior and rendered cold.
|
|
49
51
|
* - `none`: nothing to adopt — an empty served pair, the address no state
|
|
50
52
|
* routed, or a view the document served no markers for.
|
|
51
|
-
*
|
|
52
|
-
* @category client
|
|
53
53
|
*/
|
|
54
54
|
export type AdoptOutcome = 'adopted' | 'fell-back' | 'none';
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* The name of the event a served `<ui-view>` dispatches once its wake's
|
|
58
58
|
* outcome is known, in the `ui-view:` house style of the served markers.
|
|
59
|
-
*
|
|
60
|
-
* @category client
|
|
61
59
|
*/
|
|
62
60
|
export const uiViewAdoptEventName = 'ui-view:adopt' as const;
|
|
63
61
|
|
|
64
62
|
/**
|
|
65
63
|
* The detail of {@link UiViewAdoptEvent}.
|
|
66
|
-
*
|
|
67
|
-
* @category client
|
|
68
64
|
*/
|
|
69
65
|
export interface UiViewAdoptDetail {
|
|
70
66
|
/** What the wake came to. */
|
|
@@ -76,15 +72,11 @@ export interface UiViewAdoptDetail {
|
|
|
76
72
|
/**
|
|
77
73
|
* Dispatched from a served `<ui-view>` at its wake, once per view, bubbling and
|
|
78
74
|
* composed, in production as in development.
|
|
79
|
-
*
|
|
80
|
-
* @category client
|
|
81
75
|
*/
|
|
82
76
|
export type UiViewAdoptEvent = CustomEvent<UiViewAdoptDetail>;
|
|
83
77
|
|
|
84
78
|
/**
|
|
85
79
|
* Receives each served view's outcome, as {@link HydrateRootOptions.onAdopt}.
|
|
86
|
-
*
|
|
87
|
-
* @category client
|
|
88
80
|
*/
|
|
89
81
|
export type AdoptReporter = (
|
|
90
82
|
view: Element,
|
|
@@ -96,8 +88,6 @@ export type AdoptReporter = (
|
|
|
96
88
|
/**
|
|
97
89
|
* {@link hydrateRoot}'s options: lit's render options, plus the outcome
|
|
98
90
|
* callback.
|
|
99
|
-
*
|
|
100
|
-
* @category client
|
|
101
91
|
*/
|
|
102
92
|
export interface HydrateRootOptions extends RenderOptions {
|
|
103
93
|
/**
|
|
@@ -176,8 +166,6 @@ class UiViewSlotDirective extends RenderLightDirective {
|
|
|
176
166
|
* ```ts
|
|
177
167
|
* html`<ui-router .uiRouter=${router}><ui-view>${uiViewSlot()}</ui-view></ui-router>`;
|
|
178
168
|
* ```
|
|
179
|
-
*
|
|
180
|
-
* @category client
|
|
181
169
|
*/
|
|
182
170
|
export const uiViewSlot: typeof renderLight = directive(UiViewSlotDirective);
|
|
183
171
|
|
|
@@ -234,8 +222,8 @@ const report = (
|
|
|
234
222
|
};
|
|
235
223
|
|
|
236
224
|
const warnMismatch = (view: AdoptableView, cause: unknown): void => {
|
|
237
|
-
// DEV folds away in dist/*.js;
|
|
238
|
-
if (!import.meta.env.DEV) return;
|
|
225
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
226
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
239
227
|
console.warn(
|
|
240
228
|
'lit-ui-router-ssr: this element could not adopt the server render, so it rendered over it instead. One static document answers a whole family of urls, so a client that boots into another state reaches this legitimately.',
|
|
241
229
|
view.localName,
|
|
@@ -517,8 +505,6 @@ const parseSignature = (json: string): HydrationSignature | null => {
|
|
|
517
505
|
* @param container - the element the server's markup was written into
|
|
518
506
|
* @returns the signature, or `null` when the container holds none, or one that
|
|
519
507
|
* does not parse to an object with a string `version`
|
|
520
|
-
*
|
|
521
|
-
* @category client
|
|
522
508
|
*/
|
|
523
509
|
export function readHydrationSignature(
|
|
524
510
|
container: ParentNode,
|
|
@@ -556,8 +542,8 @@ const releaseLine = (version: string): string => {
|
|
|
556
542
|
};
|
|
557
543
|
|
|
558
544
|
const warnVersionSkew = (served: string): void => {
|
|
559
|
-
// DEV folds away in dist/*.js;
|
|
560
|
-
if (!import.meta.env.DEV) return;
|
|
545
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
546
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
561
547
|
console.warn(
|
|
562
548
|
'lit-ui-router-ssr: this document was prerendered by a release line this client does not adopt, so hydrateRoot() left it to a cold render. Prerender it again with the version the client ships. Prerendered by, then client:',
|
|
563
549
|
served,
|
|
@@ -566,8 +552,8 @@ const warnVersionSkew = (served: string): void => {
|
|
|
566
552
|
};
|
|
567
553
|
|
|
568
554
|
const warnMarkersStripped = (): void => {
|
|
569
|
-
// DEV folds away in dist/*.js;
|
|
570
|
-
if (!import.meta.env.DEV) return;
|
|
555
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
556
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
571
557
|
console.warn(
|
|
572
558
|
'lit-ui-router-ssr: this document carries a hydration signature but no lit-part marker follows it, so hydrateRoot() left it to a cold render. hydrate() reads html comments: serve prerendered pages without stripping them.',
|
|
573
559
|
);
|
|
@@ -661,8 +647,6 @@ const makeCold = (container: HTMLElement): void => {
|
|
|
661
647
|
* @param value - the same template the server rendered, with every `<ui-view>` hole empty
|
|
662
648
|
* @param options - lit render options, passed on to `hydrate()`, and `onAdopt`
|
|
663
649
|
* @returns the function that releases the provider, or `false`, over an emptied container, when there is nothing to adopt — no signature, as on a cold client render or a dev server, one from another release line, or one no render marker follows
|
|
664
|
-
*
|
|
665
|
-
* @category client
|
|
666
650
|
*/
|
|
667
651
|
export function hydrateRoot(
|
|
668
652
|
container: HTMLElement,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { devGate } from '@repo/dev-gate/node';
|
package/src/dev-gate.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { devGate } from '@repo/dev-gate';
|
package/src/dev-warn.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// The development-only warnings the served view raises; folded out of dist/*.js by check:dev-split.
|
|
2
2
|
|
|
3
|
+
import { devGate } from '#dev-gate';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Warns that a `<ui-view>` woke from `defer-hydration` with nothing answering
|
|
5
7
|
* its adopter request, so it dropped the nodes it held and rendered cold.
|
|
@@ -12,8 +14,8 @@
|
|
|
12
14
|
* @internal
|
|
13
15
|
*/
|
|
14
16
|
export function warnDeferredWithoutClient(element: Element): void {
|
|
15
|
-
// DEV folds the whole body out of dist/*.js;
|
|
16
|
-
if (!import.meta.env.DEV) return;
|
|
17
|
+
// DEV folds the whole body out of dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
18
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
17
19
|
console.warn(
|
|
18
20
|
'lit-ui-router-ssr: this <ui-view> woke from defer-hydration and nothing answered its adoptUiViewContext request, so its held nodes were dropped and it rendered cold. Provide an adopter before the wake.',
|
|
19
21
|
element,
|
|
@@ -41,8 +43,8 @@ const warnedNeverWoken = new WeakSet<Element>();
|
|
|
41
43
|
* @internal
|
|
42
44
|
*/
|
|
43
45
|
export function warnDeferredNeverWoken(element: Element): void {
|
|
44
|
-
// DEV folds the whole body out of dist/*.js;
|
|
45
|
-
if (!import.meta.env.DEV) return;
|
|
46
|
+
// DEV folds the whole body out of dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
47
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
46
48
|
|
|
47
49
|
if (warnedNeverWoken.has(element)) return;
|
|
48
50
|
warnedNeverWoken.add(element);
|
package/src/index.ts
CHANGED
package/src/prerender.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { provideRouter, withRouterSync } from 'lit-ui-router/context';
|
|
|
8
8
|
import { DefType, isFunction, isString } from '@uirouter/core';
|
|
9
9
|
import { createServerRouter } from 'ui-router-server';
|
|
10
10
|
import type { MountConfig, ServerRouter, Verdict } from 'ui-router-server';
|
|
11
|
+
import { devGate } from '#dev-gate';
|
|
11
12
|
|
|
12
13
|
import { packageVersion, signatureAttribute } from './signature.js';
|
|
13
14
|
import { UiViewRenderer } from './ui-view-renderer.js';
|
|
@@ -319,8 +320,8 @@ export const renderPage = (
|
|
|
319
320
|
);
|
|
320
321
|
|
|
321
322
|
const warnUnclaimed = (path: string): void => {
|
|
322
|
-
// DEV folds away in dist/*.js;
|
|
323
|
-
if (!import.meta.env.DEV) return;
|
|
323
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
324
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
324
325
|
console.warn(
|
|
325
326
|
'lit-ui-router-ssr: no route matched this path and its mount declares no otherwise projection, so no page was emitted for it:',
|
|
326
327
|
path,
|
|
@@ -331,8 +332,8 @@ const warnStrictSlash = async (
|
|
|
331
332
|
resolver: ServerRouter,
|
|
332
333
|
path: string,
|
|
333
334
|
): Promise<void> => {
|
|
334
|
-
// DEV folds away in dist/*.js;
|
|
335
|
-
if (!import.meta.env.DEV) return;
|
|
335
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
336
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
336
337
|
const slashed = await resolver.resolve(`${path}/`);
|
|
337
338
|
|
|
338
339
|
if (slashed.kind === 'shell' && slashed.status === undefined) return;
|
|
@@ -416,8 +417,8 @@ const resolverOf = (options: PrerenderOptions): ServerRouter => {
|
|
|
416
417
|
};
|
|
417
418
|
|
|
418
419
|
const warnUnregistered = (): void => {
|
|
419
|
-
// DEV folds away in dist/*.js;
|
|
420
|
-
if (!import.meta.env.DEV) return;
|
|
420
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
421
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
421
422
|
|
|
422
423
|
if (globalThis.customElements?.get('ui-view')) return;
|
|
423
424
|
console.warn(
|
|
@@ -535,6 +536,7 @@ export async function prerender(
|
|
|
535
536
|
|
|
536
537
|
if (
|
|
537
538
|
import.meta.env.DEV &&
|
|
539
|
+
devGate() &&
|
|
538
540
|
!slashProbed &&
|
|
539
541
|
wantsSlashProbe(verdict, path, subpath)
|
|
540
542
|
) {
|
package/src/served-view.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { PropertyValues } from 'lit';
|
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import { requestContext } from 'lit-ui-router/context';
|
|
6
6
|
import { UiView } from 'lit-ui-router/pure';
|
|
7
|
+
import { devGate } from '#dev-gate';
|
|
7
8
|
|
|
8
9
|
import { adoptUiViewContext } from './adopt-context.js';
|
|
9
10
|
import {
|
|
@@ -33,8 +34,6 @@ const isRenderMarker = (node: ChildNode | null): boolean => {
|
|
|
33
34
|
* Brands the served class, so a second copy of this package recognises the one
|
|
34
35
|
* already registered. `customElements` identity cannot: two copies build two
|
|
35
36
|
* classes.
|
|
36
|
-
*
|
|
37
|
-
* @category client
|
|
38
37
|
*/
|
|
39
38
|
export const servedViewBrand: unique symbol = Symbol.for(
|
|
40
39
|
'lit-ui-router-ssr#served-view',
|
|
@@ -42,8 +41,6 @@ export const servedViewBrand: unique symbol = Symbol.for(
|
|
|
42
41
|
|
|
43
42
|
/**
|
|
44
43
|
* A `<ui-view>` that owns its side of a server render.
|
|
45
|
-
*
|
|
46
|
-
* @category client
|
|
47
44
|
*/
|
|
48
45
|
export interface ServedUiView extends UiView {
|
|
49
46
|
/**
|
|
@@ -61,8 +58,6 @@ export interface ServedUiView extends UiView {
|
|
|
61
58
|
/**
|
|
62
59
|
* The class {@link withServedRender} produces: a `<ui-view>` constructor,
|
|
63
60
|
* branded.
|
|
64
|
-
*
|
|
65
|
-
* @category client
|
|
66
61
|
*/
|
|
67
62
|
export interface ServedUiViewConstructor {
|
|
68
63
|
/** Builds one served view; the element takes no constructor arguments. */
|
|
@@ -76,8 +71,6 @@ export interface ServedUiViewConstructor {
|
|
|
76
71
|
* another copy's.
|
|
77
72
|
*
|
|
78
73
|
* @param constructor - the class a registry holds for a tag
|
|
79
|
-
*
|
|
80
|
-
* @category client
|
|
81
74
|
*/
|
|
82
75
|
export const isServedViewClass = (
|
|
83
76
|
constructor: CustomElementConstructor | undefined,
|
|
@@ -118,8 +111,6 @@ export const isServedViewClass = (
|
|
|
118
111
|
*
|
|
119
112
|
* customElements.define('app-view', withServedRender(UiView));
|
|
120
113
|
* ```
|
|
121
|
-
*
|
|
122
|
-
* @category client
|
|
123
114
|
*/
|
|
124
115
|
export const withServedRender = (
|
|
125
116
|
Base: typeof UiView,
|
|
@@ -142,7 +133,7 @@ export const withServedRender = (
|
|
|
142
133
|
if (this.deferHydration) {
|
|
143
134
|
this.deferredAtConnect = true;
|
|
144
135
|
|
|
145
|
-
if (import.meta.env.DEV) {
|
|
136
|
+
if (import.meta.env.DEV && devGate()) {
|
|
146
137
|
// A macrotask: the hydrate walk clears the attribute within this task, and a pin answers on the wake update queued inside it.
|
|
147
138
|
setTimeout(() => {
|
|
148
139
|
if (this.isConnected && this.deferHydration && !this.hasUpdated) {
|
package/src/signature.ts
CHANGED
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
* `prerender()` writes `state` as the name of the state the router stood on and
|
|
9
9
|
* `params` as an object of that state's url parameters, each encoded by its
|
|
10
10
|
* type as the url spells it. Narrow both before use.
|
|
11
|
-
*
|
|
12
|
-
* @category client
|
|
13
11
|
*/
|
|
14
12
|
export interface HydrationSignature {
|
|
15
13
|
/** The `lit-ui-router-ssr` version that drew the document. */
|
package/src/ui-view-renderer.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
UIViewInjectedProps,
|
|
18
18
|
} from 'lit-ui-router/pure';
|
|
19
19
|
import { getScopedRouter } from 'lit-ui-router/context';
|
|
20
|
+
import { devGate } from '#dev-gate';
|
|
20
21
|
import { servedMarkerPrefix } from './served-markers.js';
|
|
21
22
|
|
|
22
23
|
/** The tag this renderer answers for. */
|
|
@@ -59,8 +60,8 @@ const escapeAttribute = (value: string): string =>
|
|
|
59
60
|
value.replace(/&/g, '&').replace(/"/g, '"');
|
|
60
61
|
|
|
61
62
|
const warnElementComponent = (fqn: string): void => {
|
|
62
|
-
// DEV folds away in dist/*.js;
|
|
63
|
-
if (!import.meta.env.DEV) return;
|
|
63
|
+
// DEV folds away in dist/*.js; #dev-gate also closes it under node when NODE_ENV is production.
|
|
64
|
+
if (!import.meta.env.DEV || !devGate()) return;
|
|
64
65
|
console.warn(
|
|
65
66
|
'lit-ui-router-ssr: this view is a RoutedLitElement class, which has no server render, so the part was left empty for the client to fill:',
|
|
66
67
|
fqn,
|
|
@@ -103,8 +104,6 @@ const warnElementComponent = (fqn: string): void => {
|
|
|
103
104
|
* const page = (router: UIRouterLit) =>
|
|
104
105
|
* html`<ui-router .uiRouter=${router}><ui-view>${uiViewSlot()}</ui-view></ui-router>`;
|
|
105
106
|
* ```
|
|
106
|
-
*
|
|
107
|
-
* @category server
|
|
108
107
|
*/
|
|
109
108
|
export class UiViewRenderer extends ElementRenderer {
|
|
110
109
|
/** Answers for `<ui-view>`, whatever class the tag is registered with. */
|