@absolutejs/absolute 0.19.0-beta.954 → 0.19.0-beta.956

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.
@@ -4,6 +4,11 @@ export type SitemapRouteOverride = {
4
4
  priority?: number;
5
5
  lastmod?: string;
6
6
  };
7
+ /** Per-route sitemap metadata, accepted as an optional `sitemap` field
8
+ * on every framework page-handler input (`handleAngularPageRequest`,
9
+ * `handleReactPageRequest`, etc.). Statically read off the handler
10
+ * source at registration time. */
11
+ export type PageHandlerSitemapMetadata = SitemapRouteOverride;
7
12
  export type SitemapConfig = {
8
13
  baseUrl?: string;
9
14
  exclude?: (string | RegExp)[];
package/dist/vue/index.js CHANGED
@@ -102,6 +102,7 @@ var exports_devRouteRegistrationCallsite = {};
102
102
  __export(exports_devRouteRegistrationCallsite, {
103
103
  patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
104
104
  isPageHandler: () => isPageHandler,
105
+ getOriginalPageHandlerSource: () => getOriginalPageHandlerSource,
105
106
  getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
106
107
  });
107
108
  import { AsyncLocalStorage } from "async_hooks";
@@ -116,6 +117,12 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
116
117
  if (pageHandlerWrappers.has(fn))
117
118
  return true;
118
119
  return handlerSourceMentionsPageHelper(fn);
120
+ }, getOriginalPageHandlerSource = (handler) => {
121
+ if (typeof handler !== "function")
122
+ return;
123
+ const fn = handler;
124
+ const info = pageHandlerWrappers.get(fn);
125
+ return (info?.originalHandler ?? fn).toString();
119
126
  }, isObjectRecord4 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord4(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
120
127
  const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
121
128
  if (value === null || typeof value === "undefined") {
@@ -153,7 +160,9 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
153
160
  const callsite = captureRouteRegistrationCallsite();
154
161
  const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
155
162
  if (methodName === "get" && typeof handler === "function" && typeof wrapped === "function" && handlerSourceMentionsPageHelper(handler)) {
156
- pageHandlerWrappers.add(wrapped);
163
+ pageHandlerWrappers.set(wrapped, {
164
+ originalHandler: handler
165
+ });
157
166
  }
158
167
  return Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);
159
168
  }, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
@@ -191,7 +200,7 @@ var init_devRouteRegistrationCallsite = __esm(() => {
191
200
  "handleHTMLPageRequest",
192
201
  "handleHTMXPageRequest"
193
202
  ];
194
- pageHandlerWrappers = new WeakSet;
203
+ pageHandlerWrappers = new WeakMap;
195
204
  });
196
205
 
197
206
  // src/client/streamSwap.ts
@@ -4657,5 +4666,5 @@ export {
4657
4666
  Image
4658
4667
  };
4659
4668
 
4660
- //# debugId=B3625EDB2664480764756E2164756E21
4669
+ //# debugId=A276D0D95D86FAE564756E2164756E21
4661
4670
  //# sourceMappingURL=index.js.map