type-plus icon indicating copy to clipboard operation
type-plus copied to clipboard

fix(deps): update dependency astro to v4

Open renovate[bot] opened this issue 7 months ago • 1 comments

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
astro (source) ^2.5.6 -> ^4.0.0 age adoption passing confidence

Release Notes

withastro/astro (astro)

v4.0.3

Compare Source

Patch Changes

v4.0.2

Compare Source

Patch Changes

v4.0.1

Compare Source

Patch Changes

v4.0.0

Compare Source

Major Changes
  • #​9138 abf601233 Thanks @​bluwy! - Updates the unified, remark, and rehype dependencies to latest. Make sure to update your custom remark and rehype plugins as well to be compatible with the latest versions.

    Potentially breaking change: The default value of markdown.remarkRehype.footnoteBackLabel is changed from "Back to content" to "Back to reference 1". See the mdast-util-to-hast commit for more information.

  • #​9181 cdabf6ef0 Thanks @​bluwy! - Removes support for returning simple objects from endpoints (deprecated since Astro 3.0). You should return a Response instead.

    ResponseWithEncoding is also removed. You can refactor the code to return a response with an array buffer instead, which is encoding agnostic.

    The types for middlewares have also been revised. To type a middleware function, you should now use MiddlewareHandler instead of MiddlewareResponseHandler. If you used defineMiddleware() to type the function, no changes are needed.

  • #​9263 3cbd8ea75 Thanks @​bluwy! - Removes additional deprecated APIs:

    • The Astro preview server now returns a 404 status instead of a 301 redirect when requesting assets from the public directory without a base.
    • Removes special handling when referencing the astro/client-image type. You should use the astro/client type instead.
    • Removes deprecated built-in rss support in getStaticPaths. You should use @astrojs/rss instead.
    • Removes deprecated Astro.request.params support. You should use Astro.params instead.
  • #​9271 47604bd5b Thanks @​matthewp! - Renames Dev Overlay to Dev Toolbar

    The previously named experimental Dev Overlay is now known as the Astro Dev Toolbar. Overlay plugins have been renamed as Toolbar Apps. All APIs have been updated to reflect this name change.

    To not break existing APIs, aliases for the Toolbar-based names have been created. The previous API names will continue to function but will be deprecated in the future. All documentation has been updated to reflect Toolbar-based names.

  • #​9122 1c48ed286 Thanks @​bluwy! - Adds Vite 5 support. There are no breaking changes from Astro. Check the Vite migration guide for details of the breaking changes from Vite instead.

  • #​9225 c421a3d17 Thanks @​natemoo-re! - Removes the opt-in handleForms property for <ViewTransitions />. Form submissions are now handled by default and this property is no longer necessary. This default behavior can be disabled by setting data-astro-reload on relevant <form /> elements.

  • #​9196 37697a2c5 Thanks @​bluwy! - Removes support for Shiki custom language's path property. The language JSON file should be imported and passed to the option instead.

    // astro.config.js
    + import customLang from './custom.tmLanguage.json'
    
    export default defineConfig({
      markdown: {
        shikiConfig: {
          langs: [
    -       { path: './custom.tmLanguage.json' },
    +       customLang,
          ],
        },
      },
    })
    
  • #​9199 49aa215a0 Thanks @​lilnasy! - This change only affects maintainers of third-party adapters. In the Integration API, the app.render() method of the App class has been simplified.

    Instead of two optional arguments, it now takes a single optional argument that is an object with two optional properties: routeData and locals.

     app.render(request)
    
    - app.render(request, routeData)
    + app.render(request, { routeData })
    
    - app.render(request, routeData, locals)
    + app.render(request, { routeData, locals })
    
    - app.render(request, undefined, locals)
    + app.render(request, { locals })
    

    The current signature is deprecated but will continue to function until next major version.

  • #​9212 c0383ea0c Thanks @​alexanderniebuhr! - Removes deprecated app.match() option, matchNotFound

  • #​9168 153a5abb9 Thanks @​bluwy! - Removes deprecated features from Astro 3.0

    • Adapters are now required to pass supportedAstroFeatures to specify a list of features they support.
    • The build.split and build.excludeMiddleware options are removed. Use functionPerRoute and edgeMiddleware from adapters instead.
    • The markdown.drafts option and draft feature is removed. Use content collections instead.
    • Lowercase endpoint names are no longer supported. Use uppercase endpoint names instead.
    • getHeaders() exported from markdown files is removed. Use getHeadings() instead.
