Write modern mobile and web apps in C#. Run them anywhere in JavaScript with Bridge.NET.
C# JavaScript TypeScript PowerShell Batchfile HTML
Latest commit 80a7ce3 Jan 9, 2017 @vladsch vladsch committed with LeonidVeriga [2140] Enum value (number) is emitted for '[Enum(Emit.Name)]' attribu…
…te. (#2173)

* [2140] Enum value (number) is emitted for '[Enum(Emit.Name)]' attribute.

* Update client test output

* [2140] Compiler Test 18

* [2140] Optimization:remove redundant braces

* [2140] Update Client Tests output

* [2140] Restore Compiler Test 18

* [2140] Fix some unit tests generated code

* [2140] Update Client Test output
Permalink
Failed to load latest commit information.
.build Update Batch1,2,3,4 projects with new references to Bridge.Test.Core,… Dec 15, 2016
.github Updated Template to include sample link to Deck Sep 29, 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 [2140] Enum value (number) is emitted for '[Enum(Emit.Name)]' attribu… Jan 9, 2017
Compiler [2140] Enum value (number) is emitted for '[Enum(Emit.Name)]' attribu… Jan 9, 2017
Html5 [2034] Window.OnError wrong arguments (#2041) Nov 13, 2016
PostBuild [2027] ToString fails for enum values when concatenating with another… Nov 7, 2016
Tests [2140] Enum value (number) is emitted for '[Enum(Emit.Name)]' attribu… Jan 9, 2017
packages [2183] Reflection metadata is added to referencing assemblies (#2193) Jan 6, 2017
.gitattributes [2015] Resource encoding and new North theme (#2016) Nov 2, 2016
.gitignore [1869] Generic type definition should be shared (not type with argume… Sep 26, 2016
.travis.yml [CI] Commit labels to control build (#2104) Nov 28, 2016
Bridge.Dev.sln [2136] Set ExternalAttribute on Assembly (#2153) Dec 11, 2016
Bridge.sln [1836] Rename Bridge .sln files (#1860) Sep 19, 2016
Gruntfile.js [2076] Javascript Global Namespace Pollution for linq.js (#2087) Nov 25, 2016
LICENSE.md Update to use full Apache 2.0 LICENSE Oct 5, 2016
README.md Fixed broken LICENSE links Dec 14, 2016
appveyor.yml Bump15.6 (#2166) Dec 12, 2016
package.json [1482] [1719] Bridge project building on Mac + Linux (#1724) Sep 4, 2016

README.md

Bridge.NET - C# to JavaScript Compiler

Build status Build Status NuGet Status Join the chat at https://gitter.im/bridgedotnet/Bridge

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

Compile your C#...

Window.Alert("Hello, World!");

into JavaScript

window.alert("Hello, World!");

Run the sample above at Deck.NET.

TL;DR

Getting Started

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

The easiest place to see Bridge in action is Deck.NET.

Sample

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

Example (Deck)

public class Program
{
    public static void Main()
    {
        Console.WriteLine("Hello World!");
    }
}

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.assembly("Demo", function ($asm, globals) {
    "use strict";

    Bridge.define("Demo.Program", {
        $main: function () {
            Bridge.Console.log("Hello World!");
        }
    });
});

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

Once installation is complete 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.

Bridge can also be installed using the NuGet Command Line tool by running the following command:

Install-Package Bridge

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

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, and are items we just haven't had time to implement. Your help is always appreciated.

How to Help

We need your help spreading the word about Bridge. Any of the following items will help:

  1. Star bridge project on GitHub
  2. Leave a review on Visual Studio Gallery
  3. Blog about Bridge.NET
  4. Tweet about @bridgedotnet
  5. Start a discussion on Reddit
  6. Answer Bridge related questions on StackOverflow
  7. Give a local usergroup presentation on Bridge
  8. Give a conference talk on Bridge
  9. Provide feedback (forums, GitHub or email)
  10. Vote for Bridge.NET on UserVoice

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.