@absolutejs/absolute 0.20.0-beta.180 → 0.20.0-beta.182

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.
Files changed (129) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/changelog.json +70 -0
  3. package/dist/angular/browser.js +2 -2
  4. package/dist/angular/browser.js.map +4 -4
  5. package/dist/angular/components/constants.js +4 -0
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  7. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  8. package/dist/angular/index.js +349 -48
  9. package/dist/angular/index.js.map +11 -11
  10. package/dist/angular/server.js +349 -48
  11. package/dist/angular/server.js.map +11 -11
  12. package/dist/build.js +605 -114
  13. package/dist/build.js.map +20 -20
  14. package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
  15. package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
  16. package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
  17. package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
  18. package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
  19. package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
  20. package/dist/cli/{build-fntmf42w.js → build-p3qra1nj.js} +65 -7
  21. package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
  22. package/dist/cli/{buildReactServerComponents-fq6mw10d.js → buildReactServerComponents-vc9hh2rd.js} +5 -5
  23. package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
  24. package/dist/cli/config/server.js +18 -17
  25. package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
  26. package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
  27. package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
  28. package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
  29. package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
  30. package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
  31. package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
  32. package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
  33. package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
  34. package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
  35. package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
  36. package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
  37. package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
  38. package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
  39. package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
  40. package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
  41. package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
  42. package/dist/cli/{index-w79snsxv.js → index-7zwzyymv.js} +2 -2
  43. package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
  44. package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
  45. package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
  46. package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
  47. package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
  48. package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
  49. package/dist/cli/{index-xf9sfr8a.js → index-fgqh48qr.js} +63 -1
  50. package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
  51. package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
  52. package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
  53. package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
  54. package/dist/cli/{index-x1vvn549.js → index-mmm6d3k5.js} +3 -3
  55. package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
  56. package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
  57. package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
  58. package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
  59. package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
  60. package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
  61. package/dist/cli/index.js +32 -32
  62. package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
  63. package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
  64. package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
  65. package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
  66. package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
  67. package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
  68. package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
  69. package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
  70. package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
  71. package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
  72. package/dist/cli/prerender-26pzynh4.js +13 -0
  73. package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
  74. package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
  75. package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
  76. package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
  77. package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
  78. package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
  79. package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
  80. package/dist/cli/{staticAnalyzeSpaRoutes-2nev05m1.js → staticAnalyzeSpaRoutes-rcc1d3az.js} +3 -1
  81. package/dist/cli/{typecheck-488txsfc.js → typecheck-yjme4fv1.js} +71 -35
  82. package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
  83. package/dist/index.js +620 -126
  84. package/dist/index.js.map +22 -22
  85. package/dist/islands/index.js +312 -23
  86. package/dist/islands/index.js.map +5 -5
  87. package/dist/mobile/index.js +2 -2
  88. package/dist/mobile/index.js.map +3 -3
  89. package/dist/react/browser.js +18 -1
  90. package/dist/react/browser.js.map +6 -4
  91. package/dist/react/components/index.js +2 -2
  92. package/dist/react/components/index.js.map +3 -3
  93. package/dist/react/index.js +366 -61
  94. package/dist/react/index.js.map +14 -13
  95. package/dist/react/server.js +47 -35
  96. package/dist/react/server.js.map +10 -10
  97. package/dist/src/angular/components/constants.d.ts +1 -0
  98. package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
  99. package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +9 -0
  100. package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
  101. package/dist/src/cli/scripts/typecheck.d.ts +7 -0
  102. package/dist/src/constants.d.ts +1 -0
  103. package/dist/src/core/prerender.d.ts +10 -0
  104. package/dist/src/dev/spaRouteRefresh.d.ts +12 -5
  105. package/dist/src/react/browser.d.ts +1 -0
  106. package/dist/src/react/index.d.ts +1 -0
  107. package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
  108. package/dist/src/utils/pageCspNonce.d.ts +14 -0
  109. package/dist/src/utils/spaRouteManifest.d.ts +2 -0
  110. package/dist/svelte/components/Image.svelte +1 -1
  111. package/dist/svelte/components/Island.svelte +1 -1
  112. package/dist/svelte/index.js +368 -68
  113. package/dist/svelte/index.js.map +11 -11
  114. package/dist/svelte/router/Router.svelte.d.ts +31 -1
  115. package/dist/svelte/server.js +359 -59
  116. package/dist/svelte/server.js.map +11 -11
  117. package/dist/types/manifest.d.ts +3 -2
  118. package/dist/types/svelte.d.ts +3 -0
  119. package/dist/vue/components/Image.js +2 -2
  120. package/dist/vue/components/Image.js.map +3 -3
  121. package/dist/vue/components/index.js +2 -2
  122. package/dist/vue/components/index.js.map +3 -3
  123. package/dist/vue/index.js +360 -60
  124. package/dist/vue/index.js.map +11 -11
  125. package/dist/vue/server.js +50 -39
  126. package/dist/vue/server.js.map +9 -9
  127. package/package.json +4 -1
  128. package/dist/cli/prerender-w65xp6h8.js +0 -11
  129. /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
@@ -30,6 +30,7 @@ export declare const CONFIG_DEFAULT_PORT = 4099;
30
30
  export declare const HMR_UPDATE_TIMEOUT_MS = 2000;
31
31
  export declare const HOOK_SIGNATURE_LENGTH = 12;
32
32
  export declare const EXCLUDE_LAST_OFFSET = -1;
33
+ export declare const HTML_CONTENT_TYPE = "text/html; charset=utf-8";
33
34
  export declare const HTTP_STATUS_OK = 200;
34
35
  export declare const HTTP_STATUS_BAD_REQUEST = 400;
35
36
  export declare const HTTP_STATUS_NOT_FOUND = 404;
@@ -1,5 +1,10 @@
1
1
  export type AngularDeferSlotPayload = {
2
2
  data?: Record<string, string>;
3
+ /** Size-accounting only: the streaming pipeline measures it for
4
+ * `maxSlotHtmlSizeBytes` and slot metrics. Never insert it into the DOM;
5
+ * the slot renders from `data` through Angular's own escaping, and the
6
+ * stream-swap runtime deliberately skips `angular-defer` payloads.
7
+ * Interpolated values in it are HTML-escaped at build time. */
3
8
  html: string;
4
9
  kind: 'angular-defer';
5
10
  state?: 'error' | 'resolved';
@@ -4,6 +4,15 @@ export declare const analyzeAngularSpaRouteFile: (filePath: string) => Promise<{
4
4
  routes: SpaRoute[];
5
5
  sourceFile: string;
6
6
  } | null>;
7
+ /** Read a page's colocated `export const routes = [...]` — the routes the
8
+ * build wires into `provideRouter` itself (see scanAngularPageRoutes).
9
+ * Their mount path comes from the Elysia route at request time, so the
10
+ * host's `baseHref` is `/` and the paths stay relative; dev uses these
11
+ * only to report route edits, never for the 404 table. */
12
+ export declare const analyzeAngularColocatedRouteFile: (filePath: string) => Promise<SpaHost | null>;
13
+ /** Every colocated-routes page under `angularDirectory` that is not
14
+ * already an `APP_BASE_HREF` + `provideRouter` host. */
15
+ export declare const analyzeAngularColocatedRoutes: (angularDirectory: string) => Promise<SpaHost[]>;
7
16
  /** Statically scan an Angular page-source directory for SPA hosts —
8
17
  * files that both import `APP_BASE_HREF`/`provideRouter` and declare
9
18
  * an `APP_BASE_HREF` provider plus a literal `Routes` array. Returns
@@ -0,0 +1,9 @@
1
+ type TsconfigLists = {
2
+ exclude?: unknown;
3
+ files?: unknown;
4
+ include?: unknown;
5
+ };
6
+ /** The note, or null when tsconfig.json (its `include`, `files` and
7
+ * `exclude`) already lists the declaration. */
8
+ export declare const manifestKeysEditorHint: (config: TsconfigLists) => string | null;
9
+ export {};
@@ -16,10 +16,17 @@ export declare const svelteShimSource: (fileNames: readonly string[]) => string;
16
16
  * folder inside another one folded into it so no two mirrors overlap.
17
17
  * Relative to the project root. */
18
18
  export declare const svelteRoots: (projectRoot: string, svelteDirs: readonly string[], svelteFiles: readonly string[]) => string[];
19
+ /** What svelte-check's program includes for each Svelte root: a configured
20
+ * svelteDirectory whole, as it always was, and only the `.svelte` files of
21
+ * a root outside one (an island folder), whose `.ts` files (the registry)
22
+ * belong to the plain checker and would otherwise be reported twice.
23
+ * Relative to the generated config in the cache directory. */
24
+ export declare const svelteCheckIncludes: (projectRoot: string, configuredDirs: readonly string[], roots: readonly string[]) => string[];
19
25
  /** Every service's server entry, deduplicated, keeping only the ones that are
20
26
  * actually on disk — `absolute typecheck` also runs in plain TypeScript
21
27
  * libraries, which have no server entry at all. */
22
28
  export declare const serverEntryPaths: (targets: readonly AbsoluteServiceConfig[]) => string[];
29
+ export declare const dedupeAngularResult: (results: CheckerResult[], cacheDir: string) => CheckerResult[];
23
30
  export declare const dedupeVueResult: (results: CheckerResult[]) => CheckerResult[];
24
31
  export declare const typecheck: (configPath?: string) => Promise<void>;
25
32
  export {};
@@ -30,6 +30,7 @@ export declare const CONFIG_DEFAULT_PORT = 4099;
30
30
  export declare const HMR_UPDATE_TIMEOUT_MS = 2000;
31
31
  export declare const HOOK_SIGNATURE_LENGTH = 12;
32
32
  export declare const EXCLUDE_LAST_OFFSET = -1;
33
+ export declare const HTML_CONTENT_TYPE = "text/html; charset=utf-8";
33
34
  export declare const HTTP_STATUS_OK = 200;
34
35
  export declare const HTTP_STATUS_BAD_REQUEST = 400;
35
36
  export declare const HTTP_STATUS_NOT_FOUND = 404;
@@ -1,9 +1,16 @@
1
1
  import type { StaticConfig } from '../../types/build';
2
+ export type PrerenderFailure = {
3
+ /** Why the route couldn't be pre-rendered */
4
+ reason: string;
5
+ route: string;
6
+ };
2
7
  export type PrerenderResult = {
3
8
  /** Map of route path → rendered HTML file path on disk */
4
9
  routes: Map<string, string>;
5
10
  /** Directory where pre-rendered files are stored */
6
11
  dir: string;
12
+ /** Routes that couldn't be pre-rendered; they render per request */
13
+ failures: PrerenderFailure[];
7
14
  };
8
15
  type LogFn = (message: string) => void;
9
16
  /** Header used to bypass the prerender cache during ISR re-renders */
@@ -17,6 +24,9 @@ export declare const readTimestamp: (htmlPath: string) => number;
17
24
  * with the bypass header so it hits SSR instead of the cache.
18
25
  */
19
26
  export declare const rerenderRoute: (route: string, port: number, prerenderDir: string) => Promise<boolean>;
27
+ /** The line `absolute start` and `absolute compile` print, once, for a
28
+ * route that couldn't be pre-rendered. */
29
+ export declare const formatPrerenderFailure: ({ reason, route }: PrerenderFailure) => string;
20
30
  /**
21
31
  * Pre-render routes by fetching them from a running server and saving the HTML to disk.
22
32
  *
@@ -1,13 +1,20 @@
1
1
  import type { ResolvedBuildPaths } from './configResolver';
2
- type SpaFramework = 'angular' | 'react' | 'svelte' | 'vue';
3
- type SpaRouteChange = {
2
+ export type SpaFramework = 'angular' | 'react' | 'svelte' | 'vue';
3
+ export type SpaRouteChange = {
4
4
  added: string[];
5
5
  file: string;
6
6
  framework: SpaFramework;
7
7
  removed: string[];
8
8
  };
9
+ /** Re-analyze `files` without touching the route table. `changes` lists
10
+ * each file whose routes differ from the table; `publish(frameworks?)`
11
+ * writes those changes (all of them, or only the given frameworks') into
12
+ * the table and logs them. Publishing a framework twice is a no-op. */
13
+ export declare const readSpaRouteChanges: (files: string[], paths: ResolvedBuildPaths) => Promise<{
14
+ changes: SpaRouteChange[];
15
+ publish: (frameworks?: SpaFramework[]) => Promise<void>;
16
+ }>;
9
17
  /** Re-analyze `files` and patch the in-memory SPA route table (plus the
10
- * build's `spa-routes.json`). Returns one entry per file whose routes
11
- * changed; each is logged as a `routes update` line. */
18
+ * build's `spa-routes.json`) at once. Returns one entry per file whose
19
+ * routes changed; each is logged as a `routes update` line. */
12
20
  export declare const refreshSpaRoutesForFiles: (files: string[], paths: ResolvedBuildPaths) => Promise<SpaRouteChange[]>;
13
- export {};
@@ -1,3 +1,4 @@
1
1
  export { Island } from './Island.browser';
2
2
  export { createTypedIsland } from './createIsland.browser';
3
3
  export { useIslandStore } from './hooks/useIslandStore';
4
+ export { getCspNonce } from '../utils/pageCspNonce';
@@ -4,3 +4,4 @@ export { handleReactServerPageRequest } from './serverComponents/pageHandler';
4
4
  export { Island } from './Island';
5
5
  export { createTypedIsland } from './createIsland';
6
6
  export { useIslandStore } from './hooks/useIslandStore';
7
+ export { getCspNonce } from '../utils/pageCspNonce';
@@ -1,4 +1,27 @@
1
1
  export declare const AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->";
2
+ export declare const AWAIT_SCOPE_CLASS_PLACEHOLDER = "__absoluteAwaitScopeClass__";
3
+ export declare const AWAIT_HTML_HELPERS_SOURCE: string;
4
+ /** Puts `scopeClass` (or nothing, for a component without a `<style>`)
5
+ * where the lowering left the scoped-CSS class placeholder. */
6
+ export declare const applyAwaitScopeClass: (code: string, scopeClass: string) => string;
7
+ /** A `cssHash` compile option that hashes exactly as Svelte's default does
8
+ * (svelte/src/compiler/validate-options.js) and remembers the class, plus
9
+ * `apply`, which writes that class into the compiled code of a lowered
10
+ * component. Svelte only calls `cssHash` for a component with a `<style>`,
11
+ * so without one the placeholder becomes an empty string. One capture per
12
+ * `compile` call. */
13
+ export declare const createAwaitScopeClassCapture: () => {
14
+ apply: (code: string) => string;
15
+ cssHash: (args: {
16
+ name: string;
17
+ filename: string;
18
+ css: string;
19
+ hash: (input: string) => string;
20
+ }) => string;
21
+ };
22
+ /** Turns a branch's markup into a JS template literal that renders it,
23
+ * escaping every expression as Svelte's SSR would. */
24
+ export declare const branchMarkupToTemplateLiteral: (markup: string, branch?: string, filePath?: string) => string;
2
25
  /** Lowers every `{#await}` marked with `AWAIT_STREAM_DIRECTIVE` to a
3
26
  * streaming slot and leaves every other block to Svelte. Throws for a
4
27
  * marked block it can't stream. */
@@ -0,0 +1,14 @@
1
+ /** This page's Content-Security-Policy nonce, for the inline `<script>` and
2
+ * `<style>` tags a page component writes itself:
3
+ *
4
+ * ```tsx
5
+ * <script nonce={getCspNonce()} dangerouslySetInnerHTML={{ __html: code }} />
6
+ * ```
7
+ *
8
+ * Safe in code that also runs in the browser. During SSR it is the
9
+ * request's nonce (the one in the policy header); in the browser it is the
10
+ * same value, read back from the page's own scripts, so the component
11
+ * renders the same nonce on both sides. Undefined without
12
+ * `secureHeaders()`. In a route handler, `cspNonce` in the context is the
13
+ * same value. */
14
+ export declare const getCspNonce: () => string | undefined;
@@ -5,5 +5,7 @@ export type RuntimeSpaHost = SpaHost & {
5
5
  };
6
6
  export declare const setSpaRouteManifest: (hosts: RuntimeSpaHost[]) => void;
7
7
  export declare const getSpaRouteManifest: () => RuntimeSpaHost[];
8
+ export declare const getObservedSpaRoutes: () => RuntimeSpaHost[];
9
+ export declare const setObservedSpaRoutes: (hosts: RuntimeSpaHost[]) => void;
8
10
  export declare const isKnownSpaRoute: (framework: keyof ConventionsMap, pageName: string, request: Request | undefined) => boolean;
9
11
  export declare const renderSpaNotFound: (framework: keyof ConventionsMap, pageName: string, request: Request | undefined) => Promise<Response | null>;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { ImageProps } from '@absolutejs/absolute/image';
2
+ import type { ImageProps } from '../../../types/image';
3
3
  import {
4
4
  DEFAULT_QUALITY,
5
5
  buildOptimizedUrl,
@@ -29,7 +29,7 @@
29
29
  .replaceAll('>', '&gt;');
30
30
 
31
31
  const buildFallbackMarkup = (runtimeProps: RuntimeIslandRenderProps) => {
32
- const attributes = [
32
+ const attributes: [string, string][] = [
33
33
  ['data-component', runtimeProps.component],
34
34
  ['data-framework', runtimeProps.framework],
35
35
  ['data-hydrate', runtimeProps.hydrate ?? 'load'],