Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
366 KiB
astro
3.2.3
Patch Changes
-
#8737
6f60da805
Thanks @ematipico! - Add provenance statement when publishing the library from CI -
#8747
d78806dfe
Thanks @natemoo-re! - Improve error message when user attempts to render a dynamic component reference -
#8736
d1c75fe15
Thanks @bluwy! - Fixtsconfig.json
update causing the server to crash -
#8743
aa265d730
Thanks @bluwy! - Remove unused CSS output files when inlined -
#8700
78adbc443
Thanks @jacobthesheep! - Update link for Netlify SSR -
#8729
21e0757ea
Thanks @lilnasy! - Node-based adapters now create less server-side javascript -
#8730
357270f2a
Thanks @natemoo-re! - Improveastro info
copy to clipboard compatability -
Updated dependencies [
21f482657
,6f60da805
,21e0757ea
]:- @astrojs/markdown-remark@3.2.1
- @astrojs/internal-helpers@0.2.1
- @astrojs/telemetry@3.0.3
3.2.2
Patch Changes
-
#8710
4c2bec681
Thanks @matthewp! - Fixes View transition styles being missing when component used multiple times
3.2.1
Patch Changes
-
#8680
31c59ad8b
Thanks @bluwy! - Fix hydration on slow connection -
#8698
47ea310f0
Thanks @Princesseuh! - Use a Node-specific image endpoint to resolve images in dev and Node SSR. This should fix many issues related to getting 404 from the _image endpoint under certain configurations -
#8706
345808170
Thanks @bluwy! - Fix duplicated Astro and Vite injected styles
3.2.0
Minor Changes
-
#8696
2167ffd72
Thanks @matthewp! - Support adding integrations dynamicallyAstro integrations can now themselves dynamically add and configure additional integrations during set-up. This makes it possible for integration authors to bundle integrations more intelligently for their users.
In the following example, a custom integration checks whether
@astrojs/sitemap
is already configured. If not, the integration adds Astro’s sitemap integration, passing any desired configuration options:import sitemap from '@astrojs/sitemap'; import type { AstroIntegration } from 'astro'; const MyIntegration = (): AstroIntegration => { return { name: 'my-integration', 'astro:config:setup': ({ config, updateConfig }) => { // Look for sitemap in user-configured integrations. const userSitemap = config.integrations.find( ({ name }) => name === '@astrojs/sitemap' ); if (!userSitemap) { // If sitemap wasn’t found, add it. updateConfig({ integrations: [sitemap({ /* opts */ }], }); } }, }; };
-
#8696
2167ffd72
Thanks @matthewp! - View transitions can now be triggered from JavaScript!Import the client-side router from "astro:transitions/client" and enjoy your new remote control for navigation:
import { navigate } from 'astro:transitions/client'; // Navigate to the selected option automatically. document.querySelector('select').onchange = (ev) => { let href = ev.target.value; navigate(href); };
-
#8696
2167ffd72
Thanks @matthewp! - Route Announcer in<ViewTransitions />
The View Transitions router now does route announcement. When transitioning between pages with a traditional MPA approach, assistive technologies will announce the page title when the page finishes loading. This does not automatically happen during client-side routing, so visitors relying on these technologies to announce routes are not aware when a page has changed.
The view transitions route announcer runs after the
astro:page-load
event, looking for the page<title>
to announce. If one cannot be found, the announcer falls back to the first<h1>
it finds, or otherwise announces the pathname. We recommend you always include a<title>
in each page for accessibility.See the View Transitions docs for more on how accessibility is handled.
Patch Changes
-
#8647
408b50c5e
Thanks @lilnasy! - Fixed an issue where configured redirects with dynamic routes did not work in dev mode. -
#8696
2167ffd72
Thanks @matthewp! - Fix logLevel passed to Vite build -
#8696
2167ffd72
Thanks @matthewp! - Fix NoImageMetadata image path error message -
#8670
e797b6816
Thanks @MichailiK! - Fix asset optimization failing when outDir is outside the project directory -
#8684
824dd4670
Thanks @matthewp! - Support content collections with % in filename -
#8648
cfd895d87
Thanks @lilnasy! - Fixed an issue where a response with status code 404 led to an endless loop of implicit rerouting in dev mode.
3.1.4
Patch Changes
3.1.3
Patch Changes
-
#8591
863f5171e
Thanks @rishi-raj-jain! - add site url to the location of redirect -
#8633
63141f3f3
Thanks @Princesseuh! - Fix build not working when having multiple images in the same Markdown file -
#8636
974d5117a
Thanks @martrapp! - fix: no deletion of scripts during view transition -
#8645
cb838b84b
Thanks @matthewp! - Fix getDataEntryById to lookup by basename -
#8640
f36c4295b
Thanks @matthewp! - Warn on empty content collections -
#8615
4c4ad9d16
Thanks @alexanderniebuhr! - Improve the logging of assets for adapters that do not support image optimization
3.1.2
Patch Changes
-
#8612
bcad715ce
Thanks @matthewp! - Ensure cookies are attached when middleware changes the Response -
#8598
bdd267d08
Thanks @Princesseuh! - Fix relative images in Markdown breaking the build process in certain circumstances -
#8382
e522a5eb4
Thanks @DerTimonius! - Do not throw an error for an empty collection directory. -
#8600
ed54d4644
Thanks @FredKSchott! - Improve config info telemetry -
#8592
70f2a8003
Thanks @bluwy! - Fix alias plugin causing CSS ordering issue -
#8614
4398e9298
Thanks @lilnasy! - Fixed an issue where spaces and unicode characters in project path prevented middleware from running. -
#8603
8f8b9069d
Thanks @matthewp! - Prevent body scripts from re-executing on navigation -
#8609
5a988eaf6
Thanks @bluwy! - Fix Astro HMR from a CSS dependency -
Updated dependencies [
ed54d4644
]:- @astrojs/telemetry@3.0.2
3.1.1
Patch Changes
-
#8580
8d361169b
Thanks @rishi-raj-jain! - add hide to style & script generated for island -
#8568
95b5f6280
Thanks @Princesseuh! - Fix small types issues related toastro:assets
's AVIF support andgetImage
-
#8579
0586e20e8
Thanks @rishi-raj-jain! - show redirect symbol as of the page
3.1.0
Minor Changes
-
#8467
ecc65abbf
Thanks @Princesseuh! - Add a newimage.endpoint
setting to allow using a custom endpoint in dev and SSR -
#8518
2c4fc878b
Thanks @Princesseuh! - Adds support for using AVIF (.avif
) files with the Image component. Importing an AVIF file will now correctly return the same object shape as other image file types. See the Image docs for more information on the different properties available on the returned object. -
#8464
c92e0acd7
Thanks @Princesseuh! - Add types for the object syntax forstyle
(ex:style={{color: 'red'}}
)
Patch Changes
-
#8532
7522bb491
Thanks @bluwy! - Improve markdown rendering performance by sharing processor instance -
#8537
f95febf96
Thanks @martrapp! - bugfix checking media-type in client-side router -
#8536
b85c8a78a
Thanks @Princesseuh! - Improved error messages aroundastro:assets
-
#7607
45364c345
Thanks @FineWolf! - AddCollectionKey
,ContentCollectionKey
, andDataCollectionKey
exports toastro:content
-
Updated dependencies [
d93987824
,7522bb491
]:- @astrojs/markdown-remark@3.2.0
3.0.13
Patch Changes
-
#8484
78b82bb39
Thanks @bb010g! - fix(astro): add support forsrc/content/config.mts
files -
#8504
5e1099f68
Thanks @ematipico! - Minify the HTML of the redicts emitted during the build. -
#8480
644825845
Thanks @yamanoku! - Do not add type="text/css" to inline style tag -
#8472
fa77fa63d
Thanks @matthewp! - Prevent client:only styles from being removed in dev (View Transitions) -
#8506
23f9536de
Thanks @mascii! - chore: correct description ofattribute
option inscopedStyleStrategy
-
#8505
2db9762eb
Thanks @martrapp! - Restore horizontal scroll position on history navigation (view transitions) -
#8461
435b10549
Thanks @rdwz! - Fix lang unspecified code blocks (markdownlint MD040) -
#8492
a6a516d94
Thanks @xiBread! - fix(types): makeimage.service
optional -
#8522
43bc5f2a5
Thanks @martrapp! - let view transitions handle same origin redirects -
#8491
0ca332ba4
Thanks @martrapp! - Bugfixes for back navigation in the view transition client-side router
3.0.12
Patch Changes
3.0.11
Patch Changes
-
#8441
f66053a1e
Thanks @martrapp! - Only transition between pages where both have ViewTransitions enabled -
#8443
0fa483283
Thanks @the-dijkstra! - Fix "Cannot read properties of null" error in CLI code -
Updated dependencies [
f3f62a5a2
]:- @astrojs/markdown-remark@3.1.0
3.0.10
Patch Changes
-
#8437
b3cf1b327
Thanks @Princesseuh! - Fix imports of images with uppercased file extensions not working -
#8440
b92d066b7
Thanks @natemoo-re! - Fix issue whererenderToFinalDestination
would throw in internal Astro code
3.0.9
Patch Changes
-
#8351
7d95bd9ba
Thanks @lilnasy! - Fixed a case where dynamic imports tried to preload inlined stylesheets. -
#8353
1947ef7a9
Thanks @elevatebart! - Astro will now skip asset optimization when there is a query in the import. Instead, it will let vite deal with it using plugins.<script> // This will not return an optimized asset import Component from './Component.vue?component'; </script>
-
#8424
61ad70fdc
Thanks @itsmatteomanf! - Fixes remote assets caching logic to not use expired assets -
#8306
d2f2a11cd
Thanks @jacobthesheep! - Support detecting Bun when logging messages with package manager information. -
#8414
5126c6a40
Thanks @Princesseuh! - Fix missing type forimageConfig
export fromastro:assets
-
#8416
48ff7855b
Thanks @Princesseuh! - Installing will no longer fail when Sharp can't be installed -
#8332
8935b3b46
Thanks @martrapp! - Fix scroll position when navigating back from page w/o ViewTransitions
3.0.8
Patch Changes
-
#8388
362491b8d
Thanks @natemoo-re! - Properly handleBEFORE_HYDRATION_SCRIPT
generation, fixing MIME type error on hydration. -
#8370
06e7256b5
Thanks @itsmatteomanf! - Removed extra curly brace.
3.0.7
Patch Changes
-
#8366
c5633434f
Thanks @natemoo-re! - UpdatechunkFileNames
to avoid emitting invalid characters -
#8367
405ad9501
Thanks @Princesseuh! - Fixtsc
complaining about imports of.astro
files in specific cases -
#8357
6b1e79814
Thanks @itsmatteomanf! - Added counter to show progress for assets image generation. Fixed small unit of measurement error. -
Updated dependencies [
0ce0720c7
]:- @astrojs/telemetry@3.0.1
3.0.6
Patch Changes
-
#8276
d3a6f9f83
Thanks @FredKSchott! - Sanitize route params for leading and trailing slashes -
#8339
f21599671
Thanks @martrapp! - Respect the download attribute in links when using view transitions
3.0.5
Patch Changes
-
#8327
5f3a44aee
Thanks @natemoo-re! - Improveastro info
command formatting, allow users to copy info automatically -
#8320
b21038c19
Thanks @ematipico! - Exclude redirects from split entry points -
#8331
7a894eec3
Thanks @matthewp! - Prevent View Transition fallback from waiting on looping animations -
#8231
af41b03d0
Thanks @justinbeaty! - Fixes scroll behavior when using View Transitions by enablingmanual
scroll restoration
3.0.4
Patch Changes
-
#8324
0752cf368
Thanks @matthewp! - Prevent React hook call warnings when used with MDXWhen React and MDX are used in the same project, if the MDX integration is added before React, previously you'd get a warning about hook calls.
This makes it so that the MDX integration's JSX renderer is last in order.
3.0.3
Patch Changes
- #8300
d4a6ab733
Thanks @ematipico! - Correctly retrive middleware when using it in SSR enviroments.
3.0.2
Patch Changes
- #8293
d9bd7cf5c
Thanks @Princesseuh! - Fixtsc
errors insideastro/components/index.ts
3.0.1
Patch Changes
-
#8290
ef37f9e29
Thanks @matthewp! - Remove "experimental" text from the image config options, for docs and editor etc. text displayed. -
#8290
ef37f9e29
Thanks @matthewp! - Prevent astro check cache issuesastro check
hits cache issues in 3.0 causing it never to work on the first try. -
#8283
c32f52a62
Thanks @ematipico! - Add useful warning when deprecated options are still used.
3.0.0
Major Changes
-
#8188
d0679a666
Thanks @ematipico! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. -
#8188
364d861bd
Thanks @ematipico! - Removed automatic flattening ofgetStaticPaths
result..flatMap
and.flat
should now be used to ensure that you're returning a flat array. -
#8113
2484dc408
Thanks @Princesseuh! - This import alias is no longer included by default with astro:assets. If you were using this alias with experimental assets, you must convert them to relative file paths, or create your own import aliases.--- // src/pages/posts/post-1.astro - import rocket from '~/assets/rocket.png' + import rocket from '../../assets/rocket.png'; ---
-
#8142
81545197a
Thanks @natemoo-re! - Fixes for theclass:list
directive- Previously,
class:list
would ocassionally not be merged theclass
prop when passed to Astro components. Now,class:list
is always converted to aclass
prop (as a string value). - Previously,
class:list
diverged fromclsx
in a few edge cases. Now,class:list
usesclsx
directly.class:list
used to deduplicate matching values, but it no longer doesclass:list
used to sort individual values, but it no longer doesclass:list
used to supportSet
and other iterables, but it no longer does
- Previously,
-
#8179
6011d52d3
Thanks @matthewp! - Astro 3.0 Release Candidate -
#8188
80f1494cd
Thanks @ematipico! - Thebuild.split
andbuild.excludeMiddleware
configuration options are deprecated and have been replaced by options in the adapter config.If your config includes the
build.excludeMiddleware
option, replace it withedgeMiddleware
in your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - excludeMiddleware: true }, adapter: netlify({ + edgeMiddleware: true }), });
If your config includes the
build.split
option, replace it withfunctionPerRoute
in your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - split: true }, adapter: netlify({ + functionPerRoute: true }), });
-
#8207
e45f30293
Thanks @natemoo-re! - Change the View Transition built-in animation options.The
transition:animate
valuemorph
has been renamed toinitial
. Also, this is no longer the default animation.If no
transition:animate
directive is specified, your animations will now default tofade
.Astro also supports a new
transition:animate
value,none
. This value can be used on a page's<html>
element to disable animated full-page transitions on an entire page. -
#8188
c0de7a7b0
Thanks @ematipico! - Sharp is now the default image service used forastro:assets
. If you would prefer to still use Squoosh, you can update your config with the following:import { defineConfig, squooshImageService } from 'astro/config'; // https://astro.build/config export default defineConfig({ image: { service: squooshImageService(), }, });
However, not only do we recommend using Sharp as it is faster and more reliable, it is also highly likely that the Squoosh service will be removed in a future release.
-
#8188
3c3100851
Thanks @ematipico! - Remove support forAstro.__renderMarkdown
which is used by@astrojs/markdown-component
.The
<Markdown />
component was deprecated in Astro v1 and is completely removed in v3. This integration must now be removed from your project.As an alternative, you can use community packages that provide a similar component like https://github.com/natemoo-re/astro-remote instead.
-
#8019
34cb20021
Thanks @bluwy! - Remove backwards-compatible kebab-case transform for camelCase CSS variable names passed to thestyle
attribute. If you were relying on the kebab-case transform in your styles, make sure to use the camelCase version to prevent missing styles. For example:--- const myValue = 'red'; --- <!-- input --> <div style={{ '--myValue': myValue }}></div> <!-- output (before) --> <div style="--my-value:var(--myValue);--myValue:red"></div> <!-- output (after) --> <div style="--myValue:red"></div>
<style> div { - color: var(--my-value); + color: var(--myValue); } </style>
-
#8170
be6bbd2c8
Thanks @bluwy! - Remove deprecated config option types, deprecated script/style attributes, and deprecatedimage
export fromastro:content
-
#8188
7511a4980
Thanks @ematipico! - When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits ofastro:assets
such as enforcingalt
, no CLS etc to users -
#7979
dbc97b121
Thanks @bluwy! - Export experimentaldev
,build
,preview
, andsync
APIs fromastro
. These APIs allow you to run Astro's commands programmatically, and replaces the previous entry point that runs the Astro CLI.While these APIs are experimental, the inline config parameter is relatively stable without foreseeable changes. However, the returned results of these APIs are more likely to change in the future.
import { dev, build, preview, sync, type AstroInlineConfig } from 'astro'; // Inline Astro config object. // Provide a path to a configuration file to load or set options directly inline. const inlineConfig: AstroInlineConfig = { // Inline-specific options... configFile: './astro.config.mjs', logLevel: 'info', // Standard Astro config options... site: 'https://example.com', }; // Start the Astro dev server const devServer = await dev(inlineConfig); await devServer.stop(); // Build your Astro project await build(inlineConfig); // Preview your built project const previewServer = await preview(inlineConfig); await previewServer.stop(); // Generate types for your Astro project await sync(inlineConfig);
-
#8188
7d2f311d4
Thanks @ematipico! - Removed support for old syntax of the API routes. -
#8085
68efd4a8b
Thanks @bluwy! - Remove exports forastro/internal/*
andastro/runtime/server/*
in favour ofastro/runtime/*
. Add newastro/compiler-runtime
export for compiler-specific runtime code.These are exports for Astro's internal API and should not affect your project, but if you do use these entrypoints, you can migrate like below:
- import 'astro/internal/index.js'; + import 'astro/runtime/server/index.js'; - import 'astro/server/index.js'; + import 'astro/runtime/server/index.js';
import { transform } from '@astrojs/compiler'; const result = await transform(source, { - internalURL: 'astro/runtime/server/index.js', + internalURL: 'astro/compiler-runtime', // ... });
-
#7893
7bd1b86f8
Thanks @ematipico! - Implements a new scope style strategy called"attribute"
. When enabled, styles are applied usingdata-*
attributes.The default value of
scopedStyleStrategy
is"attribute"
.If you want to use the previous behaviour, you have to use the
"where"
option:import { defineConfig } from 'astro/config'; export default defineConfig({ + scopedStyleStrategy: 'where', });
-
#7924
519a1c4e8
Thanks @matthewp! - Astro's JSX handling has been refactored with better support for each framework.Previously, Astro automatically scanned your components to determine which framework-specific transformations should be used. In practice, supporting advanced features like Fast Refresh with this approach proved difficult.
Now, Astro determines which framework to use with
include
andexclude
config options where you can specify files and folders on a per-framework basis. When using multiple JSX frameworks in the same project, users should manually control which files belong to each framework using theinclude
andexclude
options.export default defineConfig({ // The `include` config is only needed in projects that use multiple JSX frameworks; // if only using one no extra config is needed. integrations: [ preact({ include: ['**/preact/*'], }), react({ include: ['**/react/*'], }), solid({ include: ['**/solid/*'], }), ], });
-
#8030
5208a3c8f
Thanks @natemoo-re! - Removed duplicateastro/dist/jsx
export. Please use theastro/jsx
export instead -
#8188
84af8ed9d
Thanks @ematipico! - Remove MDX plugin re-ordering hack -
#8180
f003e7364
Thanks @ematipico! - The scoped hash created by the Astro compiler is now lowercase. -
#7878
0f637c71e
Thanks @bluwy! - The value ofimport.meta.env.BASE_URL
, which is derived from thebase
option, will no longer have a trailing slash added by default or whentrailingSlash: "ignore"
is set. The existing behavior ofbase
in combination withtrailingSlash: "always"
ortrailingSlash: "never"
is unchanged.If your
base
already has a trailing slash, no change is needed.If your
base
does not have a trailing slash, add one to preserve the previous behaviour:// astro.config.mjs - base: 'my-base', + base: 'my-base/',
-
#8118
8a5b0c1f3
Thanks @lilnasy! - Astro is smarter about CSS! Small stylesheets are now inlined by default, and no longer incur the cost of additional requests to your server. Your visitors will have to wait less before they see your pages, especially those in remote locations or in a subway.This may not be news to you if you had opted-in via the
build.inlineStylesheets
configuration. Stabilized in Astro 2.6 and set to "auto" by default for Starlight, this configuration allows you to reduce the number of requests for stylesheets by inlining them into