| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This directory contains sources for Microsoft.JSInterop, a package that provides abstractions and features for interop between .NET and JavaScript code.
The primary use case is for applications built with Blazor. For usage information, see the following documentation:
This section provides a brief overview of the architecture.
Microsoft.JSInterop is a .NET package with the following roles:
For these types to become usable in a particular runtime environment, such as Blazor Server or Blazor WebAssembly, the runtime environment implements its own concrete subclasses that know how to dispatch calls to the actual JavaScript runtime that is available in that environment. For example, Blazor Server uses the SignalR-based circuit to send invocations to the end user's browser.
Microsoft.JSInterop.JS is the JavaScript-side counterpart to the preceding. It runs within a standard web browser environment, receives the invocations from .NET code, executes them, and sends back results in the format understood by the JSRuntime base class. This includes special handling for certain parameter types such as ElementReference and DotNetObjectReference. Microsoft.JSInterop.JS also exposes JavaScript functions that can be used to issue calls from JavaScript to .NET.
Since Microsoft.JSInterop.JS is platform-independent, runtime environments such as Blazor Server or Blazor WebAssembly must initialize it by registering environment-specific callbacks that know how to dispatch invocations across their own communication channels.
To build the .NET code, you can:
Alternatively, open JSInterop.slnf in Visual Studio.
To build the JavaScript code, execute the following commands in a command shell:
Warning: Due to special requirements related to ASP.NET Core's CI process for Linux distributions, we store the compiled JavaScript artifacts for Microsoft.JSInterop.JS in source control in the Microsoft.JSInterop.JS/src/dist directory. If you edit and build JavaScript sources, your Git client should indicate that those outputs have changed. You will need to include changes to those dist files in any PRs that you submit. When this leads to merge conflicts, we have to resolve them manually by rebasing and rebuilding.
For more information, see the ASP.NET Core README.
| Back | FazBrowse Home | New Git URL |