fix(v2): align generic pointer TypeScript names#5599
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
WalkthroughFixes a bug where Go generic pointer type arguments (e.g., ChangesGeneric Pointer TypeScript Name Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies" 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 |
Description
Fixes #5160.
The v2 binding generator already strips
*from generic type arguments when writingApp.d.ts, butmodels.tskept the*while deriving model class names. This madeMessage[*string]generate a binding reference toMessage_string_while the model was emitted asMessage__string_.This mirrors the same
*stripping innameTypeOf()and also deduplicates emitted models by generated TypeScript name so pointer and non-pointer generic instantiations do not produce duplicate class declarations after normalisation.Type of change
How Has This Been Tested?
Commands run:
GOWORK=off go test ./internal/binding/binding_test -run TestGenericPointerBindingsUseSameTypeNameGOWORK=off go test ./internal/binding/...GOWORK=off go test ./...GOWORK=off go run ./cmd/wails doctorI also attempted the repo-local
coderabbit --plaincheck, but thecoderabbitexecutable is not installed in this environment.Test Configuration
Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)Note: I used Codex while preparing this change, and I reviewed the final diff and ran the listed checks locally.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests