Skip to content

Commit

Permalink
Remove experimental.serverIslands flag (#11991)
Browse files Browse the repository at this point in the history
* Remove experimental.serverIslands flag

* update link to the guide

* Add changeset

* Update packages/astro/src/core/errors/errors-data.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/astro/src/core/errors/errors-data.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
  • Loading branch information
matthewp and sarah11918 committed Sep 13, 2024
1 parent a604a0c commit d7a396c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 67 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-lamps-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Update error link to on-demand rendering guide
4 changes: 2 additions & 2 deletions packages/astro/src/core/errors/errors-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ export const AdapterSupportOutputMismatch = {
/**
* @docs
* @see
* - [Server-side Rendering](https://docs.astro.build/en/guides/server-side-rendering/)
* - [On-demand Rendering](https://5-0-0-beta.docs.astro.build/en/guides/on-demand-rendering/)
* @description
* To use server islands, the same constraints exist as for sever-side rendering, so an adapter is needed.
*/
export const NoAdapterInstalledServerIslands = {
name: 'NoAdapterInstalledServerIslands',
title: 'Cannot use Server Islands without an adapter.',
message: `Cannot use server islands without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
hint: 'See https://docs.astro.build/en/guides/server-side-rendering/ for more information.',
hint: 'See https://5-0-0-beta.docs.astro.build/en/guides/on-demand-rendering/ for more information.',
} satisfies ErrorData;
/**
* @docs
Expand Down
65 changes: 0 additions & 65 deletions packages/astro/src/types/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1603,71 +1603,6 @@ export interface AstroUserConfig {
*/
clientPrerender?: boolean;

/**
* @docs
* @name experimental.serverIslands
* @type {boolean}
* @default `false`
* @version 4.12.0
* @description
*
* Enables experimental Server Island features.
* Server Islands offer the ability to defer a component to render asynchronously after the page has already rendered.
*
* To enable, configure an [on-demand server rendering `output` mode](https://docs.astro.build/en/basics/rendering-modes/#on-demand-rendered) with an adapter, and add the `serverIslands` flag to the `experimental` object:
*
* ```js
* {
* output: 'hybrid', // or 'server'
* adapter: nodejs({ mode: 'standalone' }),
* experimental: {
* serverIslands: true,
* },
* }
* ```
*
* Use the `server:defer` directive on any Astro component to delay initial rendering:
*
* ```astro "server:defer"
* ---
* import Avatar from '~/components/Avatar.astro';
* ---
* <Avatar server:defer />
* ```
*
* The outer page will be rendered, either at build time (`hybrid`) or at runtime (`server`) with the island content omitted and a `<script>` tag included in its place.
*
* After the page loads in the browser, the script tag will replace itself with the the contents of the island by making a request.
*
* Any Astro component can be given the `server: defer` attribute to delay its rendering. There is no special API and you can write `.astro` code as normal:
*
* ```astro
* ---
* import { getUser } from '../api';
*
* const user = await getUser(Astro.locals.userId);
* ---
* <img class="avatar" src={user.imageUrl}>
* ```
*
* #### Server island fallback content
*
* Since your component will not render with the rest of the page, you may want to add generic content (e.g. a loading message) to temporarily show in its place. This content will be displayed when the page first renders but before the island has loaded.
*
* Add placeholder content as a child of your Astro component with the `slot="fallback"` attribute. When your island content is available, the fallback content will be replaced.
*
* The example below displays a generic avatar as fallback content, then animates into a personalized avatar using view transitions:
*
* ```astro
* <Avatar server:defer>
* <svg slot="fallback" class="generic-avatar" transition:name="avatar">...</svg>
* </Avatar>
* ```
*
* For a complete overview, and to give feedback on this experimental API, see the [Server Islands RFC](https://github.com/withastro/roadmap/pull/963).
*/
serverIslands?: boolean;

/**
* @docs
* @name experimental.contentIntellisense
Expand Down

0 comments on commit d7a396c

Please sign in to comment.