Skip to content

Releases: jibini-net/SourceGeneration

2024.03.03c - For Microcontrollers

03 Mar 21:47
Compare
Choose a tag to compare

"Rezacht Core"

Descriptor language transpiler for templated web content in C

This is a port for microcontrollers which omits

  • Reactive UI and supporting JS
  • Component action interfaces
  • Generated view controllers
  • Generated SQL data layers
  • HTML escaping and some security handling
  • Some child-parent relationship features
  • Dependency injection pipeline

Primarily, this port allows

  • Efficient concatenation of numerous strings
  • Component state variables
  • Rendering of static HTML
  • Component and sub-component rendering
  • Conditional and flow control logic

Special Notes

  • Two test components are included and an executable built from test.c demonstrating how to render components
  • Generated C sources are emitted to generated/ and are meant to be committed with your descriptor files
  • Register all new components as #include directives in generated/components.h
  • There is an issue after deleting .view files; after doing so, delete the CMake build folder to resolve "no target to build ..." errors
  • The language server must be running during the CMake build process; this can be achieved by launching a new Terminal in VSCode and running ./tools/SourceGenerator in the background
  • Component state in dynamic memory must be managed externally. Generated HTML and content from writer_t must be freed manually

Included components
tools/SourceGenerator - Source Generator language server executable
tools/rezacht.sh - Submits .view source to the language server for generation
tools/buildall.sh - Cleans generated/ then recursively finds and compiles .view files
CMake Module - Project build structure to build generated C view templates

New components

  • Language server process - Binds to the loopback interface and accepts compilation/IntelliSense requests. A shared process which provides metadata to all running instances of Visual Studio from provided sources.

Component Templates

  • HTML nodes
  • HTML node parameters
  • Inline C expressions
  • Flow control statements if(
  • Loop statements for(
  • Sub-components
  • Component immutable state
  • DOM node grouping operator <>
  • Multiline string operator <">

2024.02.18

19 Feb 01:06
Compare
Choose a tag to compare

Included components
SourceGenerator.Installer.msi - Installs the Source Generator language server
SourceGenerator.zip - Binaries for the Source Generator language server
SourceGenerator.VsAdapter.zip - Source analyzer plugin for Visual Studio projects
SourceGenerator.VsEditor.vsix - Syntax highlighting extension for Visual Studio

New components

  • Language server process - Binds to the loopback interface and accepts compilation/IntelliSense requests. A shared process which provides metadata to all running instances of Visual Studio from provided sources.
  • Visual Studio source analyzer plugin - Relies on the language server to provide generated source from project sources in VS.
  • Visual Studio syntax highlighting extension - Relies on the language server to provide span classifications for source in the VS editor.

Datalayer generation

  • Table schema fields
  • DTO class types
  • Partial sub-class types
  • Stored procedure repositories
  • SQL Server JSON results
  • Service interfaces
  • Backend service wrapper
  • HTTP client for frontend
  • Parameter splatting from DTO type

Reactive components

  • HTML nodes
  • HTML node parameters
  • HTML node nicknaming (alias)
  • Inline C# expressions
  • Flow control statements if(
  • Loop statements for(/foreach(
  • Sub-components
  • Component state
  • Component action interfaces
  • Generated view controllers
  • Minimal JS dispatch function
  • Component child content child(
  • Dependency injection inject(
  • Parent state access parent(
  • DOM node grouping operator <>
  • Multiline string operator <">
  • Unescaped content unsafe(

Source analyzer plugin

  • Generated model sources
  • Generated view sources
  • Dependency injection utility functions
  • Implements socket interface to language server

Syntax highlighting extension

  • Delimiter and identifier classifications
  • Full document re-highlighting
  • Throttled updates based on user input events
  • Implements socket interface to language server