Topside

screenshot of Topside

Type-safe templates for server-side TypeScript applications inspired by Laravel Blade

Overview

Topside is an innovative templating language and compiler designed to enhance TypeScript applications by incorporating type-safety into the front-end view layer. Common issues in web development, particularly those related to unsafe templates, can lead to typos and errors that are difficult to identify and refactor. With Topside, these problems are tackled head-on through rigorous type checking, allowing developers to catch mistakes during the compilation stage.

This powerful tool is particularly well-suited for server-side rendering, making it ideal for server-only or hybrid applications where a significant portion of the view is generated on the server. Although it should not be seen as a replacement for established front-end frameworks like Vue or React, Topside effectively fills the gaps in type safety, making it an essential addition for TypeScript developers.

Features

  • Type-Safety Integration: Topside introduces type checking directly into the view layer, catching common mistakes before runtime.
  • Enhanced Editor Support: Enjoy type-based autocompletion, definitions lookup, and assisted refactoring when using compatible editors like VSCode.
  • Server-Side Rendering Focus: Specifically designed for applications where rendering occurs on the server, enabling efficient template generation.
  • Blade Syntax Compatibility: While not fully compatible, Topside allows for easy conversion from Blade syntax, making it accessible for Laravel users.
  • Parameter Declaration: All template parameters must be declared with the @param directive, ensuring that developers maintain type integrity.
  • Directives for Display: Use the @ directive for displaying JavaScript expressions, with HTML values being automatically escaped for security.
  • Ongoing Development: Continuous improvements are being made, with a focus on enhancing tooling and IDE integration for a better user experience.
template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.