Coder Social home page Coder Social logo

domaindevs / bootsharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elringus/bootsharp

0.0 0.0 0.0 3.87 MB

Compile C# solution into single-file ES module with auto-generated JavaScript bindings and type definitions

Home Page: https://bootsharp.com

License: MIT License

Shell 0.19% C# 84.80% PowerShell 0.40% TypeScript 14.61%

bootsharp's Introduction

Bootsharp


nuget codefactor codecov codeql


Use C# in web apps with comfort

Bootsharp streamlines consuming .NET C# apps and libraries in web projects. It's ideal for building web applications, where domain (backend) is authored in .NET C#, while the UI (frontend) is a standalone TypeScript or JavaScript project. Think of it as Embind for C++ or wasm-bindgen for Rust.

Features

✨ High-level C# <-> TypeScript interop

πŸ“¦ Embeds binaries to single-file ES module

πŸ—ΊοΈ Works in browsers and JS runtimes (Node, Deno, Bun)

⚑ Generates bindings and types over C# interfaces

🏷️ Supports interop over object instances

πŸ› οΈ Allows customizing emitted bindings

πŸ”₯ Supports WASM multi-threading, AOT, trimming

🎬 Get Started

https://bootsharp.com/guide/getting-started

Why not Blazor?

In contrast to solutions like Blazor, which attempt to bring the entire web platform inside .NET, Bootsharp facilitates high-level interoperation between C# and TypeScript, allowing to build the UI layer under its natural ecosystem using industry-standard tooling and frameworks, such as React and Svelte.

Why not System.JavaScript?

Bootsharp itself is built on top of System.Runtime.InteropServices.JavaScript introduced in .NET 7.

If you're looking to expose simple library API to JavaScript and don't need type declarations, Bootsharp would probably be an overkill. However, .NET's interop is low-level, doesn't support passing custom types by value and requires lots of boilerplate to author the bindings. It's impractical for large API surfaces.

With Bootsharp, you'll be able to just feed it your domain-specific interfaces and use them seamlessly from the other side, as if they were originally authored in TypeScript (and vice-versa). Additionally, Bootsharp provides an option to bundle all the binaries into single-file ES module and patches .NET's internal JavaScript code to make it compatible with constrained runtime environments, such as VS Code web extensions.

bootsharp's People

Contributors

elringus avatar cadbimdeveloper avatar skleni avatar promontis avatar thomasrockhu-codecov avatar aragas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.