Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@serenity-is/corelib

serenity-is1.9kMIT9.0.0TypeScript support: included

Serenity Core Library

serenity, business, application, framework

readme

Serenity Core Library (Classic UI)

This is the package containing core TypeScript classes and functions used in Serenity applications.

The main entry for the NPM package is @serenity-is/corelib. This should be installed by default in your projects created from Serene or StartSharp template:

{
  "dependencies": {
    // ...
    "@serenity-is/corelib": "./node_modules/.dotnet/serenity.corelib"
  }
}

If you have "./node_modules/.dotnet/serenity.corelib" in the version value, it means you are using this library directly via the Serenity.Corelib NuGet package reference in your project file instead of NPM. This is recommended to avoid version inconsistencies.

If you have a version number for this package in package.json, it should be equal or as close as possible to Serenity NuGet package versions in your project file.

changelog

9.0.0 (2025-09-15)

Features

  • Type registration via decorators (e.g., Decorators.registerClass, Decorators.registerEditor, etc.) is now deprecated (it still works but is not recommended):

      import { Decorators, Widget } from "@serenity-is/corelib";
    
      @Decorators.registerClass("MyProject")
      export class MyType extends Widget<any> {
      }

    Instead, use a static [Symbol.typeInfo] property declaration:

      import { Widget } from "@serenity-is/corelib";
    
      export class MyType extends Widget<any> {
          static [Symbol.typeInfo] = 
              this.registerClass("MyProject.MyModule.MyType");
      }

    This new approach offers several advantages over decorators. Most importantly, decorator information is not emitted by TypeScript in declaration files (e.g., .d.ts), making it difficult or impossible to identify registration names for referenced project/npm package types.

    Another reason for this change is a longstanding bug in esbuild (see issue) with decorators and property initializers, which currently only has a workaround by using experimentalDecorators: true in tsconfig.json.

    The new registration methods also support passing interfaces or attributes as an array in the second argument. For example, to set `@Decorators.panel(true)` on a class, you can do:

      import { Widget, PanelAttribute } from "@serenity-is/corelib";
    
      export class MyType extends Widget<any> {
          static [Symbol.typeInfo] = 
              this.registerClass("MyProject.MyModule.MyType", 
                  [new PanelAttribute(true)]);
      }

    Note: When using this new registration method, TypeScript will not allow any decorators on the containing type, as the this expression is referenced in a static field initializer. If you need to use third-party decorators, you can use an alternative registration style:

      import { Widget, classTypeInfo, registerType } from "@serenity-is/corelib";
    
      @someCustomDecorator("test")
      export class MyType extends Widget<any> {
          static [Symbol.typeInfo] = 
              classTypeInfo("MyProject.MyModule.MyType"); 
          static { registerType(this); }
      }

    This is equivalent to this.registerType, as the registerType static method in Widget calls classTypeInfo and registerType internally.

    This style is also useful for formatter registration, as formatters typically do not have a base type and cannot simply call this.registerType like widget subclasses:

      export class MyFormatter implements Formatter {
          static [Symbol.typeInfo] = 
              formatterTypeInfo("MyProject.MyModule.MyFormatter"); 
          static { registerType(this); }
      }

    For consistency, you may also choose to extend the new FormatterBase class:

      export class MyFormatter extends FormatterBase implements Formatter {
          static [Symbol.typeInfo] = 
              this.registerFormatter("MyProject.MyModule.MyFormatter");
      }

    For all registration styles, you can now pass only the namespace ending with a dot (the enclosing type name will be auto-appended):

      import { Widget } from "@serenity-is/corelib";
    
      export class MyType extends Widget<any> {
          static [Symbol.typeInfo] = this.registerClass("MyProject.MyModule.");
      }

    Sergen / Serenity.Pro.Coder now also generates namespace constants under the Modules/ServerTypes/Namespaces.ts file, so you can use them to avoid typos:

      import { Widget } from "@serenity-is/corelib";
      import { nsMyModule } from "../../ServerTypes/Namespaces";
    
      export class MyType extends Widget<any> {
          static [Symbol.typeInfo] = this.registerClass(nsMyModule);
      }

    We hope this will reduce mistakes when renaming classes or using a namespace with mismatched casing.

  • Added an EditLink function that can be used instead of SlickHelpers.itemLink with JSX elements. The DataGrid also has an EditLink arrow function for use in formatters.

  • The row type itself is now used as the base row type if a row type is passed to the PropertyItemProvider.
  • Imports generated by ServerTypingsGenerator are now ordered and organized.
  • You can now pass formatterType by reference in PropertyItem.
  • Added a value argument to the Validator.optional method, allowing validation methods to be called without an element—just a value—when desired.
  • Adjusted the Validator's onfocusout method: if a required input is cleared and loses focus, it is still validated if it has a "required" rule. Otherwise, errors were not shown until the form is saved.
  • Introduced a new Inline Editing sample in the Grid Editor (StartSharp).
  • Added new options and improved features in GridEditController (StartSharp):
    • New getPropertyItem option to optionally override the column item.
    • The bulkSaveHandler option now works.
    • The saveHandler callback receives an args argument with a defaultHandler property, allowing you to call the default save handler when needed.
  • Splitted WizardDialog's renderContents method into renderButtons, renderCancelButton, renderBackButton, renderNextButton etc. to make it easier to modify/inject content (StartSharp)

