Skip to content

Commit

Permalink
Add trade-off: stale content
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOtterlord committed Dec 22, 2024
1 parent 7b97e8c commit fb3fdef
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/src/content/docs/caveats.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@ title: Caveats
---

## Engines
Domain Expansion is *very* particular about its environment. For example, if you use any runtime besides Node.js,
you **will** run into issues. This is because Domain Expansion relies on functions that are only available in V8,

Domain Expansion is *very* particular about the build environment, and requires you to use Node.js. This is because the integration relies on functions that are only available in V8,
the runtime that Node.js uses.

If you use any runtime besides Node.js for building, Domain Expansion will not work. However, you are not required
to deploy to Node.js! After the build process is complete, any Astro-compatible runtime can be used to serve the
site.

## Global State

If you have components with global state, they might behave in weird ways, as Domain Expansion is unable to cache any
shared state between components, because every component is built in isolation. This means that when retrieving a
component from the cache, none if its side effects will be able to be recreated.

## Stale Content

Domain Expansion does not invalidate external content, recompute usage of random values, or datetime usage. The first time a component is rendered, it's output is cached until the cache is invalidated. For example, calling `Date.now()` in a component used in multiple locations will cause all locations to return the result of the first render of that component.

## Astro Versions

Domain Expansion relies on how two very functions are exported from Astro. Specifically where and how `$$createComponent`
and `getImage` are declared and exported from. If these functions are moved or changed in any way, Domain Expansion
will break. Since those functions are part of Astro's internal API, they can change at any time, even on patch releases.

If you find yourself having any issues with Domain Expansion, please open an issue on the
[GitHub repository](https://github.com/astro-expansion/domain-expansion).
[GitHub repository](https://github.com/astro-expansion/domain-expansion).

0 comments on commit fb3fdef

Please sign in to comment.