core icon indicating copy to clipboard operation
core copied to clipboard

Implement LibSass CSS preprocessor / deprecate LessCompiler

Open wezell opened this issue 8 years ago • 8 comments

Our Sass compiler is old, slow and does not support newer sass constructs. We need a new Sass compiler that leverages libsass rather than a jruby implementation.

In order to use this new compiler, we will need to ship dotCMS the native libsass library connectors that are available in the jsass. https://github.com/bit3/jsass

there is also a new config property USE_LIBSASS_FOR_SASS_COMPILATION - defaults to true

Less support has been deprecated, as is the legacy sass compiler support that relied on jruby.

wezell avatar Jan 19 '18 17:01 wezell

Passed QA. Tested on release-4.3.0 branch Mac OS 10.10 / Postgres 9.6.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8.6

shaydotcms avatar Feb 15 '18 18:02 shaydotcms

I noticed that the old SassCompiler is still used as default. Looking at the code the use of DotLibSassCompiler seems to be commented out in release 4.3.1. See https://github.com/dotCMS/core/blob/bb81de4eeaa9de17a3ff6def339a115b7bd7d33e/dotCMS/src/main/java/com/dotcms/csspreproc/CSSPreProcessServlet.java#L87

gblankendal avatar Feb 26 '18 14:02 gblankendal

Test case created here: http://qa.dotcms.com/index.php?/cases/view/62073

bryanboza avatar Feb 26 '18 19:02 bryanboza

After testing this new compiler, we have problems refreshing changes in the files

  • If you made some changes in the files locally, and then upload again via webdav (override the originals), and then refresh the browser, we are able to see the changes

  • But if you made the changes via webdav (just editing the file) or via backed, and then refresh the browser, we are unable to see the changes

Testing in a Private mode with multiple browsers and have the same problem

bryanboza avatar Feb 26 '18 20:02 bryanboza

PR ee (master) for fixing issue with runnable: https://github.com/dotCMS/enterprise-2.x/pull/592

dsilvam avatar Feb 28 '18 21:02 dsilvam

PR: https://github.com/dotCMS/enterprise-2.x/pull/594

erickgonzalez avatar Mar 06 '18 16:03 erickgonzalez

Note to QA: please make sure to test the imports with filenames with and without "_" at the beginning, both in the import and in the file

dsilvam avatar Mar 06 '18 18:03 dsilvam

Fixed, tested after the last changes and now we are able to compile without the "_" prefix. Tested in the last master code // postgres // FF .

Also test cases where created here: http://qa.dotcms.com/index.php?/cases/view/62073 and the new example was uploaded to the QA repo on git: https://github.com/dotCMS/qa/tree/master/artifacts/SASS/scss.zip

bryanboza avatar Mar 19 '18 19:03 bryanboza