8.8.9 (2025-09-03)

Features

  • Extract commit ID from assembly / nuget package generated by SourceLink and use that instead of master branch to link to source files for demo
  • Containg folder name of several projects are changed (for example Serenity\src\web\Serenity.Net.Web.csproj instead of Serenity\src\Serenity.Net.Web\Serenity.Net.Web.csproj). This may only affect you if you are using Serenity via submodules.
  • Updated OpenIddict to 7.0.0

Bugfixes

  • Use Fluent.addClass as opt.cssClass passed to quick filter element might contain spaces

8.8.8 (2025-08-23)

Features

  • Added Html.CspNonce() helper function and made it possible to optionally enable CSP by uncommenting and adjusting Content-Security-Policy meta element in _LayoutHead.cshtml
  • Also register addon option values as local text keys if they match the candidate regex
  • Run TSBuild target before ResolveProjectStaticWebAssets abd clean content items to resolve issues with static web assets issues in NET9 SDK.
  • Add npmCopy helper function to tsbuild that copies files under node_modules/ to wwwroot/npm/ folder. Used it to copy flatpickr, moment, chartjs and other scripts used in DashboardIndex to wwwroot/npm for use in appsetting.bundles.json. The entries in appsettings.bundles.json that start with ~/npm/ will be automatically copied from node_modules/ to wwwroot/npm/ by default.
  • Add Modules/*/.mts to default entry points
  • Add ability to localize input add-ons text/hint if the value is a local text key
  • Converted UI samples to use .tsx instead of .cshtml files
  • Exception Log page is now using Administration:ExceptionLog permission instead of Administration:Security permission.
  • Updated .NET libraries including:
    • ASP.NET Core framework packages to 9.0.8
    • ClosedXML to 0.105.0
    • FirebirdSql.Data.FirebirdClient to 10.3.3
    • FluentMigrator to 7.1.0
    • Microsoft.Data.SqlClient to 6.1.1
    • Microsoft.TypeScript.MSBuild to 5.9.2
    • NUglify to 1.21.17
    • Npgsql to 9.0.3
    • SixLabors.ImageSharp to 2.1.11
  • Updated NPM packages including:
    • chart.js to 4.5.0
    • dompurify to 3.2.6
    • esbuild to 0.25.9
    • glob to 11.0.3
    • preact to 10.27.1
    • typescript to 5.9.2
    • vitest to 3.2.4
  • **[Breaking Change]** Split IInsertLogRow into IInsertDateRow and IInsertUserRow subinterfaces. Split IUpdateLogRow similarly. Replace IInsertLogRow.InsertUserIdField with IInsertUserIdRow.InsertUserIdField, IUpdateLogRow.UpdateUserIdField with IUpdateUserIdRow.UpdateUserIdField, IInsertLogRow.InsertDateField with IInsertDateRow.InsertDateField, and IUpdateLogRow.UpdateDateField with IUpdateDateRow.UpdateDateField if you implemented these interfaces in your rows
  • [Breaking Change] Removed following scripts from Serenity.Assets. If you still need these legacy scripts (e.g. in appsettings.bundles.json) you may install them via npm / libman.json or use them via CDN:

    • jquery.colorbox (prefer glightbox from npm, we use it in StartSharp now)
    • jquery.cookie
    • jquery.event.drag
    • jquery.maskedinput
    • jquery-ui
    • jquery-ui-i18n
    • jspdf (if not available, PDFExportHelper will try to load it from CDNJS by default)
    • jspdf.autotable (if not available, PDFExportHelper will try to load it from CDNJS by default)
  • [Breaking Change] Removing ckeditor from Serenity.Assets. HtmlContentEditor will load it (v4.22.1) from CDNJS by default. Please remove line HtmlContentEditor.CKEditorBasePath = "~/Serenity.Assets/Scripts/ckeditor/" from ScriptInit.ts.

Bugfixes

  • Resolve issue with multiple file drag drop on uploader due to event.dataTransfer.items array getting lost during async call
  • Disable each individual radio button for RadioButtonEditor when switching read only, closes #7372
  • Fix extending entry points with "+" does not work in tsbuild

8.8.6 (2025-05-31)

Features

  • A new Interface source generator that may automatically generate relevant service handler interfaces for handler types with [GenerateInterface] attribute.
  • Update esbuild to 0.25.5. Warning! Please set "experimentalDecorators": true in your tsconfig.json as esbuild has an unresolved bug with decorators and initializers (https://github.com/evanw/esbuild/pull/4092). You may have script errors otherwise!
  • Introduced experimental DateOnlyField type. This required changing target framework of Serenity.Net.Services to net8 (was netstandard2.1).
  • Add Oracle-specific SQL type mappings to SqlTypeToFieldTypeMap (#7363)
  • Add support for partial properties for row fields source generator (requires NET9+)

Bugfixes

  • Also invalidate UserRole / UserPermission cache group when saving user as LinkingSetRelation might be updating roles

8.8.5 (2025-03-09)

Features

  • Update SixLabors.ImageSharp to 2.1.10

Bugfixes

  • Fix quoting of UPPER field expression for case sensitive like dialects

8.8.4 (2025-03-05)

Features

  • Add ability to intercept some SQL operations done through SqlHelper and EntityConnectionExtensions by implementing ISqlOperationInterceptor and/or IRowOperationInterceptor in the mock connection class.
  • Switched to vitest from jest for javascript tests
  • Try to avoid issue when StringField reads value via Newtonsoft.Json and a DateTime token is received
  • Updated nuget/npm packages
  • New writeIfChanged option in tsbuild to accelerate builds in VS
  • Also allow DefaultHandler(false) to skip a handler when multiple handlers for a type is found
  • AuthorizeRetrieveAttribute that may be used for endpoint Retrieve methods
  • Go back to StackExchange.Exceptional from our temporary fork (Serenity.Exceptional.AspNetCore) as in 3.0.1 version they also switched to Microsoft.Data.SqlClient

Bugfixes

  • Fix PasswordStrengthValidator not correctly validating MembershipSettings.RequireDigit rule (#7306)

2024

All Serenity versions published in the year 2024 (versions 8.2.1 through 8.8.3) can be found in changelog-2024.md.

2023

All Serenity versions published in the year 2023 (versions 6.4.3 through 8.1.5) can be found in changelog-2023.md.

2022

All Serenity versions published in the year 2022 (versions 5.1.2 through 6.4.2) can be found in changelog-2022.md.

2021

All Serenity versions published in the year 2021 (versions 5.0.20 through 5.1.1) can be found in changelog-2021.md.

2020

All Serenity versions published in the year 2020 (versions 3.10.0 through 3.14.5) can be found in changelog-2020.md.

2019

All Serenity versions published in the year 2019 (versions 3.8.4 through 3.9.14) can be found in changelog-2019.md.

2018

All Serenity versions published in the year 2018 (versions 3.3.15 through 3.8.3) can be found in changelog-2018.md.

2017

All Serenity versions published in the year 2017 (versions 2.8.0 through 3.3.14) can be found in changelog-2017.md.

2016

All Serenity versions published in the year 2016 (versions 1.8.19 through 2.7.2) can be found in changelog-2016.md.

2015

All Serenity versions published in the year 2015 (versions 1.4.7 through 1.8.18) can be found in changelog-2015.md.

2014

All Serenity versions published in the year 2014 (versions 1.3.0 through 1.4.6) can be found in changelog-2014.md.