summaryrefslogtreecommitdiff
path: root/packages/astro
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro')
-rw-r--r--packages/astro/CHANGELOG.md76
-rw-r--r--packages/astro/package.json2
-rw-r--r--packages/astro/src/@types/astro.ts6
-rw-r--r--packages/astro/src/core/app/ssrPipeline.ts2
-rw-r--r--packages/astro/src/core/config/schema.ts43
-rw-r--r--packages/astro/src/runtime/server/render/component.ts4
-rw-r--r--packages/astro/test/astro-class-list.test.js14
-rw-r--r--packages/astro/test/units/render/components.test.js4
8 files changed, 118 insertions, 33 deletions
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md
index 25f57c8a3..eefbb2eef 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1,5 +1,81 @@
# astro
+## 3.0.0-rc.5
+
+### Major Changes
+
+- [#8142](https://github.com/withastro/astro/pull/8142) [`81545197a`](https://github.com/withastro/astro/commit/81545197a32fd015d763fc386c8b67e0e08b7393) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Fixes for the `class:list` directive
+
+ - Previously, `class:list` would ocassionally not be merged the `class` prop when passed to Astro components. Now, `class:list` is always converted to a `class` prop (as a string value).
+ - Previously, `class:list` diverged from [`clsx`](https://github.com/lukeed/clsx) in a few edge cases. Now, `class:list` uses [`clsx`](https://github.com/lukeed/clsx) directly.
+ - `class:list` used to deduplicate matching values, but it no longer does
+ - `class:list` used to sort individual values, but it no longer does
+ - `class:list` used to support `Set` and other iterables, but it no longer does
+
+- [#8179](https://github.com/withastro/astro/pull/8179) [`6011d52d3`](https://github.com/withastro/astro/commit/6011d52d38e43c3e3d52bc3bc41a60e36061b7b7) Thanks [@matthewp](https://github.com/matthewp)! - Astro 3.0 Release Candidate
+
+- [#8170](https://github.com/withastro/astro/pull/8170) [`be6bbd2c8`](https://github.com/withastro/astro/commit/be6bbd2c86b9bf5268e765bb937dda00ff15781a) Thanks [@bluwy](https://github.com/bluwy)! - Remove deprecated config option types, deprecated script/style attributes, and deprecated `image` export from `astro:content`
+
+- [#8180](https://github.com/withastro/astro/pull/8180) [`f003e7364`](https://github.com/withastro/astro/commit/f003e7364317cafdb8589913b26b28e928dd07c9) Thanks [@ematipico](https://github.com/ematipico)! - The scoped hash created by the Astro compiler is now **lowercase**.
+
+- [#8169](https://github.com/withastro/astro/pull/8169) [`e79e3779d`](https://github.com/withastro/astro/commit/e79e3779df0ad35253abcdb931d622847d9adb12) Thanks [@bluwy](https://github.com/bluwy)! - Remove pre-shiki v0.14 theme names for compatibility. Please rename to the new theme names to migrate:
+
+ - `material-darker` -> `material-theme-darker`
+ - `material-default` -> `material-theme`
+ - `material-lighter` -> `material-theme-lighter`
+ - `material-ocean` -> `material-theme-ocean`
+ - `material-palenight` -> `material-theme-palenight`
+
+### Patch Changes
+
+- [#8147](https://github.com/withastro/astro/pull/8147) [`adf9fccfd`](https://github.com/withastro/astro/commit/adf9fccfdda107c2224558f1c2e6a77847ac0a8a) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Do not throw Error when users pass an object with a "type" property
+
+- [#8152](https://github.com/withastro/astro/pull/8152) [`582132328`](https://github.com/withastro/astro/commit/5821323285646aee7ff9194a505f708028e4db57) Thanks [@andremralves](https://github.com/andremralves)! - Displays a new config error if `outDir` is placed within `publicDir`.
+
+- [#8147](https://github.com/withastro/astro/pull/8147) [`42785c7b7`](https://github.com/withastro/astro/commit/42785c7b784b151e6d582570e5d74482129e8eb8) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Improve fidelity of time stats when running `astro build`
+
+- [#8171](https://github.com/withastro/astro/pull/8171) [`95120efbe`](https://github.com/withastro/astro/commit/95120efbe817163663492181cbeb225849354493) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix missing type for `imageConfig` export from `astro:assets`
+
+- [#8147](https://github.com/withastro/astro/pull/8147) [`2ae9d37f0`](https://github.com/withastro/astro/commit/2ae9d37f0a9cb21ab288d3c30aecb6d84db87788) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Open to configured `base` when `astro dev --open` runs
+
+- [#8099](https://github.com/withastro/astro/pull/8099) [`732111cdc`](https://github.com/withastro/astro/commit/732111cdce441639db31f40f621df48442d00969) Thanks [@bluwy](https://github.com/bluwy)! - Deprecate the `markdown.drafts` configuration option.
+
+ If you'd like to create draft pages that are visible in dev but not in production, you can [migrate to content collections](https://docs.astro.build/en/guides/content-collections/#migrating-from-file-based-routing) and [manually filter out pages](https://docs.astro.build/en/guides/content-collections/#filtering-collection-queries) with the `draft: true` frontmatter property instead.
+
+- [#8147](https://github.com/withastro/astro/pull/8147) [`33b8910cf`](https://github.com/withastro/astro/commit/33b8910cfdce5713891c50a84a0a8fe926311710) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - On back navigation only animate view transitions that were animated going forward.
+
+- [#8163](https://github.com/withastro/astro/pull/8163) [`179796405`](https://github.com/withastro/astro/commit/179796405e053b559d83f84507e5a465861a029a) Thanks [@delucis](https://github.com/delucis)! - Make typing of `defineCollection` more permissive to support advanced union and intersection types
+
+- [#8147](https://github.com/withastro/astro/pull/8147) [`a87cbe400`](https://github.com/withastro/astro/commit/a87cbe400314341d5f72abf86ea264e6b47c091f) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - fix: reinsert attribute to specify direction of ViewTransition (forward / back)
+
+- [#8132](https://github.com/withastro/astro/pull/8132) [`767eb6866`](https://github.com/withastro/astro/commit/767eb68666eb777965baa0d6ade20bbafecf95bf) Thanks [@bluwy](https://github.com/bluwy)! - Deprecate returning simple objects from endpoints. Endpoints should only return a `Response`.
+
+ To return a result with a custom encoding not supported by a `Response`, you can use the `ResponseWithEncoding` utility class instead.
+
+ Before:
+
+ ```ts
+ export function GET() {
+ return {
+ body: '...',
+ encoding: 'binary',
+ };
+ }
+ ```
+
+ After:
+
+ ```ts
+ export function GET({ ResponseWithEncoding }) {
+ return new ResponseWithEncoding('...', undefined, 'binary');
+ }
+ ```
+
+- Updated dependencies [[`6011d52d3`](https://github.com/withastro/astro/commit/6011d52d38e43c3e3d52bc3bc41a60e36061b7b7), [`e79e3779d`](https://github.com/withastro/astro/commit/e79e3779df0ad35253abcdb931d622847d9adb12)]:
+ - @astrojs/markdown-remark@3.0.0-rc.1
+ - @astrojs/telemetry@3.0.0-rc.3
+ - @astrojs/internal-helpers@0.2.0-rc.2
+
## 3.0.0-beta.4
### Patch Changes
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 462a10307..8db1f587d 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -1,6 +1,6 @@
{
"name": "astro",
- "version": "3.0.0-beta.4",
+ "version": "3.0.0-rc.5",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index 08a30dec4..2be15923b 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -858,10 +858,10 @@ export interface AstroUserConfig {
* @default `false`
* @deprecated Deprecated since version 3.0.
* @description
- * The build config option `build.split` has been replaced by the adapter configuration option [`functionPerRoute`](/en/reference/adapter-reference/#functionperroute).
+ * The build config option `build.split` has been replaced by the adapter configuration option [`functionPerRoute`](/en/reference/adapter-reference/#functionperroute).
*
* Please see your [SSR adapter's documentation](/en/guides/integrations-guide/#official-integrations) for using `functionPerRoute` to define how your SSR code is bundled.
- *
+ *
*/
split?: boolean;
@@ -872,7 +872,7 @@ export interface AstroUserConfig {
* @default `false`
* @deprecated Deprecated since version 3.0.
* @description
- * The build config option `build.excludeMiddleware` has been replaced by the adapter configuration option [`edgeMiddleware`](/en/reference/adapter-reference/#edgemiddleware).
+ * The build config option `build.excludeMiddleware` has been replaced by the adapter configuration option [`edgeMiddleware`](/en/reference/adapter-reference/#edgemiddleware).
*
* Please see your [SSR adapter's documentation](/en/guides/integrations-guide/#official-integrations) for using `edgeMiddleware` to define whether or not any SSR middleware code will be bundled when built.
*/
diff --git a/packages/astro/src/core/app/ssrPipeline.ts b/packages/astro/src/core/app/ssrPipeline.ts
index 6ee135197..fa354becf 100644
--- a/packages/astro/src/core/app/ssrPipeline.ts
+++ b/packages/astro/src/core/app/ssrPipeline.ts
@@ -23,6 +23,6 @@ export class SSRRoutePipeline extends Pipeline {
if (response.headers.get('X-Astro-Response') === 'Not-Found') {
throw new EndpointNotFoundError(response);
}
- return response
+ return response;
}
}
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index 0717e1a81..1c5412d14 100644
--- a/packages/astro/src/core/config/schema.ts
+++ b/packages/astro/src/core/config/schema.ts
@@ -380,29 +380,30 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: string) {
.optional()
.default({})
),
- }).transform((config) => {
- // If the user changed outDir but not build.server, build.config, adjust so those
- // are relative to the outDir, as is the expected default.
- if (
- !config.build.server.toString().startsWith(config.outDir.toString()) &&
- config.build.server.toString().endsWith('dist/server/')
- ) {
- config.build.server = new URL('./dist/server/', config.outDir);
- }
- if (
- !config.build.client.toString().startsWith(config.outDir.toString()) &&
- config.build.client.toString().endsWith('dist/client/')
- ) {
- config.build.client = new URL('./dist/client/', config.outDir);
- }
+ })
+ .transform((config) => {
+ // If the user changed outDir but not build.server, build.config, adjust so those
+ // are relative to the outDir, as is the expected default.
+ if (
+ !config.build.server.toString().startsWith(config.outDir.toString()) &&
+ config.build.server.toString().endsWith('dist/server/')
+ ) {
+ config.build.server = new URL('./dist/server/', config.outDir);
+ }
+ if (
+ !config.build.client.toString().startsWith(config.outDir.toString()) &&
+ config.build.client.toString().endsWith('dist/client/')
+ ) {
+ config.build.client = new URL('./dist/client/', config.outDir);
+ }
- // Handle `base` trailing slash based on `trailingSlash` config
- if (config.trailingSlash === 'never') {
- config.base = prependForwardSlash(removeTrailingForwardSlash(config.base));
+ // Handle `base` trailing slash based on `trailingSlash` config
+ if (config.trailingSlash === 'never') {
+ config.base = prependForwardSlash(removeTrailingForwardSlash(config.base));
} else if (config.trailingSlash === 'always') {
- config.base = prependForwardSlash(appendForwardSlash(config.base));
- } else {
- config.base = prependForwardSlash(config.base);
+ config.base = prependForwardSlash(appendForwardSlash(config.base));
+ } else {
+ config.base = prependForwardSlash(config.base);
}
return config;
diff --git a/packages/astro/src/runtime/server/render/component.ts b/packages/astro/src/runtime/server/render/component.ts
index 36528daf1..c92316d13 100644
--- a/packages/astro/src/runtime/server/render/component.ts
+++ b/packages/astro/src/runtime/server/render/component.ts
@@ -481,9 +481,9 @@ function normalizeProps(props: Record<string, any>): Record<string, any> {
if (props['class:list'] !== undefined) {
const value = props['class:list'];
delete props['class:list'];
- props['class'] = clsx(props['class'], value)
+ props['class'] = clsx(props['class'], value);
if (props['class'] === '') {
- delete props['class']
+ delete props['class'];
}
}
return props;
diff --git a/packages/astro/test/astro-class-list.test.js b/packages/astro/test/astro-class-list.test.js
index b9d6aeba4..4fd7cd13f 100644
--- a/packages/astro/test/astro-class-list.test.js
+++ b/packages/astro/test/astro-class-list.test.js
@@ -19,7 +19,10 @@ describe('Class List', async () => {
expect($('[class="test true"]')).to.have.lengthOf(1, '[class="test true"]');
expect($('[class="test truthy"]')).to.have.lengthOf(1, '[class="test truthy"]');
expect($('[class="test set"]')).to.have.lengthOf(1, '[class="test set"]');
- expect($('[class="hello goodbye hello world hello friend"]')).to.have.lengthOf(1, '[class="hello goodbye hello world hello friend"]');
+ expect($('[class="hello goodbye hello world hello friend"]')).to.have.lengthOf(
+ 1,
+ '[class="hello goodbye hello world hello friend"]'
+ );
expect($('[class="foo baz"]')).to.have.lengthOf(1, '[class="foo baz"]');
expect($('span:not([class])')).to.have.lengthOf(1, 'span:not([class])');
@@ -35,7 +38,10 @@ describe('Class List', async () => {
expect($('[class="test true"]')).to.have.lengthOf(1, '[class="test true"]');
expect($('[class="test truthy"]')).to.have.lengthOf(1, '[class="test truthy"]');
expect($('[class="test set"]')).to.have.lengthOf(1, '[class="test set"]');
- expect($('[class="hello goodbye hello world hello friend"]')).to.have.lengthOf(1, '[class="hello goodbye hello world hello friend"]');
+ expect($('[class="hello goodbye hello world hello friend"]')).to.have.lengthOf(
+ 1,
+ '[class="hello goodbye hello world hello friend"]'
+ );
expect($('[class="foo baz"]')).to.have.lengthOf(1, '[class="foo baz"]');
expect($('span:not([class])')).to.have.lengthOf(1, 'span:not([class])');
@@ -44,7 +50,9 @@ describe('Class List', async () => {
expect($('[class="test true"]').text()).to.equal('test true');
expect($('[class="test truthy"]').text()).to.equal('test truthy');
expect($('[class="test set"]').text()).to.equal('test set');
- expect($('[class="hello goodbye hello world hello friend"]').text()).to.equal('hello goodbye hello world hello friend');
+ expect($('[class="hello goodbye hello world hello friend"]').text()).to.equal(
+ 'hello goodbye hello world hello friend'
+ );
expect($('[class="foo baz"]').text()).to.equal('foo baz');
expect($('span:not([class])').text()).to.equal('');
});
diff --git a/packages/astro/test/units/render/components.test.js b/packages/astro/test/units/render/components.test.js
index f9dd71621..cd27141f9 100644
--- a/packages/astro/test/units/render/components.test.js
+++ b/packages/astro/test/units/render/components.test.js
@@ -102,14 +102,14 @@ describe('core/render components', () => {
const html = await text();
const $ = cheerio.load(html);
- const check = (name) => JSON.parse($(name).text() || '{}')
+ const check = (name) => JSON.parse($(name).text() || '{}');
const Class = check('#class');
const ClassList = check('#class-list');
const BothLiteral = check('#both-literal');
const BothFlipped = check('#both-flipped');
const BothSpread = check('#both-spread');
-
+
expect(Class).to.deep.equal({ class: 'red blue' }, '#class');
expect(ClassList).to.deep.equal({ class: 'red blue' }, '#class-list');
expect(BothLiteral).to.deep.equal({ class: 'red blue' }, '#both-literal');