Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add blazor template #656

Merged
merged 34 commits into from
Apr 23, 2024
Merged

feat: add blazor template #656

merged 34 commits into from
Apr 23, 2024

Conversation

jimmy-mll
Copy link
Contributor

@jimmy-mll jimmy-mll commented Apr 1, 2024

add blazor template for create tauri app with blazor

Screen.Recording.-.Made.with.FlexClip.5.webm

src/lib.rs Outdated Show resolved Hide resolved
@jimmy-mll jimmy-mll requested a review from amrbashir April 2, 2024 19:49
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add a new category in categories.rs file

templates/template-blazor/src/wwwroot/index.html.lte Outdated Show resolved Hide resolved
templates/template-blazor/src/wwwroot/css/app.css Outdated Show resolved Hide resolved
templates/template-blazor/.manifest Outdated Show resolved Hide resolved
templates/template-blazor/src/wwwroot/img/favicon.png Outdated Show resolved Hide resolved
templates/template-blazor/src/wwwroot/index.html.lte Outdated Show resolved Hide resolved
templates/template-blazor/src/wwwroot/img/tauri.svg Outdated Show resolved Hide resolved
@jimmy-mll
Copy link
Contributor Author

We also need to add a new category in categories.rs file

Does this imply creating a new package manager as well?
Because if I add a new category named CSharp, I end up with Cargo templates.
And since Tauri's CLI cannot be used in C#, I won't have a choice but to use Cargo.
So if I'm not mistaken, I'll create a new package manager named NuGet, but it will use Cargo?

Regarding the rest, everything is finished, only this point needs to be clarified.

@jimmy-mll jimmy-mll requested a review from amrbashir April 3, 2024 19:03
@amrbashir
Copy link
Member

amrbashir commented Apr 3, 2024

Does this imply creating a new package manager as well?
Because if I add a new category named CSharp, I end up with Cargo templates.
And since Tauri's CLI cannot be used in C#, I won't have a choice but to use Cargo.
So if I'm not mistaken, I'll create a new package manager named NuGet, but it will use Cargo?

yeah it is a bit weird, let's go with .NET as the category name and .NET CLI as the package manager name.

Ideally we would publish the Tauri CLI to NuGet and users can call it using dotnet tool run tauri, is that even possible?

@jimmy-mll
Copy link
Contributor Author

yeah it is a bit weird, let's go with .NET as the category name and .NET CLI as the package manager name.

Ideally we would publish the Tauri CLI to NuGet and users can call it using dotnet tool run tauri, is that even possible?

Yes this is possible, I'm going to do a poc, before that, what commands are required? Just the command to launch Tauri?

@amrbashir
Copy link
Member

It should be able to run any tauri subcommand tauri dev, tauri build, tauri info...etc

@jimmy-mll
Copy link
Contributor Author

It should be able to run any tauri subcommand tauri dev, tauri build, tauri info...etc

Alright, I just have to make a wrapper, which will implicitly call cargo in this case

@amrbashir
Copy link
Member

It should be able to run any tauri subcommand tauri dev, tauri build, tauri info...etc

Alright, I just have to make a wrapper, which will implicitly call cargo in this case

No need for a wrapper, I was wondering if it is possible, we could publish tauri-cli to NuGet and then this template could include it as a dependency

@jimmy-mll
Copy link
Contributor Author

No need for a wrapper, I was wondering if it is possible, we could publish tauri-cli to NuGet and then this template could include it as a dependency

publish tauri-cli on Nuget? But tauri-cli is made in rust, isn't it?

@amrbashir
Copy link
Member

yeah, can't we publish a prebuilt binary there?

@amrbashir
Copy link
Member

anyways, let's just add these categories for now and we can see about publishing tauri-cli to nuget later.

@amrbashir
Copy link
Member

@amrbashir
Copy link
Member

I have a problem when building the job with the ci, the '-' character of 'tauri-app' is not supported in C# uses

then we need to replace with a supported character it in these places

Copy link

@zenitogr zenitogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but, is there a bundler for tauri? I think using withGlobalTauri is not for release, excuse if this is incorrect i am a new dev myself

@jimmy-mll
Copy link
Contributor Author

@amrbashir
Copy link
Member

looks like you need to run pnpm format and cargo fmt

@jimmy-mll
Copy link
Contributor Author

looks like you need to run pnpm format and cargo fmt

👍

@jimmy-mll
Copy link
Contributor Author

It's all good for me, I think we're not too bad here @amrbashir

Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I left a few final comments and this should be ready to go.

Comment on lines 133 to 141
working-directory: ${{ (matrix.settings.manager == 'dotnet') && 'TauriApp' || 'tauri-app' }}

- run: ${{ matrix.settings.install_cmd }}
if: matrix.settings.install_cmd != ''
working-directory: tauri-app
working-directory: ${{ (matrix.settings.manager == 'dotnet') && 'TauriApp' || 'tauri-app' }}

- run: ${{ matrix.settings.run_cmd }} tauri build ${{ matrix.settings.no_bundle_flag }}
if: matrix.settings.manager != 'npm'
working-directory: tauri-app
working-directory: ${{ (matrix.settings.manager == 'dotnet') && 'TauriApp' || 'tauri-app' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when bootstrapping a dotnet project it should support tauri-app too, we shouldn't handle it here at all, we just need to convert tauri-app to TauriApp automatically in in the template in the files that require it to be without -, I guess for example that would be Program.cs.lte, and in that file we change {% project_name %} to {% project_name_upper_case %}. We will need to inject that variable into the template data though.

@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using {% project_name %};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one

Suggested change
using {% project_name %};
using {% project_name_uppercase %};

@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using {% project_name %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one

Suggested change
@using {% project_name %}
@using {% project_name_uppercase %}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the name of this file

@jimmy-mll
Copy link
Contributor Author

amrbashir
amrbashir previously approved these changes Apr 23, 2024
@amrbashir amrbashir changed the title add blazor template feat: add blazor template Apr 23, 2024
@amrbashir amrbashir merged commit 4edb69f into tauri-apps:dev Apr 23, 2024
2 checks passed
@jimmy-mll jimmy-mll deleted the blazor branch April 23, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants