Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] release #103

Merged
merged 1 commit into from
Dec 18, 2023
Merged

[ci] release #103

merged 1 commit into from
Dec 18, 2023

Conversation

github-actions[bot]
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@astrojs/netlify@4.0.0

Major Changes

  • #84 ca64544 Thanks @Skn0tt! - # Netlify Adapter v4 simplifies static + SSR deployments

    This update is a complete overhaul of the Netlify adapter.
    It simplifies the user-facing config, and resolves a number of bugs along the way.

    Here's what changes:

    Netlify Context is automatically available via Locals

    In v3, you could use netlify-edge-middleware.ts to inject data from the Netlify context into your Astro locals.
    In v4, this file is no longer needed because the Netlify context is automatically made available via Astro.locals.netlify.context.
    You can use this context to access information about the user (like geolocation or IP address), your Netlify site (like deploy ID) or the request (like its request ID or the CDN region it's served from).

    Action Required:
    Remove the netlify-edge-middleware.ts or netlify-edge-middleware.js file.
    In your codebase, change all usage of locals injected through that file to use Astro.locals.netlify.context instead.

    Image CDN

    v4 of this adapter integrates your Astro site with Netlify Image CDN.
    This allows transforming images on-the-fly without impacting build times.
    It's implemented using an Astro Image Service, and enabled by default.

    Replacement for On-Demand Builders

    On-Demand Builders (ODB) allows SSR-Rendered pages to be cached using a Time to Live (TTL) strategy.
    While the Netlify platform continues to support existing pages with ODBs, we now recommend using the much more powerful
    Fine-Grained Cache Control going forward.

    In v3, you could deploy your SSR-Rendered Astro pages to ODBs by enabling the builders config option,
    and then specifying the TTL on a per-page basis.
    In v4, a new cacheOnDemandPages option replaces this config option. Take a look at the README to learn more about this.

    Action Required:
    Replace the builders config option with cacheOnDemandPages.

    // astro.config.mjs
    export default defineConfig({
      // ...
      adapter: netlify({
    -   builders: true
    +   cacheOnDemandPages: true
      }),
    });

    functionPerRoute was removed

    In v3, the functionPerRoute option allowed the SSR routes to be split up into multiple Netlify Functions.
    This reduced the bundle sizes of each individual function, with the intention of speeding up code parsing, and therefore the time of cold starts.
    In practice, this benefit is often nullified by the increase in number of cold starts - more handlers means fewer requests per handler, means more cold starts.

    In v4, support for this deployment mode was removed.

    Action Required:
    Remove the functionPerRoute field from your config.

    binaryMediaTypes was removed

    binaryMediaTypes was a workaround required for some Astro endpoints, because v3 deployed those as "old" Netlify Functions (now referred to as "Lambda Compatibility Mode").
    v4 uses the new Netlify Functions 2.0, which simply doesn't need this workaround anymore - so we're removing it 🎉

    Action Required:
    Remove the binaryMediaTypes field from your config.

Copy link
Member

@alexanderniebuhr alexanderniebuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release Monday Morning CET

@alexanderniebuhr alexanderniebuhr merged commit e21ffd2 into main Dec 18, 2023
@Skn0tt
Copy link
Contributor

Skn0tt commented Dec 18, 2023

Nice, thanks for releasing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants