astro

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

OTHER License

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

Published by astrobot-houston about 1 year ago

Minor Changes

  • #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: #24292e">
      <pre>
        <span class="line" style="color: #e1e4e8">my code</span>
      </pre>
    </code>
    

    After:

    <code class="astro-code" style="background-color: #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.

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

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: #24292e">
      <pre>
        <span class="line" style="color: #e1e4e8">my code</span>
      </pre>
    </code>
    

    After:

    <code class="astro-code" style="background-color: #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.

    srcset support

    Two new properties have been added to Image and getImage(): densities and widths.

    These properties can be used to generate a srcset attribute, either based on absolute widths in pixels (e.g. [300, 600, 900]) or pixel density descriptors (e.g. ["2x"] or [1.5, 2]).

    ---
    import { Image } from 'astro';
    import myImage from './my-image.jpg';
    ---
    
    <Image src={myImage} width={myImage.width / 2} densities={[1.5, 2]} alt="My cool image" />
    
    <img
      src="/_astro/my_image.hash.webp"
      srcset="/_astro/my_image.hash.webp 1.5x, /_astro/my_image.hash.webp 2x"
      alt="My cool image"
    />
    

    Picture component

    The experimental <Picture /> component can be used to generate a <picture> element with multiple <source> elements.

    The example below uses the format property to generate a <source> in each of the specified image formats:

    ---
    import { Picture } from 'astro:assets';
    import myImage from './my-image.jpg';
    ---
    
    <Picture src={myImage} formats={['avif', 'webp']} alt="My super image in multiple formats!" />
    

    The above code will generate the following HTML, and allow the browser to determine the best image to display:

    <picture>
      <source srcset="..." type="image/avif" />
      <source srcset="..." type="image/webp" />
      <img src="..." alt="My super image in multiple formats!" />
    </picture>
    

    The Picture component takes all the same props as the Image component, including the new densities and widths properties.

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Minor Changes

  • #8655 3dd65bf88 Thanks @alexanderniebuhr! - Introduces support for local KV bindings. Enhances development experience by allowing direct integration with astro dev.

  • #8655 3dd65bf88 Thanks @alexanderniebuhr! - Introduces support for local Durable Objects bindings. Enhances development experience by allowing direct integration with astro dev.

  • #8655 3dd65bf88 Thanks @alexanderniebuhr! - Introduces support for local D1 bindings. Enhances development experience by allowing direct integration with astro dev.

  • #8655 3dd65bf88 Thanks @alexanderniebuhr! - Introduces support for local R2 bindings. Enhances development experience by allowing direct integration with astro dev.

  • #8655 3dd65bf88 Thanks @alexanderniebuhr! - Introduces support for local Caches bindings. Enhances development experience by allowing direct integration with astro dev.

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Minor Changes

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

  • #8680 31c59ad8b Thanks @bluwy! - Fix hydration on slow connection

  • #8698 47ea310f0 Thanks @Princesseuh! - Use a Node-specific image endpoint to resolve images in dev and Node SSR. This should fix many issues related to getting 404 from the _image endpoint under certain configurations

  • #8706 345808170 Thanks @bluwy! - Fix duplicated Astro and Vite injected styles

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

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 '@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 === '@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

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - @astrojs/[email protected]

Published by astrobot-houston about 1 year ago

Minor Changes

  • #8459 2365c1246 Thanks @schummar! - Adds three new config options for _routes.json generation: routes.strategy, routes.include, and routes.exclude.

  • #8542 faeead423 Thanks @adrianlyjak! - Add support for loading wasm modules in the cloudflare adapter

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year ago

Patch Changes

astro - [email protected]

Published by astrobot-houston about 1 year 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.