Playzor.Core
1.0.1
dotnet add package Playzor.Core --version 1.0.1
NuGet\Install-Package Playzor.Core -Version 1.0.1
<PackageReference Include="Playzor.Core" Version="1.0.1" />
<PackageVersion Include="Playzor.Core" Version="1.0.1" />
<PackageReference Include="Playzor.Core" />
paket add Playzor.Core --version 1.0.1
#r "nuget: Playzor.Core, 1.0.1"
#:package Playzor.Core@1.0.1
#addin nuget:?package=Playzor.Core&version=1.0.1
#tool nuget:?package=Playzor.Core&version=1.0.1
Playzor.Core
Compiles Blazor components in the browser. This is the engine under Playzor.Blazor.Editor — use it directly when you want the compiler without the editor ui.
var result = await compilationService.CompileToAssemblyAsync(codeFiles, packages, updateStatus);
if (result.Diagnostics.All(d => d.Severity != DiagnosticSeverity.Error))
LoadIntoPreview(result.AssemblyBytes);
What is in it
| Type | Purpose |
|---|---|
CompilationService |
Razor pipeline plus roslyn, running on WebAssembly. Produces an assembly from a set of code files |
CodeFile, CodeFileType |
A file of the snippet — razor, c# or the package reference list |
CompilationDiagnostic |
One error or warning, mapped back to the line the user wrote |
NugetReferenceService |
Resolves packages including their dependencies and picks the right target framework |
InlineCode |
Encodes a snippet into an url (deflate + base64url) — the format shared links use |
Brand |
Title, description, colors and default snippet per domain |
The server seam
IPlayzorApi is everything the browser cannot do on its own. In practice that is one thing:
downloading a .nupkg, because nuget.org answers without CORS headers.
// own server, see the Playzor.Server package and its MapPlayzorApi()
new PlayzorApi(httpClient)
// no own server: borrow the public playground
new PlayzorApi(httpClient, PlayzorApiOptions.PlayzorNet)
// or your own index entirely
class MyApi : IPlayzorApi { … }
IPlayzorSnippetStore is the optional counterpart for saving, loading and listing snippets.
PlayzorHttpSnippetStore talks to the endpoints of the Playzor.Server package.
Note on dependencies
The compiler hands MudBlazor and MudBlazor.Extensions to the user code as ambient references and usings, so a snippet can render mud components without declaring anything. That is why this package depends on them.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FluentValidation (>= 12.1.1)
- Microsoft.AspNetCore.Components.WebAssembly (>= 10.0.9)
- Microsoft.AspNetCore.Mvc.Razor.Extensions (>= 6.0.36)
- Microsoft.CodeAnalysis.Common (>= 5.3.0)
- Microsoft.CodeAnalysis.CSharp (>= 5.3.0)
- MudBlazor.Extensions (>= 9.8.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Playzor.Core:
| Package | Downloads |
|---|---|
|
Playzor.Blazor.Editor
The Playzor playground as a Blazor component: monaco editors for any number of files, roslyn compiling in the browser, dockable panels for file tree, preview, errors and console, and a tool bar whose built in buttons can be picked and extended. |
GitHub repositories
This package is not used by any popular GitHub repositories.
