Write modern mobile and web apps in C#. Run them anywhere in JavaScript with Bridge.NET.
JavaScript C# TypeScript CSS PowerShell Batchfile
Latest commit e8d15ae Sep 9, 2016 @LeonidVeriga LeonidVeriga committed on GitHub [1731] Troubleshoot Compiler test 11 (generateTypeScript) on Mono (#1777
)

[1731] Relocate Compiler test 11 reference folder
[1731] Enable Compiler Test 11 for Mono
Compiler test logger level = Trace
[skip ci] Remove Compiler Test 11 project (will be added/relocated later as there is a strange issue with path casing)
Restore Compiler Test 11 under correct path casing
Nice-to-have - trim `\` in path
Compiler test logger level = Warn
[skip ci] Try to remove these stuck Compiler Test 11 files
Restore Compiler Test 11 in correct path casing
Add missing d.ts files
Revert "Nice-to-have - trim `\` in path"
This reverts commit 6b1cad5.
Permalink
Failed to load latest commit information.
.build Bridge.Console (#1762) Sep 8, 2016
.github Removal of [Ready] attribute from template Jun 28, 2016
.nuget [1482] [1719] Bridge project building on Mac + Linux (#1724) Sep 4, 2016
.vscode [1482] [1719] Bridge project building on Mac + Linux (#1724) Sep 4, 2016
Bridge [1751] Remove IgnoreAttribute class (#1773) Sep 9, 2016
Compiler [1731] Troubleshoot Compiler test 11 (generateTypeScript) on Mono (#1777 Sep 9, 2016
Html5 Fixes Document.Body and Document.DocumentElement return types (#1772) Sep 9, 2016
PostBuild Transpiled renaming (#1760) Sep 6, 2016
Tests [#1722] Client test for issue Incorrect delegate creation of generic … Sep 9, 2016
packages [#947] Remove /* global Bridge */ statement from .js output Feb 15, 2016
.gitattributes Set files with the 'dat' extension to be treated as binary. [#488] Sep 22, 2015
.gitignore [1723] Throw exception if class was already defined (#1726) Sep 1, 2016
.travis.yml [1482] [1719] Bridge project building on Mac + Linux (#1724) Sep 4, 2016
Bridge.NoTest.sln Transpiled renaming (#1760) Sep 6, 2016
Bridge.sln Transpiled renaming (#1760) Sep 6, 2016
Gruntfile.js [1482] [1719] Bridge project building on Mac + Linux (#1724) Sep 4, 2016
LICENSE Update year Feb 24, 2016
README.md Fix [#1503] Remove `[Ready]` and add `$entryPoint: true` in sample in… Jul 12, 2016
appveyor.yml [AppVeyor] [skip ci] Empty email notification list; Slack is enough Sep 9, 2016
package.json [1482] [1719] Bridge project building on Mac + Linux (#1724) Sep 4, 2016

README.md

Bridge.NET - C# to JavaScript Compiler

Join the chat at https://gitter.im/bridgedotnet/Bridge

Bridge.NET is an open source C#-to-JavaScript Compiler.

Compile your C#...

Console.WriteLine("Hello, World!");

into JavaScript

console.log("Hello, World!");

TL;DR

Getting Started

A great place to start if you're new to Bridge.NET is reviewing the Getting Started Knowledge Base article.

The easiest place to see Bridge in action is Live Bridge.

Sample

The following code sample demonstrates a simple App.cs class that will run automatically on page load and prompt with an alert message.

using Bridge;
using Bridge.Html5;

namespace Demo
{
    public class App
    {
        public static void Main()
        {
            // Simple alert() to confirm it's working
            Window.Alert("Success");
        }
    }
} 

The C# class above will be compiled into JavaScript and added to /Bridge/ouput/demo.js within your project. By default, Bridge will use the Namespace name as the file name. In this case: demo.js. There are many options to control the output of your JavaScript files, and the Attribute Reference is an important Knowledge Base article to review.

Bridge.define('Demo.App', {
    statics: {
        config: {
            init: function () {
                Bridge.ready(this.main);
            }
        },
        main: function () {
            // Simple alert() to confirm it's working
            window.alert("Success");
        }
    },
    $entryPoint: true
}); 

Installation

A full list of installation options available at bridge.net/download/, including full support on Windows, Mac OS and Linux for Visual Studio Code and Mono Develop.

Bridge for Visual Studio

If you're using Visual Studio, the best way to get started is by adding the Bridge.NET for Visual Studio extension.

From within Visual Studio, go to the Tools > Extensions and Updates....

Visual Studio Extensions and Updates

From the options on the left side, be sure to select Online, then search for Bridge. Clicking Download will install Bridge for Visual Studio. After installation is complete, Visual Studio may require a restart.

Bridge for Visual Studio

After installation, you will have a new Bridge.NET project type. When creating new Bridge enabled projects, select this project type.

NuGet

Another option is installation of Bridge into a new C# Class Library project using NuGet. Within the NuGet Package Manager, search for Bridge and click to install.

Another NuGet option is installing Bridge via the NuGet Command line. Run the following command:

Install-Package Bridge

More information regarding Nuget package installation for Bridge is available in the Knowledge Base.

Contributing

Interested in contributing to Bridge? Please see CONTRIBUTING.md.

We also flag some Issues as up-for-grabs. These are generally easy introductions to the inner workings of Bridge, although are items we just haven't had time to implement. Your help is always appreciated.

Testing

Bridge is continually tested and the full test runner is available at http://testing.bridge.net/.

Credits

Bridge is developed by the team at Object.NET. Frameworks and Tools for .NET Developers.

License

Apache License, Version 2.0

Please see LICENSE for details.