Skip to content

6.0.0

Choose a tag to compare

@ascott18 ascott18 released this 06 Oct 21:08
· 115 commits to main since this release

Breaking Changes

  • Vue 2 support has been dropped.
  • The types generated for inheritance hierarchies have changed significantly. If two or more models in a type hierarchy (i.e. a base type and a derived type) are both exposed by Coalesce, that relationship is now reflected throughout the generated DTOs, generated TypeScript, and admin pages. The generated ViewModels classes for abstract classes are now just proxies intended to be used only for loading one of the concrete implementation types.
  • StandardBehaviors.AfterDelete is now AfterDeleteAsync and has a different signature and semantics. Instead of modifying the resulting item and includeTree with ref parameters, these values can be optionally overridden by returning an ItemResult with its Object and IncludeTree properties populated with non-null values.
  • ViewModel.$getErrors now returns a string[] instead of a Generator<string>.
  • IntelliTect.Coalesce.AuditLogging now uses stored procedures by default to upsert audit log entries. You can disable this (e.g. if your application lacks permission to create/update stored procedures) by chaining .WithStoredProcedures(false) when you configure audit logging.
  • The default debounce timer for auto-saves and auto-loads on ViewModels has changed from 1000ms to 300ms.
  • The CommonJS build of coalesce-vue has been dropped - only the ESM build remains. Most projects should be unaffected.

Features

  • Added support for generating Semantic Kernel plugins from CRUD models and custom methods via the new [SemanticKernel] attribute. Semantic Kernel is a Microsoft framework that allows you to create AI Agents that can call tool functions provided by your application. This feature is in beta and may undergo breaking changes in non-major releases.
  • Added [SimpleModel] attribute to explicitly declare types as Simple Models, allowing TypeScript outputs to be generated for types that are otherwise unused by Coalesce endpoints.
  • Added a set of Roslyn analyzers to help avoid common issues and suggest improvements. These analyzers are included and enabled by default.
  • All endpoints with bodies are now sent as JSON instead of form data, with the exception of endpoints that have file parameter(s) and no other non-scalar parameters.
  • Coalesce's Vite middleware (UseViteDevelopmentServer) now checks if your installed NPM packages match what's defined in package.json and package-lock.json, presenting an in-browser warning if they do not. This helps avoid forgetting to reinstall packages after pulling down changes in multi-developer projects.
  • Const fields in C#, if annotated with [Coalesce], are now emitted into generated TypeScript.
  • System.Uri is now supported as a type, mapping to a string in TypeScript.
  • Interfaces used as parameters in Coalesce-exposed methods are now automatically injected from services, without the need to specify [InjectAttribute]. This does not include known data-like interfaces including IEnumerable, ICollection, and IFile.
  • Custom methods now support descriptions via DescriptionAttribute. These are displayed in the admin pages.
  • Added FileTypeAttribute to control allowed file types for custom method file parameters.
  • Added ClientCacheDurationSeconds property to ExecuteAttribute to customize client-side cache duration for GET custom methods with VaryByProperty.

Typescript & Vue Components

  • ViewModel.$loadCleanData() now returns the VM instance, to support call chaining.
  • ListViewModel now has shorthand properties for $search, $filter, $orderBy, and $orderByDescending.
  • ListViewModel.$orderByToggle() method added to cycle through ascending, descending, and no ordering for a field.
  • ApiCaller.useRefResponse() and ApiClient.$useRefResponse() methods added to enable System.Text.Json reference preservation handling, which can significantly reduce response payload sizes by deduplicating identical objects.
  • useBindToQueryString now automatically handles parsing of all properties of ListParameters, as well as their aliases on ListViewModel. Parsing no longer needs to be manually specified when binding to these properties.
  • useBindListParametersToQueryString: New composable for binding all of a list's parameters to the query. Use with caution, see documentation for details.
  • c-admin-audit-log-page: Added userProp prop to allow specifying a custom property name for user identification.
  • c-admin-display: Binary values now render as links that will download the value as a file, instead of only showing the length in bytes.
  • c-datetime-picker: Added prop showTodayButton
  • c-datetime-picker: Enhanced keyboard navigation support - arrow keys navigate dates/times, Tab/Shift+Tab move between date and time pickers.
  • c-input (enum): Added a filter prop for enum inputs to restrict the values available for selection.
  • c-input (string): When the input's value changes to empty string, the value is instead emitted as null. This allows a user to return a field to its default, uninitialized state as if they had never typed in the field at all, which alleviates some validation edge cases like [PhoneAttribute] not treating null and "" the same.
  • c-select: When bound to a ViewModel or ViewModelCollection, selected items are converted to ViewModel instances before being emitted so that event handlers will receive the final object instance, rather than the intermediate plain model instance.
  • c-select: Now supports binding to a non-many-to-many collection navigation property. Selecting an item will populate the foreign key of the dependent item, and deselecting an item will clear the foreign key. This mechanism is only available when using c-select directly - it is not delegated by c-input.
  • c-select: The create prop now supports a position property to control whether the create item appears at the start ('start', default) or end ('end') of the dropdown list.
  • c-select-many-to-many: The itemTitle prop now receives the existing selected middle entity instance, if there is one.
  • c-loader-status: Added show-success prop and flag to display success messages when operations complete successfully.
  • c-loader-status: Added show-retry prop and flag to display retry button for failed operations.
  • c-loader-status: Added prepend and append slots, and title and density props.
  • c-list-filters: Improved the UX of adding and modifying filters. Added the capability to show/hide columns alongside setting filters.

Fixes

  • Fix error in codegen when using JS reserved keywords or C# contextual keywords as parameter names.
  • Default search behavior when no SearchAttribute is present no longer splits on spaces. The old behavior would result in multi-word searches failing to match because the default search behavior is StartsWith, not Contains.
  • Fixed InvalidOperationException when searching on collection properties with no searchable child properties.
  • c-select now receives proper disabled styling.
  • c-select with autoselect now works reliably in dialogs.
  • c-select multiple chips are no longer removable when the input is non-interactive.
  • c-select with custom tabindex no longer focuses the outer wrapper.