qalita 2.5.4__py3-none-any.whl → 2.6.1__py3-none-any.whl

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 (213) hide show
  1. qalita/_frontend/.next/static/_0oyfpC7N2IGDMa04TT9R/_clientMiddlewareManifest.json +6 -0
  2. qalita/_frontend/.next/static/chunks/236f7e5abd6f09ff.js +4 -0
  3. qalita/_frontend/.next/static/chunks/30ea11065999f7ac.js +1 -0
  4. qalita/_frontend/.next/static/chunks/4dd28bc3f722184a.js +2 -0
  5. qalita/_frontend/.next/static/chunks/711d597b816a80c1.js +1 -0
  6. qalita/_frontend/.next/static/chunks/7340adf74ff47ec0.js +1 -0
  7. qalita/_frontend/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
  8. qalita/_frontend/.next/static/chunks/{e393fec0d8ba175d.js → ecf559101be0ae12.js} +3 -3
  9. qalita/_frontend/.next/static/chunks/turbopack-25186fc8e1264445.js +4 -0
  10. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/versions.json +30 -0
  11. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  12. qalita/_frontend/node_modules/@next/env/package.json +4 -4
  13. qalita/_frontend/node_modules/next/dist/build/analyze/index.js +242 -0
  14. qalita/_frontend/node_modules/next/dist/build/define-env.js +22 -13
  15. qalita/_frontend/node_modules/next/dist/build/entries.js +5 -5
  16. qalita/_frontend/node_modules/next/dist/build/generate-routes-manifest.js +91 -0
  17. qalita/_frontend/node_modules/next/dist/build/index.js +172 -223
  18. qalita/_frontend/node_modules/next/dist/build/output/log.js +4 -7
  19. qalita/_frontend/node_modules/next/dist/build/segment-config/app/app-segments.js +23 -99
  20. qalita/_frontend/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +3 -3
  21. qalita/_frontend/node_modules/next/dist/build/spinner.js +3 -3
  22. qalita/_frontend/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +137 -0
  23. qalita/_frontend/node_modules/next/dist/build/static-paths/app.js +69 -210
  24. qalita/_frontend/node_modules/next/dist/build/static-paths/utils.js +83 -11
  25. qalita/_frontend/node_modules/next/dist/build/swc/index.js +10 -6
  26. qalita/_frontend/node_modules/next/dist/build/templates/app-page.js +21 -14
  27. qalita/_frontend/node_modules/next/dist/build/templates/app-route.js +8 -10
  28. qalita/_frontend/node_modules/next/dist/build/templates/edge-app-route.js +7 -10
  29. qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr-app.js +16 -20
  30. qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr.js +20 -14
  31. qalita/_frontend/node_modules/next/dist/build/templates/edge-wrapper.js +24 -0
  32. qalita/_frontend/node_modules/next/dist/build/templates/middleware.js +7 -6
  33. qalita/_frontend/node_modules/next/dist/build/templates/pages-edge-api.js +3 -2
  34. qalita/_frontend/node_modules/next/dist/build/turbopack-analyze/index.js +116 -0
  35. qalita/_frontend/node_modules/next/dist/build/turbopack-build/impl.js +2 -1
  36. qalita/_frontend/node_modules/next/dist/build/type-check.js +7 -8
  37. qalita/_frontend/node_modules/next/dist/build/utils.js +45 -4
  38. qalita/_frontend/node_modules/next/dist/build/validate-app-paths.js +242 -0
  39. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js +20 -2
  40. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js +2 -5
  41. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js +4 -11
  42. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-root-params-loader.js +1 -1
  43. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/flight-manifest-plugin.js +1 -1
  44. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/middleware-plugin.js +3 -0
  45. qalita/_frontend/node_modules/next/dist/build/webpack-build/impl.js +1 -0
  46. qalita/_frontend/node_modules/next/dist/build/webpack-config.js +35 -3
  47. qalita/_frontend/node_modules/next/dist/cli/next-test.js +3 -5
  48. qalita/_frontend/node_modules/next/dist/client/components/app-router-headers.js +5 -0
  49. qalita/_frontend/node_modules/next/dist/client/components/app-router-instance.js +3 -11
  50. qalita/_frontend/node_modules/next/dist/client/components/app-router.js +8 -28
  51. qalita/_frontend/node_modules/next/dist/client/components/navigation-devtools.js +5 -7
  52. qalita/_frontend/node_modules/next/dist/client/components/navigation.js +4 -3
  53. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +3 -22
  54. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +6 -18
  55. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +844 -590
  56. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +4 -76
  57. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +21 -18
  58. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +48 -85
  59. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +25 -10
  60. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +126 -113
  61. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +30 -39
  62. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +0 -1
  63. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer.js +2 -2
  64. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache-map.js +13 -18
  65. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache.js +27 -14
  66. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/lru.js +3 -1
  67. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/navigation.js +176 -133
  68. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +12 -12
  69. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +12 -12
  70. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +3 -3
  71. qalita/_frontend/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +10 -10
  72. qalita/_frontend/node_modules/next/dist/compiled/react-is/package.json +1 -1
  73. qalita/_frontend/node_modules/next/dist/lib/build-custom-route.js +4 -4
  74. qalita/_frontend/node_modules/next/dist/lib/constants.js +0 -5
  75. qalita/_frontend/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
  76. qalita/_frontend/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +0 -1
  77. qalita/_frontend/node_modules/next/dist/lib/helpers/get-npx-command.js +3 -3
  78. qalita/_frontend/node_modules/next/dist/lib/inline-static-env.js +1 -1
  79. qalita/_frontend/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
  80. qalita/_frontend/node_modules/next/dist/lib/metadata/metadata.js +17 -11
  81. qalita/_frontend/node_modules/next/dist/lib/needs-experimental-react.js +2 -2
  82. qalita/_frontend/node_modules/next/dist/lib/resolve-build-paths.js +44 -76
  83. qalita/_frontend/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
  84. qalita/_frontend/node_modules/next/dist/lib/static-env.js +6 -6
  85. qalita/_frontend/node_modules/next/dist/lib/turbopack-warning.js +3 -5
  86. qalita/_frontend/node_modules/next/dist/lib/typescript/runTypeCheck.js +61 -5
  87. qalita/_frontend/node_modules/next/dist/lib/typescript/type-paths.js +56 -0
  88. qalita/_frontend/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +6 -17
  89. qalita/_frontend/node_modules/next/dist/lib/verify-typescript-setup.js +10 -2
  90. qalita/_frontend/node_modules/next/dist/lib/worker.js +17 -9
  91. qalita/_frontend/node_modules/next/dist/server/app-render/action-handler.js +113 -77
  92. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +36 -15
  93. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-render-utils.js +36 -15
  94. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-scheduling.js +188 -0
  95. qalita/_frontend/node_modules/next/dist/server/app-render/app-render.js +804 -748
  96. qalita/_frontend/node_modules/next/dist/server/app-render/collect-segment-data.js +8 -2
  97. qalita/_frontend/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +1 -1
  98. qalita/_frontend/node_modules/next/dist/server/app-render/create-error-handler.js +42 -75
  99. qalita/_frontend/node_modules/next/dist/server/app-render/dynamic-rendering.js +127 -14
  100. qalita/_frontend/node_modules/next/dist/server/app-render/encryption-utils.js +3 -108
  101. qalita/_frontend/node_modules/next/dist/server/app-render/encryption.js +4 -3
  102. qalita/_frontend/node_modules/next/dist/server/app-render/flight-render-result.js +3 -2
  103. qalita/_frontend/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +9 -8
  104. qalita/_frontend/node_modules/next/dist/server/app-render/get-layer-assets.js +1 -1
  105. qalita/_frontend/node_modules/next/dist/server/app-render/manifests-singleton.js +257 -0
  106. qalita/_frontend/node_modules/next/dist/server/app-render/prospective-render-utils.js +25 -8
  107. qalita/_frontend/node_modules/next/dist/server/app-render/staged-rendering.js +161 -15
  108. qalita/_frontend/node_modules/next/dist/server/app-render/use-flight-response.js +67 -20
  109. qalita/_frontend/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +2 -2
  110. qalita/_frontend/node_modules/next/dist/server/async-storage/work-store.js +2 -1
  111. qalita/_frontend/node_modules/next/dist/server/base-server.js +32 -23
  112. qalita/_frontend/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
  113. qalita/_frontend/node_modules/next/dist/server/config-schema.js +8 -1
  114. qalita/_frontend/node_modules/next/dist/server/config-shared.js +83 -2
  115. qalita/_frontend/node_modules/next/dist/server/config.js +24 -17
  116. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
  117. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +37 -25
  118. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-types.js +1 -0
  119. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-webpack.js +62 -57
  120. qalita/_frontend/node_modules/next/dist/server/dev/log-requests.js +11 -3
  121. qalita/_frontend/node_modules/next/dist/server/dev/messages.js +10 -0
  122. qalita/_frontend/node_modules/next/dist/server/dev/serialized-errors.js +67 -0
  123. qalita/_frontend/node_modules/next/dist/server/dev/static-paths-worker.js +10 -0
  124. qalita/_frontend/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  125. qalita/_frontend/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +2 -2
  126. qalita/_frontend/node_modules/next/dist/server/lib/dev-bundler-service.js +6 -10
  127. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +4 -4
  128. qalita/_frontend/node_modules/next/dist/server/lib/lazy-result.js +1 -1
  129. qalita/_frontend/node_modules/next/dist/server/lib/patch-fetch.js +9 -9
  130. qalita/_frontend/node_modules/next/dist/server/lib/router-server.js +43 -29
  131. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +0 -21
  132. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/filesystem.js +2 -7
  133. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +8 -4
  134. qalita/_frontend/node_modules/next/dist/server/lib/start-server.js +3 -3
  135. qalita/_frontend/node_modules/next/dist/server/lib/trace/tracer.js +4 -0
  136. qalita/_frontend/node_modules/next/dist/server/load-components.js +3 -9
  137. qalita/_frontend/node_modules/next/dist/server/next-server.js +19 -18
  138. qalita/_frontend/node_modules/next/dist/server/next.js +1 -1
  139. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +570 -0
  140. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/utils.js +60 -3
  141. qalita/_frontend/node_modules/next/dist/server/node-environment.js +1 -0
  142. qalita/_frontend/node_modules/next/dist/server/patch-error-inspect.js +7 -4
  143. qalita/_frontend/node_modules/next/dist/server/request/fallback-params.js +23 -66
  144. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/module.js +2 -2
  145. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/pages-handler.js +6 -3
  146. qalita/_frontend/node_modules/next/dist/server/route-modules/route-module.js +79 -18
  147. qalita/_frontend/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +28 -4
  148. qalita/_frontend/node_modules/next/dist/server/typescript/rules/config.js +50 -6
  149. qalita/_frontend/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +68 -23
  150. qalita/_frontend/node_modules/next/dist/server/web/edge-route-module-wrapper.js +7 -5
  151. qalita/_frontend/node_modules/next/dist/server/web/sandbox/context.js +8 -9
  152. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +2 -1
  153. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/revalidate.js +7 -3
  154. qalita/_frontend/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
  155. qalita/_frontend/node_modules/next/dist/shared/lib/constants.js +6 -1
  156. qalita/_frontend/node_modules/next/dist/shared/lib/deployment-id.js +36 -0
  157. qalita/_frontend/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  158. qalita/_frontend/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +5 -0
  159. qalita/_frontend/node_modules/next/dist/shared/lib/router/routes/app.js +122 -0
  160. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +20 -49
  161. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +6 -6
  162. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
  163. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +116 -0
  164. qalita/_frontend/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js +3 -24
  165. qalita/_frontend/node_modules/next/dist/shared/lib/segment.js +5 -0
  166. qalita/_frontend/node_modules/next/dist/shared/lib/turbopack/utils.js +6 -5
  167. qalita/_frontend/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  168. qalita/_frontend/node_modules/next/dist/telemetry/events/build.js +11 -0
  169. qalita/_frontend/node_modules/next/dist/telemetry/events/version.js +2 -2
  170. qalita/_frontend/node_modules/next/package.json +20 -18
  171. qalita/_frontend/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  172. qalita/_frontend/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  173. qalita/_frontend/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  174. qalita/_frontend/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  175. qalita/_frontend/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  176. qalita/_frontend/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  177. qalita/_frontend/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  178. qalita/_frontend/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  179. qalita/_frontend/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  180. qalita/_frontend/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  181. qalita/_frontend/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  182. qalita/_frontend/node_modules/typescript/lib/typesMap.json +497 -0
  183. qalita/_frontend/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  184. qalita/_frontend/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  185. qalita/_frontend/package.json +3 -3
  186. qalita/_frontend/server.js +1 -1
  187. qalita/commands/pack.py +3 -3
  188. qalita/commands/source.py +1 -1
  189. qalita/internal/utils.py +11 -7
  190. qalita/web/app.py +20 -4
  191. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/METADATA +1 -1
  192. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/RECORD +197 -168
  193. qalita/_frontend/.next/static/chunks/023d923a37d494fc.js +0 -1
  194. qalita/_frontend/.next/static/chunks/247eb132b7f7b574.js +0 -1
  195. qalita/_frontend/.next/static/chunks/bba035711c7e37a2.js +0 -4
  196. qalita/_frontend/.next/static/chunks/c903f9580a4b6572.js +0 -2
  197. qalita/_frontend/.next/static/chunks/cbd55ab9639e1e66.js +0 -1
  198. qalita/_frontend/.next/static/chunks/turbopack-1ad58da399056f41.js +0 -3
  199. qalita/_frontend/node_modules/next/dist/build/deployment-id.js +0 -18
  200. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-flight-data.js +0 -53
  201. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-router-state-patch-to-tree.js +0 -105
  202. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-cache-with-new-subtree-data.js +0 -110
  203. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.js +0 -131
  204. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/handle-segment-mismatch.js +0 -25
  205. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/invalidate-cache-by-router-state.js +0 -32
  206. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/refetch-inactive-parallel-segments.js +0 -104
  207. qalita/_frontend/node_modules/next/dist/server/app-render/action-utils.js +0 -90
  208. qalita/_frontend/node_modules/next/dist/server/normalizers/request/prefetch-rsc.js +0 -31
  209. /qalita/_frontend/.next/static/{X4_AlYMbCyee-ZVLjCYMg → _0oyfpC7N2IGDMa04TT9R}/_buildManifest.js +0 -0
  210. /qalita/_frontend/.next/static/{X4_AlYMbCyee-ZVLjCYMg → _0oyfpC7N2IGDMa04TT9R}/_ssgManifest.js +0 -0
  211. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/WHEEL +0 -0
  212. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/entry_points.txt +0 -0
  213. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/licenses/LICENSE +0 -0
@@ -2,10 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "navigate", {
6
- enumerable: true,
7
- get: function() {
5
+ 0 && (module.exports = {
6
+ convertServerPatchToFullTree: null,
7
+ navigate: null,
8
+ navigateToSeededRoute: null
9
+ });
10
+ function _export(target, all) {
11
+ for(var name in all)Object.defineProperty(target, name, {
12
+ enumerable: true,
13
+ get: all[name]
14
+ });
15
+ }
16
+ _export(exports, {
17
+ convertServerPatchToFullTree: function() {
18
+ return convertServerPatchToFullTree;
19
+ },
20
+ navigate: function() {
8
21
  return navigate;
22
+ },
23
+ navigateToSeededRoute: function() {
24
+ return navigateToSeededRoute;
9
25
  }
10
26
  });
11
27
  const _fetchserverresponse = require("../router-reducer/fetch-server-response");
@@ -15,7 +31,7 @@ const _cache = require("./cache");
15
31
  const _cachekey = require("./cache-key");
16
32
  const _segment = require("../../../shared/lib/segment");
17
33
  const _types = require("./types");
18
- function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, nextUrl, shouldScroll, accumulation) {
34
+ function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, nextUrl, freshnessPolicy, shouldScroll, accumulation) {
19
35
  const now = Date.now();
20
36
  const href = url.href;
21
37
  // We special case navigations to the exact same URL as the current location.
@@ -36,12 +52,7 @@ function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, n
36
52
  // Also note that this only refreshes the dynamic data, not static/ cached
37
53
  // data. If the page segment is fully static and prefetched, the request is
38
54
  // skipped. (This is also how refresh() works.)
39
- const isSamePageNavigation = // TODO: This is not the only place we read from the location, but we should
40
- // consider storing the current URL in the router state instead of reading
41
- // from the location object. In practice I don't think this matters much
42
- // since we keep them in sync anyway, but having two sources of truth can
43
- // lead to subtle bugs and race conditions.
44
- href === window.location.href;
55
+ const isSamePageNavigation = href === currentUrl.href;
45
56
  const cacheKey = (0, _cachekey.createCacheKey)(href, nextUrl);
46
57
  const route = (0, _cache.readRouteCacheEntry)(now, cacheKey);
47
58
  if (route !== null && route.status === _cache.EntryStatus.Fulfilled) {
@@ -60,7 +71,7 @@ function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, n
60
71
  // the URL.
61
72
  const newCanonicalUrl = route.canonicalUrl + url.hash;
62
73
  const renderedSearch = route.renderedSearch;
63
- return navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, newCanonicalUrl, renderedSearch, shouldScroll, url.hash);
74
+ return navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, newCanonicalUrl, renderedSearch, freshnessPolicy, shouldScroll);
64
75
  }
