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
@@ -8,83 +8,11 @@ Object.defineProperty(exports, "hmrRefreshReducer", {
8
8
  return hmrRefreshReducer;
9
9
  }
10
10
  });
11
- const _fetchserverresponse = require("../fetch-server-response");
12
- const _createhreffromurl = require("../create-href-from-url");
13
- const _applyrouterstatepatchtotree = require("../apply-router-state-patch-to-tree");
14
- const _isnavigatingtonewrootlayout = require("../is-navigating-to-new-root-layout");
15
- const _navigatereducer = require("./navigate-reducer");
16
- const _handlemutable = require("../handle-mutable");
17
- const _applyflightdata = require("../apply-flight-data");
18
- const _approuter = require("../../app-router");
19
- const _handlesegmentmismatch = require("../handle-segment-mismatch");
20
- const _hasinterceptionrouteincurrenttree = require("./has-interception-route-in-current-tree");
21
- // A version of refresh reducer that keeps the cache around instead of wiping all of it.
22
- function hmrRefreshReducerImpl(state, action) {
23
- const { origin } = action;
24
- const mutable = {};
25
- const href = state.canonicalUrl;
26
- mutable.preserveCustomHistoryState = false;
27
- const cache = (0, _approuter.createEmptyCacheNode)();
28
- // If the current tree was intercepted, the nextUrl should be included in the request.
29
- // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.
30
- const includeNextUrl = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree);
31
- // TODO-APP: verify that `href` is not an external url.
32
- // Fetch data from the root of the tree.
33
- const navigatedAt = Date.now();
34
- cache.lazyData = (0, _fetchserverresponse.fetchServerResponse)(new URL(href, origin), {
35
- flightRouterState: [
36
- state.tree[0],
37
- state.tree[1],
38
- state.tree[2],
39
- 'refetch'
40
- ],
41
- nextUrl: includeNextUrl ? state.nextUrl : null,
42
- isHmrRefresh: true
43
- });
44
- return cache.lazyData.then((result)=>{
45
- // Handle case when navigating to page in `pages` from `app`
46
- if (typeof result === 'string') {
47
- return (0, _navigatereducer.handleExternalUrl)(state, mutable, result, state.pushRef.pendingPush);
48
- }
49
- const { flightData, canonicalUrl, renderedSearch } = result;
50
- // Remove cache.lazyData as it has been resolved at this point.
51
- cache.lazyData = null;
52
- let currentTree = state.tree;
53
- let currentCache = state.cache;
54
- for (const normalizedFlightData of flightData){
55
- const { tree: treePatch, isRootRender } = normalizedFlightData;
56
- if (!isRootRender) {
57
- // TODO-APP: handle this case better
58
- console.log('REFRESH FAILED');
59
- return state;
60
- }
61
- const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''
62
- [
63
- ''
64
- ], currentTree, treePatch, state.canonicalUrl);
65
- if (newTree === null) {
66
- return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);
67
- }
68
- if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {
69
- return (0, _navigatereducer.handleExternalUrl)(state, mutable, href, state.pushRef.pendingPush);
70
- }
71
- const applied = (0, _applyflightdata.applyFlightData)(navigatedAt, currentCache, cache, normalizedFlightData);
72
- if (applied) {
73
- mutable.cache = cache;
74
- currentCache = cache;
75
- }
76
- mutable.patchedTree = newTree;
77
- mutable.renderedSearch = renderedSearch;
78
- mutable.canonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl);
79
- currentTree = newTree;
80
- }
81
- return (0, _handlemutable.handleMutable)(state, mutable);
82
- }, ()=>state);
11
+ const _refreshreducer = require("./refresh-reducer");
12
+ const _pprnavigations = require("../ppr-navigations");
13
+ function hmrRefreshReducer(state) {
14
+ return (0, _refreshreducer.refreshDynamicData)(state, _pprnavigations.FreshnessPolicy.HMRRefresh);
83
15
  }
84
- function hmrRefreshReducerNoop(state, _action) {
85
- return state;
86
- }
87
- const hmrRefreshReducer = process.env.NODE_ENV === 'production' ? hmrRefreshReducerNoop : hmrRefreshReducerImpl;
88
16
 
89
17
  if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
90
18
  Object.defineProperty(exports.default, '__esModule', { value: true });
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  STATIC_STALETIME_MS: null,
8
8
  generateSegmentsFromPatch: null,
9
9
  handleExternalUrl: null,
10
+ handleNavigationResult: null,
10
11
  navigateReducer: null
11
12
  });
12
13
  function _export(target, all) {
@@ -28,6 +29,9 @@ _export(exports, {
28
29
  handleExternalUrl: function() {
29
30
  return handleExternalUrl;
30
31
  },
32
+ handleNavigationResult: function() {
33
+ return handleNavigationResult;
34
+ },
31
35
  navigateReducer: function() {
32
36
  return navigateReducer;
33
37
  }
@@ -37,6 +41,7 @@ const _handlemutable = require("../handle-mutable");
37
41
  const _navigation = require("../../segment-cache/navigation");
38
42
  const _types = require("../../segment-cache/types");
39
43
  const _cache = require("../../segment-cache/cache");
44
+ const _pprnavigations = require("../ppr-navigations");
40
45
  const DYNAMIC_STALETIME_MS = Number(process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME) * 1000;
41
46
  const STATIC_STALETIME_MS = (0, _cache.getStaleTimeMs)(Number(process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME));
42
47
  function handleExternalUrl(state, mutable, url, pendingPush) {
@@ -83,12 +88,22 @@ function handleNavigationResult(url, state, mutable, pendingPush, result) {
83
88
  const newUrl = result.data;
84
89
  return handleExternalUrl(state, mutable, newUrl, pendingPush);
85
90
  }
86
- case _types.NavigationResultTag.NoOp:
91
+ case _types.NavigationResultTag.Success:
87
92
  {
88
- // The server responded with no change to the current page. However, if
89
- // the URL changed, we still need to update that.
90
- const newCanonicalUrl = result.data.canonicalUrl;
91
- mutable.canonicalUrl = newCanonicalUrl;
93
+ // Received a new result.
94
+ mutable.cache = result.data.cacheNode;
95
+ mutable.patchedTree = result.data.flightRouterState;
96
+ mutable.renderedSearch = result.data.renderedSearch;
97
+ mutable.canonicalUrl = result.data.canonicalUrl;
98
+ // TODO: During a refresh, we don't set the `scrollableSegments`. There's
99
+ // some confusing and subtle logic in `handleMutable` that decides what
100
+ // to do when `shouldScroll` is set but `scrollableSegments` is not. I'm
101
+ // not convinced it's totally coherent but the tests assert on this
102
+ // particular behavior so I've ported the logic as-is from the previous
103
+ // router implementation, for now.
104
+ mutable.scrollableSegments = result.data.scrollableSegments ?? undefined;
105
+ mutable.shouldScroll = result.data.shouldScroll;
106
+ mutable.hashFragment = result.data.hash;
92
107
  // Check if the only thing that changed was the hash fragment.
93
108
  const oldUrl = new URL(state.canonicalUrl, url);
94
109
  const onlyHashChange = // We don't need to compare the origins, because client-driven
@@ -105,18 +120,6 @@ function handleNavigationResult(url, state, mutable, pendingPush, result) {
105
120
  }
106
121
  return (0, _handlemutable.handleMutable)(state, mutable);
107
122
  }
108
- case _types.NavigationResultTag.Success:
109
- {
110
- // Received a new result.
111
- mutable.cache = result.data.cacheNode;
112
- mutable.patchedTree = result.data.flightRouterState;
113
- mutable.renderedSearch = result.data.renderedSearch;
114
- mutable.canonicalUrl = result.data.canonicalUrl;
115
- mutable.scrollableSegments = result.data.scrollableSegments;
116
- mutable.shouldScroll = result.data.shouldScroll;
117
- mutable.hashFragment = result.data.hash;
118
- return (0, _handlemutable.handleMutable)(state, mutable);
119
- }
120
123
  case _types.NavigationResultTag.Async:
121
124
  {
122
125
  return result.data.then((asyncResult)=>handleNavigationResult(url, state, mutable, pendingPush, asyncResult), // If the navigation failed, return the current state.
@@ -152,7 +155,7 @@ function navigateReducer(state, action) {
152
155
  // implementation. Eventually we'll rewrite the router reducer to a
153
156
  // state machine.
154
157
  const currentUrl = new URL(state.canonicalUrl, location.origin);
155
- const result = (0, _navigation.navigate)(url, currentUrl, state.cache, state.tree, state.nextUrl, shouldScroll, mutable);
158
+ const result = (0, _navigation.navigate)(url, currentUrl, state.cache, state.tree, state.nextUrl, _pprnavigations.FreshnessPolicy.Default, shouldScroll, mutable);
156
159
  return handleNavigationResult(url, state, mutable, pendingPush, result);
157
160
  }
158
161
 
@@ -2,98 +2,61 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "refreshReducer", {
6
- enumerable: true,
7
- get: function() {
5
+ 0 && (module.exports = {
6
+ refreshDynamicData: null,
7
+ refreshReducer: null
8
+ });
9
+ function _export(target, all) {
10
+ for(var name in all)Object.defineProperty(target, name, {
11
+ enumerable: true,
12
+ get: all[name]
13
+ });
14
+ }
15
+ _export(exports, {
16
+ refreshDynamicData: function() {
17
+ return refreshDynamicData;
18
+ },
19
+ refreshReducer: function() {
8
20
  return refreshReducer;
9
21
  }
10
22
  });
11
- const _fetchserverresponse = require("../fetch-server-response");
12
- const _createhreffromurl = require("../create-href-from-url");
13
- const _applyrouterstatepatchtotree = require("../apply-router-state-patch-to-tree");
14
- const _isnavigatingtonewrootlayout = require("../is-navigating-to-new-root-layout");
15
23
  const _navigatereducer = require("./navigate-reducer");
16
- const _handlemutable = require("../handle-mutable");
17
- const _filllazyitemstillleafwithhead = require("../fill-lazy-items-till-leaf-with-head");
18
- const _approuter = require("../../app-router");
19
- const _handlesegmentmismatch = require("../handle-segment-mismatch");
20
- const _hasinterceptionrouteincurrenttree = require("./has-interception-route-in-current-tree");
21
- const _refetchinactiveparallelsegments = require("../refetch-inactive-parallel-segments");
24
+ const _navigation = require("../../segment-cache/navigation");
22
25
  const _cache = require("../../segment-cache/cache");
23
- function refreshReducer(state, action) {
24
- const { origin } = action;
26
+ const _hasinterceptionrouteincurrenttree = require("./has-interception-route-in-current-tree");
27
+ const _pprnavigations = require("../ppr-navigations");
28
+ function refreshReducer(state) {
29
+ // TODO: Currently, all refreshes purge the prefetch cache. In the future,
30
+ // only client-side refreshes will have this behavior; the server-side
31
+ // `refresh` should send new data without purging the prefetch cache.
32
+ const currentNextUrl = state.nextUrl;
33
+ const currentRouterState = state.tree;
34
+ (0, _cache.revalidateEntireCache)(currentNextUrl, currentRouterState);
35
+ return refreshDynamicData(state, _pprnavigations.FreshnessPolicy.RefreshAll);
36
+ }
37
+ function refreshDynamicData(state, freshnessPolicy) {
38
+ const currentNextUrl = state.nextUrl;
39
+ // We always send the last next-url, not the current when performing a dynamic
40
+ // request. This is because we update the next-url after a navigation, but we
41
+ // want the same interception route to be matched that used the last next-url.
42
+ const nextUrlForRefresh = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree) ? state.previousNextUrl || currentNextUrl : null;
43
+ // A refresh is modeled as a navigation to the current URL, but where any
44
+ // existing dynamic data (including in shared layouts) is re-fetched.
45
+ const currentCanonicalUrl = state.canonicalUrl;
46
+ const currentUrl = new URL(currentCanonicalUrl, location.origin);
47
+ const currentFlightRouterState = state.tree;
48
+ const shouldScroll = true;
49
+ const navigationSeed = {
50
+ tree: state.tree,
51
+ renderedSearch: state.renderedSearch,
52
+ data: null,
53
+ head: null
54
+ };
55
+ const now = Date.now();
56
+ const result = (0, _navigation.navigateToSeededRoute)(now, currentUrl, currentCanonicalUrl, navigationSeed, currentUrl, state.cache, currentFlightRouterState, freshnessPolicy, nextUrlForRefresh, shouldScroll);
25
57
  const mutable = {};
26
- const href = state.canonicalUrl;
27
- let currentTree = state.tree;
28
58
  mutable.preserveCustomHistoryState = false;
29
- const cache = (0, _approuter.createEmptyCacheNode)();
30
- // If the current tree was intercepted, the nextUrl should be included in the request.
31
- // This is to ensure that the refresh request doesn't get intercepted, accidentally triggering the interception route.
32
- const includeNextUrl = (0, _hasinterceptionrouteincurrenttree.hasInterceptionRouteInCurrentTree)(state.tree);
33
- // TODO-APP: verify that `href` is not an external url.
34
- // Fetch data from the root of the tree.
35
- cache.lazyData = (0, _fetchserverresponse.fetchServerResponse)(new URL(href, origin), {
36
- flightRouterState: [
37
- currentTree[0],
38
- currentTree[1],
39
- currentTree[2],
40
- 'refetch'
41
- ],
42
- nextUrl: includeNextUrl ? state.nextUrl : null
43
- });
44
- const navigatedAt = Date.now();
45
- return cache.lazyData.then(async (result)=>{
46
- // Handle case when navigating to page in `pages` from `app`
47
- if (typeof result === 'string') {
48
- return (0, _navigatereducer.handleExternalUrl)(state, mutable, result, state.pushRef.pendingPush);
49
- }
50
- const { flightData, canonicalUrl, renderedSearch } = result;
51
- // Remove cache.lazyData as it has been resolved at this point.
52
- cache.lazyData = null;
53
- for (const normalizedFlightData of flightData){
54
- const { tree: treePatch, seedData: cacheNodeSeedData, head, isRootRender } = normalizedFlightData;
55
- if (!isRootRender) {
56
- // TODO-APP: handle this case better
57
- console.log('REFRESH FAILED');
58
- return state;
59
- }
60
- const newTree = (0, _applyrouterstatepatchtotree.applyRouterStatePatchToTree)(// TODO-APP: remove ''
61
- [
62
- ''
63
- ], currentTree, treePatch, state.canonicalUrl);
64
- if (newTree === null) {
65
- return (0, _handlesegmentmismatch.handleSegmentMismatch)(state, action, treePatch);
66
- }
67
- if ((0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(currentTree, newTree)) {
68
- return (0, _navigatereducer.handleExternalUrl)(state, mutable, href, state.pushRef.pendingPush);
69
- }
70
- mutable.canonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl);
71
- // Handles case where prefetch only returns the router tree patch without rendered components.
72
- if (cacheNodeSeedData !== null) {
73
- const rsc = cacheNodeSeedData[0];
74
- const loading = cacheNodeSeedData[2];
75
- cache.rsc = rsc;
76
- cache.prefetchRsc = null;
77
- cache.loading = loading;
78
- (0, _filllazyitemstillleafwithhead.fillLazyItemsTillLeafWithHead)(navigatedAt, cache, // Existing cache is not passed in as `router.refresh()` has to invalidate the entire cache.
79
- undefined, treePatch, cacheNodeSeedData, head);
80
- (0, _cache.revalidateEntireCache)(state.nextUrl, newTree);
81
- }
82
- await (0, _refetchinactiveparallelsegments.refreshInactiveParallelSegments)({
83
- navigatedAt,
84
- state,
85
- updatedTree: newTree,
86
- updatedCache: cache,
87
- includeNextUrl,
88
- canonicalUrl: mutable.canonicalUrl || state.canonicalUrl
89
- });
90
- mutable.cache = cache;
91
- mutable.patchedTree = newTree;
92
- mutable.renderedSearch = renderedSearch;
93
- currentTree = newTree;
94
- }
95
- return (0, _handlemutable.handleMutable)(state, mutable);
96
- }, ()=>state);
59
+ return (0, _navigatereducer.handleNavigationResult)(currentUrl, state, mutable, false, result);
97
60
  }
98
61
 
99
62
  if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
@@ -11,9 +11,8 @@ Object.defineProperty(exports, "restoreReducer", {
11
11
  const _createhreffromurl = require("../create-href-from-url");
12
12
  const _computechangedpath = require("../compute-changed-path");
13
13
  const _pprnavigations = require("../ppr-navigations");
14
+ const _navigatereducer = require("./navigate-reducer");
14
15
  function restoreReducer(state, action) {
15
- const { url, historyState } = action;
16
- const href = (0, _createhreffromurl.createHrefFromUrl)(url);
17
16
  // This action is used to restore the router state from the history state.
18
17
  // However, it's possible that the history state no longer contains the `FlightRouterState`.
19
18
  // We will copy over the internal state on pushState/replaceState events, but if a history entry
@@ -22,6 +21,7 @@ function restoreReducer(state, action) {
22
21
  // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state.
23
22
  let treeToRestore;
24
23
  let renderedSearch;
24
+ const historyState = action.historyState;
25
25
  if (historyState) {
26
26
  treeToRestore = historyState.tree;
27
27
  renderedSearch = historyState.renderedSearch;
@@ -29,14 +29,26 @@ function restoreReducer(state, action) {
29
29
  treeToRestore = state.tree;
30
30
  renderedSearch = state.renderedSearch;
31
31
  }
32
- const oldCache = state.cache;
33
- const newCache = process.env.__NEXT_PPR ? // data for any segment whose dynamic data was already received. This
34
- // prevents an unnecessary flash back to PPR state during a
35
- // back/forward navigation.
36
- (0, _pprnavigations.updateCacheNodeOnPopstateRestoration)(oldCache, treeToRestore) : oldCache;
32
+ const currentUrl = new URL(state.canonicalUrl, location.origin);
33
+ const restoredUrl = action.url;
34
+ const restoredCanonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(restoredUrl);
35
+ const restoredNextUrl = (0, _computechangedpath.extractPathFromFlightRouterState)(treeToRestore) ?? restoredUrl.pathname;
36
+ const now = Date.now();
37
+ const accumulation = {
38
+ scrollableSegments: null,
39
+ separateRefreshUrls: null
40
+ };
41
+ const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, state.cache, state.tree, treeToRestore, _pprnavigations.FreshnessPolicy.HistoryTraversal, null, null, null, null, false, false, accumulation);
42
+ if (task === null) {
43
+ const mutable = {
44
+ preserveCustomHistoryState: true
45
+ };
46
+ return (0, _navigatereducer.handleExternalUrl)(state, mutable, restoredCanonicalUrl, false);
47
+ }
48
+ (0, _pprnavigations.spawnDynamicRequests)(task, restoredUrl, restoredNextUrl, _pprnavigations.FreshnessPolicy.HistoryTraversal, accumulation);
37
49
  return {
38
50
  // Set canonical url
39
- canonicalUrl: href,
51
+ canonicalUrl: restoredCanonicalUrl,
40
52
  renderedSearch,
41
53
  pushRef: {
42
54
  pendingPush: false,
@@ -45,10 +57,13 @@ function restoreReducer(state, action) {
45
57
  preserveCustomHistoryState: true
46
58
  },
47
59
  focusAndScrollRef: state.focusAndScrollRef,
48
- cache: newCache,
60
+ cache: task.node,
49
61
  // Restore provided tree
50
62
  tree: treeToRestore,
51
- nextUrl: (0, _computechangedpath.extractPathFromFlightRouterState)(treeToRestore) ?? url.pathname,
63
+ nextUrl: restoredNextUrl,
64
+ // TODO: We need to restore previousNextUrl, too, which represents the
65
+ // Next-Url that was used to fetch the data. Anywhere we fetch using the
66
+ // canonical URL, there should be a corresponding Next-Url.
52
67
  previousNextUrl: null,
53
68
  debugInfo: null
54
69
  };