Minor Changes
  • #​9105 6201bbe96 Thanks @​FredKSchott! - Update CLI logging experience

  • #​9200 b4b851f5a Thanks @​ematipico! - Adds a new way to configure the i18n.locales array.

    Developers can now assign a custom URL path prefix that can span multiple language codes:

    // astro.config.mjs
    export default defineConfig({
      experimental: {
        i18n: {
          defaultLocale: 'english',
          locales: ['de', { path: 'english', codes: ['en', 'en-US'] }, 'fr'],
        },
      },
    });
    

    With the above configuration, the URL prefix of the default locale will be /english/. When computing Astro.preferredLocale, Astro will use the codes.

  • #​9115 3b77889b4 Thanks @​natemoo-re! - Adds the astro preferences command to manage user preferences. User preferences are specific to individual Astro users, unlike the astro.config.mjs file which changes behavior for everyone working on a project.

    User preferences are scoped to the current project by default, stored in a local .astro/settings.json file. Using the --global flag, user preferences can also be applied to every Astro project on the current machine. Global user preferences are stored in an operating system-specific location.

v3.6.4

Compare Source

Patch Changes
  • #​9226 8f8a40e93 Thanks @​outofambit! - Fix i18n fallback routing with routing strategy of always-prefix

  • #​9179 3f28336d9 Thanks @​lilnasy! - Fixes an issue where the presence of a slot in a page led to an error.

  • #​9219 067a65f5b Thanks @​natemoo-re! - Fix edge case where <style> updates inside of .astro files would ocassionally fail to update without reloading the page.

  • #​9236 27d3e86e4 Thanks @​ematipico! - The configuration i18n.routingStrategy has been replaced with an object called routing.

    export default defineConfig({
      experimental: {
          i18n: {
    -          routingStrategy: "prefix-always",
    +          routing: {
    +              prefixDefaultLocale: true,
    +          }
          }
      }
    })
    
    export default defineConfig({
      experimental: {
          i18n: {
    -          routingStrategy: "prefix-other-locales",
    +          routing: {
    +              prefixDefaultLocale: false,
    +          }
          }
      }
    })
    

v3.6.3

Compare Source

Patch Changes

v3.6.2

Compare Source

Patch Changes

v3.6.1

Compare Source

Patch Changes

v3.6.0

Compare Source

Minor Changes
  • #​9090 c87223c21 Thanks @​martrapp! - Take full control over the behavior of view transitions!

    Three new events now complement the existing astro:after-swap and astro:page-load events:

    'astro:before-preparation'; // Control how the DOM and other resources of the target page are loaded
    'astro:after-preparation'; // Last changes before taking off? Remove that loading indicator? Here you go!
    'astro:before-swap'; // Control how the DOM is updated to match the new page
    

    The astro:before-* events allow you to change properties and strategies of the view transition implementation. The astro:after-* events are notifications that a phase is complete. Head over to docs to see the full view transitions lifecycle including these new events!

  • #​9092 0ea4bd47e Thanks @​smitbarmase! - Changes the fallback prefetch behavior on slow connections and when data saver mode is enabled. Instead of disabling prefetch entirely, the tap strategy will be used.

  • #​9166 cba6cf32d Thanks @​matthewp! - The Picture component is no longer experimental

    The <Picture /> component, part of astro:assets, has exited experimental status and is now recommended for use. There are no code changes to the component, and no upgrade to your project is necessary.

    This is only a change in documentation/recommendation. If you were waiting to use the <Picture /> component until it had exited the experimental stage, wait no more!

  • #​9092 0ea4bd47e Thanks @​smitbarmase! - Adds a ignoreSlowConnection option to the prefetch() API to prefetch even on data saver mode or slow connection.

v3.5.7

Compare Source

Patch Changes

v3.5.6

Compare Source

Patch Changes

v3.5.5

Compare Source

Patch Changes
  • #​9091 536c6c9fd Thanks @​ematipico! - The routingStrategy prefix-always should not force its logic to endpoints. This fixes some regression with astro:assets and @astrojs/rss.

  • #​9102 60e8210b0 Thanks @​Princesseuh! - In the dev overlay, when there's too many plugins enabled at once, some of the plugins will now be hidden in a separate sub menu to avoid the bar becoming too long

v3.5.4

Compare Source

Patch Changes

v3.5.3

Compare Source

Patch Changes

v3.5.2

Compare Source

Patch Changes

v3.5.1

Compare Source

Patch Changes

v3.5.0

Compare Source

Minor Changes
  • #​8869 f5bdfa272 Thanks @​matthewp! - ## Integration Hooks to add Middleware

    It's now possible in Astro for an integration to add middleware on behalf of the user. Previously when a third party wanted to provide middleware, the user would need to create a src/middleware.ts file themselves. Now, adding third-party middleware is as easy as adding a new integration.

    For integration authors, there is a new addMiddleware function in the astro:config:setup hook. This function allows you to specify a middleware module and the order in which it should be applied:

    // my-package/middleware.js
    import { defineMiddleware } from 'astro:middleware';
    
    export const onRequest = defineMiddleware(async (context, next) => {
      const response = await next();
    
      if (response.headers.get('content-type') === 'text/html') {
        let html = await response.text();
        html = minify(html);
        return new Response(html, {
          status: response.status,
          headers: response.headers,
        });
      }
    
      return response;
    });
    

    You can now add your integration's middleware and specify that it runs either before or after the application's own defined middleware (defined in src/middleware.{js,ts})

    // my-package/integration.js
    export function myIntegration() {
      return {
        name: 'my-integration',
        hooks: {
          'astro:config:setup': ({ addMiddleware }) => {
            addMiddleware({
              entrypoint: 'my-package/middleware',
              order: 'pre',
            });
          },
        },
      };
    }
    
  • #​8854 3e1239e42 Thanks @​natemoo-re! - Provides a new, experimental build cache for Content Collections as part of the Incremental Build RFC. This includes multiple refactors to Astro's build process to optimize how Content Collections are handled, which should provide significant performance improvements for users with many collections.

    Users building a static site can opt-in to preview the new build cache by adding the following flag to your Astro config:

    // astro.config.mjs
    export default {
      experimental: {
        contentCollectionCache: true,
      },
    };
    

    When this experimental feature is enabled, the files generated from your content collections will be stored in the cacheDir (by default, node_modules/.astro) and reused between builds. Most CI environments automatically restore files in node_modules/ by default.

    In our internal testing on the real world Astro Docs project, this feature reduces the bundling step of astro build from 133.20s to 10.46s, about 92% faster. The end-to-end astro build process used to take 4min 58s and now takes just over 1min for a total reduction of 80%.

    If you run into any issues with this experimental feature, please let us know!

    You can always bypass the cache for a single build by passing the --force flag to astro build.

    astro build --force
    
  • #​8963 fda3a0213 Thanks @​matthewp! - Form support in View Transitions router

    The <ViewTransitions /> router can now handle form submissions, allowing the same animated transitions and stateful UI retention on form posts that are already available on <a> links. With this addition, your Astro project can have animations in all of these scenarios:

    • Clicking links between pages.
    • Making stateful changes in forms (e.g. updating site preferences).
    • Manually triggering navigation via the navigate() API.

    This feature is opt-in for semver reasons and can be enabled by adding the handleForms prop to the `<ViewTransitions /> component:

v3.4.4

Compare Source

Patch Changes

v3.4.3

Compare Source

Patch Changes

v3.4.2

Compare Source

Patch Changes

v3.4.1

Compare Source

Patch Changes

v3.4.0

Compare Source

Minor Changes
  • #​8755 fe4079f05 Thanks @​matthewp! - Page Partials

    A page component can now be identified as a partial page, which will render its HTML content without including a <! DOCTYPE html> declaration nor any <head> content.

    A rendering library, like htmx or Stimulus or even just jQuery can access partial content on the client to dynamically update only parts of a page.

    Pages marked as partials do not have a doctype or any head content included in the rendered result. You can mark any page as a partial by setting this option:

v3.3.4

Compare Source

Patch Changes

v3.3.3

Compare Source

Patch Changes

v3.3.2

Compare Source

Patch Changes

v3.3.1

Compare Source

Patch Changes

v3.3.0

Compare Source

Minor Changes
  • #​8808 2993055be Thanks @​delucis! - Adds support for an --outDir CLI flag to astro build

  • #​8502 c4270e476 Thanks @​bluwy! - Updates the internal shiki syntax highlighter to shikiji, an ESM-focused alternative that simplifies bundling and maintenance.

    There are no new options and no changes to how you author code blocks and syntax highlighting.

    Potentially breaking change: While this refactor should be transparent for most projects, the transition to shikiji now produces a smaller HTML markup by attaching a fallback color style to the pre or code element, instead of to the line span directly. For example:

    Before:

    <code class="astro-code" style="background-color: #&#8203;24292e">
      <pre>
        <span class="line" style="color: #e1e4e8">my code</span>
      </pre>
    </code>
    

    After:

    <code class="astro-code" style="background-color: #&#8203;24292e; color: #e1e4e8">
      <pre>
        <span class="line">my code<span>
      </pre>
    </code>
    

    This does not affect the colors as the span will inherit the color from the parent, but if you're relying on a specific HTML markup, please check your site carefully after upgrading to verify the styles.

  • #​8798 f369fa250 Thanks @​Princesseuh! - Fixed tsconfig.json's new array format for extends not working. This was done by migrating Astro to use tsconfck instead of tsconfig-resolver to find and parse tsconfig.json files.

  • #​8620 b2ae9ee0c Thanks @​Princesseuh! - Adds experimental support for generating srcset attributes and a new <Picture /> component.

v3.2.4

Compare Source

Patch Changes

v3.2.3

Compare Source

Patch Changes

v3.2.2

Compare Source

Patch Changes

v3.2.1

Compare Source

Patch Changes

v3.2.0

Compare Source

Minor Changes
  • #​8696 2167ffd72 Thanks @​matthewp! - Support adding integrations dynamically

    Astro integrations can now themselves dynamically add and configure additional integrations during set-up. This makes it possible for integration authors to bundle integrations more intelligently for their users.

    In the following example, a custom integration checks whether @astrojs/sitemap is already configured. If not, the integration adds Astro’s sitemap integration, passing any desired configuration options:

    import sitemap from '@&#8203;astrojs/sitemap';
    import type { AstroIntegration } from 'astro';
    
    const MyIntegration = (): AstroIntegration => {
      return {
        name: 'my-integration',
    
        'astro:config:setup': ({ config, updateConfig }) => {
          // Look for sitemap in user-configured integrations.
          const userSitemap = config.integrations.find(
            ({ name }) => name === '@&#8203;astrojs/sitemap'
          );
    
          if (!userSitemap) {
            // If sitemap wasn’t found, add it.
            updateConfig({
              integrations: [sitemap({ /* opts */ }],
            });
          }
        },
      };
    };
    
  • #​8696 2167ffd72 Thanks @​matthewp! - View transitions can now be triggered from JavaScript!

    Import the client-side router from "astro:transitions/client" and enjoy your new remote control for navigation:

    import { navigate } from 'astro:transitions/client';
    
    // Navigate to the selected option automatically.
    document.querySelector('select').onchange = (ev) => {
      let href = ev.target.value;
      navigate(href);
    };
    
  • #​8696 2167ffd72 Thanks @​matthewp! - Route Announcer in <ViewTransitions />

    The View Transitions router now does route announcement. When transitioning between pages with a traditional MPA approach, assistive technologies will announce the page title when the page finishes loading. This does not automatically happen during client-side routing, so visitors relying on these technologies to announce routes are not aware when a page has changed.

    The view transitions route announcer runs after the astro:page-load event, looking for the page <title> to announce. If one cannot be found, the announcer falls back to the first <h1> it finds, or otherwise announces the pathname. We recommend you always include a <title> in each page for accessibility.

    See the View Transitions docs for more on how accessibility is handled.

Patch Changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

renovate[bot] avatar Dec 05 '23 15:12 renovate[bot]