@sveltejs/kit 2.69.2 → 2.69.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -636,6 +636,16 @@ export function tweak_types(content, is_server) {
|
|
|
636
636
|
const code = new MagicString(content);
|
|
637
637
|
|
|
638
638
|
const exports = new Map();
|
|
639
|
+
/** @param {import('typescript').BindingName} name */
|
|
640
|
+
function add_export(name) {
|
|
641
|
+
if (ts.isIdentifier(name)) {
|
|
642
|
+
if (names.has(name.text)) exports.set(name.text, name.text);
|
|
643
|
+
} else {
|
|
644
|
+
for (const element of name.elements) {
|
|
645
|
+
if (ts.isBindingElement(element)) add_export(element.name);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
639
649
|
|
|
640
650
|
ast.forEachChild((node) => {
|
|
641
651
|
if (
|
|
@@ -662,9 +672,7 @@ export function tweak_types(content, is_server) {
|
|
|
662
672
|
|
|
663
673
|
if (ts.isVariableStatement(node)) {
|
|
664
674
|
node.declarationList.declarations.forEach((declaration) => {
|
|
665
|
-
|
|
666
|
-
exports.set(declaration.name.text, declaration.name.text);
|
|
667
|
-
}
|
|
675
|
+
add_export(declaration.name);
|
|
668
676
|
});
|
|
669
677
|
}
|
|
670
678
|
}
|
|
@@ -981,7 +981,7 @@ async function kit({ svelte_config }) {
|
|
|
981
981
|
|
|
982
982
|
if (is_build) {
|
|
983
983
|
const ssr = /** @type {boolean} */ (config.build?.ssr);
|
|
984
|
-
const
|
|
984
|
+
const app_immutable = `${kit.appDir}/immutable`;
|
|
985
985
|
|
|
986
986
|
/** @type {Record<string, string>} */
|
|
987
987
|
const input = {};
|
|
@@ -1071,9 +1071,9 @@ async function kit({ svelte_config }) {
|
|
|
1071
1071
|
|
|
1072
1072
|
/** @type {string} */
|
|
1073
1073
|
const base = (kit.paths.assets || kit.paths.base) + '/';
|
|
1074
|
-
const root_to_assets =
|
|
1074
|
+
const root_to_assets = app_immutable + '/assets/';
|
|
1075
1075
|
const assets_to_root =
|
|
1076
|
-
|
|
1076
|
+
app_immutable
|
|
1077
1077
|
.split('/')
|
|
1078
1078
|
.map(() => '..')
|
|
1079
1079
|
.join('/') + '/../';
|
|
@@ -1099,9 +1099,11 @@ async function kit({ svelte_config }) {
|
|
|
1099
1099
|
output: {
|
|
1100
1100
|
format: inline ? 'iife' : 'esm',
|
|
1101
1101
|
name: `__sveltekit_${version_hash}.app`,
|
|
1102
|
-
entryFileNames: ssr ? '[name].js' : `${
|
|
1103
|
-
chunkFileNames: ssr
|
|
1104
|
-
|
|
1102
|
+
entryFileNames: ssr ? '[name].js' : `${app_immutable}/[name].[hash].${ext}`,
|
|
1103
|
+
chunkFileNames: ssr
|
|
1104
|
+
? 'chunks/[name].js'
|
|
1105
|
+
: `${app_immutable}/chunks/[hash].${ext}`,
|
|
1106
|
+
assetFileNames: `${app_immutable}/assets/[name].[hash][extname]`,
|
|
1105
1107
|
hoistTransitiveImports: false,
|
|
1106
1108
|
sourcemapIgnoreList,
|
|
1107
1109
|
inlineDynamicImports: is_rolldown ? undefined : !split
|
|
@@ -1129,9 +1131,9 @@ async function kit({ svelte_config }) {
|
|
|
1129
1131
|
worker: {
|
|
1130
1132
|
rollupOptions: {
|
|
1131
1133
|
output: {
|
|
1132
|
-
entryFileNames: `${
|
|
1133
|
-
chunkFileNames: `${
|
|
1134
|
-
assetFileNames: `${
|
|
1134
|
+
entryFileNames: `${app_immutable}/workers/[name]-[hash].js`,
|
|
1135
|
+
chunkFileNames: `${app_immutable}/workers/chunks/[hash].js`,
|
|
1136
|
+
assetFileNames: `${app_immutable}/workers/assets/[name]-[hash][extname]`,
|
|
1135
1137
|
hoistTransitiveImports: false
|
|
1136
1138
|
}
|
|
1137
1139
|
}
|
|
@@ -1151,6 +1153,11 @@ async function kit({ svelte_config }) {
|
|
|
1151
1153
|
return { relative };
|
|
1152
1154
|
}
|
|
1153
1155
|
|
|
1156
|
+
if (!relative) return;
|
|
1157
|
+
|
|
1158
|
+
// ensure assets loaded by CSS files are loaded relative to the
|
|
1159
|
+
// CSS file rather than the default of relative to the root
|
|
1160
|
+
|
|
1154
1161
|
// _app/immutable/assets files
|
|
1155
1162
|
if (filename.startsWith(root_to_assets)) {
|
|
1156
1163
|
return `./${filename.slice(root_to_assets.length)}`;
|
|
@@ -15,10 +15,11 @@ const INVALID_COOKIE_CHARACTER_REGEX = /[\x00-\x1F\x7F()<>@,;:"/[\]?={} \t]/;
|
|
|
15
15
|
const cookie_paths = {};
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Cookies
|
|
19
|
-
*
|
|
18
|
+
* Cookies whose name and value combined are larger than this size are
|
|
19
|
+
* discarded by browsers. This is the limit codified for the name/value pair
|
|
20
|
+
* in RFC 6265bis: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-20#section-5.6-7.5.1
|
|
20
21
|
*/
|
|
21
|
-
const MAX_COOKIE_SIZE =
|
|
22
|
+
const MAX_COOKIE_SIZE = 4096;
|
|
22
23
|
|
|
23
24
|
// TODO 3.0 remove this check
|
|
24
25
|
/** @param {import('./page/types.js').Cookie['options']} options */
|
|
@@ -254,8 +255,11 @@ export function get_cookies(request, url) {
|
|
|
254
255
|
new_cookies.set(cookie_key, cookie);
|
|
255
256
|
|
|
256
257
|
if (DEV) {
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
// only the name/value pair counts towards MAX_COOKIE_SIZE, not the other attributes
|
|
259
|
+
const encoder = cookie.options.encode || encodeURIComponent;
|
|
260
|
+
const size =
|
|
261
|
+
text_encoder.encode(name).byteLength + text_encoder.encode(encoder(value)).byteLength;
|
|
262
|
+
if (size > MAX_COOKIE_SIZE) {
|
|
259
263
|
throw new Error(`Cookie "${name}" is too large, and will be discarded by the browser`);
|
|
260
264
|
}
|
|
261
265
|
|
package/src/version.js
CHANGED