Less.js: Rhino Support in 2.x

Created on 28 Nov 2014  路  6Comments  路  Source: less/less.js

How does Rhino support work in 2.x? I noticed that the information on the webpage is outdated because there is no less-rhino in 2.x although the website states:
http://lesscss.org/#command-line-with-rhino

"Each less.js release contains also rhino-compatible version."
and
"java -jar js.jar -f less-rhino-.js lessc-rhino-.js styles.less styles.css"

How does one proceed here?

high priority question rhino

Most helpful comment

It would be nice to at least update documentation, which currently says ...

Each less.js release contains also rhino-compatible version.

... and causes waste of time trying to find the way to run LESS 2.x with Rhino.

All 6 comments

I've been looking into the same thing my self. The bad news is it would seem you're stuck on 1.7.5 for now.

The heart of the matter is that 2.x is a major overhaul of less, specifically they have started to rely heavly on the use of Promises, which is only supported by quite modern browsers: (This link has a fairly complete list of platforms which support Promises: http://kangax.github.io/compat-table/es6/)

Based on a quick glance of the code, it would seem that they have tried to mitigate this requirement by implementing a polyfill of Promises. Unfortunately that implementation seems to be borked, specifically they invoke a parameterless Resolve() in line 680, which causes Less to shortcircut the remaining logic.

In short, even if the team distributed the missing files, it will not work. Less v. 2.x cannot easily be brought to execute successfully using Rhino, and the browser option is limited to the versions shown in the link above.

Since I'm just a user like you, I cannot know if, when and how they plan to handle this issue.

This is related to #2322 (premises) and probably to #2063 (nashorn support).

It would be nice to at least update documentation, which currently says ...

Each less.js release contains also rhino-compatible version.

... and causes waste of time trying to find the way to run LESS 2.x with Rhino.

Yes.....I also wasted precious time because of this...

Unfortunately, there aren't active maintainers who know anything about Rhino. Without expertise in Rhino, the maintenance of that piece has fallen by the wayside.

I would propose that someone make a separate less-rhino repo that's more dedicated to this piece, and that this is removed from the main less.js repo. There were never any tests made for Rhino, whomever did the original implementation, and it was not integrated into the main build process, meaning it wasn't, by default, part of regular releases.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joe223 picture joe223  路  4Comments

rejas picture rejas  路  6Comments

BrianMulhall picture BrianMulhall  路  4Comments

xblakestone picture xblakestone  路  3Comments

awebdev picture awebdev  路  4Comments