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

Add empty (no sample content) option for Blazor Hybrid #23615

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

Eilon
Copy link
Member

@Eilon Eilon commented Jul 15, 2024

Also removed unneeded favicon.

The option is available via command line by running dotnet new maui-blazor --Empty, or in Visual Studio:
image

To see the effect of the new option, check out this PR diff comparing the default option (with sample content) to the empty option (no sample content): https://github.com/Eilon/MauiBlazorHybridEmpty/pull/1/files

The change is based on what the Blazor Web template does, and what was already replicated in the .NET 9 MAUI Blazor + Web App template (which already has the Empty option).

Fixes #9126, #16542

Also removed unneeded favicon.

Fixes #9126, #16542
@Eilon Eilon added area-blazor Blazor Hybrid / Desktop, BlazorWebView area-templates Project templates, Item Templates for Blazor and MAUI labels Jul 15, 2024
@Eilon Eilon requested review from a team as code owners July 15, 2024 18:06
@Eilon Eilon changed the title Add empty (no sample content) option Add empty (no sample content) option for Blazor Hybrid Jul 15, 2024
@Eilon
Copy link
Member Author

Eilon commented Jul 16, 2024

@javiercn / @MackinnonBuck / @SteveSandersonMS - could I please get a Blazor code review for this change?

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

Only have 1 comment.

Does the template match the option on the web template? Doesn't the checkbox on the web template say something like "Include Sample content"?

@Eilon
Copy link
Member Author

Eilon commented Jul 16, 2024

Only have 1 comment.

Does the template match the option on the web template? Doesn't the checkbox on the web template say something like "Include Sample content"?

It's an exact copy of the text and UI:

image

@Eilon
Copy link
Member Author

Eilon commented Jul 16, 2024

And perhaps to clarify... or make things more confusing... the UI option in VS is Include sample pages, but from the command line and in the template authoring there is both that option, but also a --Empty option, which is a separate option, but easier to use from command line (I guess). Those two options together are used to compute whether sample content should be generated.

Here's the rough logic from the template.json:

      "IncludeSampleContent": { // this is the UI option in VS (also available in command line)
        "defaultValue": "true",
        "displayName": "_Include sample pages",
      },
      "Empty": { // this UI option is command-line only
        "defaultValue": "false",
      },
      "SampleContent": { // this is the computed value that uses the two previous options to decide what should be generated
        "type": "computed",
        "value": "(IncludeSampleContent) || (!Empty)"
      }

@Eilon Eilon enabled auto-merge (squash) July 17, 2024 15:56
@Eilon
Copy link
Member Author

Eilon commented Jul 17, 2024

@mattleibow / @Redth / @rmarinho - can I get a MAUI review so that this can get merged? It's been Blazor-approved.

@Eilon Eilon merged commit 82ac810 into net9.0 Jul 17, 2024
112 checks passed
@Eilon Eilon deleted the eilon/net9-template-empty branch July 17, 2024 15:58
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Aug 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2024
@samhouts samhouts added the fixed-in-net8.0-nightly This may be available in a nightly release! label Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-templates Project templates, Item Templates for Blazor and MAUI fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants