Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

astro@3.0.0

Compare
Choose a tag to compare
Loading
@astrobot-houstonastrobot-houston released this 30 Aug 11:40
· 5638 commits to main since this release
5598feb
This commit was created on GitHub.com and signed with GitHub’sverified signature. The key has expired.
GPG key ID:4AEE18F83AFDEB23
Expired
Verified
Learn about vigilant mode.

Major Changes

  • #8188d0679a666 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.

  • #8188364d861bd Thanks@ematipico! - Removed automatic flattening ofgetStaticPaths result..flatMap and.flat should now be used to ensure that you're returning a flat array.

  • #81132484dc408 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 ownimport aliases.

    ---// src/pages/posts/post-1.astro- import rocket from '~/assets/rocket.png'+ import rocket from '../../assets/rocket.png';---
  • #814281545197a 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 does
      • class:list used to sort individual values, but it no longer does
      • class:list used to supportSet and other iterables, but it no longer does
  • #81796011d52d3 Thanks@matthewp! - Astro 3.0 Release Candidate

  • #818880f1494cd Thanks@ematipico! - Thebuild.split andbuild.excludeMiddleware configuration options are deprecated and have been replaced by options in the adapter config.

    If your config includes thebuild.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 thebuild.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     }),});
  • #8207e45f30293 Thanks@natemoo-re! - Change theView Transition built-in animation options.

    Thetransition:animate valuemorph has been renamed toinitial. Also, this is no longer the default animation.

    If notransition:animate directive is specified, your animations will now default tofade.

    Astro also supports a newtransition:animate value,none. This value can be used on a page's<html> element to disable animated full-page transitions on an entire page.

  • #8188c0de7a7b0 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/configexportdefaultdefineConfig({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.

  • #81883c3100851 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 likehttps://github.com/natemoo-re/astro-remote instead.

  • #801934cb20021 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--><divstyle={{'--myValue':myValue }}></div><!-- output (before)--><divstyle="--my-value:var(--myValue);--myValue:red"></div><!-- output (after)--><divstyle="--myValue:red"></div>
    <style>  div {-   color: var(--my-value);+   color: var(--myValue);  }</style>
  • #8170be6bbd2c8 Thanks@bluwy! - Remove deprecated config option types, deprecated script/style attributes, and deprecatedimage export fromastro:content

  • #81887511a4980 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

  • #7979dbc97b121 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,typeAstroInlineConfig}from'astro';// Inline Astro config object.// Provide a path to a configuration file to load or set options directly inline.constinlineConfig:AstroInlineConfig={// Inline-specific options...configFile:'./astro.config.mjs',logLevel:'info',// Standard Astro config options...site:'https://example.com',};// Start the Astro dev serverconstdevServer=awaitdev(inlineConfig);awaitdevServer.stop();// Build your Astro projectawaitbuild(inlineConfig);// Preview your built projectconstpreviewServer=awaitpreview(inlineConfig);awaitpreviewServer.stop();// Generate types for your Astro projectawaitsync(inlineConfig);
  • #81887d2f311d4 Thanks@ematipico! - Removed support for old syntax of the API routes.

  • #808568efd4a8b 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',  // ...});
  • #78937bd1b86f8 Thanks@ematipico! - Implements a new scope style strategy called"attribute". When enabled, styles are applied usingdata-* attributes.

    Thedefault value ofscopedStyleStrategy 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',});
  • #7924519a1c4e8 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 withinclude 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.

    exportdefaultdefineConfig({// 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/*'],}),],});
  • #80305208a3c8f Thanks@natemoo-re! - Removed duplicateastro/dist/jsx export. Please use theastro/jsx export instead

  • #818884af8ed9d Thanks@ematipico! - Remove MDX plugin re-ordering hack

  • #8180f003e7364 Thanks@ematipico! - The scoped hash created by the Astro compiler is nowlowercase.

  • #78780f637c71e 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 yourbase already has a trailing slash, no change is needed.

    If yourbase does not have a trailing slash, add one to preserve the previous behaviour:

    // astro.config.mjs- base: 'my-base',+ base: 'my-base/',
  • #81188a5b0c1f3 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 thebuild.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 <style> tags. The new default is "auto", which selects assets smaller than 4kB and includes them in the initial response.

    To go back to the previous default behavior, changebuild.inlineStylesheets to "never".

    import{defineConfig}from'astro/config';exportdefaultdefineConfig({build:{inlineStylesheets:'never',},});
  • #8188148e61d24 Thanks@ematipico! - Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm.

  • #8169e79e3779d Thanks@bluwy! - Remove pre-shiki v0.14 theme names for compatibility. Please rename to the new theme names to migrate:

    • material-darker ->material-theme-darker
    • material-default ->material-theme
    • material-lighter ->material-theme-lighter
    • material-ocean ->material-theme-ocean
    • material-palenight ->material-theme-palenight
  • #818896beb883a Thanks@ematipico! - Updatetsconfig.json presets withmoduleResolution: 'bundler' and other new options from TypeScript 5.0. Astro now assumes that you use TypeScript 5.0 (March 2023), or that your editor includes it, ex: VS Code 1.77

  • #8188997a0db8a Thanks@ematipico! - Theastro check command now requires an external package@astrojs/check and an install oftypescript in your project. This was done in order to make the mainastro package smaller and give more flexibility to users in regard to the version of TypeScript they use.

  • #818880f1494cd Thanks@ematipico! - Thebuild.split andbuild.excludeMiddleware configuration options are deprecated and have been replaced by options in the adapter config.

    If your config includes thebuild.excludeMiddleware option, replace it withedgeMiddleware in your adapter options:

    import { defineConfig } from "astro/config";import vercel from "@astrojs/vercel/serverless";export default defineConfig({     build: {-        excludeMiddleware: true     },     adapter: vercel({+        edgeMiddleware: true     }),});

    If your config includes thebuild.split option, replace it withfunctionPerRoute in your adapter options:

    import { defineConfig } from "astro/config";import vercel from "@astrojs/vercel/serverless";export default defineConfig({     build: {-        split: true     },     adapter: vercel({+        functionPerRoute: true     }),});
  • #81880f0625504 Thanks@ematipico! - Lowercase names for endpoint functions are now deprecated.

    Rename functions to their uppercase equivalent:

    - export function get() {+ export function GET() {    return new Response(JSON.stringify({ "title": "Bob's blog" }));}- export function post() {+ export function POST() {    return new Response(JSON.stringify({ "title": "Bob's blog" }));}- export function put() {+ export function PUT() {    return new Response(JSON.stringify({ "title": "Bob's blog" }));}- export function all() {+ export function ALL() {    return new Response(JSON.stringify({ "title": "Bob's blog" }));}// you can use the whole word "DELETE"- export function del() {+ export function DELETE() {    return new Response(JSON.stringify({ "title": "Bob's blog" }));}
  • #8188e1ae56e72 Thanks@ematipico! - Astro.cookies.get(key) returns undefined if cookie doesn't exist

    With this change, Astro.cookies.get(key) no longer always returns aAstroCookie object. Instead it now returnsundefined if the cookie does not exist.

    You should update your code if you assume that all calls toget() return a value. When using withhas() you still need to assert the value, like so:

    ---if (Astro.cookies.has(id)) {const id=Astro.cookies.get(id)!;}---
  • #8188f32d093a2 Thanks@ematipico! - The propertycompressHTML is nowtrue by default. Setting this value totrue is no longer required.

    If you do not want to minify your HTML output, you must set this value tofalse inastro.config.mjs.

    import {defineConfig} from "astro/config";export default defineConfig({+  compressHTML: false})
  • #8188f01eb585e Thanks@ematipico! - Astro's default port when running the dev or preview server is now4321.

    This will reduce conflicts with ports used by other tools.

  • #7921b76c166bd Thanks@Princesseuh! -astro:assets is now enabled by default. If you were previously using theexperimental.assets flag, please remove it from your config. Also note that the previous@astrojs/image integration is incompatible, and must be removed.

    This also brings two important changes to using images in Astro:

    • New ESM shape: importing an image will now return an object with different properties describing the image such as its path, format and dimensions. This is a breaking change and may require you to update your existing images.
    • In Markdown, MDX, and Markdoc, the![]() syntax will now resolve relative images located anywhere in your project in addition to remote images and images stored in thepublic/ folder. This notably unlocks storing images next to your content.

    Please see our existingAssets page in Docs for more information about usingastro:assets.

  • #818832669cd47 Thanks@ematipico! - Remove MDX specialcomponents export handling

Minor Changes

  • #8188cd2d7e769 Thanks@ematipico! - Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter
    can tell Astro if it can support it.

    import{AstroIntegration}from'./astro';functionmyIntegration():AstroIntegration{return{name:'astro-awesome-list',// new feature mapsupportedAstroFeatures:{hybridOutput:'experimental',staticOutput:'stable',serverOutput:'stable',assets:{supportKind:'stable',isSharpCompatible:false,isSquooshCompatible:false,},},};}
  • #821844f7a2872 Thanks@matthewp! - View Transitions unflagged

    View Transition support in Astro is now unflagged. For those who have used the experimental feature you can remove the flag in your Astro config:

    import { defineConfig } from 'astro'export default defineConfig({-  experimental: {-    viewTransitions: true,-  }})

    After removing this flag, please also consult the specificupgrade to v3.0 advice as some API features have changed and you may have breaking changes with your existing view transitions.

    See theView Transitions guide to learn how to use the API.

  • #8101ea7ff5177 Thanks@matthewp! -astro:namespace aliases for middleware and components

    This adds aliases ofastro:middleware andastro:components for the middleware and components modules. This is to make our documentation consistent between are various modules, where some are virtual modules and others are not. Going forward new built-in modules will use this namespace.

  • #8188036388f66 Thanks@ematipico! - Integrations can now log messages using Astro’s built-in logger.

    The logger is available to all hooks as an additional parameter:

    import{AstroIntegration}from'./astro';// integration.jsexportfunctionmyIntegration():AstroIntegration{return{name:'my-integration',hooks:{'astro:config:done':({ logger})=>{logger.info('Configure integration...');},},};}
  • #8181a8f35777e Thanks@matthewp! - Finalize View Transition event names

  • #8012866ed4098 Thanks@ematipico! - Add a newastro/errors module. Developers can importAstroUserError, and provide amessage and an optionalhint

Patch Changes

Assets2
Loading
torn4dom4n, liruifengv, J-env, jessaleks, and ajile-in reacted with thumbs up emojidavidbernegger, martincollado, yeskunall, mundry, jee-r, Theofilos-Chamalis, QingXia-Ela, LeanderG, mkan0141, NetLancer, and 15 more reacted with hooray emojifelixicaza, LeanderG, hazelnutcloud, liruifengv, 0xk1f0, azrdn, AnaelBonnafous, gwisk, felix-berlin, maddsua, and 3 more reacted with rocket emoji
31 people reacted

[8]ページ先頭

©2009-2025 Movatter.jp