dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.66k stars 25.28k forks source link

[RC1] Blazor CSS isolation #19360

Closed javiercn closed 4 years ago

javiercn commented 4 years ago

We'll be providing more content here before this is ready.

/cc: @SteveSandersonMS

guardrex commented 4 years ago

@javiercn I can take a stab πŸ”ͺ at this based on Steve's presentation on the Community Standup combined with the engineering issue(s)/PR(s). Do you want me to give it a shot? ... might take a little pressure off of u πŸ’₯🀯πŸ’₯.

javiercn commented 4 years ago

If you want to, go for it, we are still working out some changes that will land on RC1

guardrex commented 4 years ago

In that case, I'll wait until RC1. I was burned πŸ€• back when I tried to document Health Checks too early. I should have plenty of time after RC1 comes out.

Let's do this ... I'll take the assignment now, and we'll fix anything on review when I put the PR up after RC1 releases.

Same thing for Identity 2.0 updates. Immediately after RC1, I'll get busy on it. If I hit any problems, I'll ping on that issue. Otherwise, we can troubleshoot my PR after I put it up ... after RC1. Given that the changes might be extensive, it might take me a week (or longer if other work hits me). You can always track what I'm currently working on on the Blazor.Docs project by looking at the In Progress column.

daveabrock commented 4 years ago

Hey, all. I wanted to let you know I just got done writing a post on this feature. I appreciate the bulleted list on what to cover here, as it helped me make sure I was covering everything. 😎

As you're writing this, feel free to lean on that, correct me where I was wrong, and so on. Or, if you'd like me to take a stab at writing this for you guys, I'd be more than happy to give it a shot.

guardrex commented 4 years ago

@daveabrock You are super welcome πŸ₯‡ to write the section on this, and we can put your name on the author byline with a link to your blog (or organization website).

Let me get back to you tomorrow (Friday) morning on where it will slot into the coverage and any notes/gotchas going in on it.

daveabrock commented 4 years ago

@guardrex Sounds good! I've done plenty of contributions but this would be my first Blazor oneβ€”so all ears on if there's any gotchas for writing Blazor docs.

guardrex commented 4 years ago

@javiercn, TL;DR on my guidance to @daveabrock below, but ... you said that there might be additional updates to CSS isolation for RC1. Anything in that vein for @daveabrock since you opened this issue?

@daveabrock ... I read your post. Great piece. I hope you let @jongalloway know (if he doesn't get the ping here on https://daveabrock.com/2020/09/10/blazor-css-isolation) about that for a mention in a Community Standup. You can tweet him.

There's enough here that this should be a new topic in the Components node of the Blazor ToC. If Dan wants it elsewhere tho, no worries ... topic content is easy to move at the PR stage, of course. He'll let us know on the PR. For now, let's proceed with creating a new topic for this.

Two options ...

  1. You fork+clone+branch the repo, create the topic with its metadata for the repo, and integrate the topic into the site's ToC. You submit the PR, and I'll make a direct edit pass on it. You can then pull down my changes and continue to work with it if needed.
  2. You just write the topic and shoot it into an issue comment here, and I'll do the legwork on those other bits :point_up:. I'll submit the PR, and we can pick up with updates from there.

If you want the fully experience, then I'll supply some added notes here for Option 1. If you just want to go Option 2, then I'll just ping you on the PR for further discussion and updates after I've taken your issue comment into a repo doc. Let me know which way you want to go :ear:, and either way is fine. It just depends on how much into the doc repo weeds you want to get into it.

WRT the content itself, a few points ...

javiercn commented 4 years ago

@daveabrock that's a great post! It covers almost everything I would cover. There are a few things we've changed and that are important to reflect on the docs and a couple of additional details:

In the things that have changes:

On the things that are missing or need more detail:

I think that covers everything, that said there are extensive comments on the feature PR as well as in the msbuild code file

daveabrock commented 4 years ago

Hey guys, thanks for the nice words on the post (and @guardrex, @jongalloway has come to expect a not-so-subtle nudge the morning of the standups πŸ‘Œ).

@guardrex, I'm fine with the first option. As I think I said (it's been a long week) I have experience with your process so that should save time for everybody. I know you are targeting RC1 for thisβ€”when is that, exactly? Thanks for the tips. I'll keep those in mind.

@javiercn, thanks for the great input! Are all these changes coming with RC1, or is it in preview 8? I was playing with the preview 8 bits, obviously. I would definitely prefer to get my hands on the bits before publishing this post, if possible.

As for some of the MSBuild settings in the project file, could someone assist on how to use DisableScopedCssBinding and StaticWebAssetBasePath in terms of how it fits in the structure of the project file (like the tag, what node it's under, and so on). I was trying to put some pieces together looking at the code, but would appreciate some assistance there.

guardrex commented 4 years ago

targeting RC1 for thisβ€”when is that, exactly?

I know the target date, but I don't like saying what it is. It might be public info, but I just don't like conveying dates without explicit authorization. Javier will let u know if he thinks this should absolutely be up for the RC1 release (that day) or not; and if so, he (or Dan) can convey the date, here or via email.

get my hands on the bits before publishing this post

This is what I was going to do, so there would've been a delay of at least a couple of days post RC1 release. I assume that they're fine with you taking that course as well.

javiercn commented 4 years ago

I don't remember exactly if they are in RC1 or RC2, I believe RC1, but Dan can confirm since he's played with the bits more recently.

As to how to put things in the project file:

<PropertyGroup>
  <StaticWebAssetBasePath>_content/$(PackageId)</StaticWebAssetBasePath>
  <DisableScopedCssBundling>true</DisableScopedCssBundling>
</PropertyGroup>

There's a lot of content in the comments https://github.com/dotnet/aspnetcore/blob/release/5.0-rc1/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.ScopedCss.targets and on the PRs with the details

daveabrock commented 4 years ago

Thanks @javiercn. I have what I need to get started.

And @guardrex, all fair on timing. I'm just looking for a general timeframe - do you want something in the next two weeks, four weeks, six weeks?

guardrex commented 4 years ago

:smile: ... Dan has publicly said 'target in September'. ⏰ ... soon ... very soon is fair to say if everything goes off without a hitch.

isc30 commented 4 years ago

Hi everyone, should the docs also cover referencing a RCL that has components with scoped CSS? At least reminding the net5.0 as a target and 5.0.0-preview.8.20414.8 as version for Microsoft.AspNetCore.Components NuGet packages.

daveabrock commented 4 years ago

:smile: ... Dan has publicly said 'target in September'. ⏰ ... soon ... very soon is fair to say if everything goes off without a hitch.

You don't say? πŸ˜€ https://devblogs.microsoft.com/dotnet/announcing-net-5-0-rc-1/

Will try to carve out some time this week.

guardrex commented 4 years ago

πŸŽ‰

carve out some time this week

Me, too. I've a got a SEA 🚒 of Blazor WASM security bits to update!

daveabrock commented 4 years ago

Hi everyone, should the docs also cover referencing a RCL that has components with scoped CSS? At least reminding the net5.0 as a target and 5.0.0-preview.8.20414.8 as version for Microsoft.AspNetCore.Components NuGet packages.

Any thoughts, @javiercn?

SteveSandersonMS commented 4 years ago

@daveabrock We have project template for RCL which will be correctly set up to use scoped CSS by default, so hopefully that will put people on the right track. I'm not sure if we'll cover in the docs what versions of things are required, since typically the docs don't do that for each feature - the docs themselves are tied to an overall version of the framework.

daveabrock commented 4 years ago

Update for you, @guardrex: working with the RC1 bits and should have a PR for you tomorrow morning.

guardrex commented 4 years ago

Thanks @daveabrock ... no giant huge rush if you feel that you need more time ... we are in preview after all.

daveabrock commented 4 years ago

@guardrex - I would like an initial review but I have QUESTIONS! Would you like a link to the branch or should I just do a PR, knowing there will be a lot of back and forth?

guardrex commented 4 years ago

A link to your branch is fine. We can discuss it there.

btw--- My hours are almost burned for the week ... I have just a couple of hours left today, then I'm back on Monday morning. I suspect a discussion would bleed over to Monday. That's no big deal tho ... next week for this is fine. Everything for 5.0 is running very much on time πŸš… at the moment. πŸ€žπŸ€

daveabrock commented 4 years ago

A link to your branch is fine. We can discuss it there.

btw--- My hours are almost burned for the week ... I have just a couple of hours left today, then I'm back on Monday morning. I suspect a discussion would bleed over to Monday. That's no big deal tho ... next week for this is fine. Everything for 5.0 is running very much on time πŸš… at the moment. πŸ€žπŸ€

Thanks for letting me know and I definitely anticipated a few days to think through everything.

Here's a link to my updates in the branch (I also updated toc.yaml so the nav is set to go): https://github.com/daveabrock/AspNetCore.Docs/blob/daveabrock/css-isolation/aspnetcore/blazor/components/css-isolation.md

I welcome your feedback on content and tone.

My questions:

guardrex commented 4 years ago

I took a look ... yes, indeed! 🎷 ... that looks great. The metadata looks good, and that ToC location is good. I actually think you could go ahead and send a PR to master here now with that.

  1. We'll do technical review first with Javier when he gets back.
  2. After technical sign-off, I'll make a direct edit pass on the branch here for the grammar+style repo nitpicks.
  3. You take a final look to make sure that I didn't break anything πŸ’₯πŸ™ˆ in the process.
  4. Merge it and go live.

I know we don't want to endorse third-party tools this much

That's more of a personal thing with me than with MS and the Foundation. I yield to management. Go ahead and place whatever you feel is reasonable/useful. Thus far, that content is very light on specifics. If it stays that light, then perhaps just a link list to 3rd party preprocessor options can appear at the end of your CSS preprocessor support section ... a list where we would welcome 3rd party PRs that add new preprocessors to the list and thus level the playing field for everyone. We wouldn't be picking a (or a couple of) "winners" there.

I'll leave the rest of your bullets to Javier, but I'll mention that I do like the way you handle explaining a bit on how the infrastructure works. We don't do it a lot because in most cases we just want to say 'here's the feature, here's how to use it' and consider the framework's implementation details to be less relevant to most devs. In this case, it works well.

btw-- Javier is OOF at the moment ... stand-by for his response when he gets back.

daveabrock commented 4 years ago

Excellent. Thanks @guardrex.

Yes, I feel some infra is needed. I definitely thought about if it is worth it, but folks are very curious about how to integrate with other tools and to do that, some knowledge is needed.

I'll add a little to the preprocessor section sometime this weekend, then will have a fresh PR waiting for you all on Monday.

Have a good weekend!