Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lessphp is falling off, preparing for alternatives - how? #67

Open
lkraav opened this issue Feb 27, 2014 · 19 comments
Open

lessphp is falling off, preparing for alternatives - how? #67

lkraav opened this issue Feb 27, 2014 · 19 comments

Comments

@lkraav
Copy link

lkraav commented Feb 27, 2014

thom4parisot/wp-less#53 has an overview of the situation. leafo/lessphp seems to be dying.

@meitzner-hannes
Copy link

It is. You can specify less.php as drop-in.

By the way, it seams to me that there is an bug regarding this.
In the "lib/Compiler.class.php" File will be checked if the the global "WP_LESS_COMPILER" is set.
But as far as I can see this Global never gets set, not even a default.
Also the same file second line "$compiler = 'lessphp';" never get used, is it?

Found that today as lessphp fails to compile my less files using the Semantic Grid System.
Hopefully less.php does a better job :)
But it seams so.

Greetings!

@lkraav
Copy link
Author

lkraav commented Feb 27, 2014

README doesn't state how to switch between compiler implementations. Maybe you want to open a pull request with an added instruction how you do it?

@roborourke
Copy link
Owner

I think the way the uses of preprocessors is going it'd be be better to put
the time into making an easy install gulp.js implementation that can be
applied to a WP implementation.

@lkraav
Copy link
Author

lkraav commented Feb 27, 2014

Geez, I'm having a hard time staying up to date with all these *js new technologies :) Going to google gulp js now..

EDIT mmmkay. I for one have no idea how to set that up here.

@lkraav
Copy link
Author

lkraav commented Mar 3, 2014

@jeremyhaile
Copy link

@lkraav is there a way to use wp-lesscss as an alternative compiler? I can't find any instructions. Also - is there any way to use the native less compiler rather than a PHP version? I'd be totally happy just having a plugin that ran "lessc" on the server to compile LESS files when they update.

@jeremyhaile
Copy link

For example, I really want to use LESS' @import (inline) "my.css" but it isn't supported by lessphp.

@lkraav
Copy link
Author

lkraav commented Mar 14, 2014

Haven't had any time to upgrade myself yet either, still running on stock for now, since I don't actually require anything better right at this moment.

@lkraav
Copy link
Author

lkraav commented Mar 23, 2014

It looks like it is as easy as changing the require section in composer.json

"oyejorge/less.php": "~1.5"

Then "composer update" will drop-in replace leafo with less.php

@lkraav
Copy link
Author

lkraav commented Mar 23, 2014

I'm noticing I have to use quoted url() notation with the new parser

url("@{themeurl}/img/something.jpg")

or @{themeurl} will not get parsed. Otherwise things seem nice. I'm able to nicely inline @import a filename passed via "less_vars" filter, so I'd say #23 can be solved by switching the parser.

scottsweb added a commit to scottsweb/wp-less that referenced this issue Jun 13, 2014
…ne thing to note is that variables within URLs must be place within quotes "" as noted here: roborourke#67 (comment)
@roborourke
Copy link
Owner

@lkraav or @scottsweb would you be able to get a PR ready on this repo for this? Don't have much time at the mo!

@vburlak
Copy link
Contributor

vburlak commented Mar 22, 2015

@scottsweb thx a lot for reference.

Had an errors with compilation latest bootstrap 3.3.4 via lessphp.
Then, tested your fork with less.php compiler — and all compiled well.

@vburlak
Copy link
Contributor

vburlak commented Mar 23, 2015

Important: when installing wp-less via Composer — it installs less.php as a dependency package.
Theme Check plugin found a /test directory in less.php package with a lot of "unwanted" stuff in it..

I'm sure, that /test directory must be removed from composer installation. Read more about in my pull request note: oyejorge/less.php/pull/215

@lkraav
Copy link
Author

lkraav commented Mar 23, 2015

@vburlak you're right. I've noticed this myself as well.

@vburlak
Copy link
Contributor

vburlak commented Mar 23, 2015

oh, I was not careful in the morning :(

Theme Check reportes more warnings in less.php/lib/less/parser.php

WARNING: Found ini_set in the file /lib/Less/Parser.php. Themes should not change server PHP settings.

  • Line 173: @ini_set('precision',16);
  • Line 211: @ini_set('precision',$precision);
  • Line 471: @ini_set('mbstring.internal_encoding', 'ascii');
  • Line 478: @ini_set('mbstring.internal_encoding', $mb_internal_encoding);

Any suggestions, how it can be replaces is less.php package?

@vburlak
Copy link
Contributor

vburlak commented Mar 23, 2015

Found old issue in less.php repo about @ini_set('precision',16); strings - oyejorge/less.php/issues/21

Tried just comment it in my local installation of less.php — at first glance, still compiles fine. Need more testing..

@vburlak
Copy link
Contributor

vburlak commented Mar 23, 2015

In _parse function from /lib/Less/Parser.php found one more issue: it isn't override LESS variables previously defined in .less files.
Tried to pass variables via less_vars filter and add_less_var() function — both methods igrnored and less.php compiles variables from .less files.

That have reference in less.php issues oyejorge/less.php/issues/162 . Can't understand how it can be fixed in wp-less.

Conclusion for _parse function:

  • need to understand what to do with @ini_set('mbstring.internal_encoding', 'ascii'); and @ini_set('mbstring.internal_encoding', $mb_internal_encoding); (Theme Check Warnings)
  • need to implement fix for overriding LESS variables set in files

@scottsweb
Copy link
Contributor

Unfortunately a pull request from my repo looks like it would be a tricky(ish) merge @sanchothefat as my fork is based on @tarendai's fork (which introduced logging and https support and quite a few other changes).

It's a very small change to composer.json to switch the compiler: scottsweb@622541a and I have been running it for some time without any issues.

@tomjn
Copy link
Contributor

tomjn commented Apr 1, 2015

I'd recommend merging my fork into yours if possible, if only because it makes debugging issues 1 million times easier, and it provides a place to put a rebuild button and somewhere to make use of the WP File system apis from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants