astro/packages/astro/CHANGELOG.md
Fred K. Bot 5d58787f7a
[ci] release (#4968)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-10-03 18:48:40 -04:00

42 KiB

astro

1.4.4

Patch Changes

  • #4967 e6a881081 Thanks @matthewp! - Final perf fix from 1.3.0 regression

    A regression in rendering perf happened in 1.3.0. This is the final fix for the underlying issue.

1.4.3

Patch Changes

1.4.2

Patch Changes

1.4.1

Patch Changes

1.4.0

Minor Changes

  • #4907 01c1aaa00 Thanks @matthewp! - Order Astro styles last, to override imported styles

    This fixes CSS ordering so that imported styles are placed higher than page/component level styles. This means that if you do:

    ---
    import '../styles/global.css';
    ---
    
    <style>
      body {
        background: limegreen;
      }
    </style>
    

    The <style> defined in this component will be placed below the imported CSS. When compiled for production this will result in something like this:

    /* /src/styles/global.css */
    body {
      background: blue;
    }
    
    /* /src/pages/index.astro */
    body:where(.astro-12345) {
      background: limegreen;
    }
    

    Given Astro's 0-specificity hashing, this change effectively makes it so that Astro styles "win" when they have the same specificity as global styles.

  • #4876 d3091f89e Thanks @matthewp! - Adds the Astro.cookies API

    Astro.cookies is a new API for manipulating cookies in Astro components and API routes.

    In Astro components, the new Astro.cookies object is a map-like object that allows you to get, set, delete, and check for a cookie's existence (has):

    ---
    type Prefs = {
      darkMode: boolean;
    };
    
    Astro.cookies.set<Prefs>(
      'prefs',
      { darkMode: true },
      {
        expires: '1 month',
      }
    );
    
    const prefs = Astro.cookies.get<Prefs>('prefs').json();
    ---
    
    <body data-theme={prefs.darkMode ? 'dark' : 'light'}></body>
    

    Once you've set a cookie with Astro.cookies it will automatically be included in the outgoing response.

    This API is also available with the same functionality in API routes:

    export function post({ cookies }) {
      cookies.set('loggedIn', false);
    
      return new Response(null, {
        status: 302,
        headers: {
          Location: '/login',
        },
      });
    }
    

    See the RFC to learn more.

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

  • #4775 b0cc93996 Thanks @tony-sull! - Adds a new "astro:build:generated" hook that runs after SSG builds finish but before build artifacts are cleaned up. This is a very specific use case, "astro:build:done" is probably what you're looking for.

  • #4669 a961aa3c2 Thanks @aggre! - astro-island now correctly passes Uint8Array/Uint16Array/Uint32Array

  • #4832 73f215df7 Thanks @matthewp! - Allows Responses to be passed to set:html

    This expands the abilities of set:html to ultimate service this use-case:

    <div set:html={fetch('/legacy-post.html')}></div>
    

    This means you can take a legacy app that has been statically generated to HTML and directly consume that HTML within your templates. As is always the case with set:html, this should only be used on trusted content.

    To make this possible, you can also pass several other types into set:html now:

    • Response objects, since that is what fetch() returns:
      <div
        set:html={new Response('<span>Hello world</span>', {
          headers: { 'content-type': 'text/html' },
        })}
      >
      </div>
      
    • ReadableStreams:
      <div
        set:html={new ReadableStream({
          start(controller) {
            controller.enqueue(`<span>read me</span>`);
            controller.close();
          },
        })}
      >
      </div>
      
    • AsyncIterables:
      <div
        set:html={(async function* () {
          for await (const num of [1, 2, 3, 4, 5]) {
            yield `<li>${num}</li>`;
          }
        })()}
      >
      </div>
      
    • Iterables (non-async):
      <div
        set:html={(function* () {
          for (const num of [1, 2, 3, 4, 5]) {
            yield `<li>${num}</li>`;
          }
        })()}
      >
      </div>
      

Patch Changes

1.2.8

Patch Changes

1.2.7

Patch Changes

1.2.6

Patch Changes

1.2.5

Patch Changes

1.2.4

Patch Changes

1.2.3

Patch Changes

1.2.2

Patch Changes

1.2.1

Patch Changes

1.2.0

Minor Changes

  • #4682 d1e695914 Thanks @bholmesdev! - astro add - move configuration updates to final step

  • #4549 255636cc7 Thanks @altano! - Allow specifying custom encoding when using a non-html route. Only option before was 'utf-8' and now that is just the default.

  • #4578 c706d845e Thanks @bholmesdev! - Restart dev server when config file is added, updated, or removed

Patch Changes

1.1.8

Patch Changes

1.1.7

Patch Changes

1.1.6

Patch Changes

1.1.5

Patch Changes

1.1.4

Patch Changes

1.1.3

Patch Changes

  • #4574 b92c24f40 Thanks @delucis! - Update astro add to list official integrations & adapters with same organisation we use in docs

1.1.2

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

  • #4423 d4cd7a59f Thanks @bholmesdev! - Update Markdown type signature to match new markdown plugin,and update top-level layout props for better alignment

Patch Changes

  • #4497 78e06c8ec Thanks @bholmesdev! - Production build logging - Only log [code].html instead of [code]/index.html for 404 and 500 routes

  • Updated dependencies [ac0321824, 839097c84]:

    • @astrojs/markdown-remark@1.1.0

1.1.0-next.0

Minor Changes

  • #4423 d4cd7a59f Thanks @bholmesdev! - Update Markdown type signature to match new markdown plugin,and update top-level layout props for better alignment

Patch Changes

1.0.9

Patch Changes

1.0.8

Patch Changes

  • #4385 8164fa6f1 Thanks @krolebord! - Fix warning when using hooks inside the react components not exported as a function declaration
  • #4446 27ac6a03a Thanks @matthewp! - Deterministic CSS ordering

    This makes our CSS link order deterministic. It uses CSS depth; that is how deeply a module import the CSS comes from, in order to determine which CSS is page-level vs. component-level CSS.

    This is intended to match dev ordering where, because we do not bundle, the page-level CSS always comes after component-level.

1.0.7

Patch Changes

1.0.6

Patch Changes

1.0.5

Patch Changes

  • #4302 1d3a0a16f Thanks @FredKSchott! - Revert "Ensure hydration scripts inside of slots render ASAP (#4288)" to fix Svelte integration bug

1.0.4

Patch Changes

  • #4268 f7afdb889 Thanks @bholmesdev! - Align MD with MDX on layout props and "glob" import results:
    • Add Content to MDX
    • Add file and url to MDX frontmatter (layout import only)
    • Update glob types to reflect differences (lack of rawContent and compiledContent)

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Astro v1.0 is out! Read the official announcement post.

Note

If you need help migrating an existing Astro project to the new Astro v1.0, check out our updated Migration Guide and full documentation website.

0.X

For older changelog entries -- including all v0.X, v1.0 Beta, and v1.0 Release Candidate versions -- check out the v0.X changelog.