vike 0.4.244 → 0.4.245

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.
@@ -1,5 +1,5 @@
1
1
  export { initOnLinkClick };
2
- import { isLinkIgnored, isSameAsCurrentUrl, skipLink } from './skipLink.js';
2
+ import { isLinkIgnored, isHrefCurrentUrl, isLinkSkipped } from './isLinkSkipped.js';
3
3
  import { renderPageClientSide } from './renderPageClientSide.js';
4
4
  import { scrollToHashOrTop } from './setScrollPosition.js';
5
5
  function initOnLinkClick() {
@@ -19,14 +19,14 @@ async function onLinkClick(ev) {
19
19
  // Workaround for Firefox bug: clicking on a hash link that doesn't change the current URL causes Firefox to erroneously set `window.history.state = null` without firing any signal that we can detect.
20
20
  // - https://github.com/vikejs/vike/issues/1962
21
21
  // - https://github.com/sveltejs/kit/issues/8725
22
- if (href.includes('#') && isSameAsCurrentUrl(href)) {
22
+ if (href.includes('#') && isHrefCurrentUrl(href)) {
23
23
  // Prevent Firefox from setting `window.history.state` to `null`
24
24
  ev.preventDefault();
25
25
  // Replicate the browser's native behavior
26
26
  scrollToHashOrTop(href.split('#')[1]);
27
27
  return;
28
28
  }
29
- if (skipLink(linkTag))
29
+ if (isLinkSkipped(linkTag))
30
30
  return;
31
31
  ev.preventDefault();
32
32
  let scrollTarget;
@@ -14,7 +14,7 @@ import { catchInfiniteLoop } from './utils.js';
14
14
  // 2. URL hash changes:
15
15
  // - By the user clicking on `<a href="#some-hash">`
16
16
  // - The popstate event is *only* triggered if `href` starts with '#' (even if `href==='/foo#bar'` and the current URL has the same pathname '/foo' then popstate isn't triggered)
17
- // - Vike doesn't intercept hash links (see `skipLink()`) and let's the browser handle them.
17
+ // - Vike doesn't intercept hash links (see `isLinkSkipped()`) and let's the browser handle them.
18
18
  // - By the app using a `location` API such as `location.hash = 'some-hash'`
19
19
  // - Only upon hash navigation: setting `location.href='/foo'` triggers a full page reload and no popstate event is fired.
20
20
  // - Also upon `location.href='/foo#bar'` while the current URL is '/foo' (unlike <a> clicks).
@@ -0,0 +1,6 @@
1
+ export { isLinkSkipped };
2
+ export { isLinkIgnored };
3
+ export { isHrefCurrentUrl };
4
+ declare function isLinkSkipped(linkTag: HTMLElement): boolean;
5
+ declare function isLinkIgnored(linkTag: HTMLElement): boolean;
6
+ declare function isHrefCurrentUrl(href: string): boolean;
@@ -1,18 +1,17 @@
1
- // TODO: rename_full skipLink isLinkSkipped
2
- export { skipLink };
1
+ export { isLinkSkipped };
3
2
  export { isLinkIgnored };
4
- export { isSameAsCurrentUrl };
3
+ export { isHrefCurrentUrl };
5
4
  import { normalizeClientSideUrl } from '../shared/normalizeClientSideUrl.js';
6
5
  import { getBaseServer } from './getBaseServer.js';
7
6
  import { assert, parseUrl, isBaseServer, isUrl, isUrlExternal } from './utils.js';
8
- function skipLink(linkTag) {
7
+ function isLinkSkipped(linkTag) {
9
8
  const href = linkTag.getAttribute('href');
10
9
  return (href === null ||
11
10
  !isUrl(href) ||
12
11
  href === '' ||
13
12
  isUrlExternal(href) ||
14
- isSamePageHashLink(href) ||
15
- isNewTabLink(linkTag) ||
13
+ isHrefSamePageHash(href) ||
14
+ isLinkExternal(linkTag) ||
16
15
  isLinkIgnored(linkTag) ||
17
16
  !hasBaseServer(href) ||
18
17
  // Purposely last because disableAutomaticLinkInterception will be removed in the next major release
@@ -25,13 +24,11 @@ function isVikeLink(linkTag) {
25
24
  return true;
26
25
  }
27
26
  else {
28
- // TODO: rename target attrVal
29
- const target = linkTag.getAttribute('data-vike-link');
30
- return target !== null && target !== 'false';
27
+ const attrVal = linkTag.getAttribute('data-vike-link');
28
+ return attrVal !== null && attrVal !== 'false';
31
29
  }
32
30
  }
33
- // TODO rename
34
- function isNewTabLink(linkTag) {
31
+ function isLinkExternal(linkTag) {
35
32
  const target = linkTag.getAttribute('target');
36
33
  const rel = linkTag.getAttribute('rel');
37
34
  return target === '_blank' || target === '_external' || rel === 'external' || linkTag.hasAttribute('download');
@@ -39,11 +36,9 @@ function isNewTabLink(linkTag) {
39
36
  function isLinkIgnored(linkTag) {
40
37
  return linkTag.getAttribute('data-vike') === 'false';
41
38
  }
42
- // TODO refactor both functions below?
43
- function isSamePageHashLink(href) {
39
+ function isHrefSamePageHash(href) {
44
40
  if (href.startsWith('#'))
45
41
  return true;
46
- // TODO: remove?
47
42
  if (href.includes('#') &&
48
43
  normalizeClientSideUrl(href, { withoutHash: true }) ===
49
44
  normalizeClientSideUrl(window.location.href, { withoutHash: true })) {
@@ -51,7 +46,7 @@ function isSamePageHashLink(href) {
51
46
  }
52
47
  return false;
53
48
  }
54
- function isSameAsCurrentUrl(href) {
49
+ function isHrefCurrentUrl(href) {
55
50
  if (href.startsWith('#'))
56
51
  return href === window.location.hash;
57
52
  return normalizeClientSideUrl(href) === normalizeClientSideUrl(window.location.href);
@@ -7,7 +7,7 @@ export { addLinkPrefetchHandlers_watch };
7
7
  export { addLinkPrefetchHandlers_unwatch };
8
8
  import { assert, assertClientRouting, assertUsage, assertWarning, checkIfClientRouting, getGlobalObject, hasProp, objectAssign, } from './utils.js';
9
9
  import { isErrorFetchingStaticAssets, loadPageConfigsLazyClientSide } from '../shared/loadPageConfigsLazyClientSide.js';
10
- import { skipLink } from './skipLink.js';
10
+ import { isLinkSkipped } from './isLinkSkipped.js';
11
11
  import { disableClientRouting } from './renderPageClientSide.js';
12
12
  import { isClientSideRoutable } from './isClientSideRoutable.js';
13
13
  import { createPageContextClientSide } from './createPageContextClientSide.js';
@@ -170,7 +170,7 @@ function addLinkPrefetchHandlers_apply() {
170
170
  if (globalObject.linkPrefetchHandlerAdded.has(linkTag))
171
171
  continue;
172
172
  globalObject.linkPrefetchHandlerAdded.add(linkTag);
173
- if (skipLink(linkTag))
173
+ if (isLinkSkipped(linkTag))
174
174
  continue;
175
175
  linkTag.addEventListener('mouseover', () => {
176
176
  prefetchOnEvent(linkTag, 'hover');
@@ -205,7 +205,7 @@ async function prefetchOnEvent(linkTag, event) {
205
205
  }
206
206
  }
207
207
  // Check again in case DOM was manipulated since last check
208
- if (skipLink(linkTag))
208
+ if (isLinkSkipped(linkTag))
209
209
  return;
210
210
  const urlOfLink = linkTag.getAttribute('href');
211
211
  const pageContextLink = await getPageContextLink(urlOfLink);
@@ -221,9 +221,10 @@ function handleAssetsManifest_assertUsageCssCodeSplit(config) {
221
221
  }
222
222
  function handleAssetsManifest_alignCssTarget(config) {
223
223
  globalObject.configsAll.push(config);
224
- const { cssTarget } = globalObject.configsAll
225
- .filter((c) => !isViteServerSide_viteEnvOptional(c, undefined))
226
- .at(-1).build;
224
+ const clientSideConfigs = globalObject.configsAll.filter((c) => !isViteServerSide_viteEnvOptional(c, undefined));
225
+ if (clientSideConfigs.length === 0)
226
+ return;
227
+ const { cssTarget } = clientSideConfigs.at(-1).build;
227
228
  assert(cssTarget);
228
229
  globalObject.configsAll.forEach((c) => (c.build.cssTarget = cssTarget));
229
230
  }
@@ -89,6 +89,7 @@ function pluginBuildApp() {
89
89
  */
90
90
  async handler(options, bundle) {
91
91
  try {
92
+ handleAssetsManifest_assertUsageCssTarget(config, this.environment);
92
93
  await handleAssetsManifest(config, this.environment, options, bundle);
93
94
  await triggerPrerendering(config, this.environment, bundle);
94
95
  }
@@ -112,7 +113,6 @@ function pluginBuildApp() {
112
113
  order: 'post',
113
114
  handler() {
114
115
  onSetupBuild();
115
- handleAssetsManifest_assertUsageCssTarget(config, this.environment);
116
116
  },
117
117
  },
118
118
  },
@@ -1,6 +1,6 @@
1
1
  export { pluginViteConfigVikeExtensions };
2
2
  import { mergeConfig } from 'vite';
3
- import { assertUsage, isObject } from '../utils.js';
3
+ import { assertUsage, isCallable, isObject } from '../utils.js';
4
4
  import { getVikeConfigInternalEarly } from '../../api/resolveViteConfigFromUser.js';
5
5
  // Apply +vite
6
6
  // - For example, Vike extensions adding Vite plugins
@@ -12,10 +12,13 @@ async function pluginViteConfigVikeExtensions() {
12
12
  const viteConfigsExtensions = vikeConfig._from.configsCumulative.vite;
13
13
  if (!viteConfigsExtensions)
14
14
  return [];
15
- viteConfigsExtensions.values.forEach((v) => {
16
- assertUsage(isObject(v.value), `${v.definedAt} should be an object`);
17
- viteConfigFromExtensions = mergeConfig(viteConfigFromExtensions, v.value);
18
- });
15
+ await Promise.all(viteConfigsExtensions.values.map(async (v) => {
16
+ let val = v.value;
17
+ if (isCallable(val))
18
+ val = await val();
19
+ assertUsage(isObject(val), `${v.definedAt} should be an object, or a function returning an object`);
20
+ viteConfigFromExtensions = mergeConfig(viteConfigFromExtensions, val);
21
+ }));
19
22
  const pluginsFromExtensions = (viteConfigFromExtensions.plugins ?? []);
20
23
  delete viteConfigFromExtensions.plugins;
21
24
  return [
@@ -2,7 +2,6 @@ export { getVikeConfig };
2
2
  export type { VikeConfig };
3
3
  export { getVikeConfigInternal };
4
4
  export { getVikeConfigInternalOptional };
5
- export { getVikeConfigInternalSync };
6
5
  export { setVikeConfigContext };
7
6
  export { isVikeConfigContextSet };
8
7
  export { reloadVikeConfig };
@@ -38,13 +37,14 @@ type VikeConfigInternal = GlobalConfigPublic & {
38
37
  };
39
38
  declare function reloadVikeConfig(): void;
40
39
  declare function getVikeConfigInternal(doNotRestartViteOnError?: boolean): Promise<VikeConfigInternal>;
41
- declare function getVikeConfigInternalSync(): VikeConfigInternal;
42
40
  /**
43
41
  * Get all the information Vike knows about the app in your Vite plugin.
44
42
  *
45
43
  * https://vike.dev/getVikeConfig
46
44
  */
47
- declare function getVikeConfig(config: ResolvedConfig | UserConfig): VikeConfig;
45
+ declare function getVikeConfig(
46
+ /** @deprecated the `config` argument isn't needed anymore — remove it (it doesn't have any effect) */
47
+ config?: ResolvedConfig | UserConfig): VikeConfig;
48
48
  type VikeConfig = Pick<VikeConfigInternal, 'config' | 'pages' | 'prerenderContext'> & {
49
49
  /** https://vike.dev/warning/internals */
50
50
  dangerouslyUseInternals: DangerouslyUseInternals<VikeConfigInternal>;
@@ -3,7 +3,6 @@ export { getVikeConfig };
3
3
  // Internal usage
4
4
  export { getVikeConfigInternal };
5
5
  export { getVikeConfigInternalOptional };
6
- export { getVikeConfigInternalSync };
7
6
  export { setVikeConfigContext };
8
7
  export { isVikeConfigContextSet };
9
8
  export { reloadVikeConfig };
@@ -58,11 +57,6 @@ doNotRestartViteOnError = false) {
58
57
  const vikeConfig = await getOrResolveVikeConfig(userRootDir, isDev, vikeVitePluginOptions, doNotRestartViteOnError);
59
58
  return vikeConfig;
60
59
  }
61
- // TO-DO/next-major-release: remove
62
- function getVikeConfigInternalSync() {
63
- assert(globalObject.vikeConfigSync);
64
- return globalObject.vikeConfigSync;
65
- }
66
60
  // TO-DO/eventually: this maybe(/probably?) isn't safe against race conditions upon file changes in development, thus:
67
61
  // - Like getGlobalContext() and getGlobalContextSync() — make getVikeConfig() async and provide a getVikeConfigSync() while discourage using it
68
62
  // Public usage
@@ -72,10 +66,17 @@ function getVikeConfigInternalSync() {
72
66
  * https://vike.dev/getVikeConfig
73
67
  */
74
68
  function getVikeConfig(
75
- // TO-DO/eventually: remove unused arguments (older versions used it and we didn't remove it yet to avoid a TypeScript breaking change)
76
- // - No rush: we can do it later since it's getVikeConfig() is a beta feature as documented at https://vike.dev/getVikeConfig
69
+ /** @deprecated the `config` argument isn't needed anymore remove it (it doesn't have any effect) */
77
70
  config) {
78
- const vikeConfig = getVikeConfigInternalSync();
71
+ /* TO-DO/eventualy: add deprecation warning. We don't do it yet because of vike-server and vike-cloudflare which are using getVikeConfig() with the argument.
72
+ assertWarning(
73
+ config === undefined,
74
+ `getVikeConfig() doesn't accept any argument anymore — remove the argument (it doesn't have any effect)`,
75
+ { onlyOnce: true, showStackTrace: true },
76
+ )
77
+ */
78
+ assert(globalObject.vikeConfigSync);
79
+ const vikeConfig = globalObject.vikeConfigSync;
79
80
  assertUsage(vikeConfig, 'getVikeConfig() can only be used when Vite is loaded (i.e. during development or build) — Vite is never loaded in production.');
80
81
  const vikeConfigPublic = getProxyForPublicUsage(vikeConfig, 'vikeConfig');
81
82
  return vikeConfigPublic;
@@ -55,37 +55,64 @@ type HookNameOldDesign = 'render' | 'prerender' | 'onBeforePrerender';
55
55
  type ConfigNameBuiltIn = Exclude<keyof ConfigBuiltIn, keyof VikeVitePluginOptions | 'onBeforeRoute' | 'onPrerenderStart' | 'vite' | 'redirects'> | 'prerender' | 'hasServerOnlyHook' | 'isClientRuntimeLoaded' | 'onBeforeRenderEnv' | 'dataEnv' | 'hooksTimeout' | 'clientHooks' | 'middleware';
56
56
  type ConfigNameGlobal = 'onPrerenderStart' | 'onBeforeRoute' | 'prerender' | 'disableAutoFullBuild' | 'includeAssetsImportedByServer' | 'baseAssets' | 'baseServer' | 'redirects' | 'trailingSlash' | 'disableUrlNormalization' | 'vite';
57
57
  type Config = ConfigBuiltIn & Vike.Config;
58
- /** @deprecated This type is deprecated, see https://vike.dev/data */
58
+ /** @deprecated This type is deprecated, see:
59
+ * - https://vike.dev/migration/hook-types
60
+ * - https://vike.dev/data
61
+ */
59
62
  type DataAsync<Data = unknown> = (pageContext: PageContextServer) => Promise<Data>;
60
- /** @deprecated This type is deprecated, see https://vike.dev/data */
63
+ /** @deprecated This type is deprecated, see:
64
+ * - https://vike.dev/migration/hook-types
65
+ * - https://vike.dev/data
66
+ */
61
67
  type DataSync<Data = unknown> = (pageContext: PageContextServer) => Data;
62
- /** @deprecated This type is deprecated, see https://vike.dev/guard */
68
+ /** @deprecated This type is deprecated, see:
69
+ * - https://vike.dev/migration/hook-types
70
+ * - https://vike.dev/guard
71
+ */
63
72
  type GuardAsync = (pageContext: PageContextServer) => Promise<void>;
64
- /** @deprecated This type is deprecated, see https://vike.dev/guard */
73
+ /** @deprecated This type is deprecated, see:
74
+ * - https://vike.dev/migration/hook-types
75
+ * - https://vike.dev/guard
76
+ */
65
77
  type GuardSync = (pageContext: PageContextServer) => void;
66
- /** @deprecated This type is deprecated, see https://vike.dev/onBeforePrerenderStart */
78
+ /** @deprecated This type is deprecated, see:
79
+ * - https://vike.dev/migration/hook-types
80
+ * - https://vike.dev/onBeforePrerenderStart
81
+ */
67
82
  type OnBeforePrerenderStartAsync<Data = unknown> = () => Promise<(string | {
68
83
  url: string;
69
84
  pageContext: Partial<Vike.PageContext & {
70
85
  data: Data;
71
86
  }>;
72
87
  })[]>;
73
- /** @deprecated This type is deprecated, see https://vike.dev/onBeforePrerenderStart */
88
+ /** @deprecated This type is deprecated, see:
89
+ * - https://vike.dev/migration/hook-types
90
+ * - https://vike.dev/onBeforePrerenderStart
91
+ */
74
92
  type OnBeforePrerenderStartSync<Data = unknown> = () => (string | {
75
93
  url: string;
76
94
  pageContext: Partial<Vike.PageContext & {
77
95
  data: Data;
78
96
  }>;
79
97
  })[];
80
- /** @deprecated This type is deprecated, see https://vike.dev/onBeforeRender */
98
+ /** @deprecated This type is deprecated, see:
99
+ * - https://vike.dev/migration/hook-types
100
+ * - https://vike.dev/onBeforeRender
101
+ */
81
102
  type OnBeforeRenderAsync = (pageContext: PageContextServer) => Promise<{
82
103
  pageContext: Partial<Vike.PageContext>;
83
104
  } | void>;
84
- /** @deprecated This type is deprecated, see https://vike.dev/onBeforeRender */
105
+ /** @deprecated This type is deprecated, see:
106
+ * - https://vike.dev/migration/hook-types
107
+ * - https://vike.dev/onBeforeRender
108
+ */
85
109
  type OnBeforeRenderSync = (pageContext: PageContextServer) => {
86
110
  pageContext: Partial<Vike.PageContext>;
87
111
  } | void;
88
- /** @deprecated This type is deprecated, see https://vike.dev/onBeforeRoute */
112
+ /** @deprecated This type is deprecated, see:
113
+ * - https://vike.dev/migration/hook-types
114
+ * - https://vike.dev/onBeforeRoute
115
+ */
89
116
  type OnBeforeRouteAsync = (pageContext: PageContextServer) => Promise<{
90
117
  pageContext: Partial<{
91
118
  /** The URL you provided to Vike when calling `renderPage({ urlOriginal })` in your server middleware.
@@ -95,7 +122,10 @@ type OnBeforeRouteAsync = (pageContext: PageContextServer) => Promise<{
95
122
  urlOriginal: string;
96
123
  } | Vike.PageContext>;
97
124
  }>;
98
- /** @deprecated This type is deprecated, see https://vike.dev/onBeforeRoute */
125
+ /** @deprecated This type is deprecated, see:
126
+ * - https://vike.dev/migration/hook-types
127
+ * - https://vike.dev/onBeforeRoute
128
+ */
99
129
  type OnBeforeRouteSync = (pageContext: PageContextServer) => {
100
130
  pageContext: Partial<{
101
131
  /** The URL you provided to Vike when calling `renderPage({ urlOriginal })` in your server middleware.
@@ -105,19 +135,40 @@ type OnBeforeRouteSync = (pageContext: PageContextServer) => {
105
135
  urlOriginal: string;
106
136
  } | Vike.PageContext>;
107
137
  };
108
- /** @deprecated This type is deprecated, see https://vike.dev/onHydrationEnd */
138
+ /** @deprecated This type is deprecated, see:
139
+ * - https://vike.dev/migration/hook-types
140
+ * - https://vike.dev/onHydrationEnd
141
+ */
109
142
  type OnHydrationEndAsync = (pageContext: PageContextClient) => Promise<void>;
110
- /** @deprecated This type is deprecated, see https://vike.dev/onHydrationEnd */
143
+ /** @deprecated This type is deprecated, see:
144
+ * - https://vike.dev/migration/hook-types
145
+ * - https://vike.dev/onHydrationEnd
146
+ */
111
147
  type OnHydrationEndSync = (pageContext: PageContextClient) => void;
112
- /** @deprecated This type is deprecated, see https://vike.dev/onPageTransitionEnd */
148
+ /** @deprecated This type is deprecated, see:
149
+ * - https://vike.dev/migration/hook-types
150
+ * - https://vike.dev/onPageTransitionEnd
151
+ */
113
152
  type OnPageTransitionEndAsync = (pageContext: PageContextClient) => Promise<void>;
114
- /** @deprecated This type is deprecated, see https://vike.dev/onPageTransitionEnd */
153
+ /** @deprecated This type is deprecated, see:
154
+ * - https://vike.dev/migration/hook-types
155
+ * - https://vike.dev/onPageTransitionEnd
156
+ */
115
157
  type OnPageTransitionEndSync = (pageContext: PageContextClient) => void;
116
- /** @deprecated This type is deprecated, see https://vike.dev/onPageTransitionStart */
158
+ /** @deprecated This type is deprecated, see:
159
+ * - https://vike.dev/migration/hook-types
160
+ * - https://vike.dev/onPageTransitionStart
161
+ */
117
162
  type OnPageTransitionStartAsync = (pageContext: PageContextClient) => Promise<void>;
118
- /** @deprecated This type is deprecated, see https://vike.dev/onPageTransitionStart */
163
+ /** @deprecated This type is deprecated, see:
164
+ * - https://vike.dev/migration/hook-types
165
+ * - https://vike.dev/onPageTransitionStart
166
+ */
119
167
  type OnPageTransitionStartSync = (pageContext: PageContextClient) => void;
120
- /** @deprecated This type is deprecated, see https://vike.dev/onPrerenderStart */
168
+ /** @deprecated This type is deprecated, see:
169
+ * - https://vike.dev/migration/hook-types
170
+ * - https://vike.dev/onPrerenderStart
171
+ */
121
172
  type OnPrerenderStartAsync = (prerenderContext: {
122
173
  pageContexts: PageContextServer[];
123
174
  }) => Promise<{
@@ -125,7 +176,10 @@ type OnPrerenderStartAsync = (prerenderContext: {
125
176
  pageContexts: PageContextServer[];
126
177
  };
127
178
  }>;
128
- /** @deprecated This type is deprecated, see https://vike.dev/onPrerenderStart */
179
+ /** @deprecated This type is deprecated, see:
180
+ * - https://vike.dev/migration/hook-types
181
+ * - https://vike.dev/onPrerenderStart
182
+ */
129
183
  type OnPrerenderStartSync = (prerenderContext: {
130
184
  pageContexts: PageContextServer[];
131
185
  }) => {
@@ -133,13 +187,25 @@ type OnPrerenderStartSync = (prerenderContext: {
133
187
  pageContexts: PageContextServer[];
134
188
  };
135
189
  };
136
- /** @deprecated This type is deprecated, see https://vike.dev/onRenderClient */
190
+ /** @deprecated This type is deprecated, see:
191
+ * - https://vike.dev/migration/hook-types
192
+ * - https://vike.dev/onRenderClient
193
+ */
137
194
  type OnRenderClientAsync = (pageContext: PageContextClient) => Promise<void>;
138
- /** @deprecated This type is deprecated, see https://vike.dev/onRenderClient */
195
+ /** @deprecated This type is deprecated, see:
196
+ * - https://vike.dev/migration/hook-types
197
+ * - https://vike.dev/onRenderClient
198
+ */
139
199
  type OnRenderClientSync = (pageContext: PageContextClient) => void;
140
- /** @deprecated This type is deprecated, see https://vike.dev/onRenderHtml */
200
+ /** @deprecated This type is deprecated, see:
201
+ * - https://vike.dev/migration/hook-types
202
+ * - https://vike.dev/onRenderHtml
203
+ */
141
204
  type OnRenderHtmlAsync = (pageContext: PageContextServer) => Promise<OnRenderHtmlReturn>;
142
- /** @deprecated This type is deprecated, see https://vike.dev/onRenderHtml */
205
+ /** @deprecated This type is deprecated, see:
206
+ * - https://vike.dev/migration/hook-types
207
+ * - https://vike.dev/onRenderHtml
208
+ */
143
209
  type OnRenderHtmlSync = (pageContext: PageContextServer) => OnRenderHtmlReturn;
144
210
  type OnRenderHtmlReturn = DocumentHtml | {
145
211
  injectFilter?: (assets: InjectFilterEntry[]) => void;
@@ -155,7 +221,10 @@ type RouteAsync = (pageContext: PageContextServer | PageContextClient) => Promis
155
221
  routeParams?: Record<string, string>;
156
222
  precedence?: number;
157
223
  } | boolean>;
158
- /** @deprecated This type is deprecated, see https://vike.dev/route */
224
+ /** @deprecated This type is deprecated, see:
225
+ * - https://vike.dev/migration/hook-types
226
+ * - https://vike.dev/route
227
+ */
159
228
  type RouteSync = (pageContext: PageContextServer | PageContextClient) => {
160
229
  routeParams?: Record<string, string>;
161
230
  precedence?: number;
@@ -386,7 +455,7 @@ type ConfigBuiltIn = {
386
455
  *
387
456
  * https://vite.dev/config/
388
457
  */
389
- vite?: InlineConfig;
458
+ vite?: InlineConfig | (() => InlineConfig | Promise<InlineConfig>);
390
459
  /** Permanent redirections (HTTP status code 301)
391
460
  *
392
461
  * https://vike.dev/redirects
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.244";
1
+ export declare const PROJECT_VERSION: "0.4.245";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.244';
2
+ export const PROJECT_VERSION = '0.4.245';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.244",
3
+ "version": "0.4.245",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -1,6 +0,0 @@
1
- export { skipLink };
2
- export { isLinkIgnored };
3
- export { isSameAsCurrentUrl };
4
- declare function skipLink(linkTag: HTMLElement): boolean;
5
- declare function isLinkIgnored(linkTag: HTMLElement): boolean;
6
- declare function isSameAsCurrentUrl(href: string): boolean;