Serenity Application Platform
repository·master·Indexed 25 days ago
https://github.com/serenity-is/serenityAn ASP.NET Core and TypeScript application platform for building data-centric business applications using a service-based architecture. The platform includes @serenity-is/corelib for core TypeScript classes and @serenity-is/domwise, a library that allows using JSX syntax to create and manage DOM elements without a Virtual DOM, featuring integration with @preact/signals-core for fine-grained reactivity.
What's inside Serenity
- Serenity is an ASP.NET Core and TypeScript application platform optimized for building data-centric business applications. It utilizes a service-based architecture designed to reduce boilerplate code, minimize repetitive tasks, and implement software design best practices to lower maintenance costs.
Overview of Serene (Serenity Application Template)
masterSerene is the Serenity Application Template provided as a VSIX extension. It is designed to help developers quickly bootstrap new projects using the Serenity Application Platform.Overview of SleekGrid
masterSleekGrid is a modern Data Grid / Spreadsheet component written in TypeScript with ES6 modules. It is a complete rewrite of the original SlickGrid and includes features and fixes from the 6pac fork.
Key characteristics:
- Works without jQuery or jQuery UI (though it can utilize them for column ordering and resizing if they are available in the global namespace).
- Provides backward compatibility with the original SlickGrid via compatibility files located in the
dist/compatdirectory.
Use the TypeScript Scanner and Parser (AST) Implementation
masterThis project provides a C# implementation of the TypeScript Compiler's Scanner and Parser modules. It is designed for use in .NET source generators to obtain an Abstract Syntax Tree (AST) of TypeScript files directly within the .NET runtime, eliminating the need for a JavaScript runtime like Node.js. It is highly performant, specifically optimized for the requirements of source generators.Quickstart: Create a new Serene project
masterTo create a new Serenity application using the Serene template, follow these steps. Ensure you have the necessary prerequisites installed before starting.
- Install or update the
Serene.Templatespackage using the dotnet CLI. - Create a new project named
MySereneAppusing theserenetemplate. - Navigate to the web project directory:
MySereneApp/MySereneApp.Web. - Install the required NPM packages.
- Build and run the project using
dotnet run.
Once running, you can access your application at
http://localhost:5000(the port may vary; check your console output).# Install/Update Serene.Templates package. dotnet new install Serene.Templates # Create a new Serene project. dotnet new serene -n MySereneApp # Navigate into your project folder. cd MySereneApp/MySereneApp.Web # Install NPM packages. npm i # Build and run the project. dotnet run- Install or update the
Migrate font assets for Serene users (v8.7.0)
masterVersion 8.7.0 removed legacy font assets. Serene users must update their
appsettings.bundles.jsonto use the new paths:- Open Sans: Replace
~/Serenity.Assets/Content/font-open-sans.csswith~/Serenity.Assets/fonts/open-sans/open-sans.css. - Font Awesome: Replace
~/Serenity.Assets/Content/font-awesome.csswith~/Serenity.Assets/line-awesome/css/line-awesome-fa.min.css(this switches the project to Line Awesome).
- Open Sans: Replace
Configure JSX for DomWise
masterTo use JSX with DomWise, you must configure your TypeScript environment to use the DomWise JSX factory. Set yourjsxImportSourceto@serenity-is/domwisein yourtsconfig.json.Migrate to new Controller and Endpoint naming conventions
masterAs of version 6.6.0, Serenity has standardized naming conventions for controllers and endpoints to improve consistency:
- Pages: Rename page controllers to use the
Page.cssuffix instead ofController(e.g.,XYZPage.cs). - Service Endpoints: Rename service endpoint controllers to use the
Endpoint.cssuffix (e.g.,XYZEndpoint.cs). - Base Class Change:
ServiceEndpointnow derives fromControllerBaseinstead ofController. If you were returning views from a service endpoint, you must move that logic to a standard controller.
Sergen and Pro.Coder are updated to support these new suffixes.
- Pages: Rename page controllers to use the
Update tsconfig.json for ES6 Promise support
masterIn version 6.1.0, the globalPromiseinterface augmentation was removed. If your code usesPromise.resolveor similar, you must update yourtsconfig.jsontarget toES6.Update jQuery includes in appsettings.bundles.json
masterIn version 6.4.0, the location of jQuery changed. You must update your includes inappsettings.bundles.jsonto point toSerenity.Assets/jquery/jquery.jsinstead of the old pathSerenity.Assets/Scripts/jquery-3.5.1.js.Enable advanced filtering in Grids
masterTo enable advanced, customizable filtering (including grouping and/or logic) in a grid, add the[Filterable]attribute to your grid class. This introduces theFilterPanelwidget.Enable local sorting on remote views
masterTo enable local sorting for in-memory grid editors on remote views, override thegetViewOptionsmethod and setlocalSorttotrue.