astro

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

OTHER License

Downloads
8.9M
Stars
43K
Committers
807
astro - [email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Minor Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Minor Changes

  • #9751 1153331cbbaa66a88645d15c6e949432210d4acc Thanks @florian-lefebvre! - Allows extending Alpine using the new entrypoint configuration

    You can extend Alpine by setting the entrypoint option to a root-relative import specifier (for example, entrypoint: "/src/entrypoint").

    The default export of this file should be a function that accepts an Alpine instance prior to starting, allowing the use of custom directives, plugins and other customizations for advanced use cases.

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import alpine from '@astrojs/alpinejs';
    
    export default defineConfig({
      // ...
      integrations: [alpine({ entrypoint: '/src/entrypoint' })],
    });
    
    // src/entrypoint.ts
    import type { Alpine } from 'alpinejs'
    
    export default (Alpine: Alpine) => {
        Alpine.directive('foo', el => {
            el.textContent = 'bar';
        })
    }
    
astro - [email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 9 months ago

Patch Changes

  • #9792 e22cb8b10c0ca9f6d88cab53cd2713f57875ab4b Thanks @tugrulates! - Accept aria role switch on toolbar audit.

  • #9606 e6945bcf23b6ad29388bbadaf5bb3cc31dd4a114 Thanks @eryue0220! - Fixes escaping behavior for .html files and components

  • #9786 5b29550996a7f5459a0d611feea6e51d44e1d8ed Thanks @Fryuni! - Fixes a regression in routing priority for index pages in rest parameter folders and dynamic sibling trees.

    Considering the following tree:

    src/pages/
    ├── index.astro
    ├── static.astro
    ├── [dynamic_file].astro
    ├── [...rest_file].astro
    ├── blog/
    │   └── index.astro
    ├── [dynamic_folder]/
    │   ├── index.astro
    │   ├── static.astro
    │   └── [...rest].astro
    └── [...rest_folder]/
        ├── index.astro
        └── static.astro
    

    The routes are sorted in this order:

    /src/pages/index.astro
    /src/pages/blog/index.astro
    /src/pages/static.astro
    /src/pages/[dynamic_folder]/index.astro
    /src/pages/[dynamic_file].astro
    /src/pages/[dynamic_folder]/static.astro
    /src/pages/[dynamic_folder]/[...rest].astro
    /src/pages/[...rest_folder]/static.astro
    /src/pages/[...rest_folder]/index.astro
    /src/pages/[...rest_file]/index.astro
    

    This allows for index files to be used as overrides to rest parameter routes on SSR when the rest parameter matching undefined is not desired.

  • #9775 075706f26d2e11e66ef8b52288d07e3c0fa97eb1 Thanks @lilnasy! - Simplifies internals that handle endpoints.

  • #9773 9aa7a5368c502ae488d3a173e732d81f3d000e98 Thanks @LunaticMuch! - Raises the required vite version to address a vulnerability in vite.server.fs.deny that affected the dev mode.

  • #9781 ccc05d54014e24c492ca5fddd4862f318aac8172 Thanks @stevenbenner! - Fix build failure when image file name includes special characters

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Minor Changes

astro - [email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Minor Changes

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Major Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Minor Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Major Changes

  • #9661 d6edc7540864cf5d294d7b881eb886a3804f6d05 Thanks @ematipico! - If host is unset in standalone mode, the server host will now fallback to localhost instead of 127.0.0.1. When localhost is used, the operating system can decide to use either ::1 (ipv6) or 127.0.0.1 (ipv4) itself. This aligns with how the Astro dev and preview server works by default.

    If you relied on 127.0.0.1 (ipv4) before, you can set the HOST environment variable to 127.0.0.1 to explicitly use ipv4. For example, HOST=127.0.0.1 node ./dist/server/entry.mjs.

  • #9661 d6edc7540864cf5d294d7b881eb886a3804f6d05 Thanks @ematipico! - Breaking: Minimum required Astro version is now 4.2.0.
    Reorganizes internals to be more maintainable.

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston 9 months ago

Patch Changes

astro - [email protected]

Published by astrobot-houston 9 months ago

Minor Changes

  • #9566 165cfc154be477337037185c32b308616d1ed6fa Thanks @OliverSpeir! - Allows remark plugins to pass options specifying how images in .md files will be optimized

  • #9661 d6edc7540864cf5d294d7b881eb886a3804f6d05 Thanks @ematipico! - Adds new helper functions for adapter developers.

    • Astro.clientAddress can now be passed directly to the app.render() method.
    const response = await app.render(request, { clientAddress: '012.123.23.3' });
    
    • Helper functions for converting Node.js HTTP request and response objects to web-compatible Request and Response objects are now provided as static methods on the NodeApp class.
    http.createServer((nodeReq, nodeRes) => {
      const request: Request = NodeApp.createRequest(nodeReq);
      const response = await app.render(request);
      await NodeApp.writeResponse(response, nodeRes);
    });
    
    • Cookies added via Astro.cookies.set() can now be automatically added to the Response object by passing the addCookieHeader option to app.render().
    -const response = await app.render(request)
    -const setCookieHeaders: Array<string> = Array.from(app.setCookieHeaders(webResponse));
    
    -if (setCookieHeaders.length) {
    -    for (const setCookieHeader of setCookieHeaders) {
    -        headers.append('set-cookie', setCookieHeader);
    -    }
    -}
    +const response = await app.render(request, { addCookieHeader: true })
    
  • #9638 f1a61268061b8834f39a9b38bca043ae41caed04 Thanks @ematipico! - Adds a new i18n.routing config option redirectToDefaultLocale to disable automatic redirects of the root URL (/) to the default locale when prefixDefaultLocale: true is set.

    In projects where every route, including the default locale, is prefixed with /[locale]/ path, this property allows you to control whether or not src/pages/index.astro should automatically redirect your site visitors from / to /[defaultLocale].

    You can now opt out of this automatic redirection by setting redirectToDefaultLocale: false:

    // astro.config.mjs
    export default defineConfig({
      i18n: {
        defaultLocale: 'en',
        locales: ['en', 'fr'],
        routing: {
          prefixDefaultLocale: true,
          redirectToDefaultLocale: false,
        },
      },
    });
    
  • #9671 8521ff77fbf7e867701cc30d18253856914dbd1b Thanks @bholmesdev! - Removes the requirement for non-content files and assets inside content collections to be prefixed with an underscore. For files with extensions like .astro or .css, you can now remove underscores without seeing a warning in the terminal.

    src/content/blog/
    post.mdx
    - _styles.css
    - _Component.astro
    + styles.css
    + Component.astro
    

    Continue to use underscores in your content collections to exclude individual content files, such as drafts, from the build output.

  • #9567 3a4d5ec8001ebf95c917fdc0d186d29650533d93 Thanks @OliverSpeir! - Improves the a11y-missing-content rule and error message for audit feature of dev-overlay. This also fixes an error where this check was falsely reporting accessibility errors.

  • #9643 e9a72d9a91a3741566866bcaab11172cb0dc7d31 Thanks @blackmann! - Adds a new markdown.shikiConfig.transformers config option. You can use this option to transform the Shikiji hast (AST format of the generated HTML) to customize the final HTML. Also updates Shikiji to the latest stable version.

    See Shikiji's documentation for more details about creating your own custom transformers, and a list of common transformers you can add directly to your project.

  • #9644 a5f1682347e602330246129d4666a9227374c832 Thanks @rossrobino! - Adds an experimental flag clientPrerender to prerender your prefetched pages on the client with the Speculation Rules API.

    // astro.config.mjs
    {
      prefetch: {
        prefetchAll: true,
        defaultStrategy: 'viewport',
      },
      experimental: {
        clientPrerender: true,
      },
    }
    

    Enabling this feature overrides the default prefetch behavior globally to prerender links on the client according to your prefetch configuration. Instead of appending a <link> tag to the head of the document or fetching the page with JavaScript, a <script> tag will be appended with the corresponding speculation rules.

    Client side prerendering requires browser support. If the Speculation Rules API is not supported, prefetch will fallback to the supported strategy.

    See the Prefetch Guide for more prefetch options and usage.

  • #9439 fd17f4a40b83d14350dce691aeb79d87e8fcaf40 Thanks @Fryuni! - Adds an experimental flag globalRoutePriority to prioritize redirects and injected routes equally alongside file-based project routes, following the same route priority order rules for all routes.

    // astro.config.mjs
    export default defineConfig({
      experimental: {
        globalRoutePriority: true,
      },
    });
    

    Enabling this feature ensures that all routes in your project follow the same, predictable route priority order rules. In particular, this avoids an issue where redirects or injected routes (e.g. from an integration) would always take precedence over local route definitions, making it impossible to override some routes locally.

    The following table shows which route builds certain page URLs when file-based routes, injected routes, and redirects are combined as shown below:

    • File-based route: /blog/post/[pid]
    • File-based route: /[page]
    • Injected route: /blog/[...slug]
    • Redirect: /blog/tags/[tag] -> /[tag]
    • Redirect: /posts -> /blog

    URLs are handled by the following routes:

    Page Current Behavior Global Routing Priority Behavior
    /blog/tags/astro Injected route /blog/[...slug] Redirect to /tags/[tag]
    /blog/post/0 Injected route /blog/[...slug] File-based route /blog/post/[pid]
    /posts File-based route /[page] Redirect to /blog

    In the event of route collisions, where two routes of equal route priority attempt to build the same URL, Astro will log a warning identifying the conflicting routes.

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.