astro 4.0.0 → 4.0.2
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.
|
@@ -104,6 +104,12 @@ const { fallback = 'animate' } = Astro.props;
|
|
|
104
104
|
let action = submitter?.getAttribute('formaction') ?? form.action ?? location.pathname;
|
|
105
105
|
const method = submitter?.getAttribute('formmethod') ?? form.method;
|
|
106
106
|
|
|
107
|
+
// the "dialog" method is a special keyword used within <dialog> elements
|
|
108
|
+
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-method
|
|
109
|
+
if (method === 'dialog') {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
107
113
|
const options: Options = { sourceElement: submitter ?? form };
|
|
108
114
|
if (method === 'get') {
|
|
109
115
|
const params = new URLSearchParams(formData as any);
|
|
@@ -113,6 +119,7 @@ const { fallback = 'animate' } = Astro.props;
|
|
|
113
119
|
} else {
|
|
114
120
|
options.formData = formData;
|
|
115
121
|
}
|
|
122
|
+
|
|
116
123
|
ev.preventDefault();
|
|
117
124
|
navigate(action, options);
|
|
118
125
|
});
|
package/dist/@types/astro.d.ts
CHANGED
|
@@ -1250,37 +1250,19 @@ export interface AstroUserConfig {
|
|
|
1250
1250
|
/**
|
|
1251
1251
|
* @docs
|
|
1252
1252
|
* @kind heading
|
|
1253
|
-
* @name Legacy Flags
|
|
1254
|
-
* @description
|
|
1255
|
-
* To help some users migrate between versions of Astro, we occasionally introduce `legacy` flags.
|
|
1256
|
-
* These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro
|
|
1257
|
-
* in the latest version, so that you can continue to upgrade and take advantage of new Astro releases.
|
|
1258
|
-
*/
|
|
1259
|
-
legacy?: object;
|
|
1260
|
-
/**
|
|
1261
|
-
* @docs
|
|
1262
|
-
* @kind heading
|
|
1263
|
-
* @name Experimental Flags
|
|
1264
|
-
* @description
|
|
1265
|
-
* Astro offers experimental flags to give users early access to new features.
|
|
1266
|
-
* These flags are not guaranteed to be stable.
|
|
1267
|
-
*/
|
|
1268
|
-
/**
|
|
1269
|
-
* @docs
|
|
1270
1253
|
* @name i18n
|
|
1271
1254
|
* @type {object}
|
|
1272
1255
|
* @version 3.5.0
|
|
1273
1256
|
* @type {object}
|
|
1274
1257
|
* @description
|
|
1275
1258
|
*
|
|
1276
|
-
* Configures
|
|
1259
|
+
* Configures i18n routing and allows you to specify some customization options.
|
|
1277
1260
|
*
|
|
1278
1261
|
* See our guide for more information on [internationalization in Astro](/en/guides/internationalization/)
|
|
1279
1262
|
*/
|
|
1280
1263
|
i18n?: {
|
|
1281
1264
|
/**
|
|
1282
1265
|
* @docs
|
|
1283
|
-
* @kind h4
|
|
1284
1266
|
* @name i18n.defaultLocale
|
|
1285
1267
|
* @type {string}
|
|
1286
1268
|
* @version 3.5.0
|
|
@@ -1293,7 +1275,6 @@ export interface AstroUserConfig {
|
|
|
1293
1275
|
defaultLocale: string;
|
|
1294
1276
|
/**
|
|
1295
1277
|
* @docs
|
|
1296
|
-
* @kind h4
|
|
1297
1278
|
* @name i18n.locales
|
|
1298
1279
|
* @type {Locales}
|
|
1299
1280
|
* @version 3.5.0
|
|
@@ -1308,7 +1289,6 @@ export interface AstroUserConfig {
|
|
|
1308
1289
|
locales: Locales;
|
|
1309
1290
|
/**
|
|
1310
1291
|
* @docs
|
|
1311
|
-
* @kind h4
|
|
1312
1292
|
* @name i18n.fallback
|
|
1313
1293
|
* @type {Record<string, string>}
|
|
1314
1294
|
* @version 3.5.0
|
|
@@ -1324,14 +1304,12 @@ export interface AstroUserConfig {
|
|
|
1324
1304
|
*
|
|
1325
1305
|
* ```js
|
|
1326
1306
|
* export default defineConfig({
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1333
|
-
* fr: "en"
|
|
1334
|
-
* }
|
|
1307
|
+
* i18n: {
|
|
1308
|
+
* defaultLocale: "en",
|
|
1309
|
+
* locales: ["en", "fr", "pt-br", "es"],
|
|
1310
|
+
* fallback: {
|
|
1311
|
+
* pt: "es",
|
|
1312
|
+
* fr: "en"
|
|
1335
1313
|
* }
|
|
1336
1314
|
* }
|
|
1337
1315
|
* })
|
|
@@ -1340,7 +1318,6 @@ export interface AstroUserConfig {
|
|
|
1340
1318
|
fallback?: Record<string, string>;
|
|
1341
1319
|
/**
|
|
1342
1320
|
* @docs
|
|
1343
|
-
* @kind h4
|
|
1344
1321
|
* @name i18n.routing
|
|
1345
1322
|
* @type {Routing}
|
|
1346
1323
|
* @version 3.7.0
|
|
@@ -1352,6 +1329,7 @@ export interface AstroUserConfig {
|
|
|
1352
1329
|
/**
|
|
1353
1330
|
* @docs
|
|
1354
1331
|
* @name i18n.routing.prefixDefaultLocale
|
|
1332
|
+
* @kind h4
|
|
1355
1333
|
* @type {boolean}
|
|
1356
1334
|
* @default `false`
|
|
1357
1335
|
* @version 3.7.0
|
|
@@ -1378,6 +1356,24 @@ export interface AstroUserConfig {
|
|
|
1378
1356
|
strategy: 'pathname';
|
|
1379
1357
|
};
|
|
1380
1358
|
};
|
|
1359
|
+
/**
|
|
1360
|
+
* @docs
|
|
1361
|
+
* @kind heading
|
|
1362
|
+
* @name Legacy Flags
|
|
1363
|
+
* @description
|
|
1364
|
+
* To help some users migrate between versions of Astro, we occasionally introduce `legacy` flags.
|
|
1365
|
+
* These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro
|
|
1366
|
+
* in the latest version, so that you can continue to upgrade and take advantage of new Astro releases.
|
|
1367
|
+
*/
|
|
1368
|
+
legacy?: object;
|
|
1369
|
+
/**
|
|
1370
|
+
* @docs
|
|
1371
|
+
* @kind heading
|
|
1372
|
+
* @name Experimental Flags
|
|
1373
|
+
* @description
|
|
1374
|
+
* Astro offers experimental flags to give users early access to new features.
|
|
1375
|
+
* These flags are not guaranteed to be stable.
|
|
1376
|
+
*/
|
|
1381
1377
|
experimental?: {
|
|
1382
1378
|
/**
|
|
1383
1379
|
* @docs
|
|
@@ -1969,7 +1965,7 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
1969
1965
|
*/
|
|
1970
1966
|
locals: App.Locals;
|
|
1971
1967
|
/**
|
|
1972
|
-
* Available only when `
|
|
1968
|
+
* Available only when `i18n` configured and in SSR.
|
|
1973
1969
|
*
|
|
1974
1970
|
* It represents the preferred locale of the user. It's computed by checking the supported locales in `i18n.locales`
|
|
1975
1971
|
* and locales supported by the users's browser via the header `Accept-Language`
|
|
@@ -1981,7 +1977,7 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
1981
1977
|
*/
|
|
1982
1978
|
preferredLocale: string | undefined;
|
|
1983
1979
|
/**
|
|
1984
|
-
* Available only when `
|
|
1980
|
+
* Available only when `i18n` configured and in SSR.
|
|
1985
1981
|
*
|
|
1986
1982
|
* It represents the list of the preferred locales that are supported by the application. The list is sorted via [quality value].
|
|
1987
1983
|
*
|
|
@@ -187,11 +187,9 @@ ${bgGreen(black(` ${verb} static routes `))}`);
|
|
|
187
187
|
async function generatePage(pageData, ssrEntry, builtPaths, pipeline) {
|
|
188
188
|
const logger = pipeline.getLogger();
|
|
189
189
|
const config = pipeline.getConfig();
|
|
190
|
-
const manifest = pipeline.getManifest();
|
|
191
190
|
const pageModulePromise = ssrEntry.page;
|
|
192
191
|
const onRequest = ssrEntry.onRequest;
|
|
193
192
|
const pageInfo = getPageDataByComponent(pipeline.getInternals(), pageData.route.component);
|
|
194
|
-
const hoistedScripts = pageInfo?.hoistedScript ?? null;
|
|
195
193
|
const styles = pageData.styles.sort(cssOrder).map(({ sheet }) => sheet).reduce(mergeInlineCss, []);
|
|
196
194
|
const linkIds = [];
|
|
197
195
|
const scripts = pageInfo?.hoistedScript ?? null;
|
|
@@ -224,6 +222,12 @@ async function generatePage(pageData, ssrEntry, builtPaths, pipeline) {
|
|
|
224
222
|
mod: pageModule
|
|
225
223
|
};
|
|
226
224
|
for (const route of eachRouteInRouteData(pageData)) {
|
|
225
|
+
const icon = route.type === "page" || route.type === "redirect" || route.type === "fallback" ? green("\u25B6") : magenta("\u03BB");
|
|
226
|
+
if (isRelativePath(route.component)) {
|
|
227
|
+
logger.info(null, `${icon} ${route.route}`);
|
|
228
|
+
} else {
|
|
229
|
+
logger.info(null, `${icon} ${route.component}`);
|
|
230
|
+
}
|
|
227
231
|
const paths = await getPathsForRoute(route, pageModule, pipeline, builtPaths);
|
|
228
232
|
let timeStart = performance.now();
|
|
229
233
|
let prevTimeEnd = timeStart;
|
|
@@ -373,12 +377,6 @@ async function generatePath(pathname, pipeline, gopts, route) {
|
|
|
373
377
|
});
|
|
374
378
|
}
|
|
375
379
|
}
|
|
376
|
-
const icon = route.type === "page" || route.type === "redirect" || route.type === "fallback" ? green("\u25B6") : magenta("\u03BB");
|
|
377
|
-
if (isRelativePath(route.component)) {
|
|
378
|
-
logger.info(null, `${icon} ${route.route}`);
|
|
379
|
-
} else {
|
|
380
|
-
logger.info(null, `${icon} ${route.component}`);
|
|
381
|
-
}
|
|
382
380
|
if (route.type === "page") {
|
|
383
381
|
addPageName(pathname, pipeline.getStaticBuildOptions());
|
|
384
382
|
}
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -21,7 +21,7 @@ async function dev(inlineConfig) {
|
|
|
21
21
|
base: restart.container.settings.config.base
|
|
22
22
|
})
|
|
23
23
|
);
|
|
24
|
-
const currentVersion = "4.0.
|
|
24
|
+
const currentVersion = "4.0.2";
|
|
25
25
|
if (currentVersion.includes("-")) {
|
|
26
26
|
logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
|
|
27
27
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -36,7 +36,7 @@ function serverStart({
|
|
|
36
36
|
host,
|
|
37
37
|
base
|
|
38
38
|
}) {
|
|
39
|
-
const version = "4.0.
|
|
39
|
+
const version = "4.0.2";
|
|
40
40
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
41
41
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
42
42
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -258,7 +258,7 @@ function printHelp({
|
|
|
258
258
|
message.push(
|
|
259
259
|
linebreak(),
|
|
260
260
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
261
|
-
`v${"4.0.
|
|
261
|
+
`v${"4.0.2"}`
|
|
262
262
|
)} ${headline}`
|
|
263
263
|
);
|
|
264
264
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "withastro",
|
|
@@ -153,13 +153,13 @@
|
|
|
153
153
|
"unist-util-visit": "^5.0.0",
|
|
154
154
|
"vfile": "^6.0.1",
|
|
155
155
|
"vite": "^5.0.0",
|
|
156
|
-
"vitefu": "^0.2.
|
|
156
|
+
"vitefu": "^0.2.5",
|
|
157
157
|
"which-pm": "^2.1.1",
|
|
158
158
|
"yargs-parser": "^21.1.1",
|
|
159
159
|
"zod": "^3.22.4",
|
|
160
|
-
"@astrojs/internal-helpers": "0.2.1",
|
|
161
160
|
"@astrojs/markdown-remark": "4.0.0",
|
|
162
|
-
"@astrojs/telemetry": "3.0.4"
|
|
161
|
+
"@astrojs/telemetry": "3.0.4",
|
|
162
|
+
"@astrojs/internal-helpers": "0.2.1"
|
|
163
163
|
},
|
|
164
164
|
"optionalDependencies": {
|
|
165
165
|
"sharp": "^0.32.5"
|