@absolutejs/absolute 0.20.0-beta.54 → 0.20.0-beta.55
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/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +25 -4
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +25 -4
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +56 -9
- package/dist/build.js.map +10 -9
- package/dist/cli/config/server.js +4 -1
- package/dist/client/index.js +126 -7
- package/dist/client/index.js.map +8 -6
- package/dist/index.js +279 -232
- package/dist/index.js.map +12 -11
- package/dist/islands/index.js +17 -2
- package/dist/islands/index.js.map +5 -4
- package/dist/react/index.js +19 -3
- package/dist/react/index.js.map +6 -5
- package/dist/react/server.js +17 -2
- package/dist/react/server.js.map +5 -4
- package/dist/src/client/browserTranslation.d.ts +19 -0
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/core/browserTranslation.d.ts +6 -0
- package/dist/src/ember/browser.d.ts +0 -16
- package/dist/src/vue/browser.d.ts +1 -0
- package/dist/src/vue/browserTranslation.d.ts +5 -0
- package/dist/src/vue/index.d.ts +1 -0
- package/dist/svelte/index.js +19 -3
- package/dist/svelte/index.js.map +6 -5
- package/dist/svelte/server.js +17 -2
- package/dist/svelte/server.js.map +5 -4
- package/dist/vue/browser.js +96 -1
- package/dist/vue/browser.js.map +5 -3
- package/dist/vue/index.js +114 -3
- package/dist/vue/index.js.map +8 -5
- package/dist/vue/server.js +17 -2
- package/dist/vue/server.js.map +5 -4
- package/package.json +7 -7
package/dist/angular/server.js
CHANGED
|
@@ -867,6 +867,20 @@ var requireCurrentIslandRegistry = () => {
|
|
|
867
867
|
globalThis.__absoluteIslandRegistry = registry;
|
|
868
868
|
};
|
|
869
869
|
|
|
870
|
+
// src/core/browserTranslation.ts
|
|
871
|
+
var BASELINE_MARKER = "__ABSOLUTE_SSR_TEXT_BASELINES__", BROWSER_TRANSLATION_BASELINE_SCRIPT, browserTranslationBaselineTag = () => `<script>${BROWSER_TRANSLATION_BASELINE_SCRIPT}</script>`, injectBrowserTranslationBaseline = (html) => {
|
|
872
|
+
if (html.includes(BASELINE_MARKER))
|
|
873
|
+
return html;
|
|
874
|
+
const script = browserTranslationBaselineTag();
|
|
875
|
+
const closingBodyIndex = html.lastIndexOf("</body>");
|
|
876
|
+
if (closingBodyIndex < 0)
|
|
877
|
+
return `${html}${script}`;
|
|
878
|
+
return `${html.slice(0, closingBodyIndex)}${script}${html.slice(closingBodyIndex)}`;
|
|
879
|
+
};
|
|
880
|
+
var init_browserTranslation = __esm(() => {
|
|
881
|
+
BROWSER_TRANSLATION_BASELINE_SCRIPT = "window.__ABSOLUTE_SSR_TEXT_BASELINES__=new WeakMap();" + "{const r=document.body,b=window.__ABSOLUTE_SSR_TEXT_BASELINES__;" + 'if(r)for(const e of [r,...r.querySelectorAll("*")]){' + "const t=new Map();for(const [i,n]of[...e.childNodes].entries())" + 'if(n.nodeType===3)t.set(i,n.nodeValue??"");if(t.size)b.set(e,t);}}';
|
|
882
|
+
});
|
|
883
|
+
|
|
870
884
|
// src/angular/requestProviders.ts
|
|
871
885
|
var buildRequestProviders = (deps, request, requestContext, responseInit) => [
|
|
872
886
|
{ provide: deps.REQUEST, useValue: request ?? null },
|
|
@@ -904,7 +918,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
904
918
|
}
|
|
905
919
|
return html + snippet;
|
|
906
920
|
}, injectSsrScripts = (html, requestId, indexPath, requestContext) => {
|
|
907
|
-
let result = html;
|
|
921
|
+
let result = injectBeforeClose(html, browserTranslationBaselineTag());
|
|
908
922
|
const registeredScripts = getAndClearClientScripts(requestId);
|
|
909
923
|
if (registeredScripts.length > 0) {
|
|
910
924
|
result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
|
|
@@ -940,6 +954,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
940
954
|
};
|
|
941
955
|
var init_ssrRender = __esm(() => {
|
|
942
956
|
init_registerClientScript();
|
|
957
|
+
init_browserTranslation();
|
|
943
958
|
routeContextCache = new Map;
|
|
944
959
|
selectorCache = new Map;
|
|
945
960
|
});
|
|
@@ -5671,6 +5686,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
|
|
5671
5686
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
5672
5687
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
5673
5688
|
import { provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
5689
|
+
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
5674
5690
|
import * as pageModule from '${normalizedImportPath}';
|
|
5675
5691
|
var ${componentClassName} = pageModule.default;
|
|
5676
5692
|
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
@@ -5734,8 +5750,10 @@ if (!document.querySelector(_sel)) {
|
|
|
5734
5750
|
}
|
|
5735
5751
|
|
|
5736
5752
|
var providers = [provideZonelessChangeDetection()];
|
|
5753
|
+
var restoreTranslation = function() {};
|
|
5737
5754
|
if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
5738
5755
|
providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
5756
|
+
restoreTranslation = prepareBrowserTranslationHydration(document.querySelector(_sel));
|
|
5739
5757
|
}
|
|
5740
5758
|
delete window.__HMR_SKIP_HYDRATION__;
|
|
5741
5759
|
providers.push.apply(providers, pageProviders);
|
|
@@ -5762,7 +5780,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
5762
5780
|
});
|
|
5763
5781
|
}
|
|
5764
5782
|
return appRef;
|
|
5765
|
-
});
|
|
5783
|
+
}).finally(restoreTranslation);
|
|
5766
5784
|
}
|
|
5767
5785
|
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
5768
5786
|
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
@@ -5778,6 +5796,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
|
|
5778
5796
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
5779
5797
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
5780
5798
|
import { enableProdMode, provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
5799
|
+
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
5781
5800
|
import * as pageModule from '${normalizedImportPath}';
|
|
5782
5801
|
var ${componentClassName} = pageModule.default;
|
|
5783
5802
|
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
@@ -5820,8 +5839,10 @@ if (!document.querySelector(_sel)) {
|
|
|
5820
5839
|
}
|
|
5821
5840
|
|
|
5822
5841
|
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
|
|
5842
|
+
var restoreTranslation = function() {};
|
|
5823
5843
|
if (!isClientRender && !pageHasIslands) {
|
|
5824
5844
|
providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
5845
|
+
restoreTranslation = prepareBrowserTranslationHydration(document.querySelector(_sel));
|
|
5825
5846
|
}
|
|
5826
5847
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
5827
5848
|
var absolutePageReady = Promise.resolve();
|
|
@@ -5845,7 +5866,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
5845
5866
|
});
|
|
5846
5867
|
}
|
|
5847
5868
|
return appRef;
|
|
5848
|
-
});
|
|
5869
|
+
}).finally(restoreTranslation);
|
|
5849
5870
|
}
|
|
5850
5871
|
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
5851
5872
|
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
@@ -7182,5 +7203,5 @@ export {
|
|
|
7182
7203
|
withPendingTask
|
|
7183
7204
|
};
|
|
7184
7205
|
|
|
7185
|
-
//# debugId=
|
|
7206
|
+
//# debugId=DDB31A317058248664756E2164756E21
|
|
7186
7207
|
//# sourceMappingURL=server.js.map
|