astro 0.23.0
Minor Changes
-
#2489
618a16f5Thanks @natemoo-re! - Add support for theset:htmlandset:textdirectives.With the introduction of these directives, unescaped HTML content in expressions is now deprecated. Please migrate to
set:htmlin order to continue injecting unescaped HTML in future versions of Astro—you can use<Fragment set:html={content}>to avoid a wrapper element.set:textallows you to opt-in to escaping now, but it will soon become the default. -
#2494
d7149f9bThanks @FredKSchott! - Refactor dev server to use vite server internally.This should be an invisible change, and no breaking changes are expected from this change. However, it is a big enough refactor that some unexpected changes may occur. If you've experienced a regression in the dev server, it is most likely a bug!
-
#2586
d6d35bcaThanks @tony-sull! - Support for non-HTML pages⚠️ This feature is currently only supported with the
--experimental-static-buildCLI flag. This feature may be refined over the next few weeks/months as SSR support is finalized.This adds support for generating non-HTML pages form
.jsand.tspages during the build. Built file and extensions are based on the source file's name, ex:src/pages/data.json.tswill be built todist/data.json.Is this different from SSR? Yes! This feature allows JSON, XML, etc. files to be output at build time. Keep an eye out for full SSR support if you need to build similar files when requested, for example as a serverless function in your deployment host.
Examples
// src/pages/company.json.ts export async function get() { return { body: JSON.stringify({ name: 'Astro Technology Company', url: 'https://astro.build/', }), }; }What about
getStaticPaths()? It just works™.export async function getStaticPaths() { return [ { params: { slug: 'thing1' }}, { params: { slug: 'thing2' }} ] } export async function get(params) { const { slug } = params return { body: // ...JSON.stringify() } } -
#2424
1abb9ed0Thanks @natemoo-re! - Upgradeviteto2.8.x, unvendoringviteand bringing Astro's dependencies up-to-date.This is a low-level change that you shouldn't have to worry about too much, but it should fix many, many issues with CJS/ESM interoperability. It also allows Astro to stay up-to-date with the
viteecosystem. If you run into any unexpected problems, please let us know by opening an issue. -
#2471
c9bb1147Thanks @FredKSchott! - Standardize trailing subpath behavior in config.Most users are not aware of the subtle differences between
/fooand/foo/. Internally, we have to handle both which means that we are constantly worrying about the format of the URL, needing to add/remove trailing slashes when we go to work with this property, etc. This change transforms allsitevalues to use a trailing slash internally, which should help reduce bugs for both users and maintainers. -
#2548
ba5e2b5eThanks @matthewp! - Experimental SSR Support⚠️ If you are a user of Astro and see this PR and think that you can start deploying your app to a server and get SSR, slow down a second! This is only the initial flag and very basic support. Styles are not loading correctly at this point, for example. Like we did with the
--experimental-static-buildflag, this feature will be refined over the next few weeks/months and we'll let you know when its ready for community testing.Changes
-
This adds a new
--experimental-ssrflag toastro buildwhich will result indist/server/anddist/client/directories. -
SSR can be used through this API:
import { createServer } from 'http'; import { loadApp } from 'astro/app/node'; const app = await loadApp(new URL('./dist/server/', import.meta.url)); createServer((req, res) => { const route = app.match(req); if(route) { let html = await app.render(req, route); } }).listen(8080); -
This API will be refined over time.
-
This only works in Node.js at the moment.
-
Many features will likely not work correctly, but rendering HTML at least should.
-
Patch Changes
-
#2486
6bd165f8Thanks @matthewp! - Fix for the static build when project contains a space -
#2424
1abb9ed0Thanks @natemoo-re! - Fixes HMR of CSS that is imported from astro, when using the static build flag -
#2522
3e8844faThanks @matthewp! - Fix for CSS superset support and HMR in the static build -
#2506
187d5128Thanks @jonathantneal! - Fix an issue rendering content within HTMLElement -
#2606
96609d4cThanks @matthewp! - Fixes 404 to HMR script in the static build -
#2599
929fae68Thanks @natemoo-re! - Update@astrojs/compilertov0.11.0, which moves from TinyGo to Go's built-in WASM output. This will be a significant improvement for stability and memory safety. -
#2532
b210fd00Thanks @matthewp! - Fixes HMR of .astro modules in astro@next -
#2552
e81bc3cfThanks @matthewp! - Fixes build slowness on large appsThis fixes slowness on large apps, particularly during the static build. Fix is to prevent the Vite dev server plugin from being run during build, as it is not needed.
-
#2605
87762410Thanks @matthewp! - Fixes Astro style resolution in the static build -
#2569
82544e41Thanks @matthewp! - Fixes pageUrlFormat: 'file' in the static build -
#2588
10216176Thanks @matthewp! - Fix for passing children to client component when the component does not render them -
#2531
ef1d81efThanks @FredKSchott! - Fix issue where hostname was not passed to dev server -
#2537
b0666286Thanks @FredKSchott! - Improve debug logs -
#2511
3d2c1849Thanks @matthewp! - Bug fix fordefine:varswith the --experimental-static-build flag -
#2518
2bc91543Thanks @JuanM04! - Added the ability to use custom themes and langs with Shiki (<Code />and@astrojs/markdown-remark) -
#2612
39cbe500Thanks @natemoo-re! - Improve suppport forimport.meta.env.Prior to this change, all variables defined in
.envfiles had to include thePUBLIC_prefix, meaning that they could potentially be visible to the client if referenced.Now, Astro includes any referenced variables defined in
.envfiles onimport.meta.envduring server-side rendering, but only referencedPUBLIC_variables on the client. -
#2471
c9bb1147Thanks @FredKSchott! - Respect subpath URL paths in the fetchContent url property.This fixes an issue where fetchContent() URL property did not include the buildOptions.site path in it.
-
#2538
16d532feThanks @natemoo-re! - Fix rendering of HTML boolean attributes likeopenandasync.Fix rendering of HTML and SVG enumerated attributes like
contenteditableandspellcheck. -
#2570
34317bc0Thanks @matthewp! - Fixes bug with astro/components not loading in the next release -
#2581
ec6f148fThanks @matthewp! - Fix for resolving relative imports from hoisted scripts in the static build. -
#2593
40c0e2b3Thanks @tony-sull! - Dynamic route params should ignore param order when matching paths -
#2594
085468e9Thanks @natemoo-re! - Upgrade@astrojs/compilertov0.10.2 -
Updated dependencies [
a907a73b,cfeaa941,2bc91543,6fe1b027,2bc91543,d71c4620]:- @astrojs/renderer-preact@0.5.0
- @astrojs/renderer-react@0.5.0
- @astrojs/renderer-svelte@0.4.0
- @astrojs/renderer-vue@0.4.0
- @astrojs/markdown-remark@0.6.1