Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RSCG - 212 Examples of Roslyn Source Code Generators / 14 created by Microsoft /
# RSCG - 213 Examples of Roslyn Source Code Generators / 14 created by Microsoft /

## Latest Update : 2025-08-01 => 01 August 2025
## Latest Update : 2025-08-02 => 02 August 2025

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -20,8 +20,30 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 212 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 213 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 14 from Microsoft )
### 213. [Blazor.TSRuntime](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime) , in the [Blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) category

Generated on : 2025-08-02 => 02 August 2025

<details>
<summary>Expand</summary>



Author: Black White Yoshi

TSRuntime is an improved JSRuntime with automatic JS-module loading and caching, compile time errors instead of runtime errors and nice IntelliSense guidance.

Nuget: [https://www.nuget.org/packages/Blazor.TSRuntime/](https://www.nuget.org/packages/Blazor.TSRuntime/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime)

Source: [https://github.com/BlackWhiteYoshi/Blazor.TSRuntime](https://github.com/BlackWhiteYoshi/Blazor.TSRuntime)

</details>

### 212. [StackXML](https://ignatandrei.github.io/RSCG_Examples/v2/docs/StackXML) , in the [Serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) category

Generated on : 2025-08-01 => 01 August 2025
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2025-08-01 => 01 August 2025
## Latest Update : 2025-08-02 => 02 August 2025



Expand Down
16 changes: 15 additions & 1 deletion v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public string[] SourceNoRSCG()
text = text.Replace("(CopyTo)", $"({d.Generator!.Source}/CopyTo");
text=text.Replace("(./docs/BenchmarksResults)", $"({d.Generator!.Source}/docs/BenchmarksResults");
text = text.Replace("(sg_example.png", $"({d.Generator!.Source}/sg_example.png");
text = text.Replace("(Readme_md/", $"({d.Generator!.Source}Readme_md/");
text = text.Replace("(README.md)", $"({d.Generator!.Source}README.md");
text = text.Replace("(src/samples/ConsoleSample)", $"({d.Generator!.Source}src/samples/ConsoleSample");
text = text.Replace("(src/Jab.Performance/)", $"({d.Generator!.Source}src/Jab.Performance/");
Expand Down Expand Up @@ -923,7 +924,20 @@ private async Task<bool> WroteDocusaurus(Description it, string pathDocusaurus)
var template = await File.ReadAllTextAsync("DocusaurusExample.txt");
var templateScriban = Scriban.Template.Parse(template);
var output = templateScriban.Render(new {Description=it, otherDesc, category}, member => member.Name);

output = output
.Replace(" { ", " \\{ ")
.Replace(" } ", " \\} ")
.Replace("Action<>", "Action&lt;&gt;")
.Replace("Func<>", "Func&lt;&gt;")
.Replace("{Type}", "\\{Type}\\}")
.Replace("{Name}", "\\{Name}\\}")
.Replace("{PropertyName}", "\\{PropertyName}\\}")
.Replace("{TypeName}", "\\{TypeName}\\}")
.Replace("{NameOfProperty}", "\\{NameOfProperty}\\}")
.Replace("{SingularName}", "\\{SingularName}\\}")
.Replace("{get}", "\\{get}\\}")

;
string folderToWrite = Path.Combine(pathDocusaurus, "docs", "RSCG-Examples");
ArgumentNullException.ThrowIfNull(it.Generator);
string file = it.Generator.Name+ ".md";
Expand Down
2 changes: 1 addition & 1 deletion v2/Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ await File.WriteAllTextAsync(Path.Combine(examples,"description.json"),

long nr = await m.GenerateMSFT();
Console.WriteLine("RSCG used by MSFT :" + nr);
var lastGenerator = "AssemblyVersionInfo";
var lastGenerator = "Blazor.TSRuntime";

await m.WrotePost(lastGenerator);
await m.WroteDocusaurusAll(lastGenerator);
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,4 @@ Nr,Key,Source,Category
210,AssemblyVersionInfo, https://github.com/BlackWhiteYoshi/AssemblyVersionInfo,EnhancementProject
211,ShadowWriterNullobjects, https://github.com/StefanStolz/ShadowWriter,Interface
212,StackXML, https://github.com/ZingBallyhoo/StackXML,Serializer
213,Blazor.TSRuntime, https://github.com/BlackWhiteYoshi/Blazor.TSRuntime,Blazor
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1280,5 +1280,11 @@
"Category": 16,
"dtStart": "2025-08-01T00:00:00",
"show": true
},
{
"ID":"Blazor.TSRuntime",
"Category": 21,
"dtStart": "2025-08-02T00:00:00",
"show": true
}
]
116 changes: 116 additions & 0 deletions v2/book/examples/Blazor.TSRuntime.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@

<h1>RSCG nr 213 : Blazor.TSRuntime</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/Blazor.TSRuntime/" target="_blank">https://www.nuget.org/packages/Blazor.TSRuntime/</a>

<p>You can find more details at : <a href="https://github.com/BlackWhiteYoshi/Blazor.TSRuntime" target="_blank"> https://github.com/BlackWhiteYoshi/Blazor.TSRuntime</a></p>

<p>Author :Black White Yoshi</p>

<p>Source: <a href="https://github.com/BlackWhiteYoshi/Blazor.TSRuntime" target="_blank">https://github.com/BlackWhiteYoshi/Blazor.TSRuntime</a> </p>

<h2>About</h2>

Generating C# Code for Blazor from javascript files

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/Blazor.TSRuntime/" target="_blank">Blazor.TSRuntime</a> in the csproj
</h3>
<img src="images/Blazor.TSRuntime/BlazorData.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file Program.cs
<br />
<img src="images/Blazor.TSRuntime/csFiles/Program.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file tsruntime.json
<br />
<img src="images/Blazor.TSRuntime/csFiles/tsruntime.json.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file Home.razor
<br />
<img src="images/Blazor.TSRuntime/csFiles/Home.razor.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file Home.razor.js
<br />
<img src="images/Blazor.TSRuntime/csFiles/Home.razor.js.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is ITSRuntime_bootstrap.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_bootstrap_bundle.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_bundle.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_bootstrap_bundle_min.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_bundle_min.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_bootstrap_esm.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_esm.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_bootstrap_esm_min.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_esm_min.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_bootstrap_min.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_min.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_Core.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_Core.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is ITSRuntime_Home.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_Home.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is TSRuntime.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/TSRuntime.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is TSRuntime_ServiceExtension.g.cs
<br />
<img src="images/Blazor.TSRuntime/generated/TSRuntime_ServiceExtension.g.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 212 RSCG with examples =>
This is the list of 213 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -874,6 +874,10 @@ <h1>
<td>212</td>
<td><a href="examples/StackXML.html">StackXML</a></td>
</tr>
<tr>
<td>213</td>
<td><a href="examples/Blazor.TSRuntime.html">Blazor.TSRuntime</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ input-files:
- examples/AssemblyVersionInfo.html
- examples/ShadowWriterNullobjects.html
- examples/StackXML.html
- examples/Blazor.TSRuntime.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/Blazor.TSRuntime/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"Blazor.TSRuntime",
"nuget":[
"https://www.nuget.org/packages/Blazor.TSRuntime/"
],
"link":"https://github.com/BlackWhiteYoshi/Blazor.TSRuntime",
"author":"Black White Yoshi",
"source":"https://github.com/BlackWhiteYoshi/Blazor.TSRuntime"
},
"data":{
"goodFor":["Generating C# Code for Blazor from javascript files"],
"csprojDemo":"BlazorData.csproj",
"csFiles":["Program.cs","tsruntime.json","Home.razor","Home.razor.js"],
"excludeDirectoryGenerated":["Microsoft.CodeAnalysis.Razor.Compiler"],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
1 change: 1 addition & 0 deletions v2/rscg_examples/Blazor.TSRuntime/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TSRuntime is an improved JSRuntime with automatic JS-module loading and caching, compile time errors instead of runtime errors and nice IntelliSense guidance.
Loading