umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.67k forks source link

Can't disable Razor runtime compilation in "development" runtime mode. #12706

Open JasonElkin opened 2 years ago

JasonElkin commented 2 years ago

Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9

v10.1.0 RC

Bug summary

Firstly, this new feature in 10.1 is great!

I came here needing Razor runtime compilation disabled, and my problem is half solved (🎉), but the only way to disable it is to use the "production" runtime mode. The production mode enforces settings that are not right for my environment (it's not a production environment).

It would be helpful to be able to disable Razor runtime compilation independently of the runtime mode - perhaps as its own setting that the production mode can then validate, like the others?

Steps to reproduce

Install Umbraco 10.1.0 RC. Use "development" runtime mode. Razor runtime compilation is enabled, with no option to turn off.

Expected result / actual result

Razor runtime compilation to be configurable independently of other environment specific settings.

github-actions[bot] commented 2 years ago

Hi there @JasonElkin!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

nul800sebastiaan commented 2 years ago

Thanks @JasonElkin - we're working on it but it's a difficult problem: https://github.com/umbraco/Umbraco-CMS/pull/12631#issuecomment-1180389100

I'll assign this to @ronaldbarendse since he's been trying out different options. FYI: I don't expect this to make a lot of progress over the next few weeks, and it looks like this will need to be done in a new major due to breaking changes.

JasonElkin commented 2 years ago

I'm not actually after Hot Reload here @nul800sebastiaan , which I think is what @ronaldbarendse is getting at there.

I literally just want runtime compilation itself disabled - i.e. I don't want the file watchers enabled, and I don't want changes to files (or anything else) to result in a recompilation of my razor views (I'm working some edge-case high performance optimisations).

As such, all I think all this really needs is a dedicated setting here so it can be controlled independently of the runtime mode.

nul800sebastiaan commented 2 years ago

~Yes, but do read the second half of that comment. 😉~

~We currently rely on Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation which messes with your wish and is something we want to look at in the future.~

nul800sebastiaan commented 2 years ago

Scratch that, I should read better instead.. let me enquire.

martinlcp commented 2 years ago

My comment https://github.com/umbraco/Umbraco-CMS/pull/12631#issuecomment-1185344703 in @ronaldbarendse thread requests the same thing. Having the option to turn off RuntimeCompilation no-matter what mode your running should essentially re-enable IDE/SDK features (hot-reload/CSS isolation/watch etc). I understand that would probably break runtime recompilation of modelsbuilder in the backoffice, but I tend to build out the back-end first. Then I need a mode that gives me IDE freedom to build my views and CSS as intended in .net 6.