@sveltejs/kit 1.0.0-next.392 → 1.0.0-next.395

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.
@@ -4,6 +4,7 @@ import { assets, set_paths } from '../paths.js';
4
4
  import Root from '__GENERATED__/root.svelte';
5
5
  import { components, dictionary, matchers } from '__GENERATED__/client-manifest.js';
6
6
  import { init } from './singletons.js';
7
+ export { set_public_env } from '../env-public.js';
7
8
 
8
9
  /**
9
10
  * @param {unknown} err
@@ -569,6 +570,9 @@ function create_client({ target, session, base, trailing_slash }) {
569
570
  if (!ready) return;
570
571
  session_id += 1;
571
572
 
573
+ const current_load_uses_session = current.branch.some((node) => node?.uses.session);
574
+ if (!current_load_uses_session) return;
575
+
572
576
  update(new URL(location.href), [], true);
573
577
  });
574
578
  ready = true;
@@ -876,8 +880,11 @@ function create_client({ target, session, base, trailing_slash }) {
876
880
  };
877
881
 
878
882
  for (let i = 0; i < filtered.length; i += 1) {
879
- const loaded = filtered[i].loaded;
880
- result.props[`props_${i}`] = loaded ? await loaded.props : null;
883
+ // Only set props if the node actually updated. This prevents needless rerenders.
884
+ if (!current.branch.some((node) => node === filtered[i])) {
885
+ const loaded = filtered[i].loaded;
886
+ result.props[`props_${i}`] = loaded ? await loaded.props : null;
887
+ }
881
888
  }
882
889
 
883
890
  const page_changed =
@@ -0,0 +1 @@
1
+ export { env } from '../../env-private.js';
@@ -0,0 +1 @@
1
+ export { env } from '../../env-public.js';
@@ -0,0 +1,9 @@
1
+ /** @type {App.PrivateEnv} */
2
+ let env = {};
3
+
4
+ /** @type {(environment: Record<string, string>) => void} */
5
+ function set_private_env(environment) {
6
+ env = environment;
7
+ }
8
+
9
+ export { env, set_private_env };
@@ -0,0 +1,9 @@
1
+ /** @type {App.PublicEnv} */
2
+ let env = {};
3
+
4
+ /** @type {(environment: Record<string, string>) => void} */
5
+ function set_public_env(environment) {
6
+ env = environment;
7
+ }
8
+
9
+ export { env, set_public_env };
@@ -1474,7 +1474,10 @@ async function render_response({
1474
1474
 
1475
1475
  // prettier-ignore
1476
1476
  const init_app = `
1477
- import { start } from ${s(options.prefix + entry.file)};
1477
+ import { set_public_env, start } from ${s(options.prefix + entry.file)};
1478
+
1479
+ set_public_env(${s(options.public_env)});
1480
+
1478
1481
  start({
1479
1482
  target: document.querySelector('[data-sveltekit-hydrate="${target}"]').parentNode,
1480
1483
  paths: ${s(options.paths)},