v1.10
v1.10.1
Improvements
- Generate step after build is faster
- Generated assemblies are compiled in parallel and share metadata references
- Roslyn is warmed up in background while domain model is being built
- Minor breaking change:
AddDomainTypesphase is removed, domain layer now provides its configuration targets inPreparephase of buildtime layer
- Minor breaking change:
- Domain model conventions reuse model contexts instead of recreating them
for every convention
- Minor breaking change:
Traceof a model context is only available while a convention is being applied, assign it to a variable to use it in a delegate that runs later
- Minor breaking change:
- Xml documentation of domain members is looked up from an index instead of searching the whole xml file, so it no longer slows down as domain grows
- Compile errors of generated code are now reported as
compile-errordiagnostics instead of an unhandled exception- Errors of all failing assemblies are reported at once, each with the name of its generated assembly
- Minor UI improvements
- Page title icons in method form page was configured incorrectly, fixed
- Every page uses their route icon as large avatar by default
PageTitle- Its shadow was leaking to side menu, removed completely, it now has a backdrop blur
Avatarsize wasn't consistent between type and method pages, fixedWrapwas causing button to behave different under certain conditions, it is nowcontentsand completely transparent, now button with a wrapper behaves identical to a button without wrapperButton.w-fullunderSimpleFormis now removed
Bugfixes
- Page title actions were being drilled without using
page-titlein the path, fixed
v1.10.0
Features
Domain
Businessnamespace now providesValidateobject to perform business validationsFlagsEnumCodingStyleis now available that supports enums with[Flags]StatusEnumViaSuffixCodingStyleis now available that provides a status enum system using codes that are similar to HTTP status codes- Enums with
Statussuffix getSeveritiesattribute mapping their values to a severity, e.g.,2xxissuccess,4xxiswarn - Properties of a status enum type get
Statusattribute - Severities are exported to
severities.jsonand are available throughuseSeveritiescomposable - It is included in
MonolithRecipeby default
- Enums with
IExportOptionsinBaked.Bindinglets an attribute set the name it is exported with, e.g.,IdPropertyis exported as@id
Schemas and Conventions
- All component, data, action, trigger and constraint schemas now have a
parameterless constructor, so a convention can add any of them by its type,
e.g.,
conventions.AddMethodComponent<DataPanel>() - Values are no longer set while adding, they are set by edit conventions, so adding and configuring a schema are separate concerns
- Default theme provides default conventions for the schemas it adds at
Order.At.Min, so an added schema comes configured without any extra convention- To change a default, add an edit convention at default order, e.g.,
conventions.EditMethodSchema<RemoteData>(schema: rd => ...)
- To change a default, add an edit convention at default order, e.g.,
- A schema is turned into a component descriptor with
ToDescriptor(), which also acceptsdataandaction
Components
- New display components are added;
TagandAvatar- Enum properties are rendered as
Tagwith localized text by default, and status enums are colored with their severity - Page titles of routes with an icon render an
Avatarby default
- Enum properties are rendered as
Buttonnow hasDialogOptionsto render a dialog before executing its action, withDialogandConfirmmodesActionsAsButtonsrenders delete methods and methods with up tomaxParameterCountForConfirmparameters (default3) as a confirm popup
SimpleFormnow accepts aMessagecomponent to render before its inputsWrapis introduced to help wrap multi children depending on a condition- It strips out any comment node when condition is false to make sure a single child node renders on its own allowing directives to work properly
Breaking Changes
Feature Definitions
- Features are now defined with
Define()of their abstraction configurator, feature classes andXConfiguratorclasses are removed// was public class WelcomeGreetingFeature : IFeature<GreetingConfigurator> { public void Configure(LayerConfigurator configurator) { ... } } // now public static IFeature<GreetingFeature.Configurator> Welcome(this GreetingFeature.Configurator x) => x.Define(configurator => { ... });- Every abstraction now provides
Disabled(),Feature.Empty<T>()is removed - Custom themes no longer inherit
DefaultThemeFeature, they give their configuration toc.Default(configure: ...)instead
- Every abstraction now provides
Renamings
- Attributes used in conventions no longer have the
Attributesuffix, e.g.,LabelAttribute->Label. These also changed beyond the suffix;old new ControllerModelAttributeApiControllerActionModelAttributeApiActionParameterModelAttributeApiParameterActionAttributeUiActionDataAttributeUiDataDescriptionAttributeUiDescriptionRouteAttributeUiRouteApiInputAttributeBindableIdAttributeIdPropertyRichTransientAttributeResourceValueTypeAttributePrimitiveBindablemoved fromBaked.RestApi.ModeltoBaked.Binding
- Members named after a renamed attribute follow it;
old new GetControllerModel()GetApiController()TryGetControllerModel()TryGetApiController()GetActionModel()GetAction()IsApiInputIsBindableAllParametersAreApiInput()AllParametersAreBindable()TryGetLocatableAttribute()TryGetLocatable()ValueTypeUserType<T>PrimitiveUserType<T> - Coding styles are renamed to express how they detect types,
viais used when the mechanism needs naming andbasedwhen it reads as a qualifier;old new AddRemoveChildAddRemoveChildAsSubResourceClientSuffixBasedClientCommandPatternCommandViaMethodNameIdTypeBasedIdInitializableInitializableViaMethodNameLabelNameBasedLabelLocatableLocateViaIdLocatableExtensionExtensionViaLocatableInitializerQueryQueryViaPluralNameRichTransientResourceViaIdInitializerScopedBySuffixScopedViaSuffixUniqueUniqueViaSingleByValueTypePrimitiveViaParsable - Lifetime features are renamed after the lifetime they provide;
old new SingletonApplicationScopedScopeTransientInstance - Additional renamings are as below
old new Generator<T>.GeneratorGenerator<T>.GeneratorDelegateGenerator<T>.FilterGenerator<T>.FilterDelegateContextBasedComponent.FilterContextBasedComponent.FilterDelegateEntityInitializerIsPostResourceConventionEntityInitializerIsPostConventionPageContext.NewLocaleKeyPageContext.Localize
Schemas and Conventions
- Conventions that configure an existing attribute, component or schema are
renamed as edits
// was conventions.AddTypeAttributeConfiguration<Entity>(...); conventions.AddMethodComponentConfiguration<Button>(...); conventions.AddParameterSchemaConfiguration<Select>(...); // now conventions.EditTypeAttribute<Entity>(...); conventions.EditMethodComponent<Button>(...); conventions.EditParameterSchema<Select>(...); - All schemas now have a parameterless constructor, their constructor parameters
became settable properties, except that constraint and trigger properties
became
requiredPage
Pathis set from the route when it is left empty DomainComponents,DomainDatas,DomainActionsandComponentsbuilder classes are removed, their defaults are now handled by the default theme. A schema is built with its own constructor and turned into a descriptor withToDescriptor()// was using B = Baked.Ui.Components; B.Filter( options: f => f.Placeholder = l("Filter"), action: Publish.Event("filter-changed") ); B.PageTitle(options: pt => pt.LocalizeTitle = true); // now new Filter { Placeholder = l("Filter") } .ToDescriptor(action: Execute.Publish.Event("filter-changed")); new PageTitle { LocalizeTitle = true }.ToDescriptor();optionsparameters are gone,using staticandusing B =are no longer neededLabelcomponent is renamed asLabeler- Component exports are now collected from the theme assembly instead of
builder classes
// was exports.AddFromExtensions(typeof(C)); // now exports.AddFromAssembly(typeof(CustomThemeFeature));
Datas,ActionsandConstraintsbuilder classes are renamed asFetch,ExecuteandEvaluate// was using static Baked.Ui.Datas; using static Baked.Ui.Actions; using static Baked.Ui.Constraints; conventions.AddMethodComponentConfiguration<Button>(component: c => { c.Data = Remote("some/endpoint"); c.Action = Publish.Event("saved"); c.ShowWhen("state", constraint: Is("editing")); }); // now conventions.EditMethodComponent<Button>(component: c => { c.Data = Fetch.Remote("some/endpoint"); c.Action = Execute.Publish.Event("saved"); c.ShowWhen("state", constraint: Evaluate.Is("editing")); });
Components
SimpleFormno more provides a dialog mode, switch toButtonto render methods as button with a dialogDialog.Submitbecame redundant and removed, useButtonto render a dialog actionSimpleForm.AlwaysShowTitleis removed, title is rendered whenever it is set andSimpleForm.Titleis now optional
Authentication
FixedBearerTokenform posthashis now anHMAC-SHA256signature of form parameters, so that a value can no longer be shifted to another field// was base64(sha256("12" + "3" + token)) // now base64(hmacsha256(key: token, message: "amount=12&fee=3"))- Parameters are sorted by key, URL encoded as
key=valuepairs and joined with&, see Authentication for details
- Parameters are sorted by key, URL encoded as
Coding Styles
ExtensionViaLocatableInitializerCodingStyleno longer requires extension classes to have an implicit operator, any transient with an initializer that has one locatable parameter becomes an extension for itThis might make unintended classes an extension and change their API endpoint routes, removing
LocatableExtensionattribute from them, or adding another parameter to the initializer, resolves itQueryMethodCodingStyleis merged intoQueryViaPluralNameCodingStyleEntitySubclassCodingStyleis removed completely
Others
ICastsinterface andCaster.Cast()extension are removedAllowAnonymous,ClientCacheandNoTransactionnow declare[AttributeUsage], so they are no longer included in every export targetmessagesreturned fromuseValidation().validate()is now an array of validation results instead of a joined string
Improvements
Build and Domain
- Locale files were not found when build output path was customized, e.g.,
--artifacts-path, causing keys to be generated as values, fixed - C# friendly name calculation is now fully compliant with C# language standards
- It was not possible to validate records have locatables in their constructor
due to late initialization, fixed
- Records implementing
IValidatableObjectare validated once more after they are initialized, only for actions that have such parameters - Their validation results are returned as
ValidationProblemDetails, same as any other model validation error
- Records implementing
DefaultThemeFeature.JsonSettingsis now public to be used in custom themes
Authentication
FixedBearerTokenis hardened- Tokens and form post hashes are compared in constant time
- Only the leading
Bearerscheme is trimmed from authorization header, and the scheme is now case insensitive - Tokens configured with an empty value are ignored
Loading
Bake.vueimprovements- It now waits until data is loaded to show a component when there is a show
reaction in the descriptor
- It was showing the components that reacts to
showWhen: is nullcausing to render unintended components while page is loading
- It was showing the components that reacts to
- Reactions to a page context value now wait until the component writing
that value is loaded, e.g.,
DataTablewithDataLengthContextKey, seeusePageContextbelow
- It now waits until data is loaded to show a component when there is a show
reaction in the descriptor
AwaitLoadingno more shows skeleton during a reload, instead a page-wide loading indicator is displayed- Reloading a component without data was failing with
undefined is not a valid data type, now it tells which component cannot reload because it has no data
Forms and Dialogs
- Dialog mode is migrated from
SimpleFormtoButton- You can now simplify conventions by configuring methods as buttons with dialogs instead of simple form in dialog mode
- Modal form was closing before action is completed, now it executes and closes only if action is success
Execute.Publish.CloseDialog()helper is introduced to achieve the dialog close after a form actionExecute.Publish.Event()now acceptsemptyto publish an event without data
- Validation tooltip is replaced with a check list popover
Enumdefaults weren't getting camelized inInput, fixed
Look and Feel
SideMenuUI is improved to distract the user lessDefaultLayoutnow places header in a fixed area above a rounded page bodyPageTitleandButtonare made more compact, and page title is more responsive- Header now renders on home page as well,
Route.HeaderTitleis set for index route too - Buttons in
DataContaineractions are rendered small by default - Minor improvements in
components.css
Composables
useFormatnow providesasCamelCasehelper functionuseLocalizationcan now be used as a computed data throughFetch.Computed.UseLocalization(l("..."))usePageContextis introduced to read and write page context valuessetmarks a value as pending while the writing component is loading, so that reactions to it wait until it is written- Use
usePageContext({ trackLoading: false })when the value is not loaded, e.g., in actions
useContextnow providesprovidePageScopeto provide events, page context and pending values of a page at once, e.g., in a custom page or layout component
Library Upgrades
| NuGet Package | Old Version | New Version |
|---|---|---|
| Microsoft.AspNetCore.Authentication.JwtBearer | 10.0.12 | 10.0.13 |
| Microsoft.AspNetCore.Mvc.NewtonsoftJson | 10.0.12 | 10.0.13 |
| Microsoft.AspNetCore.Mvc.Testing | 10.0.12 | 10.0.13 |
| Microsoft.Data.Sqlite.Core | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.Caching.Abstractions | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.Configuration.Abstractions | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.Configuration.Binder | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.FileProviders.Abstractions | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.Localization.Abstractions | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.Logging.Abstractions | 10.0.12 | 10.0.13 |
| Microsoft.Extensions.TimeProvider.Testing | 10.10.0 | 10.11.0 |
| Microsoft.NET.Test.Sdk | 18.10.1 | 18.11.0 |
| Microsoft.Testing.Extensions.CodeCoverage | 18.11.2 | 18.12.0 |
| Microsoft.Testing.Extensions.TrxReport | 2.4.1 | 2.5.1 |
| NUnit3TestAdapter | 6.3.0 | 6.3.1 |
| Swashbuckle.AspNetCore | 10.2.3 | 10.3.0 |
| Swashbuckle.AspNetCore.Annotations | 10.2.3 | 10.3.0 |
| System.Security.Cryptography.Pkcs (transitive) | 8.0.1 | 10.0.13 |
| npm Package | Old Version | New Version |
|---|---|---|
| playwright | 1.63.0 | 1.64.1 |