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

Productionize ClientAssets #40572

Closed
javiercn opened this issue Mar 7, 2022 · 9 comments
Closed

Productionize ClientAssets #40572

javiercn opened this issue Mar 7, 2022 · 9 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-razor-sdk
Milestone

Comments

@javiercn
Copy link
Member

javiercn commented Mar 7, 2022

We see people struggle with integrating third-party JS assets into the ASP.NET Core pipeline.

This issue tracks productionizing the package Microsoft.AspNetCore.ClientAssets that we put out a while ago to simplify this process..

More details here

@ghost
Copy link

ghost commented Mar 7, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@Liero
Copy link

Liero commented Apr 20, 2022

The problem I have with Microsoft.AspNetCore.ClientAssets is that it does not support watch mode as far as I know.

@javiercn
Copy link
Member Author

@Liero It is not clear to me how watch would play a role here.

This is not about "running" the project on VS or the CLI but about doing a one-shot build. If you wanted to use something like watch, you would start the Web app and then would call watch on a terminal to get the process going.

@Liero
Copy link

Liero commented Apr 24, 2022

How do I write and test the client assets, e.g. some scss and typescript for UI components?

In a demo or test project that references the RCL and without being able to run in watch mode, it is very painful.

If I need to do full "one-shot" build each time I change a scss or typescript, development of those components takes forever. It's very frustrating, that all the tools required to build client assets supports watch mode, but there no convenient (nor easy) way to use it in Blazor RCL.

At the end, the Microsoft.AspNetCore.ClientAssets is good for CI builds maybe, but suboptimal for development, so I will end up with either two different build system (for development with watch mode and for CI), or I don't use otherwise nice Microsoft.AspNetCore.ClientAssets. Sofia's choice

@javiercn
Copy link
Member Author

#41921

@benlongo
Copy link

ClientAssets has generally worked but I had to make some hacky modifications to get it to call npm ci correctly. I want what's in the lockfile. Also it assumes some things about the structure of your build command so you can't pass the directories if your flags use = instead of for instance.

@javiercn
Copy link
Member Author

@benlongo thanks for the additional details.

Part of productionizing this workload involves finding out the right knobs to ensure that it works well in multiple configurations and with multiple tools.

@Liero
Copy link

Liero commented Jun 15, 2022

@javiercn

It is not clear to me how watch would play a role here.

Yet another scenario: I'm about to split a Web app into multiple smaller RCL projects (project per subdomain + shared project).
The RCL typically contains typescript and scss files. When tuning a stylesheets on a page implemented in RCL project, it it quite important to have the live reload functionality.

I'm not sure whether dotnet watch can handle live reload of static web assets in referenced RCL, but if it does, it would be very nice if the ClientAssets package supported it

@javiercn
Copy link
Member Author

Closing in favor of the tracking issue #38445

@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-razor-sdk
Projects
None yet
Development

No branches or pull requests

3 participants