Skip to content

advanced bindings documentation#4404

Merged
leaanthony merged 3 commits into
wailsapp:v3-alphafrom
atterpac:v3-alpha
Jul 11, 2025
Merged

advanced bindings documentation#4404
leaanthony merged 3 commits into
wailsapp:v3-alphafrom
atterpac:v3-alpha

Conversation

@atterpac

@atterpac atterpac commented Jul 7, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Added new guides: "Advanced Binding Techniques", "Binding Best Practices", and "Binding System Internals" to provide comprehensive explanations, best practices, and architectural insights for the Wails binding system.
    • Updated the "Bindings" documentation with a minor code example correction and formatting improvement.
    • Updated changelog to include the new bindings guide contribution.

@coderabbitai

coderabbitai Bot commented Jul 7, 2025

Copy link
Copy Markdown
Contributor
## Walkthrough

This update introduces three new documentation files to the Wails v3 docs: one on advanced binding techniques, one on binding best practices, and one explaining the binding system internals. Additionally, a minor correction is made to an example in the existing bindings documentation by removing an unnecessary function call.

## Changes

| File(s)                                                                                      | Change Summary                                                                                                         |
|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| docs/src/content/docs/learn/advanced-binding.mdx                                             | Added comprehensive documentation on advanced binding customization, directives, complex type handling, and optimizations. |
| docs/src/content/docs/learn/binding-best-practices.mdx                                       | Added guide outlining recommended usage patterns and best practices for the Wails binding system.                      |
| docs/src/content/docs/learn/binding-system.mdx                                               | Added documentation explaining the architecture and internals of the Wails binding system, including type mapping and directives. |
| docs/src/content/docs/learn/bindings.mdx                                                     | Removed a redundant function call from an example and added a trailing newline.                                        |
| docs/src/content/docs/changelog.mdx                                                         | Updated changelog to include entry for the new bindings guide contribution.                                            |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant GoCode as Go Code (with directives)
    participant BindingGenerator as Binding Generator
    participant JS_TS as Generated JS/TS Bindings
    participant Docs as Documentation

    GoCode->>BindingGenerator: Parse code and directives (inject, include, internal, ignore, id)
    BindingGenerator->>BindingGenerator: Analyze types and methods
    BindingGenerator->>JS_TS: Generate bindings (apply directives, map types)
    BindingGenerator->>Docs: Output documentation and examples

Possibly related PRs

Suggested reviewers

  • atterpac

Poem

In the docs a rabbit hops,
Through bindings deep and wide,
With tips and tricks for clever code,
And secrets not to hide.
From best practices to internals,
The knowledge now is clear—
Hop on, dear dev, your binding guide is here! 🐇📚


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0e8fc70a3237bc0616edc9a21f1f4311a3163dbe and dbd377a6150eede48bd06071ac581b9d86414829.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/src/content/docs/changelog.mdx` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* docs/src/content/docs/changelog.mdx

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS5paEzAzqQ1GWvAxFktfA2xsMuNTw+BgGAHJ+ApRcACwxAAwxBgCqiNHouDQU3GgMRvrG4FBk9PgAZjgExGTKNPRMrOxcvPzCouJSMvJMSlSq6lo6BSZQcKiomJWEpORUdQqNAVxUAO6QiH7MaBTycgq9Kmqa2rpghoWmBt4MiAD0iBQMt0wB7LfXd1bbGLe29hiOWhgFxuDwaZi0AAeHAMACJ4QYAMSIyAAQQAktVZtQnBtWNt5OVGLBMKREEZUZByGsGrwSLAyIhJCRINc/OwgiFIGV4FZIOJcFZ6LDUXYHE4AELuUFEGCiWAYeAAR2w0lhkBJMhIZHQtCU9AI/IZkAA6toLMgJABmVk+dkBTkYDSQdG4VkkQK85B/cX1bCIAjMeAAL0d6Fc/G44iDofEXLYuFgimQZXwfETLJB7llM1qwSwvB80kQzrgLLZ/jd7lwFEU2EcyDSUioFnW3FE8DQrbcFHazO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iSGdymImjSjPocQiSXipotQZT0JobxyqQ1rnSzpBody3xWzwFs6E6JEL6WI+C+Bh6vQZS7hbDuDLFJ4kRoBlBZBlaC7wzI4Rgs72xbZezcDODMT/olSSSjEaB7YRyLGXioCDFCjOiigP5iHQz8hUC8i/SmLqwsjXpqRODF4ZS5pEgZQybPGvEkZmRXyyiz7eArAgEQ6y6SQcAMm7jOh8b8AZh8B8oAj4Rr6JSQFxJpjdD6ZuhYmp6kC0C6xLI0Z2E/IMZOENJqLJSsb8AeFeH0TRF+FtF8bkDtIIhab5FXA6a9LOLZS4DuI3DPBBFmQ6xVFWaLK2YrJ1r0CNEbK3StHy4KYeAkr4CyjpFhhYloS0BQS/YsrEzuY+FOYRy9CDwih6h0DqhpBDZfoZSwjJAYC9hfBv7qgjrlyRqoDsBOaQoUCOoZQ2KT5YBEgny2RApHTOo1jwDhw2TyAAACjK2QuQCE6sOaBoE49ye2kAiIcQiQzJE4tCCq7pP20pY5npsoxR/EfAchV+vYiEgCuuSgVhEpth8SE5Km2wdhLhCpbhbGPAER3hapOympJA2pmmBQBgIweiwcUw9pgZ04TQXRaAawTpTmewH8fQRwgwpwhgt5046gAA+pZIgMBb2DMUbrQMBQGNsG6NebefECQAABxlAMAADs8QaAVoAATFaBhQIAwPEAAGwACMJFdADAAAnGgLhWRWUAxTEFaGRWRThRRVaLQFEP+TeUUKyAILQARRhWgORQAKzIV0AkAxAoUCWkXxAYVsUMCiUoVkUCDUW0AoUkUxBkXSW4XUU8W8UQDKwgVgUQVVx+HQXAW5r6BAA== -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=wailsapp/wails&utm_content=4404):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jul 7, 2025
@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Jul 7, 2025
@atterpac atterpac self-assigned this Jul 7, 2025
@atterpac atterpac enabled auto-merge July 7, 2025 21:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (7)
docs/src/content/docs/learn/binding-best-practices.mdx (3)

42-50: Add missing import for time to keep the snippet compilable
The example struct uses time.Time but the snippet omits the import "time" statement. Readers copying the code will hit a compile error.

 type User struct {
+    // import "time" is required above for these fields
     ID        int       `json:"id"`

94-102: Include context import in the cancellation example
ctx comes from the standard library’s context package, but the snippet doesn’t show the import, making it non-self-contained.

-func (s *ProductService) GetProducts(ctx context.Context, req ProductsRequest) (ProductsResponse, error) {
+import "context"
+
+func (s *ProductService) GetProducts(ctx context.Context, req ProductsRequest) (ProductsResponse, error) {

58-85: Explicitly highlight data-exposure intent when converting to UserDTO
You already drop Password, UpdatedAt, etc., but stating that the DTO is intentionally minimal helps readers understand why two models exist.

Consider adding a short comment above the UserDTO declaration, e.g.

// UserDTO is the pared-down version sent to the frontend – never expose secrets!
docs/src/content/docs/learn/binding-system.mdx (2)

68-76: Warn about 64-bit integers exceeding JS safe range
uint64/int64 map to number, but JS numbers are IEEE-754 doubles with only 53 bits of integer precision. Mentioning this pitfall would save users surprise data loss.

| `int64`, `uint64` | `number`* | `number`* |

\* Values larger than 2^53-1 lose precision in JavaScript – prefer `string` or `bigint` if you need full 64-bit accuracy.

82-93: Minor punctuation tidy-up in directive list
The dash before each directive is already bullet syntax; the extra “:” after the item results in an odd pause when read aloud.

- - `//wails:inject`: Injects custom JavaScript/TypeScript code into the generated bindings
+ - `//wails:inject` – Inject custom JavaScript/TypeScript code into the generated bindings
docs/src/content/docs/learn/advanced-binding.mdx (2)

40-44: Clarify path base for //wails:include example
The example //wails:include js/*.js implicitly uses a path relative to the Go package of the directive.
Adding a short note avoids confusion for users expecting project-root semantics.

//wails:include js/*.js  // path is relative to the *current Go package*

18-24: Demonstrate language-scoped injection even in the first example
Because //wails:inject without a scope injects into all outputs, many users accidentally pollute their TS builds with plain JS snippets. Showing the scoped variant first reduces that risk.

-//wails:inject console.log("Hello from Wails!");
+//wails:inject j*:console.log("Hello from Wails!");
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 568aa66 and 0e8fc70.

⛔ Files ignored due to path filters (1)
  • docs/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • docs/src/content/docs/learn/advanced-binding.mdx (1 hunks)
  • docs/src/content/docs/learn/binding-best-practices.mdx (1 hunks)
  • docs/src/content/docs/learn/binding-system.mdx (1 hunks)
  • docs/src/content/docs/learn/bindings.mdx (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: fbbdev
PR: wailsapp/wails#4001
File: v3/internal/generator/testdata/output/lang=TS/UseInterfaces=true/UseNames=false/github.com/wailsapp/wails/v3/internal/generator/testcases/function_single_internal/greetservice.ts:0-0
Timestamp: 2025-01-15T22:33:30.639Z
Learning: In the Wails framework's TypeScript bindings, the import path "/wails/runtime.js" is intentionally absolute and should not be changed to a relative path.
Learnt from: stavros-k
PR: wailsapp/wails#3917
File: docs/astro.config.mjs:0-0
Timestamp: 2024-12-02T22:00:10.339Z
Learning: In the Wails documentation, all content under 'docs/src/content/docs' is accessible at the root path '/', so links in the sidebar configuration should not include the '/docs' prefix.
docs/src/content/docs/learn/bindings.mdx (6)
Learnt from: nixpare
PR: wailsapp/wails#3763
File: v3/examples/keybindings/main.go:16-17
Timestamp: 2024-09-20T23:34:29.841Z
Learning: In the codebase, `application.Options.KeyBindings` uses the `application.Window` type, whereas `application.WebviewWindowOptions.KeyBindings` uses `*application.WebviewWindow`. This is intentional and acceptable.
Learnt from: leaanthony
PR: wailsapp/wails#3763
File: v3/examples/window/main.go:472-475
Timestamp: 2024-10-08T22:11:37.054Z
Learning: In `v3/examples/window/main.go`, `time.Sleep` is used within a goroutine and does not block the UI thread.
Learnt from: leaanthony
PR: wailsapp/wails#3763
File: v3/examples/window/main.go:472-475
Timestamp: 2024-09-30T06:13:46.595Z
Learning: In `v3/examples/window/main.go`, `time.Sleep` is used within a goroutine and does not block the UI thread.
Learnt from: nixpare
PR: wailsapp/wails#3763
File: v3/pkg/application/application_options.go:93-93
Timestamp: 2024-10-08T22:11:37.054Z
Learning: The `KeyBindings` property of `application.Option` uses the `application.Window` type, while `application.WebviewWindowOptions` still accepts `*application.WebviewWindow`, and this is intentional.
Learnt from: popaprozac
PR: wailsapp/wails#4256
File: v2/internal/frontend/desktop/linux/notifications.go:27-28
Timestamp: 2025-04-29T23:54:07.488Z
Learning: In Wails v2, unlike v3-alpha which has a `ServiceShutdown` method for services, there is no standardized teardown pattern for frontend implementations. When implementing features that require cleanup (like goroutines or resources), add explicit cleanup methods (e.g., `CleanupNotifications()`) that handle resource release, context cancellation, and connection closure.
Learnt from: popaprozac
PR: wailsapp/wails#4256
File: v2/internal/frontend/desktop/linux/notifications.go:27-28
Timestamp: 2025-04-29T23:54:07.488Z
Learning: In Wails v2, unlike v3-alpha which has a `ServiceShutdown` method for services, there is no standardized teardown pattern for frontend implementations. When implementing features that require cleanup (like goroutines or resources), add explicit cleanup methods (e.g., `CleanupNotifications()`) that handle resource release, context cancellation, and connection closure.
docs/src/content/docs/learn/binding-best-practices.mdx (5)
Learnt from: stavros-k
PR: wailsapp/wails#3917
File: docs/src/content/docs/index.mdx:13-18
Timestamp: 2024-12-02T22:14:41.158Z
Learning: The documentation page `/learn/services` exists in `docs/src/content/docs/learn/services.md`.
Learnt from: popaprozac
PR: wailsapp/wails#4256
File: v2/internal/frontend/desktop/linux/notifications.go:27-28
Timestamp: 2025-04-29T23:54:07.488Z
Learning: In Wails v2, unlike v3-alpha which has a `ServiceShutdown` method for services, there is no standardized teardown pattern for frontend implementations. When implementing features that require cleanup (like goroutines or resources), add explicit cleanup methods (e.g., `CleanupNotifications()`) that handle resource release, context cancellation, and connection closure.
Learnt from: popaprozac
PR: wailsapp/wails#4256
File: v2/internal/frontend/desktop/linux/notifications.go:27-28
Timestamp: 2025-04-29T23:54:07.488Z
Learning: In Wails v2, unlike v3-alpha which has a `ServiceShutdown` method for services, there is no standardized teardown pattern for frontend implementations. When implementing features that require cleanup (like goroutines or resources), add explicit cleanup methods (e.g., `CleanupNotifications()`) that handle resource release, context cancellation, and connection closure.
Learnt from: leaanthony
PR: wailsapp/wails#4128
File: v3/examples/gin-service/services/gin_service.go:67-85
Timestamp: 2025-04-18T05:57:34.711Z
Learning: In Wails services (like GinService), initializing the app field in ServiceStartup rather than in the constructor is an acceptable pattern, as ServiceStartup is guaranteed to be called before any HTTP requests are handled.
Learnt from: leaanthony
PR: wailsapp/wails#4013
File: v3/examples/contextmenus/main.go:38-44
Timestamp: 2025-01-17T05:51:02.521Z
Learning: Error handling is not required in example code within the Wails repository as examples should prioritize clarity and simplicity over production-level concerns.
docs/src/content/docs/learn/binding-system.mdx (3)
Learnt from: fbbdev
PR: wailsapp/wails#4045
File: v3/internal/generator/render/templates/index.tmpl:37-37
Timestamp: 2025-02-05T11:53:01.219Z
Learning: The template `v3/internal/generator/render/templates/index.tmpl` relies on models being sorted with exported ones first, which enables breaking early when encountering non-exported models. This contract needs to be verified and documented in the codebase.
Learnt from: fbbdev
PR: wailsapp/wails#4045
File: v3/internal/generator/testcases/directives/otherpackage/js/test_t.ts:1-3
Timestamp: 2025-02-05T11:53:45.812Z
Learning: The `//wails:inject` directive in Wails enables custom code injection, allowing methods like `CustomMethod` to be injected and used in JavaScript/TypeScript files without being explicitly defined in a service.js file.
Learnt from: fbbdev
PR: wailsapp/wails#4001
File: v3/internal/generator/testdata/output/lang=TS/UseInterfaces=true/UseNames=false/github.com/wailsapp/wails/v3/internal/generator/testcases/function_single_internal/greetservice.ts:0-0
Timestamp: 2025-01-15T22:33:30.639Z
Learning: In the Wails framework's TypeScript bindings, the import path "/wails/runtime.js" is intentionally absolute and should not be changed to a relative path.
docs/src/content/docs/learn/advanced-binding.mdx (4)
Learnt from: fbbdev
PR: wailsapp/wails#4045
File: v3/internal/generator/testcases/directives/otherpackage/js/test_t.ts:1-3
Timestamp: 2025-02-05T11:53:45.812Z
Learning: The `//wails:inject` directive in Wails enables custom code injection, allowing methods like `CustomMethod` to be injected and used in JavaScript/TypeScript files without being explicitly defined in a service.js file.
Learnt from: fbbdev
PR: wailsapp/wails#4001
File: v3/internal/generator/testdata/output/lang=TS/UseInterfaces=true/UseNames=false/github.com/wailsapp/wails/v3/internal/generator/testcases/function_single_internal/greetservice.ts:0-0
Timestamp: 2025-01-15T22:33:30.639Z
Learning: In the Wails framework's TypeScript bindings, the import path "/wails/runtime.js" is intentionally absolute and should not be changed to a relative path.
Learnt from: stavros-k
PR: wailsapp/wails#3917
File: docs/src/content/docs/index.mdx:13-18
Timestamp: 2024-12-02T22:14:41.158Z
Learning: The documentation page `/learn/services` exists in `docs/src/content/docs/learn/services.md`.
Learnt from: leaanthony
PR: wailsapp/wails#4013
File: v3/examples/contextmenus/main.go:38-44
Timestamp: 2025-01-17T05:51:02.521Z
Learning: Error handling is not required in example code within the Wails repository as examples should prioritize clarity and simplicity over production-level concerns.
🪛 LanguageTool
docs/src/content/docs/learn/binding-system.mdx

[uncategorized] ~88-~88: Loose punctuation mark.
Context: ...Available Directives - //wails:inject: Injects custom JavaScript/TypeScript co...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~91-~91: Consider using a different adverb to strengthen your wording.
Context: ...ted to the frontend - //wails:ignore: Completely ignores a method during binding generat...

(COMPLETELY_ENTIRELY)


[style] ~116-~116: To form a complete sentence, be sure to include a subject.
Context: ... - t - TypeScript only - <style> can be: - * - Both classes and interfac...

(MISSING_IT_THERE)

docs/src/content/docs/learn/advanced-binding.mdx

[style] ~64-~64: Consider using a different adverb to strengthen your wording.
Context: ...Methods The //wails:ignore directive completely ignores a method during binding generat...

(COMPLETELY_ENTIRELY)


[style] ~71-~71: Consider using a different adverb to strengthen your wording.
Context: ...s similar to //wails:internal, but it completely ignores the method rather than marking ...

(COMPLETELY_ENTIRELY)

🔇 Additional comments (1)
docs/src/content/docs/learn/bindings.mdx (1)

674-674: Only newline appended – nothing to review
This hunk just adds a trailing newline after the :::caution block. No action required.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 11, 2025
@leaanthony leaanthony disabled auto-merge July 11, 2025 11:11
@leaanthony

Copy link
Copy Markdown
Member

You nuclear-grade legend! 🙏

@leaanthony leaanthony merged commit e876560 into wailsapp:v3-alpha Jul 11, 2025
9 of 10 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants