veryfront 0.1.1157 → 0.1.1158

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/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.1157",
3
+ "version": "0.1.1158",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -472,7 +472,7 @@ export default {
472
472
  "test:all-runtimes": "deno task test:unit && deno task test:node && deno task test:bun",
473
473
  "test:e2e": "deno task test:e2e:playwright",
474
474
  "test:e2e:playwright": "PW_DISABLE_TS_ESM=1 npx playwright test --config=tests/e2e/playwright.config.cjs",
475
- "test:e2e:rsc-browser": "deno task generate && VF_DISABLE_LRU_INTERVAL=1 SSR_TRANSFORM_PER_PROJECT_LIMIT=0 REVALIDATION_PER_PROJECT_LIMIT=0 NODE_ENV=production LOG_FORMAT=text deno test --no-check --allow-all tests/e2e/regressions/rsc-proxy-hydration.test.ts --unstable-worker-options --unstable-net",
475
+ "test:e2e:rsc-browser": "deno task generate && VF_DISABLE_LRU_INTERVAL=1 SSR_TRANSFORM_PER_PROJECT_LIMIT=0 REVALIDATION_PER_PROJECT_LIMIT=0 NODE_ENV=production LOG_FORMAT=text deno test --no-check --allow-all tests/e2e/regressions/rsc-proxy-hydration.test.ts tests/e2e/regressions/2026-07-27-legacy-router-hydration.test.ts --unstable-worker-options --unstable-net",
476
476
  "test:e2e:binary": "deno task generate && deno test --allow-all tests/integration/compiled-binary-e2e.test.ts",
477
477
  "test:e2e:binary:fresh": "deno task generate && VERYFRONT_BINARY_FRESH=1 deno test --allow-all tests/integration/compiled-binary-e2e.test.ts",
478
478
  "test:e2e:templates": "deno run --allow-all scripts/test/template-runtime-e2e.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"dev-client-renderer.d.ts","sourceRoot":"","sources":["../../../../src/src/html/hydration-script-builder/dev-client-renderer.ts"],"names":[],"mappings":"AAGA,wBAAgB,+BAA+B,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CActE"}
1
+ {"version":3,"file":"dev-client-renderer.d.ts","sourceRoot":"","sources":["../../../../src/src/html/hydration-script-builder/dev-client-renderer.ts"],"names":[],"mappings":"AAQA,wBAAgB,+BAA+B,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAgBtE"}
@@ -1,4 +1,4 @@
1
- import { getLoaderScript, getRendererScript, getRouterScript } from "./templates/index.js";
1
+ import { getLoaderScript, getNavigationStoreCompatibilityScript, getRendererScript, getRouterScript, } from "./templates/index.js";
2
2
  import { buildNonceAttribute } from "../html-escape.js";
3
3
  export function generateDevClientRendererScript(nonce) {
4
4
  const nonceAttr = buildNonceAttribute(nonce);
@@ -6,8 +6,10 @@ export function generateDevClientRendererScript(nonce) {
6
6
  <script type="module"${nonceAttr}>
7
7
  import * as React from 'react';
8
8
  import { createRoot } from 'react-dom/client';
9
- import { RouterProvider, useRouter as useRouterFromModule, getNavigationStore } from 'veryfront/router';
9
+ import { RouterProvider, useRouter as useRouterFromModule } from 'veryfront/router';
10
+ import * as RouterRuntime from 'veryfront/router';
10
11
  import { PageContextProvider } from 'veryfront/context';
12
+ ${getNavigationStoreCompatibilityScript()}
11
13
 
12
14
  ${getRouterScript()}
13
15
  ${getLoaderScript()}
@@ -1 +1 @@
1
- {"version":3,"file":"prod-scripts.d.ts","sourceRoot":"","sources":["../../../../src/src/html/hydration-script-builder/prod-scripts.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAC7E,eAAO,MAAM,4CAA4C,QACH,CAAC;AAIvD,wBAAgB,2BAA2B,IAAI,MAAM,CAUpD;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAMnD;AAED,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,CAGR"}
1
+ {"version":3,"file":"prod-scripts.d.ts","sourceRoot":"","sources":["../../../../src/src/html/hydration-script-builder/prod-scripts.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAC7E,eAAO,MAAM,4CAA4C,QACH,CAAC;AAIvD,wBAAgB,2BAA2B,IAAI,MAAM,CAYpD;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAMnD;AAED,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,CAGR"}
@@ -1,4 +1,4 @@
1
- import { getLoaderScript, getRendererScript, getRouterScript } from "./templates/index.js";
1
+ import { getLoaderScript, getNavigationStoreCompatibilityScript, getRendererScript, getRouterScript, } from "./templates/index.js";
2
2
  import { buildNonceAttribute } from "../html-escape.js";
3
3
  import { fnv1aHash } from "../../utils/hash-utils.js";
4
4
  export const PROD_HYDRATION_MODULE_PATH = "/_veryfront/hydration-runtime.js";
@@ -8,8 +8,10 @@ export function generateProdHydrationModule() {
8
8
  return [
9
9
  `import * as React from 'react';`,
10
10
  `import { createRoot } from 'react-dom/client';`,
11
- `import { RouterProvider, useRouter as useRouterFromModule, getNavigationStore } from 'veryfront/router';`,
11
+ `import { RouterProvider, useRouter as useRouterFromModule } from 'veryfront/router';`,
12
+ `import * as RouterRuntime from 'veryfront/router';`,
12
13
  `import { PageContextProvider } from 'veryfront/context';`,
14
+ getNavigationStoreCompatibilityScript().trim(),
13
15
  getRouterScript().trim(),
14
16
  getLoaderScript().trim(),
15
17
  getRendererScript().trim(),
@@ -4,6 +4,7 @@
4
4
  * @module html/hydration-script-builder/templates
5
5
  */
6
6
  export { getRouterScript } from "./router.js";
7
+ export { getNavigationStoreCompatibilityScript } from "./navigation-store.js";
7
8
  export { getLoaderScript } from "./loader.js";
8
9
  export { getRendererScript } from "./renderer.js";
9
10
  export { getSpaLoaderScript, getSpaRendererScript } from "./spa-renderer.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -4,6 +4,7 @@
4
4
  * @module html/hydration-script-builder/templates
5
5
  */
6
6
  export { getRouterScript } from "./router.js";
7
+ export { getNavigationStoreCompatibilityScript } from "./navigation-store.js";
7
8
  export { getLoaderScript } from "./loader.js";
8
9
  export { getRendererScript } from "./renderer.js";
9
10
  export { getSpaLoaderScript, getSpaRendererScript } from "./spa-renderer.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generate the compatibility bridge between the shared hydration runtime and
3
+ * release-pinned router assets.
4
+ *
5
+ * Router releases since the v1 navigation store landed share the same
6
+ * Symbol.for registry entry even when they predate the public
7
+ * getNavigationStore export. Keeping the fallback store shape in sync with the
8
+ * two v1 implementations lets those releases retain SPA navigation.
9
+ */
10
+ export declare const getNavigationStoreCompatibilityScript: () => string;
11
+ //# sourceMappingURL=navigation-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-store.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/navigation-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,qCAAqC,cA2CjD,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Generate the compatibility bridge between the shared hydration runtime and
3
+ * release-pinned router assets.
4
+ *
5
+ * Router releases since the v1 navigation store landed share the same
6
+ * Symbol.for registry entry even when they predate the public
7
+ * getNavigationStore export. Keeping the fallback store shape in sync with the
8
+ * two v1 implementations lets those releases retain SPA navigation.
9
+ */
10
+ export const getNavigationStoreCompatibilityScript = () => `
11
+ const navigationStoreUsesRegistryFallback =
12
+ typeof RouterRuntime.getNavigationStore !== 'function';
13
+ const getNavigationStore = navigationStoreUsesRegistryFallback
14
+ ? () => {
15
+ const storeKey = Symbol.for('veryfront.navigation.store.v1');
16
+ const existing = globalThis[storeKey];
17
+ if (existing) return existing;
18
+
19
+ const listeners = new Set();
20
+ let navigator = null;
21
+ const store = {
22
+ subscribe(listener) {
23
+ listeners.add(listener);
24
+ return () => listeners.delete(listener);
25
+ },
26
+ getHref() {
27
+ const loc = globalThis.location;
28
+ return loc ? loc.pathname + loc.search + loc.hash : '/';
29
+ },
30
+ notify() {
31
+ for (const listener of [...listeners]) {
32
+ try {
33
+ listener();
34
+ } catch {
35
+ // One subscriber must not prevent the others from updating.
36
+ }
37
+ }
38
+ },
39
+ navigate(href, options) {
40
+ if (navigator) return navigator(href, options);
41
+ globalThis.location?.assign(href);
42
+ return Promise.resolve();
43
+ },
44
+ setNavigator(next) {
45
+ navigator = next;
46
+ },
47
+ };
48
+
49
+ globalThis[storeKey] = store;
50
+ return store;
51
+ }
52
+ : RouterRuntime.getNavigationStore;
53
+ `;
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAswC3B,CAAC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cA8wC3B,CAAC"}
@@ -1153,11 +1153,19 @@ export const getRouterScript = () => `
1153
1153
  // same SPA navigator that intercepts <Link> clicks. Without this the shared
1154
1154
  // navigation store has no navigator registered and its navigate() falls back
1155
1155
  // to a full-page location.assign (finding #7: push() full-reloads).
1156
- getNavigationStore().setNavigator((href, options) => {
1157
- const mode = options && options.history;
1158
- const historyMode = mode === 'replace' ? 'replace' : mode === 'none' ? 'none' : 'push';
1159
- return navigateSPA(href, historyMode);
1160
- });
1156
+ if (
1157
+ typeof navigationStoreUsesRegistryFallback !== 'undefined' &&
1158
+ navigationStoreUsesRegistryFallback
1159
+ ) {
1160
+ log('Router runtime does not export getNavigationStore; using shared v1 registry fallback');
1161
+ }
1162
+ if (typeof getNavigationStore === 'function') {
1163
+ getNavigationStore().setNavigator((href, options) => {
1164
+ const mode = options && options.history;
1165
+ const historyMode = mode === 'replace' ? 'replace' : mode === 'none' ? 'none' : 'push';
1166
+ return navigateSPA(href, historyMode);
1167
+ });
1168
+ }
1161
1169
 
1162
1170
  // ============================================
1163
1171
  // Event handlers
@@ -398,7 +398,7 @@ export async function clearESMDiskCache() {
398
398
  const fs = getLocalFs();
399
399
  try {
400
400
  // Remove entire cache directory and recreate it
401
- // This handles nested project directories like codersociety/local-main/
401
+ // This handles nested project directories such as customer/local-main/
402
402
  await fs.remove(cacheDir, { recursive: true });
403
403
  await fs.mkdir(cacheDir, { recursive: true });
404
404
  logger.debug(`${LOG_PREFIX_MDX_LOADER} Cleared ESM disk cache`);
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.1157";
2
+ export declare const VERSION = "0.1.1158";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.1157";
4
+ export const VERSION = "0.1.1158";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.1157",
3
+ "version": "0.1.1158",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -332,10 +332,10 @@
332
332
  "@types/react": "19.2.14",
333
333
  "@types/react-dom": "19.2.3",
334
334
  "ws": "8.21.0",
335
- "@veryfront/ext-bundler-esbuild": "0.1.1157",
336
- "@veryfront/ext-content-mdx": "0.1.1157",
337
- "@veryfront/ext-css-tailwind": "0.1.1157",
338
- "@veryfront/ext-parser-babel": "0.1.1157"
335
+ "@veryfront/ext-bundler-esbuild": "0.1.1158",
336
+ "@veryfront/ext-content-mdx": "0.1.1158",
337
+ "@veryfront/ext-css-tailwind": "0.1.1158",
338
+ "@veryfront/ext-parser-babel": "0.1.1158"
339
339
  },
340
340
  "devDependencies": {
341
341
  "@types/node": "20.9.0"