Update dependency astro to v3.5.0 #13

Merged
jahanson merged 1 commit from renovate/astro-3.x-lockfile into main 2023-11-09 14:09:31 -06:00
Collaborator

This PR contains the following updates:

Package Type Update Change
astro (source) dependencies minor 3.4.4 -> 3.5.0

Release Notes

withastro/astro (astro)

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 ` component:


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 Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro)) | dependencies | minor | [`3.4.4` -> `3.5.0`](https://renovatebot.com/diffs/npm/astro/3.4.4/3.5.0) | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v3.5.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#350) [Compare Source](https://github.com/withastro/astro/compare/astro@3.4.4...astro@3.5.0) ##### Minor Changes - [#&#8203;8869](https://github.com/withastro/astro/pull/8869) [`f5bdfa272`](https://github.com/withastro/astro/commit/f5bdfa272b4270b06bc539c2e382d6730987300c) Thanks [@&#8203;matthewp](https://github.com/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: ```js // 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}`) ```js // my-package/integration.js export function myIntegration() { return { name: 'my-integration', hooks: { 'astro:config:setup': ({ addMiddleware }) => { addMiddleware({ entrypoint: 'my-package/middleware', order: 'pre', }); }, }, }; } ``` - [#&#8203;8854](https://github.com/withastro/astro/pull/8854) [`3e1239e42`](https://github.com/withastro/astro/commit/3e1239e42b99bf069265393dc359bf967fc64902) Thanks [@&#8203;natemoo-re](https://github.com/natemoo-re)! - Provides a new, experimental build cache for [Content Collections](https://docs.astro.build/en/guides/content-collections/) as part of the [Incremental Build RFC](https://github.com/withastro/roadmap/pull/763). 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: ```js // 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`](https://docs.astro.build/en/reference/configuration-reference/#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](https://github.com/withastro/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 - [#&#8203;8963](https://github.com/withastro/astro/pull/8963) [`fda3a0213`](https://github.com/withastro/astro/commit/fda3a0213b1907fd63076ebc93d92ada3d026461) Thanks [@&#8203;matthewp](https://github.com/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: </details> --- ### 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
smeagol-help added 1 commit 2023-11-09 12:00:49 -06:00
jahanson merged commit bc17c72bd0 into main 2023-11-09 14:09:31 -06:00
jahanson deleted branch renovate/astro-3.x-lockfile 2023-11-09 14:09:31 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jahanson/joehanson-dev#13
No description provided.