-
Notifications
You must be signed in to change notification settings - Fork 33
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
LESS support (latest version, for twitter bootstrap 2) #30
Comments
Hi, I'm planning to make press much more modular so it will be possible to add support for other engines as well, such as stylus and sass. |
That would be amazing! Thanks! |
Hi dirckmc, (quietly) complaining :) |
When I said the end of the week, I meant the end of this week :) |
Hi dirckmc, is there a way to do a quick get-around myself (at least to make it to play nicely with less 0.9.1)? |
Hi, I'm working on making the change now. Hopefully it will be done by tomorrow. |
I've deployed the latest release to the module repo, version 1.0.27. |
Great, thanks! Will report... |
I still see that you're using and old less engine (we're using lesscss-engine-1.3.0.jar to support twitter's bootstrap 2). |
[some background] |
Oh I didn't realize I was using an old less engine, I just used the one that another person who made a pull request put in there. If I used a newer version of the less engine jar will that solve the problem? Or will it still have a conflict with less? |
Ok I've updated the version of the less library to 1.3.0. Try out the latest version of press, 1.0.29 |
were you able to run a local application with both dependencies:
? |
I haven't tried it.. did you try it and have a problem? I've updated to less-engine-1.3.0 |
I tried less-0.9.1 and press-1.0.29 and it seems to work fine |
Alright, then I'll try to test everything locally with bootstrap.less file in the and see if it's good. |
I get a strange behavior. Open the homepage (where it has bootstrap.less file that should run via less module, not press!) - you'll see that the css returns with "\n" (as if press changed it) which is corrupted. I've made sure (application.conf) that press.enabled was set to false and didn't add it to routes. The plugin should not have worked and yet it somehow change .less file. In addition, removing press 1.0.29 from the dependencies solves it. |
Hey Oren, |
Dirk, can you please pull https://github.com/lnbogen/bootstrap-sample and see test it there? I get - @6alf7a98g Execution exception (In {module:press-1.0.29}/app/press/ScriptCompressor.java around line 84) play.exceptions.JavaExecutionException: org.mozilla.javascript.Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode; |
Hey Oren, I'm not really sure how to get around this problem. Is it possible for you to use press to compress the less files instead of less? |
Tried to remove less and use press only (you can pull again, I've pushed the change). |
In addition, I see you're using 2.4.6 version of yui-compressor. Thinking of moving to 2.4.7? Might solve known bugs and dependency issues? http://www.yuiblog.com/blog/2011/11/14/announcing-yui-compressor-2-4-7/ |
Ugh this dependency stuff is such a pain. Ok I'll try again and see if I can find the problem with CSS compression. With regards to your question about moving to a later version of yui-compressor: |
By the way in main.html line 108 there's a space before the closing quote that causes an error (on the Mac at least): Also there's no need to check in /public/bootstrap/js/press, this is a temporary directory generated by press on the fly. |
about the bug - thanks! fixed. Regarding the dependencies - it's a mess indeed. Sorry I cannot help more |
Ok I've upgraded the version of yui compressor to 2.4.7, it seems to be working a bit better now, at least the files are not empty and there are no exceptions, although when I tried it with your project it seems like there was some weird escaping going on with \n. |
Yea, I saw the "\n" thus "as you can see, the returned css is malformed.." :/ Notice that it happens regardless of the less module (which is not installed). Obviously, there is something going on with the press module and less file. |
I don't have the issue with CSS in my own tests, I wonder if the less files have a weird encoding? I'm using a Mac and you're using Windows, right? Perhaps that makes a difference with the latest version of lesscss-engine. Are you using any special configuration options with the less module? |
I'm using windows... No special configuration option for the less module. |
Some strange behavior I see (maybe due to how play/modules work that I do not understand). Then it works... How is that possible? Different behavior for local repository module? |
I looked at the source code for the less module, and also the less engine itself. I don't think the \n bug is caused by anything on the Java side, it seems to be something within the JavaScript itself. I'm going to make a workaround for the bug, and also rework the implementation so that it handles imports and so on. It should be done by this afternoon. |
With regards to your questions about the way that dependencies are imported, I agree it just seems to be voodoo with the Rhino dependency. I think probably it depends on the order in which jars are added to the classpath. |
Great, let me know and I'll test it on my demo + real application. Thanks! |
Ok try out press version 1.0.31 |
Hi dirk, please pull again. Still no luck, getting "\n" in the .less files.. |
Is the file still cached? Try making a modification to the file (eg add and then delete a space) and then save it. |
Nope, not cache related... |
I was using my local copy of press, but when I tried with the version I uploaded to playframework.org I saw the same problem as you. Anyway I've uploaded and tested a new version, press 1.0.32 and it works for me. |
PS don't forget to modify the files or it will use the cached copy |
Perfect, works now! |
As far as I can tell I didn't change anything. I think maybe the last time I uploaded it picked up the old files somehow, I'm not really sure. Anyway I'm glad it's working. Please let me know if you run into any other bugs as you're developing. And thanks again for all the help! |
Cool, will let you know! thanks again for your effort! |
Hey folks! I know this is a months-old issue, but I was wondering if either of you ever gained any insight into the whole '\n' thing. I am having a problem wherein the un-minified versions of the less files are being returned with these bad line-breaks. BUT! The weird thing about it is that it's only happening on my teammates' machines and not my own. We're all using macs with the same jvm version, etc... It's super weird. Just wanted to see if you had come across any solutions. I'm using press 1.0.35 (it was happening on 10.33 as well) and less 0.9.1, for what it's worth. OK! Thanks! |
Sadly, I tried to integrate it with no luck so far. It looks like someone needs to take the all thing and create one package to rule them all or we'll always suffer from collisions between PRESS and LESS internal libraries. We currently have only LESS running =( |
Ugh damn it. Sorry I thought this issue was resolved. The problem seems to be that there are two versions of the Rhino jar. One is the standard Rhino included by less-cssengine. The other is a hacked Rhino jar included by yui-compressor. It seems fairly random as to which gets picked up by the JVM. Could you try doing the following:
|
Thanks for the response! Unfortunately, if I remove the less module, a couple of things happen:
I'm sure this is not the intended behavior, so is it possible I'm missing a less-specific conf setting or something? All of this works fine of course, when press-enabled=true. Everything compiles great. I am so sorry for the trouble. For what it's worth, I love this module and apart from these less-support issues, it's been a joy to use. |
hmm yeah you're right that's not how it should work. I guess if press is disabled the less files should still get compiled to CSS, but not compressed. I'd probably add a configuration option in there so that you can still serve raw less if you are trying to debug something. It should be fairly easy to change. I already took some of the code from the Less module, I'd just need to copy a couple of the methods from this class: Unfortunately I had to take my laptop in to get it repaired this morning (I'm in an internet cafe) so I won't get a chance to look at it until next week. I'll let you know when it's fixed. |
That is totally awesome. Thanks so much for the attention on this! |
Still waiting to get my laptop back, hopefully I'll get to this later in the week.. |
Fixed. Please try version 1.0.36 and let me know how it goes. |
Hey, @dirkmc! Sorry the delayed response on this. I've updated to 1.0.36 and removed the LESS module dependency and everything is working like a charm! Thanks again for you attention on this. Total lifesaver. |
That's great, I'm glad to hear it's finally working! |
Hi dirkmc,
Until now, I worked with less 0.9.1.
I want to use press but I have conflicts with versions (less 0.9.1 links to rhino-1.7R3.jar).
Any idea when a new version that supports less, with the latest engine (lesscss-engine-1.3.0.jar) ?
Thanks,
Oren
The text was updated successfully, but these errors were encountered: