vike 0.4.197-commit-7d64995 → 0.4.197-commit-9330153

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.
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROJECT_VERSION = void 0;
4
4
  // Automatically updated by @brillout/release-me
5
- exports.PROJECT_VERSION = '0.4.197-commit-7d64995';
5
+ exports.PROJECT_VERSION = '0.4.197-commit-9330153';
@@ -28,7 +28,7 @@ const globalObject = getGlobalObject('prefetch.ts', {
28
28
  });
29
29
  function getPageContextPrefetched(pageContext) {
30
30
  const prefetchSettings = getPrefetchSettings(pageContext, null);
31
- // TODO/pageContext-prefetch: we need linkTag to make this condition work
31
+ // TODO/pageContext-prefetch: I guess we need linkTag to make this condition work
32
32
  if (!prefetchSettings.pageContext)
33
33
  return null;
34
34
  const key = getCacheKey(pageContext.urlPathname);
@@ -59,13 +59,17 @@ async function prefetchPageContextFromServerHooks(pageContextLink, resultMaxAge)
59
59
  const result = await getPageContextFromServerHooks(pageContextLink, false);
60
60
  setPageContextPrefetchCache(pageContextLink, result, resultMaxAge);
61
61
  }
62
- function populatePageContextPrefetchCache(pageContext, result) {
62
+ function populatePageContextPrefetchCache(pageContext /*& PageContextExports*/, result) {
63
+ // TODO/pageContext-prefetch: replace with using pageContext.config.prerender instead. (For being able to do that: eager configs need to be accessible without have to use PageContextExports as it isn't available here.)
64
+ if (!isBrilloutDocpress())
65
+ return;
63
66
  setPageContextPrefetchCache(pageContext, result, null);
64
67
  }
65
68
  function setPageContextPrefetchCache(pageContext, result, resultMaxAge) {
66
69
  if (resultMaxAge === null)
67
70
  resultMaxAge = getResultMaxAge();
68
71
  const key = getCacheKey(pageContext.urlPathname);
72
+ assert(isBrilloutDocpress()); // Ensure this API isn't used by anyone else
69
73
  globalObject.prefetchedPageContexts[key] = {
70
74
  resultFetchedAt: Date.now(),
71
75
  resultMaxAge,
@@ -234,3 +238,7 @@ function getCacheKey(url) {
234
238
  const key = url.split('#')[0];
235
239
  return key;
236
240
  }
241
+ // TODO/pageContext-prefetch: remove
242
+ function isBrilloutDocpress() {
243
+ return '_isBrilloutDocpress' in window;
244
+ }
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.197-commit-7d64995";
1
+ export declare const PROJECT_VERSION: "0.4.197-commit-9330153";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.197-commit-7d64995';
2
+ export const PROJECT_VERSION = '0.4.197-commit-9330153';
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.197-commit-7d64995";
3
+ projectVersion: "0.4.197-commit-9330153";
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.197-commit-7d64995",
3
+ "version": "0.4.197-commit-9330153",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {