All Projects → aspnet → Javascriptservices

aspnet / Javascriptservices

Licence: apache-2.0
[Archived] This repository has been archived

Programming Languages

C#
18002 projects
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects
powershell
5483 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to Javascriptservices

Basicmiddleware
[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 170 (-94.53%)
Mutual labels:  aspnet-product
Kestrelhttpserver
[Archived] A cross platform web server for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 2,643 (-14.96%)
Mutual labels:  aspnet-product
RaspberryPi.Template
An empty project template for dotnet core IoT applications deployed to the RaspberryPi.
Stars: ✭ 29 (-99.07%)
Mutual labels:  dotnet-template
Extensions
.NET APIs for commonly used programming patterns and utilities, such as dependency injection, logging, and configuration.
Stars: ✭ 2,188 (-29.6%)
Mutual labels:  aspnet-product
Diagnostics
[Archived] Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 213 (-93.15%)
Mutual labels:  aspnet-product
Coherence
A build that verifies that all the packages form a consistent graph.
Stars: ✭ 30 (-99.03%)
Mutual labels:  aspnet-product
Universe
[Archived] Repo for building the entire ASP.NET and Entity Framework stack. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 160 (-94.85%)
Mutual labels:  aspnet-product
EventNotification
[Archived] Event notification system for broadcasting application state and configuration. Project moved to https://github.com/aspnet/Extensions
Stars: ✭ 43 (-98.62%)
Mutual labels:  aspnet-product
Signalr
[Archived] Incredibly simple real-time web for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 2,401 (-22.75%)
Mutual labels:  aspnet-product
PlatformAbstractions
OBSOLETE - used only for 1.0/1.1 patch builds
Stars: ✭ 22 (-99.29%)
Mutual labels:  aspnet-product
Metapackages
[Archived] NuGet meta packages. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 195 (-93.73%)
Mutual labels:  aspnet-product
Jquery Validation Unobtrusive
Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.
Stars: ✭ 207 (-93.34%)
Mutual labels:  aspnet-product
libuv-build
Libuv build automation for ASP.NET Core
Stars: ✭ 22 (-99.29%)
Mutual labels:  aspnet-product
Filesystem
[Archived] Abstraction of file system APIs. Project moved to https://github.com/aspnet/Extensions
Stars: ✭ 173 (-94.43%)
Mutual labels:  aspnet-product
ServerTests
[Archived] Tests for Helios, WebListener and Kestrel. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 20 (-99.36%)
Mutual labels:  aspnet-product
Identity
[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 1,953 (-37.16%)
Mutual labels:  aspnet-product
EntityFramework.Tools
.NET Command Line tools for Entity Framework Core
Stars: ✭ 23 (-99.26%)
Mutual labels:  aspnet-product
Routing
[Archived] Middleware for routing requests to application logic. Project moved to https://github.com/aspnet/AspNetCore
Stars: ✭ 276 (-91.12%)
Mutual labels:  aspnet-product
Testing
[Archived] Testing infrastructure, including support for xUnit.net and StyleCop. Project moved to https://github.com/aspnet/Extensions
Stars: ✭ 64 (-97.94%)
Mutual labels:  aspnet-product
XamarinHosting
Xamarin Forms Generic Host implementation for Microsoft.Extensions.Hosting.
Stars: ✭ 19 (-99.39%)
Mutual labels:  aspnet-product

JavaScriptServices [Archived]

IMPORTANT

The features described in this article are obsolete as of ASP.NET Core 3.0. A simpler SPA frameworks integration mechanism is available in the Microsoft.AspNetCore.SpaServices.Extensions NuGet package. For more information, see [Announcement] Obsoleting Microsoft.AspNetCore.SpaServices and Microsoft.AspNetCore.NodeServices.

What is this?

JavaScriptServices is a set of client-side technologies for ASP.NET Core. It provides infrastructure that you'll find useful if you:

  • Use Angular / React / Vue / Aurelia / Knockout / etc.
  • Build your client-side resources using Webpack.
  • Execute JavaScript on the server at runtime.

Read Building Single Page Applications on ASP.NET Core with JavaScriptServices for more details.

This repo contains:

  • A set of NuGet/NPM packages that implement functionality for:
    • Invoking arbitrary NPM packages at runtime from .NET code (docs)
    • Server-side prerendering of SPA components (docs)
    • Webpack dev middleware (docs)
    • Hot module replacement (HMR) (docs)
    • Server-side and client-side routing integration (docs)
    • Server-side and client-side validation integration
    • "Lazy loading" for Knockout apps
  • Samples and docs

It's cross-platform (Windows, Linux, or macOS) and works with .NET Core 2.0 or later.

Creating new applications

Prerequisites:

With these prerequisites, you can immediately create new ASP.NET Core applications that use Angular, React, or React+Redux without having to install anything extra.

Option 1: Creating Angular/React/Redux applications from the command line (cross-platform)

In an empty directory, run (for example) dotnet new angular. Other supported SPA frameworks include React and React+Redux. You can see the list of available SPA templates by running dotnet new spa.

Once the generator has run and restored all the dependencies, you can start up your new ASP.NET Core SPA:

npm install
dotnet run

Option 2: Creating Angular/React/Redux applications using Visual Studio 2017 Update 3 or later (Windows only)

Using the File->New Project dialog, select ASP.NET Core Web Application. You will then be offered the option to create an application with Angular, React, or React+Redux. When the application is created, you can build and run it in the normal way.

More info and other SPA frameworks

For a more detailed (albeit somewhat outdated) walkthrough, see getting started with the aspnetcore-spa generator.

If you want to build an ASP.NET Core application with Aurelia, Knockout, or Vue, you can use the Microsoft.AspNetCore.SpaTemplates package. On the command line, run dotnet new --install Microsoft.AspNetCore.SpaTemplates. Then you will be able to run dotnet new aurelia (or dotnet new vue, etc.) to create your new application.

Adding to existing applications

If you have an existing ASP.NET Core application, or if you just want to use the underlying JavaScriptServices packages directly, you can install these packages using NuGet and NPM:

  • Microsoft.AspNetCore.NodeServices
    • This provides a fast and robust way for .NET code to run JavaScript on the server inside a Node.js environment. You can use this to consume arbitrary functionality from NPM packages at runtime in your ASP.NET Core app.
    • Most applications developers don't need to use this directly, but you can do so if you want to implement your own functionality that involves calling Node.js code from .NET at runtime.
    • Find documentation and usage examples here.
  • Microsoft.AspNetCore.SpaServices
    • This provides infrastructure that's generally useful when building Single Page Applications (SPAs) with technologies such as Angular or React (for example, server-side prerendering and webpack middleware). Internally, it uses the NodeServices package to implement its features.
    • Find documentation and usage examples here

There were previously other packages called Microsoft.AspNetCore.AngularServices and Microsoft.AspNetCore.ReactServices but these are not currently needed - all applicable functionality is in Microsoft.AspNetCore.SpaServices, because it's sufficiently general.

If you want to build a helper library for some other SPA framework, you can do so by taking a dependency on Microsoft.AspNetCore.SpaServices and wrapping its functionality in whatever way is most useful for your SPA framework.

Samples

The samples directory contains examples of:

  • Using the JavaScript services family of packages with Angular and React.
  • A standalone NodeServices usage for runtime code transpilation and image processing.

To run the samples:

  • Clone this repo
  • At the repo's root directory (the one containing src, samples, etc.), run dotnet restore
  • Change directory to the sample you want to run (for example, cd samples/angular/MusicStore)
  • Restore Node dependencies by running npm install
    • If you're trying to run the Angular "Music Store" sample, then also run gulp (which you need to have installed globally). None of the other samples require this.
  • Run the application (dotnet run)
  • Browse to http://localhost:5000
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].