Skip to content

Commit

Permalink
Add proper docs
Browse files Browse the repository at this point in the history
  • Loading branch information
louisescher committed Dec 22, 2024
1 parent dd35313 commit 3e9c198
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 13 deletions.
2 changes: 2 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default defineConfig({
{ label: 'Installation', slug: '' },
{ label: 'The Tale of the Three Mages', slug: 'the-tale-of-the-three-mages' },
{ label: 'An actual explanation of what is going on here', slug: 'actual-explanation' },
{ label: 'Caveats', slug: 'caveats' },
{ label: 'El funny', slug: 'memes' },
],
plugins: [
catppuccin({ dark: 'mocha-teal', light: 'latte-teal' }),
Expand Down
Binary file added docs/src/assets/another-3-minutes-to-rollup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/bernie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/bush.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/car.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/communism.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/feelings-of-power.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/goosebumps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/grim-reaper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/assets/houston.webp
Binary file not shown.
Binary file added docs/src/assets/new-woman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/no-builds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/og.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions docs/src/component/TestStyle.astro

This file was deleted.

4 changes: 3 additions & 1 deletion docs/src/content/docs/actual-explanation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ The cache is saved in `node_modules/.domain-expansion`.
## What about assets?

Astro has built-in image optimization. That built-in image optimization adds the resulting asset to your build
output based on calls to the `getImage` function. That function is also used in the `<Image />` and `<Picture />`
output based on calls to the [`getImage` function](https://docs.astro.build/en/guides/images/#generating-images-with-getimage).
That function is also used in the [`<Image />`](https://docs.astro.build/en/guides/images/#display-optimized-images-with-the-image--component)
and [`<Picture />`](https://docs.astro.build/en/reference/modules/astro-assets/#picture-)
components. Domain Expansion detects when that function is called and also adds the parameters that the function
was called with to the cache. Whenever we reconstruct a component from the cache, we "replay" all calls to `getImage`
such that the image service is called just as if the component was rendered normally.
22 changes: 18 additions & 4 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ title: Domain Expansion
description: And they said incremental builds in Astro weren't possible.
---

import { Tabs, TabItem } from '@astrojs/starlight/components';
import TestStyle from '../../component/TestStyle.astro';
import { Tabs, TabItem, Badge } from '@astrojs/starlight/components';

<TestStyle />
Domain Expansion is an Astro integration that adds support for incremental builds. Basically,
builds go weee now.

Domain Expansion is an Astro integration that adds support for incremental builds.
## Benchmarks

<Badge text="TODO: PUT GRAFANA BENCHMARKS HERE" />

1. Astro Docs, time to build (domain expansion vs domain expansion (no logging) vs default vs default (no logging))
2. Starlight docs, time to build (domain expansion vs domain expansion (no logging) vs default vs default (no logging))
3. astro.build, time to build (domain expansion vs domain expansion (no logging) vs default vs default (no logging))
4. Astrowind basic install, time to build (domain expansion vs domain expansion (no logging) vs default vs default (no logging))
5. Cloudflare docs, time to build (domain expansion vs domain expansion (no logging) vs default vs default (no logging))
6. StudioCMS/UI Docs, time to build (domain expansion vs domain expansion (no logging) vs default vs default (no logging))

## Installation

Expand Down Expand Up @@ -75,6 +84,11 @@ Once the integration has been included in your `astro.config.mjs`, the next time
your build will be cached. From that point on, whenever you rebuild your site, only the files that have
changed will be rebuilt.

### Even more optimization

1. Set `logLevel` to `silent` in your `astro.config.mjs` to disable logging. See the [benchmarks](#benchmarks) for more information.
2. Pray that [Rolldown](https://rolldown.rs/) gets released soon.

## Authors

- [Luiz Ferraz](https://github.com/Fryuni)
Expand Down
15 changes: 15 additions & 0 deletions docs/src/content/docs/memes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: El funny
---

![Very Domain, Nice Expansion](../../assets/og.jpg)
![Another 3 Minutes to Rollup](../../assets/another-3-minutes-to-rollup.png)
![I am once again asking for faster build times](../../assets/bernie.png)
![They just reduced the Astro Docs build time below 4 minutes](../../assets/bush.png)
![The astro community drifting towards incremental builds](../../assets/car.png)
![Our incremental builds](../../assets/communism.png)
![What gives people feelings of power](../../assets/feelings-of-power.png)
![Astro incremental builds are now a thing](../../assets/goosebumps.png)
![Fryuni as the grim reaper](../../assets/grim-reaper.png)
![Astro community looking at incremental builds](../../assets/new-woman.png)
![Megamind "No incremental builds?"](../../assets/no-builds.png)

0 comments on commit 3e9c198

Please sign in to comment.