Bastion
Bastion is a lightweight runtime for isolated HTML fragments. It mounts, executes, and cleans up dynamic scripts automatically, keeping your
interfaces predictable and your memory clean.
What it does
Bastion handles the heavy lifting of managing dynamic content. Inject full HTML fragments into any container and let Bastion track the lifecycle
of every script inside. When the container goes away, the side effects go with it.
- Executes scripts within protected page containers
- Auto-tracks timers, intervals, and event listeners
- Eliminates memory leaks from view swapping
- Built for SPAs, modals, and injected layouts
Why Bastion
Dynamic views often leave behind "ghost" listeners and runaway timers that degrade performance. Bastion creates a strict boundary for your code.
It ensures that anything created inside a container stays there and is reliably destroyed the moment it is no longer needed.
Integrate Bastion
Copy the one-liner below and paste it inside your <head> or at the end of your <body>:
<script src="https://bastion.refreshing.cc"></script>
Built for developers shipping dynamic interfaces.