@absolutejs/absolute 0.19.0-beta.966 → 0.19.0-beta.967
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/angular/browser.js +24 -20
- package/dist/angular/browser.js.map +5 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +59 -84
- package/dist/angular/index.js.map +8 -7
- package/dist/angular/server.js +42 -71
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +38 -66
- package/dist/build.js.map +4 -4
- package/dist/client/index.js +17 -43
- package/dist/client/index.js.map +4 -5
- package/dist/index.js +45 -73
- package/dist/index.js.map +6 -6
- package/dist/islands/index.js +17 -43
- package/dist/islands/index.js.map +4 -5
- package/dist/react/index.js +18 -36
- package/dist/react/index.js.map +3 -3
- package/dist/react/server.js +2 -2
- package/dist/react/server.js.map +2 -2
- package/dist/src/angular/browser.d.ts +1 -2
- package/dist/src/angular/composables/index.d.ts +1 -0
- package/dist/src/angular/composables/usePageContext.d.ts +16 -0
- package/dist/src/angular/index.d.ts +1 -2
- package/dist/src/angular/pageHandler.d.ts +9 -12
- package/dist/src/angular/server.d.ts +0 -1
- package/dist/src/angular/ssrRender.d.ts +2 -6
- package/dist/svelte/index.js +18 -36
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +2 -2
- package/dist/svelte/server.js.map +2 -2
- package/dist/types/angular.d.ts +4 -46
- package/dist/types/ember.d.ts +1 -3
- package/dist/vue/index.js +18 -36
- package/dist/vue/index.js.map +3 -3
- package/dist/vue/server.js +2 -2
- package/dist/vue/server.js.map +2 -2
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -279,7 +279,7 @@ var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-
|
|
|
279
279
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
280
280
|
}
|
|
281
281
|
return normalizeSlug(str).split(/[-_]/).filter(Boolean).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()).join("");
|
|
282
|
-
}
|
|
282
|
+
};
|
|
283
283
|
|
|
284
284
|
// src/build/generateManifest.ts
|
|
285
285
|
var exports_generateManifest = {};
|
|
@@ -2164,37 +2164,19 @@ var buildRequestProviders = (deps, request, requestContext, responseInit) => [
|
|
|
2164
2164
|
];
|
|
2165
2165
|
|
|
2166
2166
|
// src/angular/ssrRender.ts
|
|
2167
|
-
var
|
|
2167
|
+
var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
2168
2168
|
const cacheKey = pagePath.split("?")[0] ?? pagePath;
|
|
2169
|
-
|
|
2170
|
-
}, getCachedRouteData = (pagePath) =>
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
{ provide: deps.Sanitizer, useValue: sanitizer },
|
|
2181
|
-
...buildRequestProviders(deps, request, requestContext, responseInit),
|
|
2182
|
-
...userProviders
|
|
2183
|
-
];
|
|
2184
|
-
if (!maybeProps) {
|
|
2185
|
-
return providers;
|
|
2186
|
-
}
|
|
2187
|
-
const propProviders = Object.entries(maybeProps).map(([propName, propValue]) => ({
|
|
2188
|
-
token: tokenMap.get(toScreamingSnake(propName)),
|
|
2189
|
-
value: propValue
|
|
2190
|
-
})).filter((entry) => entry.token).map((entry) => ({ provide: entry.token, useValue: entry.value }));
|
|
2191
|
-
return [...providers, ...propProviders];
|
|
2192
|
-
}, isInjectionToken = (value) => {
|
|
2193
|
-
if (!value || typeof value !== "object") {
|
|
2194
|
-
return false;
|
|
2195
|
-
}
|
|
2196
|
-
return "ngMetadataName" in value && value.ngMetadataName === "InjectionToken";
|
|
2197
|
-
}, discoverTokens = (pageModule) => new Map(Object.entries(pageModule).filter(([, value]) => isInjectionToken(value))), resolveSelector = (deps, pagePath, PageComponent) => {
|
|
2169
|
+
routeContextCache.set(cacheKey, data);
|
|
2170
|
+
}, getCachedRouteData = (pagePath) => routeContextCache.get(pagePath), selectorCache, buildProviders = (deps, sanitizer, request, requestContext, responseInit, userProviders = []) => [
|
|
2171
|
+
deps.provideServerRendering(),
|
|
2172
|
+
deps.provideClientHydration(deps.withHttpTransferCacheOptions(buildAbsoluteHttpTransferCacheOptions())),
|
|
2173
|
+
deps.provideZonelessChangeDetection(),
|
|
2174
|
+
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
2175
|
+
{ provide: deps.DomSanitizer, useValue: sanitizer },
|
|
2176
|
+
{ provide: deps.Sanitizer, useValue: sanitizer },
|
|
2177
|
+
...buildRequestProviders(deps, request, requestContext, responseInit),
|
|
2178
|
+
...userProviders
|
|
2179
|
+
], resolveSelector = (deps, pagePath, PageComponent) => {
|
|
2198
2180
|
const cached = selectorCache.get(pagePath);
|
|
2199
2181
|
if (cached) {
|
|
2200
2182
|
return cached;
|
|
@@ -2210,14 +2192,14 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
|
2210
2192
|
return html.replace("</html>", `${snippet}</html>`);
|
|
2211
2193
|
}
|
|
2212
2194
|
return html + snippet;
|
|
2213
|
-
}, injectSsrScripts = (html, requestId, indexPath,
|
|
2195
|
+
}, injectSsrScripts = (html, requestId, indexPath, requestContext) => {
|
|
2214
2196
|
let result = html;
|
|
2215
2197
|
const registeredScripts = getAndClearClientScripts(requestId);
|
|
2216
2198
|
if (registeredScripts.length > 0) {
|
|
2217
2199
|
result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
|
|
2218
2200
|
}
|
|
2219
|
-
if (
|
|
2220
|
-
result = injectBeforeClose(result, `<script>window.
|
|
2201
|
+
if (requestContext !== undefined) {
|
|
2202
|
+
result = injectBeforeClose(result, `<script>window.__ABS_ANGULAR_REQUEST_CONTEXT__ = ${JSON.stringify(requestContext)};</script>`);
|
|
2221
2203
|
}
|
|
2222
2204
|
if (indexPath) {
|
|
2223
2205
|
const escapedIndexPath = JSON.stringify(indexPath);
|
|
@@ -2247,7 +2229,7 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
|
2247
2229
|
};
|
|
2248
2230
|
var init_ssrRender = __esm(() => {
|
|
2249
2231
|
init_registerClientScript();
|
|
2250
|
-
|
|
2232
|
+
routeContextCache = new Map;
|
|
2251
2233
|
selectorCache = new Map;
|
|
2252
2234
|
});
|
|
2253
2235
|
|
|
@@ -14407,26 +14389,21 @@ import '@angular/compiler';
|
|
|
14407
14389
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
14408
14390
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
14409
14391
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
14410
|
-
import { provideZonelessChangeDetection } from '@angular/core';
|
|
14392
|
+
import { provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
14411
14393
|
import * as pageModule from '${normalizedImportPath}';
|
|
14412
14394
|
|
|
14413
14395
|
var ${componentClassName} = pageModule.default;
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14396
|
+
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
14397
|
+
// \`inject(REQUEST_CONTEXT)\` (or \`usePageContext<T>()\`) returns the same
|
|
14398
|
+
// object the server rendered with \u2014 no second round-trip, no transferState
|
|
14399
|
+
// dance for callers.
|
|
14400
|
+
var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR_REQUEST_CONTEXT__')
|
|
14401
|
+
? window.__ABS_ANGULAR_REQUEST_CONTEXT__
|
|
14402
|
+
: null;
|
|
14421
14403
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
14422
14404
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
14423
14405
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
14424
|
-
var
|
|
14425
|
-
var propName = entry[0];
|
|
14426
|
-
var propValue = entry[1];
|
|
14427
|
-
var token = pageModule[toScreamingSnake(propName)];
|
|
14428
|
-
return isInjectionToken(token) ? { provide: token, useValue: propValue } : null;
|
|
14429
|
-
}).filter(Boolean);
|
|
14406
|
+
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
14430
14407
|
// Page-level providers, opt-in via \`export const providers = [...]\` in the
|
|
14431
14408
|
// page module. Required so DI tokens that the component (or any service it
|
|
14432
14409
|
// injects) needs are available client-side too \u2014 without these, services
|
|
@@ -14479,7 +14456,7 @@ if (!window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
|
14479
14456
|
}
|
|
14480
14457
|
delete window.__HMR_SKIP_HYDRATION__;
|
|
14481
14458
|
providers.push.apply(providers, pageProviders);
|
|
14482
|
-
providers.push.apply(providers,
|
|
14459
|
+
providers.push.apply(providers, contextProviders);
|
|
14483
14460
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
14484
14461
|
|
|
14485
14462
|
if (pageHasRawStreamingSlots) {
|
|
@@ -14507,26 +14484,21 @@ import '@angular/compiler';
|
|
|
14507
14484
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
14508
14485
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
14509
14486
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
14510
|
-
import { enableProdMode, provideZonelessChangeDetection } from '@angular/core';
|
|
14487
|
+
import { enableProdMode, provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
14511
14488
|
import * as pageModule from '${normalizedImportPath}';
|
|
14512
14489
|
|
|
14513
14490
|
var ${componentClassName} = pageModule.default;
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14491
|
+
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
14492
|
+
// \`inject(REQUEST_CONTEXT)\` (or \`usePageContext<T>()\`) returns the same
|
|
14493
|
+
// object the server rendered with \u2014 no second round-trip, no transferState
|
|
14494
|
+
// dance for callers.
|
|
14495
|
+
var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR_REQUEST_CONTEXT__')
|
|
14496
|
+
? window.__ABS_ANGULAR_REQUEST_CONTEXT__
|
|
14497
|
+
: null;
|
|
14521
14498
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
14522
14499
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
14523
14500
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
14524
|
-
var
|
|
14525
|
-
var propName = entry[0];
|
|
14526
|
-
var propValue = entry[1];
|
|
14527
|
-
var token = pageModule[toScreamingSnake(propName)];
|
|
14528
|
-
return isInjectionToken(token) ? { provide: token, useValue: propValue } : null;
|
|
14529
|
-
}).filter(Boolean);
|
|
14501
|
+
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
14530
14502
|
// Page-level providers, opt-in via \`export const providers = [...]\` in the
|
|
14531
14503
|
// page module. Required so DI tokens that the component (or any service it
|
|
14532
14504
|
// injects) needs are available client-side too \u2014 without these, services
|
|
@@ -14543,7 +14515,7 @@ var absoluteHttpTransferCacheOptions = {
|
|
|
14543
14515
|
|
|
14544
14516
|
enableProdMode();
|
|
14545
14517
|
|
|
14546
|
-
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(
|
|
14518
|
+
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
|
|
14547
14519
|
if (!pageHasIslands) {
|
|
14548
14520
|
providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
14549
14521
|
}
|
|
@@ -26318,5 +26290,5 @@ export {
|
|
|
26318
26290
|
build
|
|
26319
26291
|
};
|
|
26320
26292
|
|
|
26321
|
-
//# debugId=
|
|
26293
|
+
//# debugId=1AAA1EDC87C015C264756E2164756E21
|
|
26322
26294
|
//# sourceMappingURL=build.js.map
|