Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(features): Add single instance page #1931

Merged
merged 18 commits into from
Apr 1, 2024

Conversation

naman-crabnebula
Copy link
Contributor

What kind of changes does this PR include?

  • New or updated content

Description

@naman-crabnebula naman-crabnebula requested a review from a team as a code owner March 6, 2024 23:25
Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for tauri-docs-starlight ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c8c0224
🔍 Latest deploy log https://app.netlify.com/sites/tauri-docs-starlight/deploys/660ac748d13d79000807763d
😎 Deploy Preview https://deploy-preview-1931--tauri-docs-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@naman-crabnebula
Copy link
Contributor Author

This PR is ready to be reviewed.

Copy link
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks amazing, just made some suggestions to make it look closer to the other feature documentation pages

@simonhyll @FabianLars do we have a standard for documenting features? I see there's a bunch of patterns for documenting how a plugin can be installed (via the tauri CLI vs manually crates.io vs manually git)

src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
Comment on lines 36 to 38
## Usage

To use this plugin, you need to register the core plugin with Tauri. The plugin init() method takes a closure that is called when a new app instance was started, but closed by the plugin. The closure has three arguments: the AppHandle, the list of arguments (important for instance on deep link usage) and the current working directory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(important for instance on deep link usage)

as this is being mentioned, it could be explained why in a aside, without diving too much. Since this was Lucas' suggestions, I'll tag him to give us a hand @lucasfernog could you help on these?

the plugin takes a closure that is called when a new app instance was started, but closed by the plugin

this is a byte ambiguous

Comment on lines 36 to 38
## Usage

To use this plugin, you need to register the core plugin with Tauri. The plugin init() method takes a closure that is called when a new app instance was started, but closed by the plugin. The closure has three arguments: the AppHandle, the list of arguments (important for instance on deep link usage) and the current working directory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General idea (you can use Starlight steps component) if you choose to do like this

Usage

  1. register the core plugin with Tauri.

// show how

  1. the plugin takes a closure that is called when a new app instance was started, but closed by the plugin. It has three arguments:
  • app, being the AppHandle,
  • args: the list of arguments
  • cwd the current working directory (what should it default to?)

:::note
why args is important for instance on deep link usage
:::

// maybe show only the line highlighting app, agrs, cwd
// .plugin(tauri_plugin_single_instance::init(|app, args, cwd| {}))

@naman-crabnebula
Copy link
Contributor Author

Hi, up for review again! Thanks a lot for your valuable suggestions.
I tried my best to accommodate most of the suggestions, and made the guide as beginner friendly as possible. I hope it is nice and clear!

src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
src/content/docs/features/single-instance.mdx Outdated Show resolved Hide resolved
@vasfvitor vasfvitor merged commit 903b5a5 into tauri-apps:next Apr 1, 2024
7 checks passed
@naman-crabnebula naman-crabnebula deleted the single-instance-docs branch April 2, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Create Single Instance guide
3 participants