vinext 0.0.42 → 0.0.44

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.
Files changed (35) hide show
  1. package/dist/client/vinext-next-data.d.ts +1 -3
  2. package/dist/deploy.js +21 -4
  3. package/dist/deploy.js.map +1 -1
  4. package/dist/entries/app-rsc-entry.js +39 -9
  5. package/dist/entries/app-rsc-entry.js.map +1 -1
  6. package/dist/index.js +3 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/routing/app-router.d.ts +2 -1
  9. package/dist/routing/app-router.js +28 -5
  10. package/dist/routing/app-router.js.map +1 -1
  11. package/dist/server/app-browser-entry.js +219 -96
  12. package/dist/server/app-browser-entry.js.map +1 -1
  13. package/dist/server/app-page-route-wiring.d.ts +1 -0
  14. package/dist/server/app-page-route-wiring.js +12 -2
  15. package/dist/server/app-page-route-wiring.js.map +1 -1
  16. package/dist/server/app-route-handler-policy.js +5 -3
  17. package/dist/server/app-route-handler-policy.js.map +1 -1
  18. package/dist/server/app-route-handler-response.js +2 -0
  19. package/dist/server/app-route-handler-response.js.map +1 -1
  20. package/dist/server/app-router-entry.js +8 -1
  21. package/dist/server/app-router-entry.js.map +1 -1
  22. package/dist/server/app-ssr-entry.js +2 -1
  23. package/dist/server/app-ssr-entry.js.map +1 -1
  24. package/dist/server/prod-server.js +16 -13
  25. package/dist/server/prod-server.js.map +1 -1
  26. package/dist/server/request-pipeline.d.ts +33 -1
  27. package/dist/server/request-pipeline.js +44 -2
  28. package/dist/server/request-pipeline.js.map +1 -1
  29. package/dist/shims/navigation.d.ts +1 -1
  30. package/dist/shims/navigation.js +32 -5
  31. package/dist/shims/navigation.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/client/entry.d.ts +0 -1
  34. package/dist/client/entry.js +0 -60
  35. package/dist/client/entry.js.map +0 -1
@@ -1,60 +0,0 @@
1
- import { isValidModulePath } from "./validate-module-path.js";
2
- import "./instrumentation-client.js";
3
- import React from "react";
4
- import { hydrateRoot } from "react-dom/client";
5
- import "next/router.js";
6
- //#region src/client/entry.ts
7
- /**
8
- * Client-side hydration entry point.
9
- *
10
- * This module is injected as a <script type="module"> in the SSR HTML.
11
- * It reads __NEXT_DATA__ from the window, dynamically imports the page
12
- * component, and hydrates it onto #__next.
13
- *
14
- * The actual page import path is injected at serve-time by the plugin
15
- * via a virtual module or inline script.
16
- */
17
- const nextData = window.__NEXT_DATA__;
18
- const pageProps = nextData?.props.pageProps ?? {};
19
- const pageModulePath = nextData?.__pageModule;
20
- const appModulePath = nextData?.__appModule;
21
- async function hydrate() {
22
- if (!isValidModulePath(pageModulePath)) {
23
- console.error("[vinext] Invalid or missing __pageModule in __NEXT_DATA__");
24
- return;
25
- }
26
- const PageComponent = (await import(
27
- /* @vite-ignore */
28
- pageModulePath
29
- )).default;
30
- if (!PageComponent) {
31
- console.error("[vinext] Page module has no default export");
32
- return;
33
- }
34
- let element;
35
- if (appModulePath) if (!isValidModulePath(appModulePath)) console.error("[vinext] Invalid __appModule in __NEXT_DATA__");
36
- else try {
37
- const AppComponent = (await import(
38
- /* @vite-ignore */
39
- appModulePath
40
- )).default;
41
- element = React.createElement(AppComponent, {
42
- Component: PageComponent,
43
- pageProps
44
- });
45
- } catch {}
46
- if (!element) element = React.createElement(PageComponent, pageProps);
47
- const container = document.getElementById("__next");
48
- if (!container) {
49
- console.error("[vinext] No #__next element found");
50
- return;
51
- }
52
- const root = hydrateRoot(container, element);
53
- window.__VINEXT_ROOT__ = root;
54
- window.__VINEXT_HYDRATED_AT = performance.now();
55
- }
56
- hydrate();
57
- //#endregion
58
- export {};
59
-
60
- //# sourceMappingURL=entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","names":[],"sources":["../../src/client/entry.ts"],"sourcesContent":["/**\n * Client-side hydration entry point.\n *\n * This module is injected as a <script type=\"module\"> in the SSR HTML.\n * It reads __NEXT_DATA__ from the window, dynamically imports the page\n * component, and hydrates it onto #__next.\n *\n * The actual page import path is injected at serve-time by the plugin\n * via a virtual module or inline script.\n */\nimport React from \"react\";\nimport { hydrateRoot } from \"react-dom/client\";\nimport \"./instrumentation-client.js\";\n// Eagerly import the router shim so its module-level popstate listener is\n// registered. Without this, browser back/forward buttons do nothing because\n// navigateClient() is never invoked on history changes.\nimport \"next/router\";\nimport { isValidModulePath } from \"./validate-module-path.js\";\nimport type { VinextNextData } from \"./vinext-next-data.js\";\n\n// Read the SSR data injected by the server\nconst nextData = window.__NEXT_DATA__ as VinextNextData | undefined;\nconst pageProps = (nextData?.props.pageProps ?? {}) as Record<string, unknown>;\nconst pageModulePath = nextData?.__pageModule;\nconst appModulePath = nextData?.__appModule;\n\nasync function hydrate() {\n if (!isValidModulePath(pageModulePath)) {\n console.error(\"[vinext] Invalid or missing __pageModule in __NEXT_DATA__\");\n return;\n }\n\n // Dynamically import the page module\n const pageModule = await import(/* @vite-ignore */ pageModulePath);\n const PageComponent = pageModule.default;\n\n if (!PageComponent) {\n console.error(\"[vinext] Page module has no default export\");\n return;\n }\n\n let element: React.ReactElement;\n\n // If there's a custom _app, wrap the page with it\n if (appModulePath) {\n if (!isValidModulePath(appModulePath)) {\n console.error(\"[vinext] Invalid __appModule in __NEXT_DATA__\");\n } else {\n try {\n const appModule = await import(/* @vite-ignore */ appModulePath);\n const AppComponent = appModule.default;\n element = React.createElement(AppComponent, {\n Component: PageComponent,\n pageProps,\n });\n } catch {\n // No _app, render page directly\n }\n }\n }\n\n // @ts-expect-error -- element is assigned in the _app branch above, or falls through here\n if (!element) {\n element = React.createElement(PageComponent, pageProps);\n }\n\n const container = document.getElementById(\"__next\");\n if (!container) {\n console.error(\"[vinext] No #__next element found\");\n return;\n }\n\n const root = hydrateRoot(container, element);\n\n // Expose root on window so the router shim (a separate module) can\n // re-render the tree during client-side navigation. import.meta.hot.data\n // is module-scoped and cannot be read across module boundaries.\n window.__VINEXT_ROOT__ = root;\n window.__VINEXT_HYDRATED_AT = performance.now();\n}\n\nvoid hydrate();\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAM,WAAW,OAAO;AACxB,MAAM,YAAa,UAAU,MAAM,aAAa,EAAE;AAClD,MAAM,iBAAiB,UAAU;AACjC,MAAM,gBAAgB,UAAU;AAEhC,eAAe,UAAU;AACvB,KAAI,CAAC,kBAAkB,eAAe,EAAE;AACtC,UAAQ,MAAM,4DAA4D;AAC1E;;CAKF,MAAM,iBADa,MAAM;;EAA0B;GAClB;AAEjC,KAAI,CAAC,eAAe;AAClB,UAAQ,MAAM,6CAA6C;AAC3D;;CAGF,IAAI;AAGJ,KAAI,cACF,KAAI,CAAC,kBAAkB,cAAc,CACnC,SAAQ,MAAM,gDAAgD;KAE9D,KAAI;EAEF,MAAM,gBADY,MAAM;;GAA0B;GACnB;AAC/B,YAAU,MAAM,cAAc,cAAc;GAC1C,WAAW;GACX;GACD,CAAC;SACI;AAOZ,KAAI,CAAC,QACH,WAAU,MAAM,cAAc,eAAe,UAAU;CAGzD,MAAM,YAAY,SAAS,eAAe,SAAS;AACnD,KAAI,CAAC,WAAW;AACd,UAAQ,MAAM,oCAAoC;AAClD;;CAGF,MAAM,OAAO,YAAY,WAAW,QAAQ;AAK5C,QAAO,kBAAkB;AACzB,QAAO,uBAAuB,YAAY,KAAK;;AAG5C,SAAS"}