You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
CollectionProviderOptions and CompositeCollectionDataSourceOptions<T> hold the optional settings of a provider and a composite: AdditionalChangeTokenProducers, which make it rebuild on a signal besides its data sources', such as a configuration reload, and the composite's CombineFunc. ICollectionProviderFactory.Create, ICollectionDataSourceFactory.CreateComposite and the CollectionProvider<TItem, TCollection> constructors each have an overload that takes them last, after owns, so these options no longer need a class derived from BaseCollectionProvider or a composite built with new. A later setting is a new property of an options type (#117, ADR-1024).
Changed
Breaking:ICollectionProvider<TItem, TCollection> is an IDisposableCollectionDataSource<TItem>, so every provider, whatever its collection type, ImmutableArray<T> and other struct collections included, passes straight to another provider or a composite as a data source. A class that implements ICollectionProvider<TItem, TCollection> itself must add ICollectionDataSource<TItem>.Collection, returning the same items as its Collection; BaseCollectionProvider already does. An owning outer provider disposes an inner provider like any other source it owns: pass owns: false, or give the outer provider CreateComposite([inner], owns: false), to keep the inner provider's lifetime your own (#116, ADR-1023).
Breaking:ICollectionProviderFactory and ICollectionDataSourceFactory gain the overloads of Create and CreateComposite without owns and with options, so a class that implements either interface must add them. The methods and constructors that had an optional owns parameter take it as a plain parameter, beside an overload without it that passes the same default, so a caller's code compiles and runs as before (#117, ADR-1024).
Breaking: every built-in source hands out a snapshot that never changes after it is returned and is safe to read from any thread, as ICollectionDataSource<T>.Collection promises. ObservableCollectionDataSource<T>.Collection returns an immutable copy of the items, taken on each change before the change token signals, instead of the ObservableCollection<T>, which its caller keeps to edit it or read it live. CompositeCollectionDataSource<T> enumerates what CombineFunc returns once per build into an immutable copy, instead of handing out a query that reads its sources again on each enumeration, and a provider over several sources hands its collection factory an immutable concatenation of their items, so a factory that returns its items as given, items => items, hands out a snapshot too (#118, ADR-1025).
Breaking:CollectionProvider<TItem, TCollection>, DefaultCollectionDataSourceFactory and DefaultCollectionProviderFactory are sealed. A class derived from CollectionProvider derives from BaseCollectionProvider<TItem, TCollection> instead and overrides CreateCollection, and one derived from a default factory implements ICollectionDataSourceFactory or ICollectionProviderFactory (#120, ADR-1026).
Breaking:NullChangeToken.Singleton is typed IChangeToken, and NullChangeToken has no public constructor, so Singleton is its one instance: replace new NullChangeToken() with NullChangeToken.Singleton (#120, ADR-1026).
Updated from project-template v0.173.0 to v0.175.0: agent workflow commands, prompts, skills and agents, the template's scripts and decision records. Every command and prompt, except execute-step, and the planner, reviewer and orchestrator agents file what a run taught as issues: problems with the template's shipped text go to the repository the new template-feedback line of AGENTS.md's Landing section names, and lessons about this project go where follow-ups sends them (ADR-0092); a plan's follow-up whose files are in another repository is filed there (ADR-0093); and the update names a package's Description or PackageTags only when the build lost it (ADR-0158).
Breaking:owns has one meaning and one default: whether a provider or a composite disposes the data sources it is given, and every overload or constructor without it passes true. A provider over several sources, CreateComposite and new CompositeCollectionDataSource<T>(...), whose Owns defaults to true, dispose their sources by default, as a provider over one source does; pass owns: false for sources the DI container or the caller still uses. BaseCollectionProvider's constructors take owns through overloads instead of an optional parameter, so a derived class that calls base(dataSources) owns them. The change departs from the template's ADR-0136 deprecate-then-remove rule and ships in 4.0.0 with the other breaking changes of epic #105 (#121, ADR-1027).
Breaking: A static or observable source disposes its items only when disposeItems is true. disposeItems replaces the owns parameter of their constructors, CreateStatic and CreateObservable, and defaults to false, so wrapping a caller's ObservableCollection<T> never disposes the caller's items; pass disposeItems: true where the source owns them (#121, ADR-1027).
Removed
Breaking:AsDataSource() and its CollectionProviderExtensions class are removed: pass the provider itself where a data source is wanted. The change departs from the template's ADR-0136 deprecate-then-remove rule, as ADR-1002 and ADR-1022 did, and ships in 4.0.0 with the other breaking changes of epic #105 (#116, ADR-1023).
Breaking:INullChangeToken and its registration by AddLiveCollections() are removed: use IChangeToken, and NullChangeToken.Singleton where a token that never signals is wanted, instead of resolving one from the container. The change departs from the template's ADR-0136 deprecate-then-remove rule and ships in 4.0.0 with the other breaking changes of epic #105 (#120, ADR-1026).