Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions src/content/docs/features/persisted-scope.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,50 @@ title: Persisted Scope
description: Persist runtime scope changes on the filesystem.
---

import Stub from '@components/Stub.astro';
import PluginLinks from '@components/PluginLinks.astro';
import { Tabs, TabItem } from '@astrojs/starlight/components';
import CommandTabs from '@components/CommandTabs.astro';

<PluginLinks plugin="persisted-scope" showJsLinks={false} />

<Stub>
Based on
https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/persisted-scope
</Stub>
Save filesystem and asset scopes and restore them when the app is reopened.

## Supported Platforms

- Windows
- Linux
- macOS

## Setup

_This plugin requires a Rust version of at least **1.75**_

Install the persisted-scope plugin to get started.

:::note
Currently manual install is required for setting up persisted-scope plugin.
:::

1. Install the Core plugin by adding the following to your `Cargo.toml` file:

```toml title="src-tauri/Cargo.toml"
[dependencies]
tauri-plugin-persisted-scope = "2.0.0-beta"
# alternatively with Git:
tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
```

2. Modify `lib.rs` to initialize the plugin:

```rust title="src-tauri/src/lib.rs" {3}
fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_persisted_scope::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```

## Usage

After setup the plugin will automatically save and restore filesystem and asset scopes.