I've been working on a project with Clojure and Noir and I'm enjoying the free hosting on Heroku's cedar stack. I've recently added some UI work in ClojureScript to find that it works locally but crashes on Heroku due to their use of the OpenJDK. The OpenJDK has the Rhino JavaScript engine in a different namespace.
Has anyone heard of a workaround to this problem? Can a version of Rhino with the correct namespace be installed as a project dependency? Or is there an alternative to Heroku that uses the Oracle JDK?
According to this post, the issues with ClojureScript and OpenJDK are supposed to have been resolved on the ClojureScript master branch.
I think this is a feature request for the ClojureScript bug-tracker. Lots of people have this issue (at least I do) so it should get attention.
Heroku is not really intending to support ClojureScript (yet) and does a lot more in terms of hosting than a compiled ClojureScript program really needs. perhaps you can find a provider that will just host javascript and send them the compiled.js instead of a java class that starts it's own java interpreter.
I agree that not using Heroku is a pain because it has the best (of my experiences) integration with git+clojure+leiningen. perhaps either Heroku or the Clojure folks will fix this soon :-/
Related
I have a requirement where I need to develop a Point of Sale system.
I want to know if it is possible to install that small point of sale app
on some machine without source code ?
Thanks for all suggestions.
I just thought I'd mention this for anybody that finds this question useful in the future.
There was a discussion about turning a Django webapp into a local app here:
https://groups.google.com/forum/#!topic/django-users/-VGqvHew35g
They provide some interesting solutions for converting the webapp into a local/desktop app.
Django is a web framework. There's no need to install any code on a client machine, since you would access it via a web browser.
I am working on an Ember-Rails app. I have used Yeoman previously for building non-ember-rails apps and js plugins and I would love to be able to realize the benefits of Yeoman (especially Grunt's livereload) when working on my Ember-Rails projects. However, I am unsure as to whether Ember, Rails, and Yeoman are fully compatible and whether they overlap in their roles and responsibilities. For example:
Dependency Management
- I understand Bower is used for dependency management. Does Bower affect how assets are loaded through the rails asset pipeline? What are the advantages/disadvantages of loading dependencies through Bower instead of using Rails gems?
Livereload
- Does livereload function with a single-page app (like one built in Ember) in the same way it does with a multi-page app (for example, an html site that doesn't use a js framework)? Are individual models/views/controllers reloaded or does the whole app reload and/or recompile through the Rails asset pipeline?
Existing Project
- Are there pitfalls when integrating Yeoman into an existing Ember-Rails app? We're running Ember 1.3.0-beta and Ember Data 1.0.0-beta on our production. If you have experience with up-to-date Ember builds, are Ember-auth and Ember-data compatible with Yeoman?
If anyone has experience combining Ember, Rails, and Yeoman, or if you understand how the frontend and backend would compare with such a stack please share your thoughts! Would you recommend just integrating part of the Yeoman setup (e.g. Grunt) with an Ember-Rails app instead of the whole of Yeoman?
Thanks.
I'm not Rails&Ember guy, but here are my general thoughts about feasibility of using Yeoman:
Not using Yeoman: Feasibility
From my experience in combining Yeoman & Django, I must say that it starts to pay off only in medium-sized or bigger projects.
In smaller ones, particularly with tight deadlines and not much attention paid to the code quality & tech. solutions used (like Univ. projects), you'll be probably better off sticking with bare Rails (downloading JS libraries manually and committing them accordingly to the Rails project structure).
The reason is simple: It might be really time-consuming to fine tune both full-stack framework (Rails) with frontend-framework (Yeoman).
Particularly if Rails is driven by CoC principle.
It might seem to work after some setup, but as the project evolves, you will spot further obstacles and you'll have to tamper waaaaaaay more.
Cons & things I consider not worth this time investment:
Livereload
I like it very much, I was amazed with it at first, but after some time I see that I don't spend that much time editing HTML&CSS in IDE and watching static page on another screen automatically refresh. In majority of cases I still need to do Alt + tab and trigger some action, perform some click, so whether I add one Ctrl+R hit in-between doesn't do any difference.
In some cases you'll be better off playing around with Local Folders Mappings (Chrome Dev Tools) or web proxy (e.g.: Fiddler).
There are cases where Livereload does a brilliant job though, such as for instance not needing to perform full reload if you edited only CSS.
As for your questions:
For me if it detects changes in JS it reloads whole page. But maybe it's because I'm using JetBrains IDEs (filesystem cache'ing) and CoffeScript (compilation to JS).
Yeoman is best suited for SPAs. Would it be acceptable for you to make it a SPA, not a round trip app ?
Bower - Attempt to provide dependency management for github projects
What bower does for your app is basically downloading stuff from github. No rocket science here.
If the structure of downloaded thing is non-standard, Bower/RequireJS/Grunt-bower-install has no bloody idea what to do with it next, i.e. how to inject everything so that you won't get errors. For most popular libraries bower just works, for highly customized ones you will end up injecting downloaded stuff manually.
The ones to blame are people who don't package useful github projects properly.
Furthermore I heard of workflows where people commit bower_components due to problems with bower, never experienced personally though, perhaps the issues were fixed. If so possibility of not committing 3rd libraries to source code is definitely an advantage.
Note: As I pointed out above, it's how bower helps you developing your app, but bower has become somewhat a standard in the frontend community, for instance http://ngmodules.org/ is build on top of that, so it's a important tool.
Can Rails assembly pipeline fetch arbitrary github project ? Yes.
Can it inject library references to your html ? Duno, I'm not Rails guy.
Generators
Some could do a beautiful job, such as configuring whole heroku-related stuff for you. Too bad generator-heroku doesn't work as expected (tried it sth like 2 months ago). Same was true for travis generator. In this case fix was easy, but see the next point.
As for Angular generators (I'm Angular guy, not Ember guy, sorry :-) ) - it just adds 2 files and includes them in index.html, furthermore if you are using not so straight-forward syntax for creating JS framework related stuff (sample: Angular-related stuff in coffee) generator will most probably not know about it. Ok, you can submit a patch to generator, but then AngularJS team decides to change the syntax a little bit in the next release - you get the idea ? - again, see the next point.
What is more, if your project uses layout in which code is structured by feature/module (e.g. admin module, profile settings module, ...), not by type (directives, controllers, ...) framework-specific generators won't work.
Stability
Karma is evolving rapidly, so does Angular, Angular-UI and loads of fronted tools, frameworks.
It's really difficult for Yeoman to keep up with most recent changes, although they do a nice job here.
Employing Yeoman: Being cutting-edge
Yeoman provides some really cool stuff such as:
Linting
Compiling coffeescript, SASS/SCSS, etc. on the fly
CDNifying
Really useful when you want to have libraries downloaded locally in case of developing offline and still benefit from pros of CDN.
Without Grunt you would have ended up writing scripts parsing your HTMLs
Automated JS/CSS minification
Grunt does it for you. You only have to configure it properly.
Encouraging separation and low coupling of your frontend and backend
As for your question: I doubt that you'll be able to manage Rails part solely with Yeoman.
A good recipe for a web app in Yeoman & sth is: https://stackoverflow.com/a/19425461/1432478.
That's for Django, adapt it accordingly to Rails.
My opinion
In majority of small projects based purely on Spring MVC, Rails, Django, etc. you simply don't perform any of things done by Grunt (hence there's less time expenditure for setup).
There are cases when producing technologically advanced frontend is a must.
e.g.: Most recently I discovered that my bank account management system doesn't minify JSes. Even funny comments are left as they were. I didn't perform any rushed money withdrawal, but I hope they at least have server-side validation. :-)
Yeoman is a really good combination of solutions facilitating all those chores.
Using only Grunt? IMHO No. Yeoman is Grunt when it comes to app assembly. You get Livereload and other stuff for free.
If:
you're lucky and found sample config that seems to work for the web framework of your choice or managed to configure one on your own
don't have deadlines to hold
then you should probably give it a try.
If you will work on multiple projects, chore of configuring it once might pay off by copy-pasting config to future projects.
But keep in mind that frontend technologies are rapidly evolving, that's why tons of samples from the net simply don't work out of the box.
Further reading :)
http://blog.tfnico.com/2013/07/considerations-for-javascript-in-modern.html
Java world here, but I hope some concepts will be useful:
http://addyosmani.com/blog/making-maven-grunt/
Javascript web app and Java server, build all in Maven or use Grunt for web app?
While developing a REST service I want to be able to manually submit some data (e.g. by PUT or POST method) to a specific URL and see the response. The only tool I know is SoapUI, which is not only a commercial product, but a bit overcomplicated while my task is so simple. There is a question about SoapUI alternatives, but all the discussion there is about SOAP services, while what I need is just some REST :-) Any ideas? I know I can write such a tool myself pretty easily, but I'd prefer not to reinvent a bicycle if there is one.
UPDATE: Mark Cidade's answer is ok, but I'd wish the tool could run on Linux too...
UPDATE 2: The solution of my choice came to be HttpRequester Firefox extension.
I have just discovered and installed RESTClient, which is a Firefox add-on (it's ideal for me as I do most development on FF, both on Windows and Linux). No idea if it's any good yet. :)
EDIT: I've started it using extensively since, and it's very good, it really gives back a lot of data about the response and the request.
My favorite is WizTools RESTClient which is written in Java. A nice feature is that it lets you save requests and responses to file if you want to reload them later. It's also cross-platform thanks to Java.
There is yet another free handy application called Postman which will let you do this. It was initially launched as a Chrome plugin and since then is available on the Mac.
I use the Chrome plugin extensively on Windows, Linux and Mac. What I find most useful is the fact that, when signed in, all your requests can be synced across all machines. I use the Mac at the office and when I get home, I pick up where I left of on a Windows machine.
Cross platform insomnia you must test it.
If you use mac then paw another option
Any HTTP request tester will do. Fiddler is a good one.
You can try this online testing tool https://reqbin.com/
For Mac and Linux there is Charles http://www.charlesproxy.com/ but it is not free.
If you need tool, which you can run on Linux, try WebScarab, it is written on Java.
https://restclientgui.codeplex.com
Download it from the downloads section
I'm Only Resting works for me.
I'm quite fond of either Fiddler (if you need to dig into things deeper) or Insomnia (if you're trying to get to grips with a particular REST API).
Fiddler runs on Linux using the Mono runtime. Insomnia provides Linux packages. I like that Insomnia has a scaffolding generator for the most popular languages, so when you made a particular REST API call work in Insomnia, you can generate code for many languages from that. Neat!
Telerik now has a new standalone software to test API's: Telerik Test Studio for APIs
http://www.telerik.com/download/teststudio-apis
If you are just looking for a lite rest client and have tried all the others here and did not like them!
I finally rested on Restlet a Chrome plugin.
It is commercial software, but "appears" to be free to use if you are only making requests, which is all I need now.
I may try the trial in the future.
cURL is free and runs on almost everything.
I am looking for a good production web server/servlet container for my compojure web appliction. What are the pros and cons of using Jetty or Tomcat or other server for a Clojure web app using compojure? Is there any good documentation for using a web server with Clojure for production, or tools?
I would prefer a web server that is flexible, easy to configure and has good documentation on how to configure and use it.
I think there is not yet a pure Clojure Webserver, but I heard that people at Apache were working on something like that. On the meanwhile I have some links I found useful myself.
A commentary on Apache + Jetty: http://briancarper.net/blog/510/deploying-clojure-websites
Take a look at this for implementing your own webserver via servlets: Clojure web application - where do I start?
If you don't already have your own infrastructure to run on, you might consider Heroku, which supports Clojure. See their tutorial Getting Started With Clojure on Heroku/Cedar. It's free to start and very easy to scale.
Chas Emerick has a rather old blog post + slides on doing continous integration on webapps right (Heroku, Pallet, War-file or whatever nescessary to NOT roll your own solution).
I am looking at deploying a Clojure web app, and I remember using Heroku for rails which was brilliant. Is there anything similar available for Clojure?
Currently, the closest there is to Heroku for Clojure is... Heroku: https://gist.github.com/1001206
Courtesy of the new Celadon Cedar stack.
As of July 2011, Heroku now officially supports Clojure:
We're very excited to announce
official support for Clojure, going
into public beta as of today.
http://blog.heroku.com/archives/2011/7/5/clojure_on_heroku/
Google App Engine! GAE supports Java and hence Clojure. I don't have any personal experience of such a project, but this blog seems to have relevent tutorials. Google for it and you'll find some more links like this.
You might also look at stax.net which offers a full Java container deployment (without the restrictions imposed by Google App Engine). CloudBees just bought Stax so Stax will become CloudBees RUN#Cloud service (according to their recent webinar).
You can read how to deploy Clojure on CloudBees here: https://cloudbees.zendesk.com/entries/452746-clojure-deployment-on-cloudbees