Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/whole-geckos-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': major
---

TODO:
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"test:integration": "astro-scripts test \"test/*.test.js\""
},
"dependencies": {
"@astrojs/compiler": "0.0.0-next-result-create-astro-20250926081949",
"@astrojs/compiler": "0.0.0-script-order-20251002140654",
"@astrojs/internal-helpers": "workspace:*",
"@astrojs/markdown-remark": "workspace:*",
"@astrojs/telemetry": "workspace:*",
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/core/compile/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export async function compile({
cssPartialCompileResults,
cssTransformErrors,
}),
experimentalScriptOrder: astroConfig.experimental.preserveScriptOrder ?? false,
async resolvePath(specifier) {
return resolvePath(specifier, filename);
},
Expand Down
5 changes: 0 additions & 5 deletions packages/astro/src/core/config/schemas/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export const ASTRO_CONFIG_DEFAULTS = {
clientPrerender: false,
contentIntellisense: false,
headingIdCompat: false,
preserveScriptOrder: false,
liveContentCollections: false,
csp: false,
staticImportMetaEnv: false,
Expand Down Expand Up @@ -468,10 +467,6 @@ export const AstroConfigSchema = z.object({
.boolean()
.optional()
.default(ASTRO_CONFIG_DEFAULTS.experimental.headingIdCompat),
preserveScriptOrder: z
.boolean()
.optional()
.default(ASTRO_CONFIG_DEFAULTS.experimental.preserveScriptOrder),
fonts: z.array(z.union([localFontFamilySchema, remoteFontFamilySchema])).optional(),
liveContentCollections: z
.boolean()
Expand Down
42 changes: 0 additions & 42 deletions packages/astro/src/types/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2358,48 +2358,6 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
directives?: CspDirective[];
};

/**
* @name experimental.preserveScriptOrder
* @type {boolean}
* @default `false`
* @version 5.5
* @description
*
* When enabled, `<script>` and `<style>` tags are rendered in the same order as they are defined.
*
* ## Example
*
* Consider the following component:
*
* ```html
* <p>I am a component</p>
* <style>
* body {
* background: red;
* }
* </style>
* <style>
* body {
* background: yellow;
* }
* </style>
* ```
*
* By default, it will generate a CSS style where `red` will be applied:
*
* ```css
* body {background:#ff0} body {background:red}
* ```
*
* When this new option is set to `true`, the generated CSS style will apply `yellow`:
*
* ```css
* body {background:red} body {background:#ff0}
* ```
*
*/
preserveScriptOrder?: boolean;

/**
* @name experimental.liveContentCollections
* @type {boolean}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { defineConfig } from 'astro/config';

export default defineConfig({
experimental: {
preserveScriptOrder: true,
}
});
export default defineConfig({});
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading