@arkstack/inertia 0.15.3 → 0.15.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveSsrBundle, o as inertiaConfig, r as superviseProcess } from "../ssr-process-
|
|
1
|
+
import { n as resolveSsrBundle, o as inertiaConfig, r as superviseProcess } from "../ssr-process-Cz4b8S_f.js";
|
|
2
2
|
import { Arkstack } from "@arkstack/contract";
|
|
3
3
|
import { Command } from "@h3ravel/musket";
|
|
4
4
|
import { existsSync } from "node:fs";
|
package/dist/index.d.ts
CHANGED
|
@@ -392,4 +392,4 @@ declare const SEE_OTHER_METHODS: Set<string>;
|
|
|
392
392
|
*/
|
|
393
393
|
declare const shouldUpgradeRedirect: (method: string, status: number) => boolean;
|
|
394
394
|
//#endregion
|
|
395
|
-
export { AlwaysProp, AlwaysPropContract, DEFAULT_SSR_BUNDLE, DEFAULT_SSR_URL, DeferProp, DeferPropContract, Inertia, InertiaConfig, InertiaPage, InertiaPropWrapper, InertiaRequest, type InertiaStore, LazyProp, LazyPropContract, PageProps, SEE_OTHER_METHODS, type SsrProcessController, type SsrResponse, type SuperviseOptions, builtInTemplate, configure, currentStore, defaultConfig, escapeHtmlAttribute, flushShared, inertia, inertiaConfig, isAlwaysProp, isDeferProp, isLazyProp, isPropWrapper, registerInertiaTags, renderDataPage, renderRootHtml, renderViaSsr, resetConfig, resolveProps, resolveSsrBundle, resolveVersion, runInertia, setVersion, shareData, sharedData, shouldUpgradeRedirect, superviseProcess };
|
|
395
|
+
export { AlwaysProp, type AlwaysPropContract, DEFAULT_SSR_BUNDLE, DEFAULT_SSR_URL, DeferProp, type DeferPropContract, Inertia, type InertiaConfig, type InertiaPage, type InertiaPropWrapper, type InertiaRequest, type InertiaStore, LazyProp, type LazyPropContract, type PageProps, SEE_OTHER_METHODS, type SsrProcessController, type SsrResponse, type SuperviseOptions, builtInTemplate, configure, currentStore, defaultConfig, escapeHtmlAttribute, flushShared, inertia, inertiaConfig, isAlwaysProp, isDeferProp, isLazyProp, isPropWrapper, registerInertiaTags, renderDataPage, renderRootHtml, renderViaSsr, resetConfig, resolveProps, resolveSsrBundle, resolveVersion, runInertia, setVersion, shareData, sharedData, shouldUpgradeRedirect, superviseProcess };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { a as defaultConfig, c as resolveVersion, i as configure, l as setVersion, n as resolveSsrBundle, o as inertiaConfig, r as superviseProcess, s as resetConfig, t as DEFAULT_SSR_BUNDLE } from "./ssr-process-C6QRQAaQ.js";
|
|
1
|
+
import { a as defaultConfig, c as resolveVersion, i as configure, l as setVersion, n as resolveSsrBundle, o as inertiaConfig, r as superviseProcess, s as resetConfig, t as DEFAULT_SSR_BUNDLE } from "./ssr-process-Cz4b8S_f.js";
|
|
3
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
3
|
import { Response } from "@arkstack/http";
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __exportAll = (all, no_symbols) => {
|
|
7
|
+
let target = {};
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
5
16
|
//#region src/props.ts
|
|
6
17
|
/**
|
|
7
18
|
* A prop that is excluded from the initial page load and only resolved when the
|
|
@@ -97,7 +108,7 @@ const flushShared = () => {
|
|
|
97
108
|
//#endregion
|
|
98
109
|
//#region src/protocol.ts
|
|
99
110
|
/** Methods whose redirects must use `303 See Other` so the Inertia client re-issues a GET. */
|
|
100
|
-
const SEE_OTHER_METHODS = new Set([
|
|
111
|
+
const SEE_OTHER_METHODS = /* @__PURE__ */ new Set([
|
|
101
112
|
"PUT",
|
|
102
113
|
"PATCH",
|
|
103
114
|
"DELETE"
|
|
@@ -192,7 +203,7 @@ const renderRootHtml = async (page, config) => {
|
|
|
192
203
|
}
|
|
193
204
|
try {
|
|
194
205
|
const { view } = await import("@arkstack/view");
|
|
195
|
-
const { registerInertiaTags } = await
|
|
206
|
+
const { registerInertiaTags } = await Promise.resolve().then(() => tags_exports);
|
|
196
207
|
const factory = view();
|
|
197
208
|
registerInertiaTags(factory);
|
|
198
209
|
if (factory.exists(config.root_view)) return await view(config.root_view, {
|
|
@@ -395,4 +406,42 @@ function inertia(component, props = {}) {
|
|
|
395
406
|
return Inertia.render(component, props);
|
|
396
407
|
}
|
|
397
408
|
//#endregion
|
|
409
|
+
//#region src/tags.ts
|
|
410
|
+
var tags_exports = /* @__PURE__ */ __exportAll({ registerInertiaTags: () => registerInertiaTags });
|
|
411
|
+
/** Factories that already have the Inertia tags registered. */
|
|
412
|
+
const registered = /* @__PURE__ */ new WeakSet();
|
|
413
|
+
/**
|
|
414
|
+
* Build an Edge tag compiler that outputs a template data variable raw (falling
|
|
415
|
+
* back to an empty string when it is absent).
|
|
416
|
+
*
|
|
417
|
+
* @param name
|
|
418
|
+
* @returns
|
|
419
|
+
*/
|
|
420
|
+
const outputVariable = (name) => {
|
|
421
|
+
return (parser, buffer, token) => {
|
|
422
|
+
const ast = parser.utils.transformAst(parser.utils.generateAST(`${name} || ""`, token.loc, token.filename), token.filename, parser);
|
|
423
|
+
buffer.outputExpression(parser.utils.stringify(ast), token.filename, token.loc.start.line, false);
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Register the `@inertia` and `@inertiaHead` Edge tags on a view factory.
|
|
428
|
+
*
|
|
429
|
+
* - `@inertia` renders the root mount element (`<div data-page="…">`), or the
|
|
430
|
+
* server-rendered markup when SSR is enabled.
|
|
431
|
+
* - `@inertiaHead` renders the SSR head tags (empty without SSR).
|
|
432
|
+
*
|
|
433
|
+
* Both read the values the adapter passes to the root template, so they replace
|
|
434
|
+
* the equivalent `{{{ inertia }}}` / `{{{ inertiaHead }}}` interpolations.
|
|
435
|
+
* Idempotent per factory.
|
|
436
|
+
*
|
|
437
|
+
* @param factory
|
|
438
|
+
* @returns
|
|
439
|
+
*/
|
|
440
|
+
const registerInertiaTags = (factory) => {
|
|
441
|
+
if (registered.has(factory)) return;
|
|
442
|
+
registered.add(factory);
|
|
443
|
+
factory.tag("inertia", false, false, outputVariable("inertia"));
|
|
444
|
+
factory.tag("inertiaHead", false, false, outputVariable("inertiaHead"));
|
|
445
|
+
};
|
|
446
|
+
//#endregion
|
|
398
447
|
export { AlwaysProp, DEFAULT_SSR_BUNDLE, DEFAULT_SSR_URL, DeferProp, Inertia, LazyProp, SEE_OTHER_METHODS, builtInTemplate, configure, currentStore, defaultConfig, escapeHtmlAttribute, flushShared, inertia, inertiaConfig, isAlwaysProp, isDeferProp, isLazyProp, isPropWrapper, registerInertiaTags, renderDataPage, renderRootHtml, renderViaSsr, resetConfig, resolveProps, resolveSsrBundle, resolveVersion, runInertia, setVersion, shareData, sharedData, shouldUpgradeRedirect, superviseProcess };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/inertia",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "InertiaJS server-side adapter for Arkstack, building the modern monolith with server-driven SPAs.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net/guide/inertia",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@arkstack/common": "^0.15.
|
|
36
|
+
"@arkstack/common": "^0.15.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@h3ravel/musket": "^2.2.1",
|
|
40
|
-
"@arkstack/
|
|
41
|
-
"@arkstack/
|
|
42
|
-
"@arkstack/view": "^0.15.
|
|
40
|
+
"@arkstack/http": "^0.15.4",
|
|
41
|
+
"@arkstack/contract": "^0.15.4",
|
|
42
|
+
"@arkstack/view": "^0.15.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@arkstack/view": {
|
package/dist/tags-DpBq4bSL.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/tags.ts
|
|
14
|
-
var tags_exports = /* @__PURE__ */ __exportAll({ registerInertiaTags: () => registerInertiaTags });
|
|
15
|
-
/** Factories that already have the Inertia tags registered. */
|
|
16
|
-
const registered = /* @__PURE__ */ new WeakSet();
|
|
17
|
-
/**
|
|
18
|
-
* Build an Edge tag compiler that outputs a template data variable raw (falling
|
|
19
|
-
* back to an empty string when it is absent).
|
|
20
|
-
*
|
|
21
|
-
* @param name
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
const outputVariable = (name) => {
|
|
25
|
-
return (parser, buffer, token) => {
|
|
26
|
-
const ast = parser.utils.transformAst(parser.utils.generateAST(`${name} || ""`, token.loc, token.filename), token.filename, parser);
|
|
27
|
-
buffer.outputExpression(parser.utils.stringify(ast), token.filename, token.loc.start.line, false);
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Register the `@inertia` and `@inertiaHead` Edge tags on a view factory.
|
|
32
|
-
*
|
|
33
|
-
* - `@inertia` renders the root mount element (`<div data-page="…">`), or the
|
|
34
|
-
* server-rendered markup when SSR is enabled.
|
|
35
|
-
* - `@inertiaHead` renders the SSR head tags (empty without SSR).
|
|
36
|
-
*
|
|
37
|
-
* Both read the values the adapter passes to the root template, so they replace
|
|
38
|
-
* the equivalent `{{{ inertia }}}` / `{{{ inertiaHead }}}` interpolations.
|
|
39
|
-
* Idempotent per factory.
|
|
40
|
-
*
|
|
41
|
-
* @param factory
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
const registerInertiaTags = (factory) => {
|
|
45
|
-
if (registered.has(factory)) return;
|
|
46
|
-
registered.add(factory);
|
|
47
|
-
factory.tag("inertia", false, false, outputVariable("inertia"));
|
|
48
|
-
factory.tag("inertiaHead", false, false, outputVariable("inertiaHead"));
|
|
49
|
-
};
|
|
50
|
-
//#endregion
|
|
51
|
-
export { tags_exports as n, registerInertiaTags as t };
|
|
File without changes
|