fix(deps): update dependency astro to v3 - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
astro (source) | dependencies | major | ^1.5.2 -> ^3.0.0 |
Release Notes
withastro/astro (astro)
v3.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
]:
v3.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
v3.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
v3.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.
v3.0.3
Patch Changes
-
#8300
d4a6ab733
Thanks @ematipico! - Correctly retrive middleware when using it in SSR enviroments.
v3.0.2
Patch Changes
-
#8293
d9bd7cf5c
Thanks @Princesseuh! - Fixtsc
errors insideastro/components/index.ts
v3.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.
v3.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.
v2.10.15
Patch Changes
-
#8268
3b0d805bd
Thanks @matthewp! - Prevent ViewTransition script from being added by mistake
v2.10.14
Patch Changes
-
#8206
52606a390
Thanks @martrapp! - fix: View Transition: swap attributes of document's root element
v2.10.13
Patch Changes
-
#8152
582132328
Thanks @andremralves! - Displays a new config error ifoutDir
is placed withinpublicDir
. -
#8166
fddd4dc71
Thanks @martrapp! - ViewTransitions: Fixes in the client-side router -
#8182
cfc465dde
Thanks @martrapp! - View Transitions: self link (href=""
) does not trigger page reload -
#8171
95120efbe
Thanks @Princesseuh! - Fix missing type forimageConfig
export fromastro:assets
-
#8187
273335cb0
Thanks @bluwy! - Fix Astro components parent-child render order -
#8184
9142178b1
Thanks @martrapp! - Fix: The scrolling behavior of ViewTransitions is now more similar to the expected browser behavior -
#8163
179796405
Thanks @delucis! - Make typing ofdefineCollection
more permissive to support advanced union and intersection types
v2.10.12
Patch Changes
-
#8144
04caa99c4
Thanks @lilnasy! - Fixed an issue where data entries' id included backslashes instead of forward slashes on Windows.
v2.10.11
Patch Changes
-
#8136
97c8760d7
Thanks @andremralves! - Fix 404 response leading to an infinite loop when there is no 404 page.
v2.10.10
Patch Changes
-
#8127
b12c8471f
Thanks @natemoo-re! - Do not throw Error when users pass an object with a "type" property -
#8092
7177f7579
Thanks @natemoo-re! - Ensure dotfiles are cleaned during static builds -
#8122
fa6b68a77
Thanks @natemoo-re! - Improve fidelity of time stats when runningastro build
-
#8070
097a8e4e9
Thanks @lilnasy! - Fix a handful of edge cases with prerendered 404/500 pages -
#8123
1f6497c33
Thanks @natemoo-re! - Open to configuredbase
whenastro dev --open
runs -
#8105
0e0fa605d
Thanks @martrapp! - ViewTransition: bug fix for lost scroll position in browser history -
#8116
b290f0a99
Thanks @martrapp! - On back navigation only animate view transitions that were animated going forward. -
#7778
d6b494376
Thanks @y-nk! - Added support for optimizing remote images from authorized sources when usingastro:assets
. This comes with two new parameters to specify which domains (image.domains
) and host patterns (image.remotePatterns
) are authorized for remote images.For example, the following configuration will only allow remote images from
astro.build
to be optimized:// astro.config.mjs export default defineConfig({ image: { domains: ['astro.build'], }, });
The following configuration will only allow remote images from HTTPS hosts:
// astro.config.mjs export default defineConfig({ image: { remotePatterns: [{ protocol: 'https' }], }, });
-
#8109
da6e3da1c
Thanks @martrapp! - fix: reinsert attribute to specify direction of ViewTransition (forward / back)
v2.10.9
Patch Changes
-
#8091
56e7c5177
Thanks @martrapp! - Handle<noscript>
tags in<head>
during ViewTransitions
v2.10.8
Patch Changes
-
#7702
c19987df0
Thanks @shishkin! - Fix AstroConfigSchema type export -
#8084
560e45924
Thanks @hbgl! - Stream request body instead of buffering it in memory. -
#8066
afc45af20
Thanks @Princesseuh! - Add support for non-awaited imports to the Image component andgetImage
-
#7866
d1f7143f9
Thanks @43081j! - Add second type argument to the AstroGlobal type to type Astro.self. This change will ultimately allow our editor tooling to provide props completions and intellisense for<Astro.self />
-
#8032
3e46634fd
Thanks @natemoo-re! -astro add
now passes down--save-prod
,--save-dev
,--save-exact
, and--no-save
flags for installation -
#8035
a12027b6a
Thanks @fyndor! - Removed extra double quotes from computed style in shiki code component
v2.10.7
Patch Changes
-
#8042
4a145c4c7
Thanks @matthewp! - Treat same pathname with different search params as different page
v2.10.6
Patch Changes
-
#8027
1b8d30209
Thanks @natemoo-re! - Ensure dev server restarts respect whenbase
is removed -
#8033
405913cdf
Thanks @matthewp! - Prevent script re-evaluation on page transition -
#8036
87d4b1843
Thanks @ematipico! - Fix a bug where the middleware entry point was passed to integrations even though the configurationbuild.excludeMiddleware
was set tofalse
. -
#8022
c23377caa
Thanks @bluwy! - Always return a new array instance fromgetCollection
in prod -
#8013
86bee2812
Thanks @martrapp! - Links with hash marks now trigger view transitions if they lead to a different page. Links to the same page do not trigger view transitions.
v2.10.5
Patch Changes
-
#8011
5b1e39ef6
Thanks @bluwy! - Move hoisted script analysis optimization behind theexperimental.optimizeHoistedScript
option
v2.10.4
Patch Changes
-
#8003
16161afb2
Thanks @JuanM04! - FixedEndpointOutput
types with{ encoding: 'binary' }
-
#7995
79376f842
Thanks @belluzj! - Fix quadratic quote escaping in nested data in island props -
#8007
58b121d42
Thanks @paperdave! - Support Bun by adjusting how@babel/plugin-transform-react-jsx
is imported.
v2.10.3
Patch Changes
-
#7986
8e5a27b48
Thanks @natemoo-re! - Ensure injectRoute is properly handled inbuild
as well asdev
v2.10.2
Patch Changes
-
#7945
a00cfb894
Thanks @matthewp! - Fix race condition when performing swap for fallback -
#7983
6cd7290d2
Thanks @natemoo-re! - Fix filename generation for.astro
pages -
#7946
9d0070095
Thanks @andremralves! - Fix: missing CSS import when 404 server Response redirects to a custom 404 page. -
#7977
a4a637c8f
Thanks @bluwy! - Fix inline root resolve logic -
#7943
c2682a17c
Thanks @natemoo-re! - Ensure that injected routes fromnode_modules
are properly detected
v2.10.1
Patch Changes
-
#8206
52606a390
Thanks @martrapp! - fix: View Transition: swap attributes of document's root element
v2.10.0
Minor Changes
-
#7861
41afb8405
Thanks @matthewp! - Persistent DOM and Islands in Experimental View TransitionsWith
viewTransitions: true
enabled in your Astro config's experimental section, pages using the<ViewTransition />
routing component can now access a newtransition:persist
directive.With this directive, you can keep the state of DOM elements and islands on the old page when transitioning to the new page.
For example, to keep a video playing across page navigation, add
transition:persist
to the element:<video controls="" autoplay="" transition:persist> <source src="https://ia804502.us.archive.org/33/items/GoldenGa1939_3/GoldenGa1939_3_512kb.mp4" type="video/mp4" /> </video>
This
<video>
element, with its current state, will be moved over to the next page (if the video also exists on that page).Likewise, this feature works with any client-side framework component island. In this example, a counter's state is preserved and moved to the new page:
<Counter count={5} client:load transition:persist />
See our View Transitions Guide to learn more on usage.
Patch Changes
-
#7821
c00b6f0c4
Thanks @ottomated! - Fixes an issue that prevents importing'astro/app'
-
#7917
1f0ee494a
Thanks @bluwy! - Prevent integration hooks from re-triggering if the server restarts on config change, but the config fails to load. -
#7901
00cb28f49
Thanks @bluwy! - Improve sourcemap generation and performance -
#7911
c264be349
Thanks @martrapp! - fix for #7882 by setting state in page navigation (view transitions) -
#7909
e1e958a75
Thanks @tonydangblog! - Fix: ignore.json
files nested in subdirectories within content collection directories starting with an_
underscore.
v2.9.7
Patch Changes
-
#7754
298dbb89f
Thanks @natemoo-re! - Refactor404
and500
route handling for consistency and improved prerendering support -
#7885
9e2203847
Thanks @andremralves! - Fix incorrect build path logging for 404.astro pages. -
#7887
5c5da8d2f
Thanks @ffxsam! - Add logging for when JSON.parse fails within hydrate func -
#7895
0b8375fe8
Thanks @bluwy! - Fix streaming Astro components -
#7876
89d015db6
Thanks @ematipico! - Check forgetStaticPaths
only if the file has the.astro
extension. -
#7879
ebf7ebbf7
Thanks @bluwy! - Refactor and improve Astro config loading flow
v2.9.6
Patch Changes
-
#7856
861f10eaf
Thanks @matthewp! - Properly serialize redirect config for SSR
v2.9.5
Patch Changes
-
#7838
e50f64675
Thanks @bluwy! - Fix head propagation for MDX components -
#7841
2275c7d56
Thanks @ematipico! - Allow to return a redirect in dev mode when the original route is not present in the file system. -
#7800
49a4b2820
Thanks @matthewp! - Scroll position restoration with ViewTransitions router
v2.9.4
Patch Changes
-
#7826
31c4031ba
Thanks @Princesseuh! - Fixastro:assets
not working on Windows in build when using Squoosh -
#7823
5161cf919
Thanks @matthewp! - Adds anastro:beforeload
event for the dark mode use-case -
#7836
59b556232
Thanks @matthewp! - Upgrade compiler to bring in Image view transition support -
#7824
267487e63
Thanks @matthewp! - Prevent navigation on hash change -
#7829
b063a2d8a
Thanks @Princesseuh! - Fixastro:assets
endpoint not working in dev and SSR ifexperimental.assets
was enabled by an integration (such as Starlight) -
#7734
d5f526b33
Thanks @Princesseuh! - Fix some global state related toastro:assets
not getting cleaned out properly in SSR with no pre-rendered pages -
#7843
7dbcbc86b
Thanks @matthewp! - Fixes head propagation regression
v2.9.3
Patch Changes
-
#7782
0f677c009
Thanks @bluwy! - Refactor Astro rendering to write results directly. This improves the rendering performance for all Astro files. -
#7786
188eeddd4
Thanks @matthewp! - Execute scripts when navigating to a new page.When navigating to an new page with client-side navigation, scripts are executed (and re-executed) so that any new scripts on the incoming page are run and the DOM can be updated.
However,
type=module
scripts never re-execute in Astro, and will not do so in client-side routing. To support cases where you want to modify the DOM, a newastro:load
event listener been added:document.addEventListener('astro:load', () => { updateTheDOMSomehow(); });
v2.9.2
Patch Changes
-
#7777
3567afac4
Thanks @bluwy! - Fix rendering TextEncoder encoding error regression -
#7759
1792737da
Thanks @Princesseuh! - Fix SharedImageService's types not properly reflecting that image services hooks can be async -
#7766
da7f1128b
Thanks @Princesseuh! - Fix missingreferrerpolicy
on ScriptHTMLAttributes -
#7746
0c9959704
Thanks @birkskyum! - Update Vite to 4.4
v2.9.1
Patch Changes
-
#7756
274e67532
Thanks @matthewp! - Fixes case where there is FOUC caused by stylesheets not loaded -
#7742
e52852628
Thanks @andersk! - Fix parsing image assets from a Markdown line along with other markup. -
#7757
c2d6cfd0c
Thanks @matthewp! - Prevent animations when prefers-reduced-motion -
#7750
201d32dcf
Thanks @matthewp! - Trigger full page refresh on back nav from page without VT enabled
v2.9.0
Minor Changes
-
#7686
ec745d689
Thanks @matthewp! - Redirects configurationThis change moves the
redirects
configuration out of experimental. If you were previously using experimental redirects, remove the following experimental flag:experimental: { redirects: true, }
If you have been waiting for stabilization before using redirects, now you can do so. Check out the docs on redirects to learn how to use this built-in feature.
-
#7707
3a6e42e19
Thanks @ottomated! - Improved hoisted script bundlingAstro's static analysis to determine which
<script>
tags to bundle together just got a little smarter!Astro create bundles that optimize script usage between pages and place them in the head of the document so that they are downloaded as early as possible. One limitation to Astro's existing approach has been that you could not dynamically use hoisted scripts. Each page received the same, all-inclusive bundle whether or not every script was needed on that page.
Now, Astro has improved the static analysis to take into account the actual imports used.
For example, Astro would previously bundle the
<script>
s from both the<Tab>
and<Accordian>
component for the following library that re-exports multiple components:export { default as Tabs } from './Tabs.astro'; export { default as Accordion } from './Accordion.astro';
Now, when an Astro page only uses a single component, Astro will send only the necessary script to the page. A page that only imports the
<Accordian>
component will not receive any<Tab>
component's scripts:
v2.8.5
Patch Changes
-
#7711
72bbfac97
Thanks @natemoo-re! - Fixstatus
code for custom404
and500
pages in the dev server -
#7693
d401866f9
Thanks @natemoo-re! - Fix loading of/404.astro
page when dynamic route returns 404 -
#7706
4f6b5ae2b
Thanks @Princesseuh! - Fix Markdoc integration not being able to importemitESMImage
from Astro -
#7694
06c255716
Thanks @natemoo-re! - Fix route matching behavior whengetStaticPaths
result includes hyphenated params
v2.8.4
Patch Changes
-
#7680
cc8e9de88
Thanks @ematipico! - Throw an error whenbuild.split
is set totrue
butoutput
isn't set to"server"
. -
#7679
1a6f833c4
Thanks @bluwy! - Handle inlining non-string boolean environment variables -
#7691
cc0f81c04
Thanks @Princesseuh! - Fix not being able to build on Vercel Edge whenastro:assets
was enabled even when using a non-Node image service
v2.8.3
Patch Changes
-
#7637
af5827d4f
Thanks @Princesseuh! - Fixastro:assets
not respecting EXIF rotation -
#7644
213e10991
Thanks @matthewp! - Fix for allowing the root path / as a redirect -
#7644
213e10991
Thanks @matthewp! - Fix static redirects prefered over dynamic regular routes -
#7643
4b82e55cf
Thanks @alvinometric! - Add support for using.svg
files withastro:assets
's base services. The SVGs will NOT be processed and will be return as-is, however, proper attributes, alt enforcement etc will all work correctly.
v2.8.2
Patch Changes
-
#7623
86e19c7cf
Thanks @matthewp! - Allow our Response wrapper to be cloneable
v2.8.1
Patch Changes
-
#7611
904921cbe
Thanks @bluwy! - Ignore content .json files prefixed with underscores (regression) -
#7618
3669e2d27
Thanks @ematipico! - Add a fallback label ifastro info
command can't determine the package manager used. -
#7620
831dfd151
Thanks @delucis! - Filter outastro
from integration peer dependencies when runningastro add
v2.8.0
Minor Changes
-
#7532
9e5fafa2b
Thanks @ematipico! - Theastro/middleware
module exports a new utility calledtrySerializeLocals
.This utility can be used by adapters to validate their
locals
before sending it to the Astro middleware.This function will throw a runtime error if the value passed is not serializable, so consumers will need to handle that error.
-
#7532
9e5fafa2b
Thanks @ematipico! - Astro exposes the middleware file path to the integrations in the hookastro:build:ssr
// myIntegration.js import type { AstroIntegration } from 'astro'; function integration(): AstroIntegration { return { name: 'fancy-astro-integration', hooks: { 'astro:build:ssr': ({ middlewareEntryPoint }) => { if (middlewareEntryPoint) { // do some operations } }, }, }; }
The
middlewareEntryPoint
is only defined if the user has created an Astro middleware. -
#7432
6e9c29579
Thanks @ematipico! - Adds a new commandastro info
, useful for sharing debugging information about your current environment when you need help!astro info
Output
Astro version v2.6.6 Package manager pnpm Platform darwin Architecture arm64 Adapter @​astrojs/vercel/serverless Integrations None
-
#7532
9e5fafa2b
Thanks @ematipico! - Theastro/middleware
module exports a new API calledcreateContext
.This a low-level API that adapters can use to create a context that can be consumed by middleware functions.
-
#7532
9e5fafa2b
Thanks @ematipico! - Introduced a new build option for SSR, calledbuild.excludeMiddleware
.// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ build: { excludeMiddleware: true, }, });
When enabled, the code that belongs to be middleware won't be imported by the final pages/entry points. The user is responsible for importing it and calling it manually.
Patch Changes
-
#7532
9e5fafa2b
Thanks @ematipico! - Correctly track the middleware during the SSR build.
v2.7.4
Patch Changes
-
#7544
47b756e3e
Thanks @johannesspohr! - Batch async iterator buffering to reduce numbers of calls tosetTimeout
-
#7565
5ffdec758
Thanks @bluwy! - Fix style crawling logic for CSS HMR
v2.7.3
Patch Changes
-
#7527
9e2426f75
Thanks @natemoo-re! - Default registry logic to fallback to NPM if registry command fails (sorry, Bun users!) -
#7542
cdc28326c
Thanks @natemoo-re! - Fix bug when usingdefine:vars
with astyle
object -
#7521
19c2d43ea
Thanks @knpwrs! - AddProps
generic forAPIRoute
type -
#7531
2172dd4f0
Thanks @wackbyte! - Fix serialization ofundefined
in framework component props -
#7539
1170877b5
Thanks @jc1144096387! - Update registry logic, improving edge cases (http support, redirects, registries ending with '/')
v2.7.2
Patch Changes
-
#7273
6dfd7081b
Thanks @bluwy! - Fix error stacktrace from Vite SSR runtime -
#7370
83016795e
Thanks @bluwy! - Simplify nested hydration flow -
#7488
d3247851f
Thanks @natemoo-re! - PasscompressHTML
setting to server adapters -
#7491
a3928016c
Thanks @bluwy! - Fix CSS error line offset -
#7494
2726098bc
Thanks @itsmatteomanf! - Replaces the instance ofsetTimeout()
in the runtime to usequeueMicrotask()
, to resolve limitations on Cloudflare Workers. -
#7509
f4fea3b02
Thanks @ematipico! - Correctly emit pre-rendered pages whenbuild.split
is set totrue
v2.7.1
Patch Changes
-
#7490
601403744
Thanks @ematipico! - Fix the URL that belongs toentryPoints
in the hookastro:build:ssr
. The paths were created with the wrong output directory. -
#7459
869197aaf
Thanks @bluwy! - Fix missing styles for Markdoc files in development -
#7476
478cd9d8f
Thanks @hirasso! - Allow astro to be installed underneath a folder with leading slashes -
#7479
57e603038
Thanks @bluwy! - Handle esbuild 0.18 changes -
#7381
f359d77b1
Thanks @matthewp! - Prevent accidental inclusion of page CSS in dev mode -
Updated dependencies [
2b7539952
]:
v2.7.0
Minor Changes
-
#7353
76fcdb84d
Thanks @bholmesdev! - Remove legacy handling for MDX content collections. Ensure you are using@astrojs/mdx
v0.18 or above. -
#7385
8e2923cc6
Thanks @ematipico! -Astro.locals
is now exposed to the adapter API. Node Adapter can now pass in alocals
object in the SSR handler middleware. -
#7220
459b5bd05
Thanks @ematipico! - Shipped a new SSR build configuration mode:split
. When enabled, Astro will "split" the singleentry.mjs
file and instead emit a separate file to render each individual page during the build process.These files will be emitted inside
dist/pages
, mirroring the directory structure of your page files insrc/pages/
, for example:├── pages │ ├── blog │ │ ├── entry._slug_.astro.mjs │ │ └── entry.about.astro.mjs │ └── entry.index.astro.mjs
To enable, set
build.split: true
in your Astro config:// src/astro.config.mjs export default defineConfig({ output: 'server', adapter: node({ mode: 'standalone', }), build: { split: true, }, });
-
#7220
459b5bd05
Thanks @ematipico! - The Astro hookastro:build:ssr
now receives a new option in their payload, calledentryPoints
.entryPoints
is defined as aMap<RouteData, URL>
, whereRouteData
represents the information of a Astro route andURL
is the path to the physical file emitted at the end of the build.export function integration(): AstroIntegration { return { name: 'my-integration', hooks: { 'astro:build:ssr': ({ entryPoints }) => { // do something with `entryPoints` }, }, }; }
Patch Changes
-
#7438
30bb36371
Thanks @bluwy! - Fixastro:build:setup
hookupdateConfig
utility, where the configuration wasn't correctly updated when the hook was fired. -
#7436
3943fa390
Thanks @kossidts! - Fix an issue related to the documentation. Destructure the argument of the function to customize the Astro dev server based on the command run. -
#7424
7877a06d8
Thanks @bholmesdev! - Update internal types for more stable builds for Astro maintainers. -
#7427
e314a04bf
Thanks @ematipico! - Correctly emit the middleware code during the build phase. The file emitted is nowdist/middleware.mjs
-
#7423
33cdc8622
Thanks @bmenant! - Ensure injected/_image
endpoint for image optimization is not prerendered on hybrid output.
v2.6.6
Patch Changes
-
#7418
2b34fc492
Thanks @ematipico! - Correctly type the optionserver.open
-
#7429
89a483520
Thanks @delucis! - Fix telemetry reporting for integrations that return an array
v2.6.5
Patch Changes
-
#7414
bb644834e
Thanks @bluwy! - Simplify telemetry Vite version detection -
#7399
d2020c29c
Thanks @natemoo-re! - Fix edge case where injected routes would cause builds to fail in a PNPM workspace
v2.6.4
Patch Changes
-
#7366
42baf62e7
Thanks @aappaapp! - FixedRedirectConfig
type definition -
#7380
1c7b63595
Thanks @bholmesdev! - Fix missing stacktraces for Zod errors
v2.6.3
Patch Changes
-
#7341
491c2db42
Thanks @bholmesdev! - Improve error message for unsupported Zod transforms from the content config. -
#7352
0a8d178c9
Thanks @bholmesdev! - Raise error when multiple content collection entries have the same slug
v2.6.2
Patch Changes
-
#7310
52f0480d1
Thanks @Edo-San! - Fixed a bug that threw an Exception when spreading potentially undefined values as HTML attributes -
#7339
e3271f8c1
Thanks @bholmesdev! - Add readable error message for invalid dynamic routes. -
#7316
e6bff651f
Thanks @bholmesdev! - Fix Zod errors getting flagged as configuration errors -
#7342
bbcf69e7b
Thanks @matthewp! - Fix for experimental redirects in dev mode -
#7326
1430ffb47
Thanks @calebdwilliams! - Fixes issue where Astro doesn't respect custom npm registry settings during project creation
v2.6.1
Patch Changes
-
#7307
8034edd9e
Thanks @bholmesdev! - Fix [Object AsyncGenerator] appearing in markup for Markdoc documents
v2.6.0
Minor Changes
-
#7067
57f8d14c0
Thanks @matthewp! - Experimental redirects supportThis change adds support for the redirects RFC, currently in stage 3: https://github.com/withastro/roadmap/pull/587
Now you can specify redirects in your Astro config:
import { defineConfig } from 'astro/config'; export defineConfig({ redirects: { '/blog/old-post': '/blog/new-post' } });
You can also specify spread routes using the same syntax as in file-based routing:
import { defineConfig } from 'astro/config'; export defineConfig({ redirects: { '/blog/[...slug]': '/articles/[...slug]' } });
By default Astro will build HTML files that contain the
<meta http-equiv="refresh">
tag. Adapters can also support redirect routes and create configuration for real HTTP-level redirects in production. -
#7237
414eb19d2
Thanks @bluwy! - Remove experimental flag for custom client directives -
#7274
b5213654b
Thanks @Princesseuh! - Update basetsconfig.json
template withallowJs: true
to provide a better relaxed experience for users unfamilliar with TypeScript.allowJs
is still set tofalse
(its default value) when using thestrictest
preset. -
#7180
e3b8c6296
Thanks @lilnasy! - The Inline Stylesheets RFC is now stable!You can now control how Astro bundles your css with a configuration change:
export default defineConfig({ ... build: { inlineStylesheets: "auto" } ... })
The options:
-
inlineStylesheets: "never"
: This is the behavior you are familiar with. Every stylesheet is external, and added to the page via a<link>
tag. Default. -
inlineStylesheets: "auto"
: Small stylesheets are inlined into<style>
tags and inserted into<head>
, while larger ones remain external. -
inlineStylesheets: "always"
: Every style required by the page is inlined.
As always, css files in the
public
folder are not affected. -
-
#7260
39403c32f
Thanks @natemoo-re! - Unflags support foroutput: 'hybrid'
mode, which enables pre-rendering by default. The additionalexperimental.hybridOutput
flag can be safely removed from your configuration. -
#7109
101f03209
Thanks @ematipico! - Remove experimental flag for the middleware
Patch Changes
-
#7296
a7e2b37ff
Thanks @Princesseuh! - Fix HTML component type causing an error when imported in the editor -
#7294
dd1a6b6c9
Thanks @matthewp! - Fix cookies not being set by middleware -
#7197
d72cfa7ca
Thanks @bluwy! - Fix nested astro-island hydration race condition -
#7262
144813f73
Thanks @andremralves! - Fix injected scripts not injected to injected routes -
#7242
890a2bc98
Thanks @JerryWu1234! - remove the white space after the doctype according to the property compressHTML
v2.5.7
Patch Changes
-
#7215
6e27f2f6d
Thanks @bmenant! - Node adapter fallbacks to:authority
http2 pseudo-header whenhost
is nullish. -
#7233
96ae37eb0
Thanks @bluwy! - FixgetViteConfig
and Vitest setup with content collections -
#7136
fea306936
Thanks @johannesspohr! - Render arrays of components in parallel -
#7257
5156c4f90
Thanks @thiti-y! - fix: build fail upon have 'process.env' in *.md file. -
#7268
9e7366567
Thanks @bholmesdev! - Fix: ignore.json
files within content collection directories starting with an_
underscore. -
#7185
339529fc8
Thanks @bholmesdev! - Bring back improved style and script handling across content collection files. This addresses bugs found in a previous release to@astrojs/markdoc
.
v2.5.6
Patch Changes
-
#7193
8b041bf57
Thanks @ematipico! - Refactor how pages are emitted during the internal bundling. Now each page is emitted as a separate entry point. -
#7218
6c7df28ab
Thanks @bluwy! - Fix CSS deduping and missing chunks -
#7235
ee2aca80a
Thanks @MoustaphaDev! - Prioritize dynamic prerendered routes over dynamic server routes -
#7192
7851f9258
Thanks @ematipico! - Detectmdx
files using their full extension -
#7244
bef3a75db
Thanks @bholmesdev! - Remove the auto-generated$entry
variable for Markdoc entries. To access frontmatter as a variable, you can passentry.data
as a prop where you render your content:
v2.5.5
Patch Changes
-
#6832
904131aec
Thanks @wulinsheng123! - fix a bug when Fragment is as a slot -
#7178
57e65d247
Thanks @bholmesdev! - Fix: revert Markdoc asset bleed changes. Production build issues were discovered that deserve a different fix.
v2.5.4
Patch Changes
-
#7125
4ce8bf7c6
Thanks @bluwy! - Make vite-plugin-content-virtual-mod rungetEntrySlug
10 at a time to preventEMFILE: too many open files
error -
#7166
626dd41d0
Thanks @ematipico! - Move generation of renderers code into their own file -
#7174
92d1f017e
Thanks @ematipico! - Remove restriction around serialisable data forAstro.locals
-
#7172
2ca94269e
Thanks @Princesseuh! - Add types forimport.meta.env.ASSETS_MREFIX
andimport.meta.env.SITE
-
#7134
5b6a0312a
Thanks @alexvuka1! - value of var can be undefined when usingdefine:vars
-
#7171
79ba74832
Thanks @bluwy! - Prevent Vite watching on Astro config load
v2.5.3
Patch Changes
-
#6758
f558a9e20
Thanks @bholmesdev! - Improve style and script handling across content collection files. This addresses style bleed present in@astrojs/markdoc
v0.1.0 -
#7143
b41963b77
Thanks @johannesspohr! - Render 404 page content when aResponse
with status 404 is returned from a page
v2.5.2
Patch Changes
-
#7144
ba0636240
Thanks @lilnasy! - Fixed an issue where scripts that weren't safe to inline were inlined. -
#7150
8f418d13c
Thanks @MoustaphaDev! - fix no matched path when usinggetStaticPaths
withoutprerender
export.
v2.5.1
Patch Changes
-
#7128
72f686a68
Thanks @johannesspohr! - Fix routes created byinjectRoute
for SSR -
#7132
319a0a7a0
Thanks @ematipico! - Emit middleware as an entrypoint during build -
#7036
852d59a8d
Thanks @ematipico! - Emit pages as dynamic import chunks during the build -
#7126
530fb9ebe
Thanks @bluwy! - Add route information when warning ofgetStaticPaths()
ignored -
#7118
3257dd289
Thanks @Princesseuh! - Fix unnecessary warning showing on start when a collection folder was empty. The warning was also enhanced to add more information about possible causes.
v2.5.0
Minor Changes
-
#7071
e186ecc5e
Thanks @johannesspohr! - Render sibling components in parallel -
#6850
c6d7ebefd
Thanks @bholmesdev! - Content collections now support data formats including JSON and YAML. You can also create relationships, or references, between collections to pull information from one collection entry into another. Learn more on our updated Content Collections docs. -
#6991
719002ca5
Thanks @MoustaphaDev! - Enable experimental support for hybrid SSR with pre-rendering enabled by defaultastro.config.mjs
import { defineConfig } from 'astro/config'; export defaultdefineConfig({ output: 'hybrid', experimental: { hybridOutput: true, }, })
Then add
export const prerender = false
to any page or endpoint you want to opt-out of pre-rendering.src/pages/contact.astro
v2.4.5
Patch Changes
-
#7000
c87d42e76
Thanks @craigjennings11! - Remove 'paths' requirement for tsconfig path aliasing -
#7055
4f1073a6a
Thanks @Princesseuh! - Fix astro:assets interfering with SSR query params ending with image extensions
v2.4.4
Patch Changes
-
#7047
48395c815
Thanks @Princesseuh! - Fix/_image
endpoint not being prefixed with thebase
path in build SSR -
#6916
630f8c8ef
Thanks @bholmesdev! - Add fast lookups for content collection entries when usinggetEntryBySlug()
. This generates a lookup map to ensure O(1) retrieval.
v2.4.3
Patch Changes
-
#7034
c00997033
Thanks @bluwy! - Fixastro:assets
SSR error -
#7032
157357e1f
Thanks @raulfdm! - fix middleware typing export for "moduleResolution: node"
v2.4.2
Patch Changes
-
#7009
1d4db68e6
Thanks @Princesseuh! - Fix types fromastro/client
not working properly due toclient-base.d.ts
being an non-ambient declaration file -
#7010
e9f0dd9b4
Thanks @ematipico! - Callnext()
without return anything should work, with a warning
v2.4.1
Patch Changes
-
#6995
71332cf96
Thanks @Princesseuh! - Move sharpImageService and squooshImageService functions toastro/config
so they can be imported
v2.4.0
Minor Changes
-
#6990
818252acd
Thanks @Princesseuh! - Generated optimized images are now cached inside thenode_modules/.astro/assets
folder. The cached images will be used to avoid doing extra work and speed up subsequent builds. -
#6659
80e3d4d3d
Thanks @lilnasy! - Implement Inline Stylesheets RFC as experimental -
#6771
3326492b9
Thanks @matthewp! - Implements a new class-based scoping strategyThis implements the Scoping RFC, providing a way to opt in to increased style specificity for Astro component styles.
This prevents bugs where global styles override Astro component styles due to CSS ordering and the use of element selectors.
To enable class-based scoping, you can set it in your config:
import { defineConfig } from 'astro/config'; export default defineConfig({ scopedStyleStrategy: 'class', });
Note that the 0-specificity
:where
pseudo-selector is still the default strategy. The intent is to change'class'
to be the default in 3.0. -
#6959
cac4a321e
Thanks @bluwy! - Support<Code inline />
to output inline code HTML (nopre
tag) -
#6721
831b67cdb
Thanks @ematipico! - Implements a new experimental middleware in Astro.The middleware is available under the following experimental flag:
export default defineConfig({ experimental: { middleware: true, }, });
Or via CLI, using the new argument
--experimental-middleware
.Create a file called
middleware.{js,ts}
inside thesrc
folder, and export aonRequest
function.From
astro/middleware
, use thedefineMiddleware
utility to take advantage of type-safety, and use thesequence
utility to chain multiple middleware functions.Example:
import { defineMiddleware, sequence } from 'astro/middleware'; const redirects = defineMiddleware((context, next) => { if (context.request.url.endsWith('/old-url')) { return context.redirect('/new-url'); } return next(); }); const minify = defineMiddleware(async (context, next) => { const repsonse = await next(); const minifiedHtml = await minifyHtml(response.text()); return new Response(minifiedHtml, { status: 200, headers: response.headers, }); }); export const onRequest = sequence(redirects, minify);
-
#6932
49514e4ce
Thanks @bluwy! - Upgrade shiki to v0.14.1. This updates the shiki theme colors and adds the theme name to thepre
tag, e.g.<pre class="astro-code github-dark">
.
Patch Changes
-
#6973
0883fd487
Thanks @matthewp! - Ensure multiple cookies set in dev result in multiple set-cookie headers -
Updated dependencies [
49514e4ce
]:
v2.3.4
Patch Changes
-
#6967
a8a319aef
Thanks @bluwy! - Fixastro-entry
error on build with multiple JSX frameworks -
#6961
a695e44ae
Thanks @Princesseuh! - Fix getImage type -
#6956
367e61776
Thanks @lilnasy! - Changed where various parts of the build pipeline look to decide if a page should be prerendered. They now exclusively consider PageBuildData, allowing integrations to participate in the decision. -
#6969
77270cc2c
Thanks @bluwy! - Avoid removing leading slash forbuild.assetsPrefix
value in the build output -
#6910
895fa07d8
Thanks @natemoo-re! - Inlineprocess.env
boolean values (0
,1
,true
,false
) during the build. This helps with DCE and allows for betterexport const prerender
detection. -
#6958
72c6bf01f
Thanks @bluwy! - Fix content render imports flow -
#6952
e5bd084c0
Thanks @Princesseuh! - Update allowed Sharp versions to support 0.32.0
v2.3.3
Patch Changes
-
#6940
a98df9374
Thanks @delucis! - Support custom 404s added viainjectRoute
or assrc/pages/404.html
-
#6948
50975f2ea
Thanks @imchell! - Placeholders for slots are cleaned in HTML String that is rendered -
#6848
ebae1eaf8
Thanks @Princesseuh! - Updateexperimental.assets
'simage.service
configuration to allow for a config option in addition to an entrypoint -
#6953
dc062f669
Thanks @Princesseuh! - Updateastro check
to use version 1.0.0 of the Astro language server -
Updated dependencies [
ac57b5549
]:
v2.3.2
Patch Changes
v2.3.1
Patch Changes
-
#6859
4c7ba4da0
Thanks @andremralves! - Fix Astro.params does not contain path parameter from URL with non-English characters. -
#6872
b6154d2d5
Thanks @bluwy! - Fix hoisted scripts path for linked package Astro components -
#6862
1f2699461
Thanks @jcdogo! - Fixes bug with assetsPrefix not being prepended to component-url and renderer-url in astro islands when using SSR mode. -
#6902
0afff3274
Thanks @bluwy! - Disable Vite optimizer for sync and config loading. Improve first page load time for warm server startup.
v2.3.0
Minor Changes
Patch Changes
-
#6544
a9c22994e
Thanks @wulinsheng123! - Correctly generate directories for assets when users customise the output via rollup options. -
#6825
948a6d7be
Thanks @Princesseuh! - Fix unnecessary warning when using images inside thesrc/content
folder withexperimental.assets
-
Updated dependencies [
2511d58d5
]:
v2.2.3
Patch Changes
-
#6765
6c09ac03b
Thanks @Princesseuh! - Properly include the needed WASM files for the Squoosh service for Netlify and Vercel in SSR -
#6817
f882bc163
Thanks @bholmesdev! - Fix sourcemap warnings when using Content Collections and MDX with thevite.build.sourcemap
option -
#6819
76dd53e3f
Thanks @MoustaphaDev! - Fix fallback content showing unexpectedly in some cases -
#6582
7653cf9e9
Thanks @bluwy! - Fix CSS chunking and deduping between multiple Astro files and framework components
v2.2.2
Patch Changes
-
#6811
60c16db6f
Thanks @bluwy! - Fix check CLI fs load fallback behaviour -
#6782
c12ca5ece
Thanks @amirhhashemi! - Force error overlay direction to be LTR
v2.2.1
Patch Changes
-
#6766
72fed684a
Thanks @Xetera! - Exporting the ImageFunction in astro:content and grouping it under a SchemaContext -
#6772
45bff6fcc
Thanks @natemoo-re! - Allowimport.meta.env
values of0
,1
,true
, andfalse
to be used forexport const prerender
statements -
#6770
52d7a4a01
Thanks @Princesseuh! - Updated types to match newer Vite versions -
#6774
9e88e0f23
Thanks @bholmesdev! - Fix: remove oldslug()
type fromdefineCollection()
helper -
#6775
fa84f1a7d
Thanks @matthewp! - Support streaming inside of slots -
#6779
a98f6f418
Thanks @matthewp! - Prevent body head content injection in MDX when using layout -
#6781
7f74326b7
Thanks @bholmesdev! - Fixastro:server:setup
middlewares not applying. This resolves an issue with the Partytown integration in dev.
v2.2.0
Minor Changes
-
#6703
a1108e037
Thanks @Princesseuh! - Moveimage()
to come fromschema
instead to fix it not working with refine and inside complex typesMigration:
Remove the
image
import fromastro:content
, and instead use a function to generate your schema, like such:import { defineCollection, z } from 'astro:content'; defineCollection({ schema: ({ image }) => z.object({ image: image().refine((img) => img.width >= 200, { message: 'image too small', }), }), });
-
#6714
ff0430786
Thanks @bluwy! - Addbuild.assetsPrefix
option for CDN support. If set, all Astro-generated asset links will be prefixed with it. For example, setting it tohttps://cdn.example.com
would generatehttps://cdn.example.com/_astro/penguin.123456.png
links.Also adds
import.meta.env.ASSETS_MREFIX
environment variable that can be used to manually create asset links not handled by Astro.
Patch Changes
-
#6753
489dd8d69
Thanks @bluwy! - FixgetViteConfig
return type -
#6744
a1a4f45b5
Thanks @Princesseuh! - Fix remote images in Markdown throwing errors when usingexperimental.assets
-
#6762
8b88e4cf1
Thanks @Princesseuh! - Improved error message when an error was encountered while generating types -
#6719
d54cbe413
Thanks @matthewp! - Better errors for when response is already sentThis adds clearer error messaging when a Response has already been sent to the browser and the developer attempts to use:
- Astro.cookies.set
- Astro.redirect
-
#6741
4c347ab51
Thanks @Princesseuh! - Fix content-type header being wrong in dev on images fromastro:assets
-
#6739
2f2e572e9
Thanks @Princesseuh! - Added more types and utilities exports related toastro:assets
to help building custom image components and image services -
Updated dependencies [
a1a4f45b5
]:
v2.1.9
Patch Changes
-
#6693
c0b7864a4
Thanks @bholmesdev! - Fix: avoid callingastro:server:setup
integration hook in production -
#6676
5e33c51a9
Thanks @bholmesdev! - Fix next and previous links for index routes when using pagination -
#6717
c2d4ae1cb
Thanks @Princesseuh! - Dynamically import check command to improve startup speed and prevent Astro from crashing due to language-server stuff -
#6679
08e92f4f8
Thanks @fcFn! - Fix incorrect path to file in error overlay on Win -
#6649
f0b732d32
Thanks @Princesseuh! - Improve error handling when usingastro:assets
-
#6710
a0bdf4ce2
Thanks @Princesseuh! - Fix multiple Image / getImage calls with the same image causing multiple duplicate images to be generated -
#6711
c04ea0d43
Thanks @Princesseuh! - Fix InferGetStaticParamsType and InferGetStaticPropsType not working when getStaticPaths wasn't async -
#6701
46ecf4662
Thanks @Princesseuh! - Remove unnecessary.wasm
files inside build output when possible
v2.1.8
Patch Changes
-
#6675
1f783e320
Thanks @matthewp! - Prevent frontmatter errors from crashing the dev server -
#6688
2e92e9aa9
Thanks @JohannesKlauss! - Add a additional check fornull
on thereq.body
check inNodeApp.render
. -
#6578
adecda7d6
Thanks @wulinsheng123! - add new flag with open for dev and preview -
#6680
386336441
Thanks @koriwi! - Invalidates cache when changing serviceEntryPoint -
#6653
7c439868a
Thanks @bholmesdev! - Simplify Markdoc configuration with a newmarkdoc.config.mjs
file. This lets you import Astro components directly to render as Markdoc tags and nodes, without the need for the previouscomponents
property. This new configuration also unlocks passing variables to your Markdoc from theContent
component (see the new docs).
v2.1.7
Patch Changes
-
#6192
b7194103e
Thanks @erg208! - Updated to fix the Node SSR fails on POST with Express JSON middleware -
#6630
cfcf2e2ff
Thanks @bholmesdev! - Support automatic image optimization for Markdoc images when usingexperimental.assets
. You can follow our Assets guide to enable this feature in your project. Then, start using relative or aliased image sources in your Markdoc files for automatic optimization:<!--Relative paths--> ![The Milky Way Galaxy](../assets/galaxy.jpg) <!--Or configured aliases--> ![Houston smiling and looking cute](~/assets/houston-smiling.jpg)
-
#6647
45da39a86
Thanks @bluwy! - Fix --mode flag for builds -
#6638
7daef9a29
Thanks @matthewp! - Avoid implicit head injection when a head is in the tree
v2.1.6
Patch Changes
-
#6633
9caf2a9cc
Thanks @bholmesdev! - Fix failedastro sync
call when runningastro check
. This change also reverts alias support in CSS styles. -
#6627
d338b6f74
Thanks @Princesseuh! - Update frontmatter assets to be relative to the current file instead ofsrc/assets
v2.1.5
Patch Changes
-
#6604
7f7a8504b
Thanks @Princesseuh! - Fix using optimized images in Markdown not working -
#6617
38e6ec21e
Thanks @MoustaphaDev! - Fix tsconfig alias regression -
#6588
f42f47dc6
Thanks @bholmesdev! - Allow access to content collection entry information (including parsed frontmatter and the entry slug) from your Markdoc using the$entry
variable:
v2.1.4
Patch Changes
-
#6547
04dddd783
Thanks @Princesseuh! - Fix images having the wrong width and height when using the new astro:assets features if both dimensions were provided -
#6566
ea9b3dd72
Thanks @bluwy! - Support tsconfig aliases in styles -
#6472
bf024cb34
Thanks @wulinsheng123! - don't finish the action of the copy before removing all files. -
#6556
22955b895
Thanks @Princesseuh! - Fix Invalid Input error when trying to use a custom Image Service -
#6568
f413446a8
Thanks @Princesseuh! - Fix image() type to be compatible with ImageMetadata -
#6559
90e5f87d0
Thanks @Princesseuh! - Vendorimage-size
to fix CJS-related issues -
#6576
388190102
Thanks @bluwy! - Simplify internal resolver in dev -
#6536
035c0c4df
Thanks @Princesseuh! - Fix Image component andgetImage
not handling images from public correctly -
#6601
f112c12b1
Thanks @bluwy! - Fix plugin apply args when filtering -
#6586
689884251
Thanks @solelychloe! - fix: Add missing --watch flag for astro check when running astro check --help -
#6572
fa132e35c
Thanks @MoustaphaDev! - Properly handle empty markdown files in content collections -
#6555
f5fddafc2
Thanks @Princesseuh! - Add avalidateOptions
hook to the Image Service API in order to set default options and validate the passed options -
#6605
283734525
Thanks @Princesseuh! - Update tsconfig.json templates to ignore TypeScript 5.0 deprecations for the moment -
#6583
66858f1f2
Thanks @francoromanol! - Fix overflow title in error message -
#6558
6c465e958
Thanks @bluwy! - Fix prerendered 404 page handling in SSR
v2.1.3
Patch Changes
-
#6530
acf78c5e2
Thanks @Princesseuh! - Fix various inaccuracies with types related to the new Assets features:- getConfiguredImageService wasn't present on the astro:assets types.
- ImageMetadata wasn't exported
- Fixed wrong module declaration for
avif
,heic
andheif
files. - Add missing module declaration for SVGs imports
-
#6527
04e624d06
Thanks @bluwy! - Treeshake exported client components that are not imported -
#6533
cc90d7219
Thanks @Princesseuh! - Added a warning when trying to useexperimental.assets
with a not compatible adapter -
#6483
a9a6ae298
Thanks @Princesseuh! - Fix images defined in content collections schemas not working -
#6537
6a7cf0712
Thanks @matthewp! - Prevent astro:content from depending on Node builtins -
#6488
bfd67ea74
Thanks @matthewp! - Remove use of createRequire breaking non-Node hosts. -
#6503
f6eddffa0
Thanks @bholmesdev! - Add caching togetCollection()
queries for faster SSG production builds -
#6508
c63874090
Thanks @bholmesdev! - Improve content collection error formatting:- Bold the collection and entry that failed
- Consistently list the frontmatter key at the start of every error
- Rich errors for union types
-
#6485
d637d1ea5
Thanks @bluwy! - Fix@astrojs/prism
edgecase with strict package managers -
#6532
637f9bc72
Thanks @Princesseuh! - Fixenv.d.ts
changing types wrongly on every restart whenexperimental.assets
is enabled -
#6460
77a046e88
Thanks @bluwy! - Add default.npmrc
file when adding the Lit integration throughastro add lit
and usingpnpm
.
v2.1.2
Patch Changes
-
#6466
ec0455352
Thanks @matthewp! - In dev, load assets relative to the root
v2.1.1
Patch Changes
-
#6454
05fc7ae54
Thanks @Princesseuh! - Add support for ESM importing SVGs when usingastro:assets
-
#6455
cf0198316
Thanks @delucis! - Documentimage.service
configuration option -
#6459
964d55246
Thanks @bluwy! - Prevent HTML-escape of raw strings in<script>
and<style>
tags of Astro JSX -
#6465
65c07ce1b
Thanks @matthewp! - Fixes ESM imported assets to be root relative
v2.1.0
Minor Changes
-
#6150
b087b83fe
Thanks @morellodev! - Add getStaticPaths type helpers to infer params and props -
#6344
694918a56
Thanks @Princesseuh! - Add a new experimental flag (experimental.assets
) to enable our new core Assets story.This unlocks a few features:
- A new built-in image component and JavaScript API to transform and optimize images.
- Relative images with automatic optimization in Markdown.
- Support for validating assets using content collections.
- and more!
See Assets (Experimental) on our docs site for more information on how to use this feature!
-
#6435
a20610609
Thanks @matthewp! - Expose the manifest to plugins via the astro:ssr-manifest virtual module -
#6394
a4a74ab70
Thanks @ematipico! - Add--help
to various commands:check
,sync
,dev
,preview
, andbuild
-
#6356
75921b3cd
Thanks @ematipico! - Added a new--watch
flag to the commandastro check
-
#6213
afbbc4d5b
Thanks @Princesseuh! - Updated compilation settings to disable downlevelling for Node 14
Patch Changes
-
#6209
fec583909
Thanks @bholmesdev! - Introduce the (experimental)@astrojs/markdoc
integration. This unlocks Markdoc inside your Content Collections, bringing support for Astro and UI components in your content. This also improves Astro core internals to make Content Collections extensible to more file types in the future.You can install this integration using the
astro add
command:astro add markdoc
Read the
@astrojs/markdoc
documentation for usage instructions, and browse the newwith-markdoc
starter to try for yourself.
v2.0.18
Patch Changes
-
#6412
cd8469947
Thanks @liruifengv! - Remove redundant comments whenastro add
updateastro.config.mjs
-
#6426
e0844852d
Thanks @MoustaphaDev! - Prevent?inline
and?raw
css query suffixes from injecting style tags in development -
Updated dependencies [
0abd1d3e4
]:
v2.0.17
Patch Changes
-
#6391
45501c531
Thanks @bluwy! - Teardown compiler after Vite build to free up memory when rendering pages -
#6392
ee8b2a067
Thanks @bluwy! - Run astro sync in build mode -
#6368
02a7266e3
Thanks @userquin! - Fix regression that caused some stateful Vite plugins to assume they were running indev
mode during thebuild
and vice versa. -
#6358
95164bfdd
Thanks @Princesseuh! - Add warning when using headers and encoding in endpoints in SSR
v2.0.16
Patch Changes
-
#6363
d94aae776
Thanks @matthewp! - Fixes cases where head is injected in body when using Astro.slots.render() -
Updated dependencies [
5aa6580f7
]:
v2.0.15
Patch Changes
-
#6323
5e26bc891
Thanks @Princesseuh! - Updated Undici to 5.20.0. This fixes a security issue and handling of cookies in certain cases in dev -
#6293
a156ecbb7
Thanks @MoustaphaDev! - Warn about setting theallowJs
compiler option only when thecontent
directory exists. -
#6320
ccd72e6bb
Thanks @wulinsheng123! - fix #6020 -
#6347
504c7bacb
Thanks @natemoo-re! - Fix internalgetSetCookie
usage forundici@5.20.x
-
#6333
63dda6ded
Thanks @ematipico! - Correctly emit mode when passingnode
to the commandastro add
-
#6330
f91a7f376
Thanks @MoustaphaDev! - Ensure prefixed underscore ignores only child paths of the content directory.
v2.0.14
Patch Changes
-
#6268
933c651fb
Thanks @natemoo-re! - Do not transform--camelCase
custom properties to--camel-case
when they're in astyle
attribute.This bug fix is backwards-compatible because we will emit both
--camelCase
and--camel-case
temporarily. This behavior will be removed in a future version of Astro. -
Updated dependencies [
bb1801013
]:
v2.0.13
Patch Changes
-
#6248
ef5cea4dc
Thanks @wulinsheng123! - Deno SSR with prerender=true complains about invalid URL scheme -
#6257
2fec47848
Thanks @bholmesdev! - Fix: prevent dev server hanging forgetCollection()
calls within a layout when using thelayout
prop
v2.0.12
Patch Changes
-
#6238
deacd5443
Thanks @bholmesdev! - Fix: run integration setup hooks duringastro sync
-
#6244
1c678f7eb
Thanks @bluwy! - Fix hydrate loading path to prevent multiple instance loaded for circular imports -
#6229
c397be324
Thanks @MoustaphaDev! - Add support for.js/.mjs
file extensions for Content Collections configuration file.
v2.0.11
Patch Changes
-
#6216
79783fc01
Thanks @matthewp! - Fix head injection in body with slots.render() and head buffering -
#6218
baa2dbb3b
Thanks @bholmesdev! - Fix: internal content collection error on spaces in file name -
#6049
8b7cb64da
Thanks @natemoo-re! - Preserve--root
CLI flag when restarting dev server
v2.0.10
Patch Changes
-
#6183
436bd0934
Thanks @Jutanium! - Fixes the first-page value ofurl.prev
when paginating a spread route at the root -
#6198
a9bdd9cc4
Thanks @matthewp! - Fixes usage of Code component in Vercel -
#6182
938ad514c
Thanks @matthewp! - Ensure base configuration appended to content collection styles -
#6197
c75d319ee
Thanks @BryceRussell! - Fixborder
andframe
attribute types onTableHTMLAttributes
interface -
#6180
6fa6025b3
Thanks @matthewp! - Allow binary data to be returned from api routes in SSG -
#6196
3390cb844
Thanks @matthewp! - Fix head injection misplacement with Astro.slots.render()
v2.0.9
Patch Changes
-
#6176
8bbdcf17d
Thanks @matthewp! - Take dynamic import into account in CSS ordering -
#6170
ec2f2a31d
Thanks @bholmesdev! - Show content config errors in overlay, instead of stopping the dev server.
v2.0.8
Patch Changes
-
#6168
c0e4b1df9
Thanks @matthewp! - Fix mixed usage of aliases and relative for client hydration
v2.0.7
Patch Changes
-
#6161
f6fc662c3
Thanks @matthewp! - Prevent ?inline and ?raw CSS from being bundled as CSS -
#6149
592386b75
Thanks @bloycey! - Moved pagination error to AstroErrorData -
#6153
1b591a143
Thanks @torchsmith! - Respectvite.build.emptyOutDir
setting duringastro build
-
#6092
bf8d7366a
Thanks @bholmesdev! - Ensure vite config (aliases, custom modules, etc) is respected when loading the content collection config -
#6111
ec38a8921
Thanks @e111077! - Implement client:only functionality in Lit and add lit to the client:only warning -
#6124
f20a85b64
Thanks @FredKSchott! - Fix outdated error message inpaginate()
function. -
#6122
9f22ac3d0
Thanks @bholmesdev! - Content collections: Fix accidental "use underscore to ignore" logs for.DS_Store
files and underscored directory names. -
#6163
cee70f5c6
Thanks @Princesseuh! - Fix returning hex / base64 images from endpoints not working in dev -
#6114
ac7fb04d6
Thanks @bluwy! - Fix sourcemap generation when scanning files -
#6152
d1f5611fe
Thanks @matthewp! - Fix MDX related head placement bugsThis fixes a variety of head content placement bugs (such as page
<link>
) related to MDX, especially when used in content collections. Issues fixed:- Head content being placed in the body instead of the head.
- Head content missing when rendering an MDX component from within a nested Astro component.
-
#6119
2189170be
Thanks @matthewp! - Fix hoisted script propagation in content collection pages -
#6117
32abe49bd
Thanks @Princesseuh! - Fix polyfills not being available in certain cases
v2.0.6
Patch Changes
-
#6107
9bec6bc41
Thanks @matthewp! - Fixes head contents being placed in body in MDX components
v2.0.5
Patch Changes
-
#6052
9793f19ec
Thanks @mayank99! - Error overlay will now show the error'scause
if available. -
#6070
f91615f5c
Thanks @AirBorne04! - * safe guard against TextEncode.encode(HTMLString) [errors on vercel edge]- safe guard against html.replace when html is undefined
-
#6064
2fb72c887
Thanks @bholmesdev! - Apply MDXcomponents
export when rendering as a content collection entry
v2.0.4
Patch Changes
-
#6045
41e97158b
Thanks @natemoo-re! - Improve error handling when an Astro component is rendered manually -
#6036
e779c6242
Thanks @natemoo-re! - Improve error handling when top-levelreturn
is present
v2.0.2
Patch Changes
-
#5983
b53e0717b
Thanks @natemoo-re! - Fixes a dev server edge case where prerender + getStaticPaths would not 404 on an unmatched route -
#5992
60b32d585
Thanks @HiDeoo! - FixAstro.url.protocol
when using the @astrojs/node SSR adapter with HTTPS -
#5971
883e0cc29
Thanks @JLarky! - improve error message: change @astrojs/solid to @astrojs/solid-js -
#5970
dabce6b8c
Thanks @bholmesdev! - Add type guard support to filters ongetCollection()
-
#5952
aedf23f85
Thanks @wulinsheng123! - Fix custom theme handling for<Code>
component -
Updated dependencies [
7abb1e905
]:
v2.0.1
Patch Changes
-
#6412
cd8469947
Thanks @liruifengv! - Remove redundant comments whenastro add
updateastro.config.mjs
-
#6426
e0844852d
Thanks @MoustaphaDev! - Prevent?inline
and?raw
css query suffixes from injecting style tags in development -
Updated dependencies [
0abd1d3e4
]:
v2.0.0
Note This is a detailed changelog of all changes in Astro v2.
See our upgrade guide for an overview of steps needed to upgrade an existing project.
Major Changes
-
#5687
e2019be6f
Thanks @bholmesdev! - Give remark and rehype plugins access to user frontmatter via frontmatter injection. This meansdata.astro.frontmatter
is now the complete Markdown or MDX document's frontmatter, rather than an empty object.This allows plugin authors to modify existing frontmatter, or compute new properties based on other properties. For example, say you want to compute a full image URL based on an
imageSrc
slug in your document frontmatter:export function remarkInjectSocialImagePlugin() { return function (tree, file) { const { frontmatter } = file.data.astro; frontmatter.socialImageSrc = new URL(frontmatter.imageSrc, 'https://my-blog.com/').pathname; }; }
When using Content Collections, you can access this modified frontmatter using the
remarkPluginFrontmatter
property returned when rendering an entry.Migration instructions
Plugin authors should now check for user frontmatter when applying defaults.
For example, say a remark plugin wants to apply a default
title
if none is present. Add a conditional to check if the property is present, and update if none exists:export function remarkInjectTitlePlugin() { return function (tree, file) { const { frontmatter } = file.data.astro; + if (!frontmatter.title) { frontmatter.title = 'Default title'; + } } }
This differs from previous behavior, where a Markdown file's frontmatter would always override frontmatter injected via remark or reype.
-
#5891
05caf445d
Thanks @bholmesdev! - Remove deprecated Markdown APIs from Astro v0.X. This includesgetHeaders()
, the.astro
property for layouts, and therawContent()
andcompiledContent()
error messages for MDX. -
#5778
49ab4f231
Thanks @bluwy! - Remove proload to load the Astro config. It will now use NodeJS and Vite to load the config only. -
#5728
8fb28648f
Thanks @natemoo-re! - The previously experimental features--experimental-error-overlay
and--experimental-prerender
, both added in v1.7.0, are now the default.You'll notice that the error overlay during
astro dev
has a refreshed visual design and provides more context for your errors.The
prerender
feature is now enabled by default when usingoutput: 'server'
. To prerender a particular page, addexport const prerender = true
to your frontmatter.Warning Integration authors that previously relied on the exact structure of Astro's v1.0 build output may notice some changes to our output file structure. Please test your integrations to ensure compatability. Users that have configured a custom
vite.build.rollupOptions.output.chunkFileNames
should ensure that their Astro project is configured as an ESM Node project. Either include"type": "module"
in your rootpackage.json
file or use the.mjs
extension forchunkFileNames
. -
#5782
1f92d64ea
Thanks @Princesseuh! - Remove support for Node 14. Minimum supported Node version is now >=16.12.0 -
#5771
259a539d7
Thanks @matthewp! - Removes support for astroFlavoredMarkdownIn 1.0 Astro moved the old Astro Flavored Markdown (also sometimes called Components in Markdown) to a legacy feature. This change removes the
legacy.astroFlavoredMarkdown
option completely.In 2.0 this feature will not be available in Astro at all. We recommend migration to MDX for those were still using this feature in 1.x.
-
#5941
304823811
Thanks @bholmesdev! - Content collections: Introduce a newslug
frontmatter field for overriding the generated slug. This replaces the previousslug()
collection config option from Astro 1.X and the 2.0 beta.When present in a Markdown or MDX file, this will override the generated slug for that entry.
v1.9.2
Patch Changes
v1.9.1
Patch Changes
-
adad7e966
Thanks @matthewp! - Fix for hoisted scripts in project with spaces in the file path
v1.9.0
Minor Changes
-
#5666
bf210f784
Thanks @bholmesdev! - Correctly handle spaces and capitalization insrc/content/
file names. This introduces github-slugger for slug generation to ensure slugs are usable bygetStaticPaths
. Changes:- Resolve spaces and capitalization:
collection/Entry With Spaces.md
becomescollection/entry-with-spaces
. - Truncate
/index
paths to base URL:collection/index.md
becomescollection
- Resolve spaces and capitalization:
Patch Changes
-
#5720
fe316be86
Thanks @umarov! - Do not add base path to a hoisted script body -
#5706
c2844a79c
Thanks @bluwy! - Add preact and sitemap integration to config load external list -
#5700
3aa3e00a6
Thanks @bholmesdev! - Fiximport.meta.env.DEV
always being set totrue
when using Content Collections
v1.8.0
Minor Changes
-
#5647
d72da5290
Thanks @bholmesdev! - Addastro sync
CLI command for type generation
Patch Changes
-
#5668
9674cf56c
Thanks @bholmesdev! - Remove strayconsole.log
from content collections error message -
#5652
0b5098758
Thanks @bluwy! - Use acorn to postprocess Astro globs -
#5648
853081d1c
Thanks @bholmesdev! - Prevent relative image paths insrc/content/
-
#5678
f8f576829
Thanks @bluwy! - Fix code generation quotes handling -
#5635
376f67011
Thanks @SegaraRai! - Addserver.headers
typing
v1.7.2
Patch Changes
-
#5641
62580ed07
Thanks @chenxsan! - Fix "Maximum call stack size exceeded" error in vite-plugin-head-propagation -
#5644
d5aff85db
Thanks @natemoo-re! - Fix static build regression where chunks would not be generated -
#5639
1ac1ed86e
Thanks @bluwy! - Fixclient:only
imports with"importsNotUsedAsValues": "error"
tsconfig
v1.7.1
Patch Changes
-
#5617
33dcaa05b
Thanks @bholmesdev! - Fix error message when using Content Collections and an out-of-date@astrojs/mdx
integration
v1.7.0
Minor Changes
-
#5297
d2960984c
Thanks @natemoo-re! - Introduces the experimental Prerender API.Note This API is not yet stable and is subject to possible breaking changes!
- Deploy an Astro server without sacrificing the speed or cacheability of static HTML.
- The Prerender API allows you to statically prerender specific
pages/
at build time.
Usage
- First, run
astro build --experimental-prerender
or enableexperimental: { prerender: true }
in yourastro.config.mjs
file. - Then, include
export const prerender = true
in any file in thepages/
directory that you wish to prerender.
-
#5495
31ec84797
Thanks @Princesseuh! - Add a new error overlay designed by @doodlemarks! This new overlay should be much more informative, clearer, astro-y, and prettier than the previous one. -
#5291
5ec0f6ed5
Thanks @bholmesdev! - Introduce Content Collections experimental API- Organize your Markdown and MDX content into easy-to-manage collections.
- Add type safety to your frontmatter with schemas.
- Generate landing pages, static routes, and SSR endpoints from your content using the collection query APIs.
-
#5564
dced4a8a2
Thanks @riywo! - Addserver.headers
option -
#5341
6b156dd3b
Thanks @alexpdraper! - Allow setting domain when deleting cookies
Patch Changes
-
#5615
d85ec7484
Thanks @natemoo-re! - Sanitize dynamically rendered tags to strip out any attributes
v1.6.15
Patch Changes
-
#5572
b2f0210c4
Thanks @matthewp! - Include base in 'page' stage injected scripts -
#5554
02bb0a1cc
Thanks @natemoo-re! - Update@astrojs/compiler
to latest -
#5577
2bd23e454
Thanks @jerzakm! - Updated magic-string to 0.27.0
v1.6.14
Patch Changes
-
#5545
9082a850e
Thanks @bluwy! - Exclude astro from Vite optimization -
#5446
4f7f20616
Thanks @jyasskin! - Fix redirect() typing to allow all redirection status codes. -
#5511
05915fec0
Thanks @matthewp! - Low-level head propagationThis adds low-level head propagation ability within the Astro runtime. This is not really usable within an Astro app at the moment, but provides the APIs necessary for
renderEntry
to do head propagation. -
#5553
1aeabe417
Thanks @matthewp! - Fix Astro.params not having values when using base in SSR -
#5549
795f00f73
Thanks @matthewp! - Use accumulated sort order when order production CSS -
#5539
2c836b9d1
Thanks @wulinsheng123! - Error reporting fails on undefined error index -
#5548
8f3f67c96
Thanks @ido-pluto! - Removed premature optimization
v1.6.13
Patch Changes
-
#5506
f536a34e5
Thanks @bluwy! - Dedupe Astro package when resolving -
#5506
f536a34e5
Thanks @bluwy! - Refactor Astro compile flow -
#5533
58188e053
Thanks @bluwy! - Refactor and remove esbuild dependency -
#5501
3c44033e4
Thanks @Princesseuh! - Added a warning in build when trying to hydrate an Astro component
v1.6.12
Patch Changes
-
#5484
731e99df8
Thanks @Pimm! - Narrow type ofParams
, as its values cannot be numbers -
#5480
c13775279
Thanks @sapphi-red! - Fix astro preview not working on Windows -
#5497
ca01a71eb
Thanks @bluwy! - Refactor internal plugins code -
#5460
57888e069
Thanks @bluwy! - Fix linked Astro library style HMR -
#5477
5e693c214
Thanks @bluwy! - Prevent inlining SCSS partials in dev -
#5498
1a3923da7
Thanks @bluwy! - Optimize JSX import source detection
v1.6.11
Patch Changes
-
#5433
936c1e411
Thanks @wtchnm! - Add missingfetchpriority
attribute to img, link, script and iframe elements -
#5437
4b188132e
Thanks @bluwy! - Correctly transform third-party JSX files -
#5434
f5ed630bc
Thanks @matthewp! - Use Vite's resolve to resolve paths for client:only
v1.6.10
Patch Changes
-
#5431
1ab505855
Thanks @matthewp! - Fix regression with loading .ts in .mjs config -
#5426
ff35b4759
Thanks @bluwy! - Fix JSX tagging for anonymous higher-order components default export -
#5430
b22ba1c03
Thanks @bluwy! - Fix preview --host in Node.js 18 -
#5417
a9f7ff966
Thanks @matthewp! - Prevent dev from crashing when there are errors in template
v1.6.9
Patch Changes
-
#5409
9f80a4046
Thanks @matthewp! - Fix Code component usage in Vercel -
#5410
3c5cb6948
Thanks @impcyber! - Fix: https://github.com/withastro/astro/issues/5400 -
#5412
a278c7ae6
Thanks @matthewp! - Restart dev server on package.json changes -
#5377
40226dd14
Thanks @matthewp! - Uses vite to load astro.config.ts files
v1.6.8
Patch Changes
-
#5375
f9104354b
Thanks @Princesseuh! - Fix regression causing nested arrays ingetStaticPaths
's return value to throw an error -
#5346
f3181b5ad
Thanks @bluwy! - Fix .html.astro file routing in dev -
#5358
9eee0f016
Thanks @matthewp! - Properly support trailingSlash: never with a base -
#5345
3ae2a961b
Thanks @bluwy! - Respect Vite user config for third-party packages config handling -
#5371
bee8c14af
Thanks @matthewp! - Prefer thebase
config rather than site config for creating URLs for links and scripts. -
#5369
e385076ef
Thanks @natemoo-re! - Upgrade@astrojs/compiler
, fixes regression withbody
handling whenhead
contains a Component node
v1.6.7
Patch Changes
-
#5353
b3d936ac2
Thanks @matthewp! - Updated the CSS naming algorithm to prevent clashes -
#5294
ae41f25e1
Thanks @mrienstra! - Consistent Markdown frontmatter typing (MarkdownAstroData["frontmatter"]
in particular wasobject
before)
v1.6.6
Patch Changes
-
#5316
a780f2595
Thanks @Princesseuh! - Improved error messages descriptions and hints to be more informative -
#5331
688f8e4bc
Thanks @matthewp! - Allow dynamic segments in injected routes -
#5330
7e19e8b30
Thanks @matthewp! - Prevent jsx throws from hanging server -
#5328
bcd0f8f8c
Thanks @matthewp! - 404 when not using subpath for items in public in devPreviously if using a base like
base: '/subpath/
you could load things from the root, which would break in prod. Now you must include the subpath. -
#5339
03a8f89d5
Thanks @natemoo-re! - Upgrade@astrojs/compiler
to latest -
#5327
0dcdc6fb1
Thanks @Princesseuh! - Update Astro language-server to 0.28.3
v1.6.5
Patch Changes
-
#5326
88c1bbe3a
Thanks @matthewp! - Fix omitted island hydration scripts in slots -
#5301
a79a37cad
Thanks @bluwy! - Improve environment variable handling performance
v1.6.4
Patch Changes
-
#5290
b2b291d29
Thanks @matthewp! - Handle base configuration in adaptersThis allows adapters to correctly handle
base
configuration. Internally Astro now matches routes when the URL includes thebase
.Adapters now also have access to the
removeBase
method which will remove thebase
from a pathname. This is useful to look up files for static assets. -
#5292
97e2b6ad7
Thanks @MontelAle! - Changes slow astro cli imports to dynamic -
#5293
4af4d8fa0
Thanks @matthewp! - Prevent overcaching .astro HMR changes -
#5314
f6add3924
Thanks @matthewp! - Fixes regression with config file restarts -
#5298
247eb7411
Thanks @wulinsheng123! - have not founded style when srcDir was root
v1.6.3
Patch Changes
-
#5273
c7b9b14a1
Thanks @matthewp! - Surface astro.config errors to the user -
#5264
0d27c4a2b
Thanks @VladCuciureanu! - Fixed memleak caused by project dir names containing '.md' or '.mdx' -
#5258
74759cf78
Thanks @bluwy! - Allow 200 response for endpoints in build -
#5284
126cd8e83
Thanks @herteleo! - Include missingclass:list
withinHTMLAttributes
type -
#5236
1cc067052
Thanks @bluwy! - Refactor CSS preprocessing handling -
#5198
c77a6cbe3
Thanks @matthewp! - HMR - Improved error recoveryThis improves error recovery for HMR. Now when the dev server finds itself in an error state (because a route contained an error), it will recover from that state and refresh the page when the user has corrected the mistake.
v1.6.2
Patch Changes
-
#5243
7d678c9ed
Thanks @matthewp! - Upgrade@astrojs/compiler
to 0.29.x -
Updated dependencies [
b6a478f37
]:
v1.6.1
Patch Changes
-
#5572
b2f0210c4
Thanks @matthewp! - Include base in 'page' stage injected scripts -
#5554
02bb0a1cc
Thanks @natemoo-re! - Update@astrojs/compiler
to latest -
#5577
2bd23e454
Thanks @jerzakm! - Updated magic-string to 0.27.0
v1.6.0
Minor Changes
-
#5147
0bf0758fb
Thanks @natemoo-re! - Addastro/types
entrypoint. These utilities can be used for common prop type patterns.
v1.5.3
Patch Changes
-
#5133
1c477dd8d
Thanks @bluwy! - Update@astrojs/compiler
and use the newresolvePath
option. This allows removing much of the runtime code, which should improve rendering performance for Astro and MDX pages. -
#5192
8728ee0b9
Thanks @tony-sull! -astro add
no longer automatically installs optional peer dependencies
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot. The local configuration can be found in the local Renovate Bot repository.