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

ClientAssets package beta not behaving as expected #42472

Closed
1 task done
MarkStega opened this issue Jun 28, 2022 · 8 comments
Closed
1 task done

ClientAssets package beta not behaving as expected #42472

MarkStega opened this issue Jun 28, 2022 · 8 comments

Comments

@MarkStega
Copy link

MarkStega commented Jun 28, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

@javiercn I've implemented the section of your blog post about the ClientAssets beta that follows the "Reusing MsBuild code" to just try to build my css

  1. In the blog post most of the first 'PropertyGroup' elements have improper closures, nothing serious that isn't easy to fix

  2. When I run a build I see the 'npm install' run followed by my commands to build css, but then the 'npm install' runs again as does the build command, this time with an output parameter added to the npm command

1>> material.blazor@2.0.0 buildStaticWebAssetsCSS
1>> npm run build-css2&&npm run build-min-css2&npm run build-material-css2 "-o" "C:\\Solutions\\OHI\\Material.Blazor\\Material.Blazor\\obj\\Debug\\net6.0\\clientassets/"
  1. To have separated css/js builds is it simply replicating the target NpmRunBuild step, changing files as needed?

Expected Behavior

I don't expect the duplicate 'runs' of npm & build

Steps To Reproduce

See bug description

Exceptions (if any)

No response

.NET Version

6.0.301

Anything else?

@javiercn
Copy link
Member

@MarkStega can you point me to a branch?

@MarkStega
Copy link
Author

@javiercn

On my fork of material blazor (https://github.com/OptimiumHealth/Material.Blazor) there is a branch called StaticResources

@MarkStega
Copy link
Author

MarkStega commented Jun 28, 2022

After several hours of experimentation:

  1. I am seeing two 'npm install' commands after renaming the targets but only one build. I 'swallowed' the error caused by the output path on the last npm command in the chain by adding '&&npm --version'. However, since I changed the command to remove the output directory I don't think I should have needed to do this.

  2. 'npm install' seems to always run on a build

  3. The output files are not getting marked as content. For some reason, the clientassetsbuild.complete.txt file is empty.

The aforementioned branch is updated.

@MarkStega
Copy link
Author

@javiercn I ended up having to use '.' as the staticassetsdirectory; Everything was fine when I was building css, but when I tried to build my typescript I ran afoul with includes. After several hours of trying to get the ts build to work I gave up, moved the directory to '.'.

The assets are being generated & stored in 'StaticAssets' (my version of 'dist') but still aren't getting tagged as content (same issue as #3 above I suspect).

@javiercn
Copy link
Member

@MarkStega I'm a bit busy with other workitems, but I'll take a look at your solution when I can. @TanayParikh is going to be working in this area, so he'll have throughts as he works through the implementation for the actual SDK feature.

There might be bugs with the package, mainly because it is much harder to test (it essentially manual testing) compared to when the feature is built-in into the product where we already have the infrastructure to test all the MSBuild cases.

@MarkStega
Copy link
Author

MarkStega commented Jun 29, 2022

@javiercn No worries, look when you can, our current solution is OK even though we have extra copies of the web assets in the nuget package. If it is something other than a mistake that I made I certainly wouldn't request to have it fixed as the preview 7 feature outlined in #38445 is not that far away.

@javiercn javiercn added this to the .NET 7 Planning milestone Jul 4, 2022
@ghost
Copy link

ghost commented Jul 4, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT
Copy link
Member

Closing this will be covered as part of #38445

@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants