Skip to content

Commit f5ea0eb

Browse files
nicolas63A-5ingh
authored andcommitted
Added documentation on blazor (jhipster#506)
* Added documentation on blazor client and some other improvment (gitignore)
1 parent 8d92b6f commit f5ea0eb

File tree

6 files changed

+111
-14
lines changed

6 files changed

+111
-14
lines changed

docs/Features/RunLocal.md renamed to docs/Development/RunLocal.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
## Running local Blueprint version for development
2-
3-
During development of blueprint, please note the below steps. They are very important.
1+
# Running local Blueprint version for development
42

53
1. Link your blueprint globally
64

7-
Note: If you do not want to link the blueprint(step 3) to each project being created, use NPM instead of Yarn as yeoman doesn't seem to fetch globally linked Yarn modules. On the other hand, this means you have to use NPM in all the below steps as well.
8-
95
```bash
10-
cd dotnetcore
6+
cd jhipster-dotnetcore
117
npm link
128
```
139

@@ -18,9 +14,6 @@ You could also use Yarn for this if you prefer
1814
```bash
1915
cd generator-jhipster
2016
npm link
21-
22-
cd dotnetcore
23-
npm link generator-jhipster
2417
```
2518

2619
3. Create a new folder for the app to be generated and link JHipster and your blueprint there

docs/Features/fronts.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Fronts
2+
3+
## Using Blazor
4+
5+
### Why Blazor ?
6+
7+
Blazor can run your client-side C# code directly in the browser, using WebAssembly. Because it's real .NET running on WebAssembly, you can re-use code and libraries from server-side parts of your application. (https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor)
8+
9+
### Prerequisites
10+
11+
https://dotnet.microsoft.com/download/dotnet/5.0
12+
13+
### Generate your application
14+
15+
Call the generator
16+
17+
```bash
18+
jhipster --blueprints dotnetcore
19+
```
20+
21+
and choose Blazor (WebAssembly)
22+
23+
![front-choice](../assets/blazor-choice.png)
24+
25+
After that, your application is ready, and you can now use it with default user (admin admin or user user)
26+
27+
You can run the Backend with
28+
29+
```bash
30+
dotnet run --verbosity normal --project ./src/YourAppName/YourAppName.csproj
31+
```
32+
33+
And you can run the Frontend with
34+
35+
```bash
36+
dotnet run --verbosity normal --project ./src/client/YourAppName.Client/YourAppName.Client.csproj
37+
```
38+
39+
You can also use the **hotreload**
40+
41+
For the backend
42+
```bash
43+
dotnet watch --project ./src/YourAppName/YourAppName.csproj run --verbosity normal
44+
```
45+
For the frontend
46+
```bash
47+
dotnet watch --project ./src/client/YourAppName.Client/YourAppName.Client.csproj run --verbosity normal
48+
```
49+
50+
### Generate entities
51+
52+
Like the others front technologies you can generate entities for blazor
53+
54+
With cli
55+
```bash
56+
jhipster entity <entity-name>
57+
```
58+
59+
or with jdl (https://start.jhipster.tech/jdl-studio/)
60+
```bash
61+
jhipster import-jdl my_file.jdl
62+
```
63+
64+
### Tools
65+
66+
As the project used SASS, to install and consume scss third parties libraries like bootstrap we use Microsoft Library Manager (aka [libman](https://github.com/aspnet/LibraryManager))
67+
You can find libman configuration in same directory than client solution (./src/client/YourAppName.Client)
68+
69+
To minify css we use Excubo.WebCompiler (aka [webcompiler](https://github.com/excubo-ag/WebCompiler))
70+
71+
These two tools are installed during jhipster client generation, and you can find the execution in client csproj (./src/client/YourAppName.Client/YourAppName.Client.csproj)
72+
73+
### UI components
74+
75+
To speed up our development we use [Blazored](https://github.com/Blazored) components like Blazored.Modal or Blazored.SessionStorage.
76+
77+
We also use [Blazorise](https://github.com/stsrki/Blazorise) which has really interesting components.
78+
79+
### UT
80+
81+
For unit test we use the awesome library [bUnit](https://github.com/egil/bUnit).
82+
83+
You can find client unit test in ./test/YourAppName.Client.Test
84+
85+
### Limitations
86+
87+
For the moment, the Blazor generation has certain limitations :
88+
89+
- Only support DTO you can't use application without DTO
90+
- No validation on entity fields (The validation is only on user management part)
91+
- No translation
92+
- Only JWT security is implemented

docs/assets/blazor-choice.png

6.25 KB
Loading

docs/index.rst

+8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ You can also find lot of information in https://www.jhipster.tech
2323
:hidden:
2424
:caption: Features
2525

26+
Features/fronts
2627
Features/services
2728
Features/dto
2829
Features/repository
@@ -31,6 +32,13 @@ You can also find lot of information in https://www.jhipster.tech
3132
Features/monitoring
3233
Features/security
3334

35+
.. toctree::
36+
:maxdepth: 3
37+
:hidden:
38+
:caption: Development
39+
40+
Development/RunLocal
41+
3442
.. toctree::
3543
:maxdepth: 3
3644
:hidden:

generators/client/templates/blazor/src/Project.Client/Project.Client.csproj.ejs

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
</Target>
7474

7575
<Target Name="CompileStaticAssets" AfterTargets="AfterBuild">
76-
<Exec Command="webcompiler -r wwwroot/content/scss -o wwwroot/content/css -z disable -p disable" StandardOutputImportance="high" />
77-
<Exec Command="webcompiler -r wwwroot/content/scss -o wwwroot/content/css -z disable -p disable -m disable" StandardOutputImportance="high" />
78-
</Target>
76+
<Exec Command="webcompiler -r wwwroot/content/scss -o wwwroot/content/css -z disable -m disable" Condition="'$(Configuration)'=='Debug'" StandardOutputImportance="high" />
77+
<Exec Command="webcompiler -r wwwroot/content/scss -o wwwroot/content/css -p disable" Condition="'$(Configuration)'=='Release'" StandardOutputImportance="high" />
78+
</Target>
7979

8080
<ItemGroup>
8181
<!--specify file extensions here as needed-->

generators/common/templates/dotnetcore/gitignore.ejs

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ npm-debug.log.*
2424
.vs
2525
.vscode
2626

27-
#Angular
28-
**/wwwroot/
27+
# Web
2928
**/ClientApp/dist/
29+
!**/wwwroot/content/css/loading.css
30+
!**/wwwroot/content/images/**
31+
!**/wwwroot/content/scss/**
32+
!**/wwwroot/index.html
33+
!**/wwwroot/favicon.ico
3034

3135
# User-specific files
3236
*.suo

0 commit comments

Comments
 (0)