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

Using a better less compiler #419

Open
pauldotknopf opened this issue Jan 27, 2017 · 5 comments
Open

Using a better less compiler #419

pauldotknopf opened this issue Jan 27, 2017 · 5 comments
Labels
Discussion/Question Discussions or questions about the code

Comments

@pauldotknopf
Copy link
Contributor

dotLess is pretty horrible.

It doesn't execute javascript, and as you can already tell, it can't compile bootstrap without modifications or warnings.

I recommend using JavaScriptServices to expose node to C#, and actually use the less compiler from http://lesscss.org/

This can complicate setups a little bit, in that they will have to have a node in their path.

@pauldotknopf
Copy link
Contributor Author

Also, JavaScriptServices is xplat.

@daveaglick
Copy link
Member

Does that require having the Node executable available (I.e., does it "shell out" the execution)? If so, I'm a little hesitant. I'd love to keep everything as native as possible to avoid platform compatibility problems in the future.

That said, I'm also not totally thrilled with DotLess...

@daveaglick daveaglick added the Discussion/Question Discussions or questions about the code label Jan 31, 2017
@pauldotknopf
Copy link
Contributor Author

pauldotknopf commented Jan 31, 2017

does it "shell out" the execution

Yes.

keep everything as native as possible to avoid platform compatibility

Sadly, the less standard has support for executing javascript. So, nothing will every been in pure c#. You will need v8.

@daveaglick
Copy link
Member

Ah, interesting - hadn't even considered the whole "JS inside Less" aspect. What about one of the libraries that implements a fully-managed JavaScript interpreter (like Jint which is what AngleSharp uses)? I've actually been meaning to check out this route for Sass compilation as well. I wonder if one of them would be able to consume the official JS Less compiler...

@daveaglick
Copy link
Member

Note that we now have a fully integrated JavaScript runtime built-in thanks to @enkafan (#452). It supports Jint by default and the user can swap out alternative JavaScript engines if they want to. The nice thing is that the engine is use is abstracted from the module perspective - modules just have to say "run this JavaScript". That should make it a bit easier to consume JavaScript libraries during execution without worrying about external dependencies, shelling out, and the like.

We're still getting a handle on how best to make use of this new capability and how to correctly interoperate with Node libraries, but it should hopefully open up scenarios like consuming a JS-based Less compiler like this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion/Question Discussions or questions about the code
Development

No branches or pull requests

2 participants