65
76
  // There was no matching route tree in the cache. Let's see if we can
66
77
  // construct an "optimistic" route tree.
@@ -83,7 +94,7 @@ function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, n
83
94
  const isPrefetchHeadPartial = headSnapshot.isPartial;
84
95
  const newCanonicalUrl = optimisticRoute.canonicalUrl + url.hash;
85
96
  const newRenderedSearch = optimisticRoute.renderedSearch;
86
- return navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, newCanonicalUrl, newRenderedSearch, shouldScroll, url.hash);
97
+ return navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, newCanonicalUrl, newRenderedSearch, freshnessPolicy, shouldScroll);
87
98
  }
88
99
  }
89
100
  // There's no matching prefetch for this route in the cache.
@@ -93,58 +104,58 @@ function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, n
93
104
  }
94
105
  return {
95
106
  tag: _types.NavigationResultTag.Async,
96
- data: navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, shouldScroll, url.hash, collectedDebugInfo)
107
+ data: navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl, currentCacheNode, currentFlightRouterState, freshnessPolicy, shouldScroll, collectedDebugInfo)
97
108
  };
98
109
  }
99
- function navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, canonicalUrl, renderedSearch, shouldScroll, hash) {
110
+ function navigateToSeededRoute(now, url, canonicalUrl, navigationSeed, currentUrl, currentCacheNode, currentFlightRouterState, freshnessPolicy, nextUrl, shouldScroll) {
111
+ // A version of navigate() that accepts the target route tree as an argument
112
+ // rather than reading it from the prefetch cache.
113
+ const accumulation = {
114
+ scrollableSegments: null,
115
+ separateRefreshUrls: null
116
+ };
117
+ const isSamePageNavigation = url.href === currentUrl.href;
118
+ const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentCacheNode, currentFlightRouterState, navigationSeed.tree, freshnessPolicy, navigationSeed.data, navigationSeed.head, null, null, false, isSamePageNavigation, accumulation);
119
+ if (task !== null) {
120
+ (0, _pprnavigations.spawnDynamicRequests)(task, url, nextUrl, freshnessPolicy, accumulation);
121
+ return navigationTaskToResult(task, canonicalUrl, navigationSeed.renderedSearch, accumulation.scrollableSegments, shouldScroll, url.hash);
122
+ }
123
+ // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.
124
+ return {
125
+ tag: _types.NavigationResultTag.MPA,
126
+ data: canonicalUrl
127
+ };
128
+ }
129
+ function navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, canonicalUrl, renderedSearch, freshnessPolicy, shouldScroll) {
100
130
  // Recursively construct a prefetch tree by reading from the Segment Cache. To
101
131
  // maintain compatibility, we output the same data structures as the old
102
132
  // prefetching implementation: FlightRouterState and CacheNodeSeedData.
103
133
  // TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should
104
134
  // read from the Segment Cache directly. It's only structured this way for now
105
135
  // so we can share code with the old prefetching implementation.
106
- const scrollableSegments = [];
107
- const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, scrollableSegments);
136
+ const accumulation = {
137
+ scrollableSegments: null,
138
+ separateRefreshUrls: null
139
+ };
140
+ const seedData = null;
141
+ const seedHead = null;
142
+ const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, freshnessPolicy, seedData, seedHead, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, accumulation);
108
143
  if (task !== null) {
109
- const dynamicRequestTree = task.dynamicRequestTree;
110
- if (dynamicRequestTree !== null) {
111
- const promiseForDynamicServerResponse = (0, _fetchserverresponse.fetchServerResponse)(new URL(canonicalUrl, url.origin), {
112
- flightRouterState: dynamicRequestTree,
113
- nextUrl
114
- });
115
- (0, _pprnavigations.listenForDynamicRequest)(task, promiseForDynamicServerResponse);
116
- } else {
117
- // The prefetched tree does not contain dynamic holes — it's
118
- // fully static. We can skip the dynamic request.
119
- }
120
- return navigationTaskToResult(task, currentCacheNode, canonicalUrl, renderedSearch, scrollableSegments, shouldScroll, hash);
144
+ (0, _pprnavigations.spawnDynamicRequests)(task, url, nextUrl, freshnessPolicy, accumulation);
145
+ return navigationTaskToResult(task, canonicalUrl, renderedSearch, accumulation.scrollableSegments, shouldScroll, url.hash);
121
146
  }
122
- // The server sent back an empty tree patch. There's nothing to update, except
123
- // possibly the URL.
147
+ // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.
124
148
  return {
125
- tag: _types.NavigationResultTag.NoOp,
126
- data: {
127
- canonicalUrl,
128
- shouldScroll
129
- }
149
+ tag: _types.NavigationResultTag.MPA,
150
+ data: canonicalUrl
130
151
  };
131
152
  }
132
- function navigationTaskToResult(task, currentCacheNode, canonicalUrl, renderedSearch, scrollableSegments, shouldScroll, hash) {
133
- const flightRouterState = task.route;
134
- if (flightRouterState === null) {
135
- // When no router state is provided, it signals that we should perform an
136
- // MPA navigation.
137
- return {
138
- tag: _types.NavigationResultTag.MPA,
139
- data: canonicalUrl
140
- };
141
- }
142
- const newCacheNode = task.node;
153
+ function navigationTaskToResult(task, canonicalUrl, renderedSearch, scrollableSegments, shouldScroll, hash) {
143
154
  return {
144
155
  tag: _types.NavigationResultTag.Success,
145
156
  data: {
146
- flightRouterState,
147
- cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,
157
+ flightRouterState: task.route,
158
+ cacheNode: task.node,
148
159
  canonicalUrl,
149
160
  renderedSearch,
150
161
  scrollableSegments,
@@ -187,10 +198,17 @@ function readRenderSnapshotFromCache(now, route, tree) {
187
198
  const promiseForFulfilledEntry = (0, _cache.waitForSegmentCacheEntry)(segmentEntry);
188
199
  rsc = promiseForFulfilledEntry.then((entry)=>entry !== null ? entry.rsc : null);
189
200
  loading = promiseForFulfilledEntry.then((entry)=>entry !== null ? entry.loading : null);
190
- // Since we don't know yet whether the segment is partial or fully
191
- // static, we must assume it's partial; we can't skip the
192
- // dynamic request.
193
- isPartial = true;
201
+ // Because the request is still pending, we typically don't know yet
202
+ // whether the response will be partial. We shouldn't skip this segment
203
+ // during the dynamic navigation request. Otherwise, we might need to
204
+ // do yet another request to fill in the remaining data, creating
205
+ // a waterfall.
206
+ //
207
+ // The one exception is if this segment is being fetched with via
208
+ // prefetch={true} (i.e. the "force stale" or "full" strategy). If so,
209
+ // we can assume the response will be full. This field is set to `false`
210
+ // for such segments.
211
+ isPartial = segmentEntry.isPartial;
194
212
  break;
195
213
  }
196
214
  case _cache.EntryStatus.Empty:
@@ -247,7 +265,7 @@ function readHeadSnapshotFromCache(now, route) {
247
265
  {
248
266
  const promiseForFulfilledEntry = (0, _cache.waitForSegmentCacheEntry)(segmentEntry);
249
267
  rsc = promiseForFulfilledEntry.then((entry)=>entry !== null ? entry.rsc : null);
250
- isPartial = true;
268
+ isPartial = segmentEntry.isPartial;
251
269
  break;
252
270
  }
253
271
  case _cache.EntryStatus.Empty:
@@ -262,7 +280,18 @@ function readHeadSnapshotFromCache(now, route) {
262
280
  isPartial
263
281
  };
264
282
  }
265
- async function navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, shouldScroll, hash, collectedDebugInfo) {
283
+ // Used to request all the dynamic data for a route, rather than just a subset,
284
+ // e.g. during a refresh or a revalidation. Typically this gets constructed
285
+ // during the normal flow when diffing the route tree, but for an unprefetched
286
+ // navigation, where we don't know the structure of the target route, we use
287
+ // this instead.
288
+ const DynamicRequestTreeForEntireRoute = [
289
+ '',
290
+ {},
291
+ null,
292
+ 'refetch'
293
+ ];
294
+ async function navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl, currentCacheNode, currentFlightRouterState, freshnessPolicy, shouldScroll, collectedDebugInfo) {
266
295
  // Runs when a navigation happens but there's no cached prefetch we can use.
267
296
  // Don't bother to wait for a prefetch response; go straight to a full
268
297
  // navigation that contains both static and dynamic data in a single stream.
@@ -274,8 +303,24 @@ async function navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl,
274
303
  // use the same server response to write the actual data into the CacheNode
275
304
  // tree. So it's the same flow as the "happy path" (prefetch, then
276
305
  // navigation), except we use a single server response for both stages.
306
+ let dynamicRequestTree;
307
+ switch(freshnessPolicy){
308
+ case _pprnavigations.FreshnessPolicy.Default:
309
+ case _pprnavigations.FreshnessPolicy.HistoryTraversal:
310
+ dynamicRequestTree = currentFlightRouterState;
311
+ break;
312
+ case _pprnavigations.FreshnessPolicy.Hydration:
313
+ case _pprnavigations.FreshnessPolicy.RefreshAll:
314
+ case _pprnavigations.FreshnessPolicy.HMRRefresh:
315
+ dynamicRequestTree = DynamicRequestTreeForEntireRoute;
316
+ break;
317
+ default:
318
+ freshnessPolicy;
319
+ dynamicRequestTree = currentFlightRouterState;
320
+ break;
321
+ }
277
322
  const promiseForDynamicServerResponse = (0, _fetchserverresponse.fetchServerResponse)(url, {
278
- flightRouterState: currentFlightRouterState,
323
+ flightRouterState: dynamicRequestTree,
279
324
  nextUrl
280
325
  });
281
326
  const result = await promiseForDynamicServerResponse;
@@ -294,65 +339,50 @@ async function navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl,
294
339
  // Since the response format of dynamic requests and prefetches is slightly
295
340
  // different, we'll need to massage the data a bit. Create FlightRouterState
296
341
  // tree that simulates what we'd receive as the result of a prefetch.
297
- const prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(currentFlightRouterState, flightData);
298
- // In our simulated prefetch payload, we pretend that there's no seed data
299
- // nor a prefetch head.
300
- const prefetchSeedData = null;
301
- const prefetchHead = null;
302
- const isPrefetchHeadPartial = true;
303
- // Now we proceed exactly as we would for normal navigation.
304
- const scrollableSegments = [];
305
- const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, scrollableSegments);
306
- if (task !== null) {
307
- // In this case, we've already sent the dynamic request, so we don't
308
- // actually use the request tree created by `startPPRNavigation`,
309
- // except to check if it contains dynamic holes.
310
- //
311
- // This is almost always true, but it could be false if all the segment data
312
- // was present in the cache, but the route tree was not. E.g. navigating
313
- // to a URL that was not prefetched but rewrites to a different URL
314
- // that was.
315
- const hasDynamicHoles = task.dynamicRequestTree !== null;
316
- if (hasDynamicHoles) {
317
- (0, _pprnavigations.listenForDynamicRequest)(task, promiseForDynamicServerResponse);
318
- } else {
319
- // The prefetched tree does not contain dynamic holes — it's
320
- // fully static. We don't need to process the server response further.
321
- }
322
- return navigationTaskToResult(task, currentCacheNode, (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl), renderedSearch, scrollableSegments, shouldScroll, hash);
323
- }
324
- // The server sent back an empty tree patch. There's nothing to update, except
325
- // possibly the URL.
326
- return {
327
- tag: _types.NavigationResultTag.NoOp,
328
- data: {
329
- canonicalUrl: (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl),
330
- shouldScroll
331
- }
332
- };
342
+ const navigationSeed = convertServerPatchToFullTree(currentFlightRouterState, flightData, renderedSearch);
343
+ return navigateToSeededRoute(now, url, (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl), navigationSeed, currentUrl, currentCacheNode, currentFlightRouterState, freshnessPolicy, nextUrl, shouldScroll);
333
344
  }
334
- function simulatePrefetchTreeUsingDynamicTreePatch(currentTree, flightData) {
335
- // Takes the current FlightRouterState and applies the router state patch
336
- // received from the server, to create a full FlightRouterState tree that we
337
- // can pretend was returned by a prefetch.
345
+ function convertServerPatchToFullTree(currentTree, flightData, renderedSearch) {
346
+ // During a client navigation or prefetch, the server sends back only a patch
347
+ // for the parts of the tree that have changed.
348
+ //
349
+ // This applies the patch to the base tree to create a full representation of
350
+ // the resulting tree.
338
351
  //
339
- // (It sounds similar to what applyRouterStatePatch does, but it doesn't need
340
- // to handle stuff like interception routes or diffing since that will be
341
- // handled later.)
352
+ // The return type includes a full FlightRouterState tree and a full
353
+ // CacheNodeSeedData tree. (Conceptually these are the same tree, and should
354
+ // eventually be unified, but there's still lots of existing code that
355
+ // operates on FlightRouterState trees alone without the CacheNodeSeedData.)
356
+ //
357
+ // TODO: This similar to what apply-router-state-patch-to-tree does. It
358
+ // will eventually fully replace it. We should get rid of all the remaining
359
+ // places where we iterate over the server patch format. This should also
360
+ // eventually replace normalizeFlightData.
342
361
  let baseTree = currentTree;
343
- for (const { segmentPath, tree: treePatch } of flightData){
344
- // If the server sends us multiple tree patches, we only need to clone the
345
- // base tree when applying the first patch. After the first patch, we can
346
- // apply the remaining patches in place without copying.
347
- const canMutateInPlace = baseTree !== currentTree;
348
- baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(baseTree, treePatch, segmentPath, canMutateInPlace, 0);
362
+ let baseData = null;
363
+ let head = null;
364
+ for (const { segmentPath, tree: treePatch, seedData: dataPatch, head: headPatch } of flightData){
365
+ const result = convertServerPatchToFullTreeImpl(baseTree, baseData, treePatch, dataPatch, segmentPath, 0);
366
+ baseTree = result.tree;
367
+ baseData = result.data;
368
+ // This is the same for all patches per response, so just pick an
369
+ // arbitrary one
370
+ head = headPatch;
349
371
  }
350
- return baseTree;
372
+ return {
373
+ tree: baseTree,
374
+ data: baseData,
375
+ renderedSearch,
376
+ head
377
+ };
351
378
  }
352
- function simulatePrefetchTreeUsingDynamicTreePatchImpl(baseRouterState, patch, segmentPath, canMutateInPlace, index) {
379
+ function convertServerPatchToFullTreeImpl(baseRouterState, baseData, treePatch, dataPatch, segmentPath, index) {
353
380
  if (index === segmentPath.length) {
354
381
  // We reached the part of the tree that we need to patch.
355
- return patch;
382
+ return {
383
+ tree: treePatch,
384
+ data: dataPatch
385
+ };
356
386
  }
357
387
  // segmentPath represents the parent path of subtree. It's a repeating
358
388
  // pattern of parallel route key and segment:
@@ -361,50 +391,63 @@ function simulatePrefetchTreeUsingDynamicTreePatchImpl(baseRouterState, patch, s
361
391
  //
362
392
  // This path tells us which part of the base tree to apply the tree patch.
363
393
  //
364
- // NOTE: In the case of a fully dynamic request with no prefetch, we receive
365
- // the FlightRouterState patch in the same request as the dynamic data.
366
- // Therefore we don't need to worry about diffing the segment values; we can
367
- // assume the server sent us a correct result.
394
+ // NOTE: We receive the FlightRouterState patch in the same request as the
395
+ // seed data patch. Therefore we don't need to worry about diffing the segment
396
+ // values; we can assume the server sent us a correct result.
368
397
  const updatedParallelRouteKey = segmentPath[index];
369
398
  // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above
370
- const baseChildren = baseRouterState[1];
371
- const newChildren = {};
372
- for(const parallelRouteKey in baseChildren){
399
+ const baseTreeChildren = baseRouterState[1];
400
+ const baseSeedDataChildren = baseData !== null ? baseData[1] : null;
401
+ const newTreeChildren = {};
402
+ const newSeedDataChildren = {};
403
+ for(const parallelRouteKey in baseTreeChildren){
404
+ const childBaseRouterState = baseTreeChildren[parallelRouteKey];
405
+ const childBaseSeedData = baseSeedDataChildren !== null ? baseSeedDataChildren[parallelRouteKey] ?? null : null;
373
406
  if (parallelRouteKey === updatedParallelRouteKey) {
374
- const childBaseRouterState = baseChildren[parallelRouteKey];
375
- newChildren[parallelRouteKey] = simulatePrefetchTreeUsingDynamicTreePatchImpl(childBaseRouterState, patch, segmentPath, canMutateInPlace, // Advance the index by two and keep cloning until we reach
407
+ const result = convertServerPatchToFullTreeImpl(childBaseRouterState, childBaseSeedData, treePatch, dataPatch, segmentPath, // Advance the index by two and keep cloning until we reach
376
408
  // the end of the segment path.
377
409
  index + 2);
410
+ newTreeChildren[parallelRouteKey] = result.tree;
411
+ newSeedDataChildren[parallelRouteKey] = result.data;
378
412
  } else {
379
413
  // This child is not being patched. Copy it over as-is.
380
- newChildren[parallelRouteKey] = baseChildren[parallelRouteKey];
414
+ newTreeChildren[parallelRouteKey] = childBaseRouterState;
415
+ newSeedDataChildren[parallelRouteKey] = childBaseSeedData;
381
416
  }
382
417
  }
383
- if (canMutateInPlace) {
384
- // We can mutate the base tree in place, because the base tree is already
385
- // a clone.
386
- baseRouterState[1] = newChildren;
387
- return baseRouterState;
388
- }
418
+ let clonedTree;
419
+ let clonedSeedData;
389
420
  // Clone all the fields except the children.
390
- //
391
- // Based on equivalent logic in apply-router-state-patch-to-tree, but should
392
- // confirm whether we need to copy all of these fields. Not sure the server
393
- // ever sends, e.g. the refetch marker.
394
- const clone = [
421
+ // Clone the FlightRouterState tree. Based on equivalent logic in
422
+ // apply-router-state-patch-to-tree, but should confirm whether we need to
423
+ // copy all of these fields. Not sure the server ever sends, e.g. the
424
+ // refetch marker.
425
+ clonedTree = [
395
426
  baseRouterState[0],
396
- newChildren
427
+ newTreeChildren
397
428
  ];
398
429
  if (2 in baseRouterState) {
399
- clone[2] = baseRouterState[2];
430
+ clonedTree[2] = baseRouterState[2];
400
431
  }
401
432
  if (3 in baseRouterState) {
402
- clone[3] = baseRouterState[3];
433
+ clonedTree[3] = baseRouterState[3];
403
434
  }
404
435
  if (4 in baseRouterState) {
405
- clone[4] = baseRouterState[4];
436
+ clonedTree[4] = baseRouterState[4];
406
437
  }
407
- return clone;
438
+ // Clone the CacheNodeSeedData tree.
439
+ const isEmptySeedDataPartial = true;
440
+ clonedSeedData = [
441
+ null,
442
+ newSeedDataChildren,
443
+ null,
444
+ isEmptySeedDataPartial,
445
+ false
446
+ ];
447
+ return {
448
+ tree: clonedTree,
449
+ data: clonedSeedData
450
+ };
408
451
  }
409
452
 
410
453
  if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {