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

Blazor Hybrid Static Files topic #25891

Merged
merged 5 commits into from
May 23, 2022
Merged

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented May 18, 2022

Fixes #25674

Internal Review Topic

Notes ...

  • Rather rough at the moment 🚧👷. I'll 🛌💤 on it tonight with a round of updates on Thursday morning. You can review it now tho if you want. It's ready for review.
  • I put the component-only static asset web root approach (wwwroot) on here in a section at the end because I wonder if a Hybrid app that only uses components can rely upon the Blazor-y-ish™ way of hosting and referencing static assets, not getting into additional complexity with localized resources (i.e., Resource Manager). I was able to get it working on Windows for MAUI, WPF, and WinForms. Idk about perf, security, or platform/OS problems that might crop up with it. If InSaNe 😵, I'll pull it off the PR ... and we'll never mention that these RexHax™ ever happened! 😆
  • Later, I'm probably going to use pivots to shield readers from frameworks that they aren't working in.
  • These cross-references don't seem ideal, but they are on the PR for .NET MAUI ...
  • Tanay to review first. After Tanay's signoff, I'll ping DR and Artak.

@guardrex guardrex requested a review from TanayParikh May 18, 2022 13:09
@TanayParikh
Copy link
Contributor

💯 , I was hoping eventually we may get .NET MAUI docs covering MauiAsset. cc/ @mattleibow is anything planned in this area?

@mattleibow
Copy link
Member

@davidbritch do we have docs on MauiAsset? I recall I saw some, but it may be in the review stuff still?

Copy link
Contributor

@TanayParikh TanayParikh left a comment

Choose a reason for hiding this comment

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

Thanks @guardrex!

aspnetcore/blazor/hybrid/static-files.md Outdated Show resolved Hide resolved
aspnetcore/blazor/hybrid/static-files.md Outdated Show resolved Hide resolved
aspnetcore/blazor/hybrid/static-files.md Outdated Show resolved Hide resolved
aspnetcore/blazor/hybrid/static-files.md Outdated Show resolved Hide resolved
aspnetcore/blazor/hybrid/static-files.md Outdated Show resolved Hide resolved
@guardrex
Copy link
Collaborator Author

That's good if that's all you spotted. I'll take care of these updates on Friday morning, edit the whole thing again, and ping u back.

@guardrex
Copy link
Collaborator Author

@TanayParikh ... I addressed your feedback and found several other nits and bits to update. You might be able to just look at the last commit to speed up your review of the changes ...

8a1da5e

For ".NET MAUI Essentials," it looks like we'll need to link to the blog post for the time being. I only do it once on the first mention at the top of the doc. Later, I'll point that link at a formal doc in the MAUI doc set.

After you see this and provide any additional feedback, I'll ping DR and Artak to look.

@davidbritch
Copy link
Collaborator

@guardrex The "Essentials" docs will be live on Monday. I can provide an URL if required.

@guardrex
Copy link
Collaborator Author

Thanks @davidbritch ... Yes, please. I think we can hold this until Monday. It might not even be likely for Dan and/or Artak to see this by then anyway.

@davidbritch
Copy link
Collaborator

@guardrex There's no root URL for Essentials, because there's no concept of Essentials in MAUI. It's all just functionality that's in MAUI. Do you want to link to a specific doc?

@guardrex
Copy link
Collaborator Author

The following lines refer to ".NET MAUI Essentials."

  • If the general phrasing is incorrect, let's fix it.
  • If ".NET MAUI Essentials" is retained anywhere here, we can link the text to something ... or not ... whatever makes sense.

btw - I'm mostly a web dev coming into desktop/mobile subjects. I'm learning as we go 👨‍🏫.

In a Blazor Hybrid app, static files are *app resources*, accessed by Razor components using the following approaches:

... and ...

In .NET MAUI apps, [raw assets](/dotnet/maui/fundamentals/single-project#raw-assets) using the `MauiAsset` build action and :::no-loc text=".NET MAUI Essentials"::: are used for static assets.

... and ...

In a Razor component:

  • The static text file contents can be read using the following techniques:
    • .NET MAUI: :::no-loc text=".NET MAUI Essentials"::: (Microsoft.Maui.Storage.FileSystem.OpenAppPackageFileAsync)
    • ...
  • ...

@guardrex
Copy link
Collaborator Author

guardrex commented May 20, 2022

It might make sense to change ".NET MAUI Essentials" to ".NET MAUI framework" or similar lingo ... and not link it.

@davidbritch
Copy link
Collaborator

Yes, there's no concept of ".NET MAUI Essentials". We still call it Essentials internally, but it's no longer a brand, and the functionality that was in the Xamarin.Essentials namespace is now split over multiple Microsoft.Maui.* namespaces (e.g. Microsoft.Maui.Devices, Microsoft.Maui.ApplicationModel etc.). What was .NET MAUI Essentials is now just .NET MAUI.

The blog link can be replaced with /dotnet/maui/platform-integration/storage/file-system-helpers. If you have access to the review site you can see it at https://review.docs.microsoft.com/en-us/dotnet/maui/platform-integration/storage/file-system-helpers?branch=pr-en-us-536&tabs=android

@guardrex
Copy link
Collaborator Author

guardrex commented May 20, 2022

Should I change the text (for that cross-link) to ".NET MAUI File System Helpers"?

UPDATE: I'll compose it that way for the next commit, and we can further modify/replace it from there.

btw ... No, I can't get internal builds. We can set that up at any time but decided not to bother with it. It's more trouble than it's worth to deal with the red tape.

UPDATE: Marking as DRAFT to make sure that this doesn't get merged until the cross-linked content goes live on Monday.

@guardrex guardrex marked this pull request as draft May 20, 2022 13:11
@guardrex guardrex changed the title Blazor Hybrid Static Files topic [HOLD 5/23] Blazor Hybrid Static Files topic May 20, 2022
@guardrex guardrex self-assigned this May 20, 2022
@guardrex
Copy link
Collaborator Author

guardrex commented May 20, 2022

btw @davidbritch in case ur wondering about the no-loc entries ...

We devised an approach to supply a global no-loc via fileMetadata in the docfx.json file. We haven't implemented it yet. For now, I'm going to lock them out of loc this way. Later, the no-loc markdown will be removed.

Copy link
Contributor

@TanayParikh TanayParikh left a comment

Choose a reason for hiding this comment

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

Content LGTM, thanks @guardrex!

@guardrex guardrex changed the title [HOLD 5/23] Blazor Hybrid Static Files topic Blazor Hybrid Static Files topic May 23, 2022
@guardrex
Copy link
Collaborator Author

The cross-link to ...

https://docs.microsoft.com/dotnet/maui/platform-integration/storage/file-system-helpers

... is LIVE. Taking this off of its HOLD/DRAFT status.

@guardrex guardrex marked this pull request as ready for review May 23, 2022 12:26
@guardrex guardrex merged commit a5dcc65 into main May 23, 2022
@guardrex guardrex deleted the guardrex/blazor-hybrid-static-files branch May 23, 2022 17:49
@guardrex guardrex mentioned this pull request May 23, 2022
25 tasks
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.

Blazor Hybrid: Static files topic
4 participants