# astro-suspense

> Out of order streaming support for Astro.

Latest version **0.1.3** (published 2024-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install astro-suspense
pnpm add astro-suspense
yarn add astro-suspense
bun add astro-suspense
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2024-06-07 |
| First published | 2023-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 26.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Charlie Hadden |
| Maintainers | charliehadden |
| Keywords | astro, suspense, async, streaming, astro-integration |

## Links

- npm: https://www.npmjs.com/package/astro-suspense
- Repository: https://github.com/charlie-hadden/astro-suspense
- Homepage: https://github.com/charlie-hadden/astro-suspense#readme
- Issues: https://github.com/charlie-hadden/astro-suspense/issues
- npm.io page: https://npm.io/package/astro-suspense

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2024-06-07
- 0.1.2 — 2024-01-11
- 0.1.1 — 2023-12-15
- 0.1.0 — 2023-12-15
- 0.0.2 — 2023-11-18
- 0.0.1 — 2023-11-16

## README

# astro-suspense

Out of order streaming support for [Astro](https://astro.build).

> :warning: This is little more than a proof of concept at this point. Use it if you dare, but know that I'm not (yet) using it in production myself.

## Demo

[See a demo](https://astro-suspense.cwh.gg/).

## Installation

```bash
npx astro add astro-suspense
```

## Usage

```astro
---
import { Suspense } from "astro-suspense/components";
import SlowComponent from "./SlowComponent.astro";
---

<Suspense>
  <p slot="fallback">Loading...</p>
  <p slot="error">Something went wrong</p>
  <SlowComponent />
</Suspense>
```

For view transitions you need to replace Astro's default `<ViewTransitions />` with this package's `<SuspenseViewTransitions />`.

```astro
---
import { SuspenseViewTransitions } from "astro-suspense/components";
---

<!doctype html>
<html>
  <head>
    <SuspenseViewTransitions />
  </head>
  <body> </body>
</html>
```

---
_Source: https://npm.io/package/astro-suspense · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
