Updates to lessc

Thanks Jenny. Forwarding to commcare-developers as well.

Simon Kelly
Director of Server Engineer | Dimagi

··· On 14 November 2017 at 16:22, Jenny Schweers wrote:

Hello HQ devs (everyone else can skip this),

There have been some changes to how we use less during the deploy process,
which might affect your local environment. Skip to the end of this if you
don’t care about the background.

For background, we used to have two versions of less installed on our
servers, because bootstrap 2 required a very old version of less (1.3)
while bootstrap 3 needed at least a slightly more up to date version (1.7).
We stopped using bootstrap 2 a while ago but still had this two-version
configuration around, which made life harder for new devs setting up an HQ
environment and reading through a long, multi-option LESS setup process.
During the past few days, we’ve removed the old version of less, removed
some code that references it, updated to the newest version (2.7), and
clarified the readme.

All devs should be using client-side less compilation: it’s the easiest to
set up and use. The one exception to this is if you’re debugging
compression errors - then it’s useful to mimic production and compress
offline.

What this means for you: depending on how you set up less locally, you
may see less errors like .make-grid-columns is undefined. Fix them by
doing this:

  • update less: sudo npm install -g less
  • In localsettings, verify you have the following values set:
    LESS_DEBUG = True
    COMPRESS_ENABLED = False
    COMPRESS_OFFLINE = False
  • In localsettings, you can also remove COMPRESS_MINT_DELAY,
    COMPRESS_MTIME_DELAY, COMPRESS_REBUILD_TIMEOUT, and LESS_FOR_BOOTSTRAP_3_
    BINARY

-Jenny