astro

The web framework for content-driven websites. ⭐️ Star to support our work!

OTHER License

Downloads
8.9M
Stars
43K
Committers
807

Bot releases are hidden (Show)

astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #10779 cefeadf Thanks @adrianlyjak! - Fixes false positives for status code routes like 404 and 500 when generating sitemaps.
astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #10813 3cc3e2c Thanks @Xetera! - Omitting compiler-internal symbol from user components to fix breaking error messages
astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #11032 b78e83f Thanks @itsMapleLeaf! - Adds support for multiple Astro Studio workspaces (aka “Teams”) to the Astro DB CLI

    Users who are members of a team workspace in Astro Studio can now choose between those and their personal workspace when runnning astro db link.

  • #11091 e14ce57 Thanks @matthewp! - Fix inconsistent result type using raw SQL

  • Updated dependencies []:

astro - [email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #11084 9637014 Thanks @bluwy! - Fixes regression when handling hoisted scripts from content collections
astro - [email protected]

Published by astrobot-houston 5 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Minor Changes

  • #11037 9332bb1 Thanks @Princesseuh! - Created package. This package contain shared code between integrations that interact with Astro Studio and is not intended to be used by end-users at this time
astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #11026 8dfb1a2 Thanks @bluwy! - Skips rendering script tags if it's inlined and empty when experimental.directRenderScript is enabled

  • #11043 d0d1710 Thanks @bholmesdev! - Fixes minor type issues in actions component example

  • #10999 5f353e3 Thanks @bluwy! - The prefetch feature is updated to better support different browsers and different cache headers setup, including:

    1. All prefetch strategies will now always try to use <link rel="prefetch"> if supported, or will fall back to fetch().
    2. The prefetch() programmatic API's with option is deprecated in favour of an automatic approach that will also try to use <link rel="prefetch> if supported, or will fall back to fetch().

    This change shouldn't affect most sites and should instead make prefetching more effective.

  • #11041 6cc3fb9 Thanks @bholmesdev! - Fixes 500 errors when sending empty params or returning an empty response from an action.

  • #11028 771d1f7 Thanks @bholmesdev! - Throw on missing server output when using Astro Actions.

  • #11029 bd34452 Thanks @bholmesdev! - Actions: include validation error in thrown error message for debugging.

  • #11046 086694a Thanks @HiDeoo! - Fixes getViteConfig() type definition to allow passing an inline Astro configuration as second argument

  • #11026 8dfb1a2 Thanks @bluwy! - Fixes CSS handling if imported in a script tag in an Astro file when experimental.directRenderScript is enabled

  • #11020 2e2d6b7 Thanks @xsynaptic! - Add type declarations for import.meta.env.ASSETS_PREFIX when defined as an object for handling different file types.

  • #11030 18e7f33 Thanks @bholmesdev! - Actions: Fix missing message for custom Action errors.

  • #10981 ad9227c Thanks @mo! - Adds deprecated HTML attribute "name" to the list of valid attributes. This attribute has been replaced by the global id attribute in recent versions of HTML.

  • #11013 4ea38e7 Thanks @QingXia-Ela! - Prevents unhandledrejection error when checking for latest Astro version

  • #11034 5f2dd45 Thanks @arganaphang! - Add popovertargetaction to the attribute that can be passed to the button and input element

astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #11027 eb1d9a4 Thanks @bholmesdev! - Fix isDbError() returning false for remote database errors. Astro will now return a LibsqlError in development and production.
astro - @astrojs/[email protected]

Published by astrobot-houston 5 months ago

Patch Changes

  • #11050 841df1f Thanks @mingjunlu! - Fixes an issue where trailing slash is not removed even if the trailingSlash option is set to false.
astro - [email protected]

Published by astrobot-houston 5 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 6 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 6 months ago

Patch Changes

  • #10987 05db5f7 Thanks @ematipico! - Fix a regression where the flag experimental.rewriting was marked mandatory. Is is now optional.

  • #10975 6b640b3 Thanks @bluwy! - Passes the scoped style attribute or class to the <picture> element in the <Picture /> component so scoped styling can be applied to the <picture> element

astro - @astrojs/[email protected]

Published by astrobot-houston 6 months ago

Patch Changes

  • #10986 4d16381 Thanks @emish89! - Fixes incorrect peerDependencies for @types/react and @types/react-dom
astro - [email protected]

Published by astrobot-houston 6 months ago

Minor Changes

  • #10935 ddd8e49 Thanks @bluwy! - Exports astro/jsx/rehype.js with utilities to generate an Astro metadata object

  • #10625 698c2d9 Thanks @goulvenclech! - Adds the ability for multiple pages to use the same component as an entrypoint when building an Astro integration. This change is purely internal, and aligns the build process with the behaviour in the development server.

  • #10906 7bbd664 Thanks @Princesseuh! - Adds a new radio checkbox component to the dev toolbar UI library (astro-dev-toolbar-radio-checkbox)

  • #10963 61f47a6 Thanks @delucis! - Adds support for passing an inline Astro configuration object to getViteConfig()

    If you are using getViteConfig() to configure the Vitest test runner, you can now pass a second argument to control how Astro is configured. This makes it possible to configure unit tests with different Astro options when using Vitest’s workspaces feature.

    // vitest.config.ts
    import { getViteConfig } from 'astro/config';
    
    export default getViteConfig(
      /* Vite configuration */
      { test: {} },
      /* Astro configuration */
      {
        site: 'https://example.com',
        trailingSlash: 'never',
      }
    );
    
  • #10867 47877a7 Thanks @ematipico! - Adds experimental rewriting in Astro with a new rewrite() function and the middleware next() function.

    The feature is available via an experimental flag in astro.config.mjs:

    export default defineConfig({
      experimental: {
        rewriting: true,
      },
    });
    

    When enabled, you can use rewrite() to render another page without changing the URL of the browser in Astro pages and endpoints.

    ---
    // src/pages/dashboard.astro
    if (!Astro.props.allowed) {
      return Astro.rewrite('/');
    }
    ---
    
    // src/pages/api.js
    export function GET(ctx) {
      if (!ctx.locals.allowed) {
        return ctx.rewrite('/');
      }
    }
    

    The middleware next() function now accepts a parameter with the same type as the rewrite() function. For example, with next("/"), you can call the next middleware function with a new Request.

    // src/middleware.js
    export function onRequest(ctx, next) {
      if (!ctx.cookies.get('allowed')) {
        return next('/'); // new signature
      }
      return next();
    }
    

    NOTE: please read the RFC to understand the current expectations of the new APIs.

  • #10858 c0c509b Thanks @bholmesdev! - Adds experimental support for the Actions API. Actions let you define type-safe endpoints you can query from client components with progressive enhancement built in.

    Actions help you write type-safe backend functions you can call from anywhere. Enable server rendering using the output property and add the actions flag to the experimental object:

    {
      output: 'hybrid', // or 'server'
      experimental: {
        actions: true,
      },
    }
    

    Declare all your actions in src/actions/index.ts. This file is the global actions handler.

    Define an action using the defineAction() utility from the astro:actions module. These accept the handler property to define your server-side request handler. If your action accepts arguments, apply the input property to validate parameters with Zod.

    This example defines two actions: like and comment. The like action accepts a JSON object with a postId string, while the comment action accepts FormData with postId, author, and body strings. Each handler updates your database and return a type-safe response.

    // src/actions/index.ts
    import { defineAction, z } from 'astro:actions';
    
    export const server = {
      like: defineAction({
        input: z.object({ postId: z.string() }),
        handler: async ({ postId }, context) => {
          // update likes in db
    
          return likes;
        },
      }),
      comment: defineAction({
        accept: 'form',
        input: z.object({
          postId: z.string(),
    
          body: z.string(),
        }),
        handler: async ({ postId }, context) => {
          // insert comments in db
    
          return comment;
        },
      }),
    };
    

    Then, call an action from your client components using the actions object from astro:actions. You can pass a type-safe object when using JSON, or a FormData object when using accept: 'form' in your action definition:

    // src/components/blog.tsx
    import { actions } from 'astro:actions';
    import { useState } from 'preact/hooks';
    
    export function Like({ postId }: { postId: string }) {
      const [likes, setLikes] = useState(0);
      return (
        <button
          onClick={async () => {
            const newLikes = await actions.like({ postId });
            setLikes(newLikes);
          }}
        >
          {likes} likes
        </button>
      );
    }
    
    export function Comment({ postId }: { postId: string }) {
      return (
        <form
          onSubmit={async (e) => {
            e.preventDefault();
            const formData = new FormData(e.target);
            const result = await actions.blog.comment(formData);
            // handle result
          }}
        >
          <input type="hidden" name="postId" value={postId} />
          <label for="author">Author</label>
          <input id="author" type="text" name="author" />
          <textarea rows={10} name="body"></textarea>
          <button type="submit">Post</button>
        </form>
      );
    }
    

    For a complete overview, and to give feedback on this experimental API, see the Actions RFC.

  • #10906 7bbd664 Thanks @Princesseuh! - Adds a new buttonBorderRadius property to the astro-dev-toolbar-button component for the dev toolbar component library. This property can be useful to make a fully rounded button with an icon in the center.

Patch Changes

  • #10977 59571e8 Thanks @BryceRussell! - Improve error message when accessing clientAddress on prerendered routes

  • #10935 ddd8e49 Thanks @bluwy! - Improves the error message when failed to render MDX components

  • #10917 3412535 Thanks @jakobhellermann! - Fixes a case where the local server would crash when the host also contained the port, eg. with X-Forwarded-Host: hostname:8080 and X-Forwarded-Port: 8080 headers

  • #10959 685fc22 Thanks @bluwy! - Refactors internal handling of styles and scripts for content collections to improve build performance

  • #10889 4d905cc Thanks @matthewp! - Preserve content modules properly in cache

  • #10955 2978287 Thanks @florian-lefebvre! - Handles AstroUserErrors thrown while syncing content collections and exports BaseSchema and CollectionConfig types

astro - @astrojs/[email protected]

Published by astrobot-houston 6 months ago

Patch Changes

  • #10947 e63e96b Thanks @delucis! - Fixes a runtime issue where Vite was unintentionally pulled into the server code
astro - @astrojs/[email protected]

Published by astrobot-houston 6 months ago

Minor Changes

  • #10929 082abb8 Thanks @florian-lefebvre! - Adds a devtools option

    You can enable the official Vue DevTools while working in development mode by setting devtools:true in your vue() integration config:

    import { defineConfig } from 'astro/config';
    import vue from '@astrojs/vue';
    
    export default defineConfig({
      integrations: [vue({ devtools: true })],
    });
    
astro - @astrojs/[email protected]

Published by astrobot-houston 6 months ago

Minor Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 6 months ago

Minor Changes

  • #10937 7179930 Thanks @florian-lefebvre! - Adds a devtools option

    You can enable the official Solid Devtools while working in development mode by setting devtools: true in your solid() integration config and adding solid-devtools to your project dependencies:

    npm install solid-devtools
    # yarn add solid-devtools
    # pnpm add solid-devtools
    
    import { defineConfig } from 'astro/config';
    import solid from '@astrojs/solid-js';
    
    export default defineConfig({
      integrations: [solid({ devtools: true })],
    });
    
astro - @astrojs/[email protected]

Published by astrobot-houston 6 months ago

Patch Changes

Package Rankings
Top 0.43% on Npmjs.org
Top 8.17% on Proxy.golang.org
Badges
Extracted from project README
CI License npm version astro version create-astro version @astrojs/react version @astrojs/preact version @astrojs/solid version @astrojs/svelte version @astrojs/vue version @astrojs/lit version @astrojs/node version @astrojs/vercel version @astrojs/cloudflare version @astrojs/partytown version @astrojs/sitemap version @astrojs/tailwind version @astrojs/alpinejs version @astrojs/mdx version @astrojs/db version @astrojs/rss version @astrojs/netlify version CII Best Practices Astro's sponsors.