Skip to content

Aspid.MVVM 1.1.0#7

Merged
VPDPersonal merged 38 commits into
mainfrom
Version/Aspid.MVVM-1.1.0
Jun 7, 2026
Merged

Aspid.MVVM 1.1.0#7
VPDPersonal merged 38 commits into
mainfrom
Version/Aspid.MVVM-1.1.0

Conversation

@VPDPersonal

@VPDPersonal VPDPersonal commented Oct 27, 2025

Copy link
Copy Markdown
Owner

Summary

Aspid.MVVM.Generators для релиза Aspid.MVVM 1.1.0: крупный апгрейд генератора, поддержка Bindable Properties, виртуальных полей биндеров с HeaderGroup, NotifyCanExecuteChangedAll(), ключевых слов в set-методах, более информативного BindSafely и крупный рефактор внутреннего кода.

Added

  • Bindable Properties — поддержка генерации в полноценном пайплайне (поля → properties, корректные #region в сгенерированном коде, Add Invocation PropertyChanged).
  • NotifyCanExecuteChangedAll() — генерируется на уровне ViewModel; обновляет CanExecuteChanged у всех RelayCommand-членов (далее починен в Fix NotifyCanExecuteChanged Generated).
  • Keyword-поддержка set-методов — генератор пропускает в сеттер пользовательские модификаторы; убран лишний this. в bindable-property сеттерах; починен генерируемый const и сами properties.
  • BindSafely / UnbindSafely — генератор всегда эмиттит owner и bindable Id (с пропуском для single-binder сценария), пополняет BinderLog контекстом view + bindable-id.
  • Виртуальные MonoBinder[]-поля + поддержка HeaderGroup (HeaderGroupAttribute / HeaderGroupStartAttribute / HeaderGroupEndAttribute) — генератор автоматически создаёт слоты под IView<TViewModel>-членов, которых нет в декларации View. Скип для ScriptableObject-наследников. Совместная работа с runtime-HeaderGroupRouter.
  • Aspid.Generators.Helper — общий helper-пакет (введён + обновлён).
  • launchSettings.json для отладки генератора.

Refactor

  • Полный рефактор BindableField, BindableCommand и связанных хелперов (см. серию Refactor коммитов).
  • Чистка Extensions/-слоя (Symbols / Declarations / Writer): удалены неиспользуемые helper'ы, упрощён SymbolExtensions.cs, мёртвый код вырезан.
  • Directory.Build.targets — общий CopyToUnity-таргет, обновлённый путь копирования под перенос Unity-проекта в Aspid.MVVM/Assets/Aspid/MVVM/.

Fixed

  • Генерация для дженерик-enum и struct (Bug/Fix-Generate-Generic-Enum-And-Struct).
  • BindAlso — корректная привязка.
  • Размер собранной DLL.

Linked PRs

Test plan

  • dotnet build Aspid.MVVM.Generators.sln собирается без ошибок.
  • dotnet test Aspid.MVVM.Generators/Aspid.MVVM.Generators.Tests/ — зелёные.
  • Перебилд → Aspid.MVVM.Generators.dll обновляется в Unity-пакете.
  • Образцы (HelloWorld / TodoList / Stats / VirtualizedList / Counter / Greeter) собираются и работают.
  • Bindable Properties: [Bind] на property корректно генерит INotifyPropertyChanged-логику.
  • NotifyCanExecuteChangedAll() обновляет все RelayCommand ViewModel'а.
  • Виртуальные поля биндеров появляются у MonoView для IView<TViewModel>-членов, [View(AutoBinderFields = false)] корректно отключает поведение.
  • HeaderGroup сворачивает поля в инспекторе и не попадает в non-DEBUG / non-UNITY_EDITOR сборки.

@VPDPersonal VPDPersonal added status: work-in-progress Draft / not ready for review needs-changelog README/CHANGELOG update required before release labels Jan 18, 2026
VPDPersonal and others added 8 commits March 5, 2026 12:51
Generated View `InitializeInternal`/`DeinitializeInternal` now forward
the View instance and the bindable member Id (`Ids.X` const) to runtime
binder helpers, so a null entry in a binders array logs the offending
View/GameObject and identifier instead of an opaque message.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The BindSafely/UnbindSafely runtime overloads for single binders
(`this T?`) do not accept owner/memberName params, so emitting them
broke compilation for any view holding a non-collection binder field.
Emit the diagnostic args only when the member resolves to a collection
overload (T[], List<T>, IEnumerable<T>).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts the IsBinderCollection split: the runtime now exposes the same
optional `owner`/`memberName` pair on single-binder overloads, so the
generator can emit a single uniform call shape regardless of binder
arity. Keeps the emitter trivial.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- VirtualBinderFields collects bindable VM members not yet declared as binder fields on a [View] type and BinderFieldsBody emits a `_<name> : MonoBinder[]` slot for each one. Opt out via [View(AutoBinderFields = false)] or by deriving from ScriptableObject.
- Propagate inspector grouping metadata from the VM: [Header], [HeaderGroup], [HeaderGroupStart], [HeaderGroupEnd] on VM members tag the corresponding generated binder fields so the editor can render foldout groups.
- Wire the collector through ViewGenerator / BinderMembersFactory / ViewData(Span) / InitializeBody / GenericInitializeView, and align Descriptions.Classes with the current Aspid.MVVM namespace for MonoBinder and AddComponentContextMenuAttribute.
…elds-And-HeaderGroup

Add virtual binder fields generation with HeaderGroup support
Update Unity copy path for MVVM folder move
@VPDPersonal VPDPersonal added type: feature New feature or capability type: refactor Internal restructuring without behavior change type: fix Bug fix area: generator Roslyn source generator labels May 22, 2026
The Sample project pinned the pre-move Assets\Plugins\Aspid\MVVM source paths via an explicit, now-stale file list, so dotnet build failed with CS2001 (missing source files). Replace the explicit list with a recursive glob over Assets\Aspid\MVVM\Source, which is Unity-independent, so the project tracks file add/remove/rename automatically.
The Sample compiles generator output that references Unity.* (profiler markers), so it only compiles inside Unity. Drop its Build.0 entries so dotnet build/test of the solution (release CI) no longer fail on it; the project still loads in the IDE.
fix(build): repair Generators.Sample headless build after package move
@VPDPersonal VPDPersonal merged commit a6b3dc1 into main Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: generator Roslyn source generator needs-changelog README/CHANGELOG update required before release status: work-in-progress Draft / not ready for review type: feature New feature or capability type: fix Bug fix type: refactor Internal restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant