Shazwazza / ClientDependency

DEPRECATED. A library for managing CSS & JavaScript dependencies and optimization in ASP.Net
139 stars 65 forks source link

When i make saves in the CMS to styles, it does not update the client dependency #171

Closed jimmyt1988 closed 5 years ago

jimmyt1988 commented 5 years ago

When i make saves in the CMS to styles, it does not update the client dependency and thus doesn't update the front end styles.

Do you recommend me just turning debug="true" on my compilation on my production site? Or is this actually a bug and that when i hit save on a script or style in the CMS, it should actually update the front end to use the new version of the file?

I use the editor to edit my css and js files.

I'm on Umbraco 8.2.0.

Shazwazza commented 5 years ago

If you are developing then you should always be in debug="true". on production set debug="false". Anytime you deploy to production you need to bump the CDF version number in the config/clientdependency.config file to another value. The CDF version number is the cache busting value.

jimmyt1988 commented 5 years ago

What i've learnt: Umbraco does not intend CMS users to adjust the styling/javascript of their website from the CMS on the fly? Interesting.

Thoughts: Why is it available in the CMS for editing when it doesn't make a difference to the site on the fly? Thanks in advance for your help, i'm just a bit confused. I wonder what the reasons are :)

Looking for a solution: Are there any plugins that you are aware of that do allow this behaviour for 8.2.0?

Reason/Context: I liked the idea of doing "colouring corner stuff" on the go. When i saw that you could edit scripts, styles and templates in the CMS, i was sold on using Umbraco over something like Wordpress because of the extra polish it had.

I'm just struggling to justify/vindicate the logic of having to open up VS and ensuring i have my publishing profile set up just so i can make an update to a client dependency number... and i kind of expected my content editors to do a bit of fiddling every now and then too.

Thanks in advance dude.

Shazwazza commented 5 years ago

Hi, Umbraco's intention is of course to allow the ability to edit css/js via the back office since it offers the ability to do so. Using Client Dependency for bundling on your front-end is entirely optional, but is not optional if you are editing styles for use within the back office.

I understand your frustration and this has been discussed for many many years without a resolution of 'just' making CDF work with all features of cache busting + file watching + persistent files. This is mostly because this is my own library that I maintain, it's very old and I don't really have a whole lot of time to invest in it. CDF is not Umbraco's library, it's just a lib that it uses.

You have some work arounds at your disposal:

I will try to revisit this issue in this repo to add the ability to file watch and configure the CDF version outside of the config file because you need to be aware that each time you change the CDF version, it restarts the website due to the nature of asp.net configuration files.