MattCheely / requirejs-maven-plugin

Maven plugin for RequireJS optimization
GNU Lesser General Public License v2.1
66 stars 21 forks source link

Use Node if available #13

Closed MattCheely closed 11 years ago

MattCheely commented 11 years ago

Rhino is slower than molasses in January. Figure out a way to detect Node.js and run the optimizer with it if it's available.

akoskm commented 11 years ago

From the commit above I guess this is implemented.

However if I put nodejs, the time it takes to optimize is roughly the same like without this option. Using node directly on my buid config takes aroud 16s to pass, with this option it takes more than a minute (same with rhino).

MattCheely commented 11 years ago

There's an initial implementation, but it hasn't been tested very well yet. It also hasn't been pushed to the maven repositories, so you won't see it unless you're building from source.

If you can provide me with some details, I may be able to help you out.

What OS you are using? Is node installed and on the system path? Can you send the plugin configuration from your pom.xml?

akoskm commented 11 years ago

You were right about that, I cloned the repo but forgot to set the latest version in the pom file which used the plugin.

After building and packaging the latest source and setting the right version the plugin used node to create the optimized build.

I noticed that even if I'm explicitly setting rhino as the runner the plugins ignores it and uses node. Looking at the source this is the normal behavior, which cannot be overridden.

MattCheely commented 11 years ago

Yes, the current version tries to detect node and uses it if it's found. It assumes that this is better than using rhino. It also means you shouldn't have to specify a path to node if it's on the path. I will probably add an override option that forces the plugin to use rhino before the next release.

On Tue, Apr 9, 2013 at 5:10 PM, akoskm notifications@github.com wrote:

You were right about that, I cloned the repo but forgot to set the latest version in the pom file which used the plugin.

After building and packaging the latest source and setting the right version the plugin used node to create the optimized build.

I noticed that even if I'm explicitly setting rhino as the runner the plugins ignores it and uses node.

— Reply to this email directly or view it on GitHubhttps://github.com/mcheely/requirejs-maven-plugin/issues/13#issuecomment-16140419 .

damiengenet commented 11 years ago

That's great news, using RequireJs with Rhino is unbearably slow on big projects. Do you intend to make a release anytime soon? - could be tagged as RC if you have some worries about stability - Thanks

MattCheely commented 11 years ago

I am hoping to push out at least a SNAPSHOT version this weekend, as long as nothing unexpected comes up.

MattCheely commented 11 years ago

A snapshot version with node support has been release: 2.0.0-SNAPSHOT You will need to add the sonatype snapshot repository to your pom to resolve the dependency. The configuration below should work, although I have not tested it. If you could try it out in your projects and let me know if there are any problems, I would appreciate it. I will likely push a full release in a week or so if no issues present themselves.

<repositories>
    <repository>
      <id>sonatype-snapshot</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
 </repositories>
damiengenet commented 11 years ago

It seems to work fine for me, thanks.

akoskm commented 11 years ago

Node support works fine in 2.0.0-SNAPSHOT. Hope you will get this into the maven repositories soon.

pekim commented 11 years ago

It provides a nice boost. Instead of about 38-40 seconds with Rhino, this brings the goal down to 7 seconds for me.

akoskm commented 11 years ago

Any updates on this?

MattCheely commented 11 years ago

Hey guys, Sorry about the delay on getting this released. I wanted to do it last weekend, but during an Ubuntu upgrade, grub somehow got borked and that's the only machine with the GPG key I use to sign the releases. I thought I had it backed up, but apparently that was less true than I believed. So now I have unbork my laptop before I can push a release.

Sorry about the weak-ass excuses - I know it's not helpful if you're working on a project that's waiting for this. I'm going to try to get it done tonight.

pekim commented 11 years ago

No problem. Despite wanting this released, I know what it's like to be on the other end. (I maintain a project where I I don't always have time to fix issues or release new versions as quickly as I'd like.)

MattCheely commented 11 years ago

I have finally taken care of the release for version 2.0.0. Sorry about the delays on this one guys. It may take as long as 24hrs to be synced from the sonatype repos to maven central.

In other news, I'm looking for someone to take over the project. I'm realizing that I just don't have time anymore to maintain a plugin that I'm no longer using in any ongoing projects. If anyone is interested, send me an email: matt.cheely@gmail.com