Repository navigation
docs: document automatic enum generation in binding generator - #4973
Conversation
Add dedicated Enums page covering string/integer/type-alias enums, $zero values, struct field typing, imported package enums, supported types, and limitations. Fix inaccurate enum section in Data Models page and add both Data Models and Enums to sidebar navigation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new Enums documentation page, updates the Models bindings page to show TypeScript enum output, adds sidebar navigation links for Models and Enums, and records the documentation addition in the v3 changelog. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@docs/src/content/docs/features/bindings/enums.mdx`:
- Around line 245-255: The `$zero` value table under the "The `$zero` Value"
section is missing the `bool` entry; update the table to add a row mapping
`bool` to `false` so the docs match the "Supported Underlying Types" list and
include the Go zero value for boolean enums; locate the "The `$zero` Value"
heading and the table showing Underlying Type → `$zero` Value and insert the
`bool` → `false` row.
- Around line 314-337: The example calls title.String() but services.Title has
no String method, causing a compile error; either add a String receiver on Title
in services/types.go (implement func (t Title) String() string that returns the
underlying string) or change the caller in GreetService.Greet to convert the
value directly (e.g., use string(title) when building the greeting). Update
either the Title type implementation (types.go) or the Greet method
(GreetService.Greet) so the call matches a defined symbol.
🧹 Nitpick comments (1)
docs/src/content/docs/features/bindings/enums.mdx (1)
396-403: Clarify iota limitation wording.Line 402 says iota-only constants "without explicit values" are not supported, then immediately says "Standard
iotapatterns work fine since the compiler resolves them to concrete values." These two statements may confuse readers — if the compiler resolves iota to concrete values, what exactly is the unsupported case? Consider rephrasing to clarify the distinction (e.g., iota with non-representable expressions, or iota used with unsupported types).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds documentation for Wails v3’s automatic enum detection/generation in the bindings generator, and updates navigation and existing model docs to reference the new material.
Changes:
- Adds a new dedicated Enums docs page describing Go enum patterns and generated JS/TS output.
- Updates the Data Models page’s enums subsection to reflect actual generator output and link to the new page.
- Adds Data Models and Enums links to the “Bindings & Services” sidebar navigation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/src/content/docs/features/bindings/models.mdx | Updates/clarifies the existing enums subsection and adds a cross-link to the new Enums page. |
| docs/src/content/docs/features/bindings/enums.mdx | New comprehensive documentation page for automatic enum generation, patterns, and limitations. |
| docs/astro.config.mjs | Adds missing sidebar links for Data Models and Enums under “Bindings & Services”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add bool → false to $zero value table - Fix title.String() → string(title) in imported package example - Clarify $zero defaults apply to class output, not interfaces - Improve iota limitation wording for clarity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
…pp#4973) * docs: document automatic enum generation in binding generator (wailsapp#4972) Add dedicated Enums page covering string/integer/type-alias enums, $zero values, struct field typing, imported package enums, supported types, and limitations. Fix inaccurate enum section in Data Models page and add both Data Models and Enums to sidebar navigation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add enum generation changelog entry (wailsapp#4972) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: address review feedback on enum documentation - Add bool → false to $zero value table - Fix title.String() → string(title) in imported package example - Clarify $zero defaults apply to class output, not interfaces - Improve iota limitation wording for clarity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Closes #4972
docs/src/content/docs/features/bindings/enums.mdx) covering:$zerofor Go zero values)Test plan
npm run buildin docs/ completes with no errors (151 pages built)/features/bindings/enums🤖 Generated with Claude Code
Summary by CodeRabbit