Discussion:
[ClojureScript] [ANN] cljs-pikaday, a reagent date picker
Tim Gilbert
2015-04-03 22:14:57 UTC
Permalink
Hi all... I have just released cljs-pikaday, which is a ClojureScript interface to the Pikaday javascript date-picker.

https://github.com/timgilbert/cljs-pikaday/

It's a pretty simple little library in its early stages. Right now there's just a reagent interface where you can pass an atom into a component which will be updated when the user selects a date.

There's a simple demo page here:

http://timgilbert.github.io/cljs-pikaday/reagent-example/

I'm planning to add an Om interface to it, as well as a nicer interface for re-frame.

This is my first published ClojureScript library, so any feedback on the design or implementation would be welcome. (I've also since realized that there are approximately 3 million javascript date-pickers out there with various features, so the name might be unfortunate if I switch to another implementation, but oh well.)

Tim
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Thomas Heller
2015-04-05 10:04:59 UTC
Permalink
Hey Tim,

I have no real feedback for you since I don't use Reagent or Om but thought I should mention that it might be better to leverage what the Closure Library has to offer before grabbing external Javascript.

The Closure Library comes with a full fledged DatePicker that is fully internationalized. Couldn't find the official demos so I uploaded them on my server [1]. See [2],[3],[4] for DatePicker demos.

The advantage of using Closure compliant Javascript is that it fully supports the :advanced compilation mode and will properly eliminate unused code, thus resulting in smaller files. The code generally is also well tested and documented since it is used in many Google Products.

There is a lot more stuff in Closure that doesn't have demos so I'd recommend browsing the code [5] and maybe grep for what you are looking for. I pretty much found everything I ever needed in there.

IMHO non-Closure JS should pretty much be the last resort not the first choice.

HTH,
/thomas

[1] http://www.zilence.net/closure-library/closure/goog/demos/
[2] http://www.zilence.net/closure-library/closure/goog/demos/datepicker.html
[3] http://www.zilence.net/closure-library/closure/goog/demos/inputdatepicker.html
[4] http://www.zilence.net/closure-library/closure/goog/demos/popupdatepicker.html
[5] https://github.com/google/closure-library
Post by Tim Gilbert
Hi all... I have just released cljs-pikaday, which is a ClojureScript interface to the Pikaday javascript date-picker.
https://github.com/timgilbert/cljs-pikaday/
It's a pretty simple little library in its early stages. Right now there's just a reagent interface where you can pass an atom into a component which will be updated when the user selects a date.
http://timgilbert.github.io/cljs-pikaday/reagent-example/
I'm planning to add an Om interface to it, as well as a nicer interface for re-frame.
This is my first published ClojureScript library, so any feedback on the design or implementation would be welcome. (I've also since realized that there are approximately 3 million javascript date-pickers out there with various features, so the name might be unfortunate if I switch to another implementation, but oh well.)
Tim
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Tim Gilbert
2015-04-05 20:07:59 UTC
Permalink
Hi Thomas, thanks for the feedback!

The goog.* libraries are still a bit of a black box to me, but you're right, I should look into them more since they don't introduce an external dependency and are built right into the Closure compiler.

On a more philosophical level, I'm not totally crazy about tying the ClojureScript ecosystem so directly to the Closure libraries, as opposed to the compiler, since (at least in theory) a different JS compiler could be released which didn't have those libraries as a dependency. I generally take a pragmatic viewpoint towards these things, though, and obviously a lot of time went into making and testing the Closure libraries and they should be used if they can. I just sometimes wish they seemed a little less like an internal Google tool that somebody accidentally pushed to github one day.

Anyways, I went with Pikaday out of lassitude as much as anything else, since it already has a cljsjs entry, and following that same train of thought it's even less effort to use the Google stuff, so I'll definitely look into it. I've also been thinking about using cljs-time in the public interface, and that uses goog.date.* libraries, so that's another nudge in the Closure direction.

Also, thanks for publishing those demos, they are quite helpful.

Tim
Post by Thomas Heller
Hey Tim,
I have no real feedback for you since I don't use Reagent or Om but thought I should mention that it might be better to leverage what the Closure Library has to offer before grabbing external Javascript.
The Closure Library comes with a full fledged DatePicker that is fully internationalized. Couldn't find the official demos so I uploaded them on my server [1]. See [2],[3],[4] for DatePicker demos.
The advantage of using Closure compliant Javascript is that it fully supports the :advanced compilation mode and will properly eliminate unused code, thus resulting in smaller files. The code generally is also well tested and documented since it is used in many Google Products.
There is a lot more stuff in Closure that doesn't have demos so I'd recommend browsing the code [5] and maybe grep for what you are looking for. I pretty much found everything I ever needed in there.
IMHO non-Closure JS should pretty much be the last resort not the first choice.
HTH,
/thomas
[1] http://www.zilence.net/closure-library/closure/goog/demos/
[2] http://www.zilence.net/closure-library/closure/goog/demos/datepicker.html
[3] http://www.zilence.net/closure-library/closure/goog/demos/inputdatepicker.html
[4] http://www.zilence.net/closure-library/closure/goog/demos/popupdatepicker.html
[5] https://github.com/google/closure-library
Post by Tim Gilbert
Hi all... I have just released cljs-pikaday, which is a ClojureScript interface to the Pikaday javascript date-picker.
https://github.com/timgilbert/cljs-pikaday/
It's a pretty simple little library in its early stages. Right now there's just a reagent interface where you can pass an atom into a component which will be updated when the user selects a date.
http://timgilbert.github.io/cljs-pikaday/reagent-example/
I'm planning to add an Om interface to it, as well as a nicer interface for re-frame.
This is my first published ClojureScript library, so any feedback on the design or implementation would be welcome. (I've also since realized that there are approximately 3 million javascript date-pickers out there with various features, so the name might be unfortunate if I switch to another implementation, but oh well.)
Tim
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Thomas Heller
2015-04-05 21:45:55 UTC
Permalink
Yeah it seemed like Google wasn't too committed to "open source" Closure but I hope the move to github changes that a bit. Also seemed like they forgot to publish the docs but they are just hidden really well with no public mirror I could find.

http://docs.closure-library.googlecode.com/git/index.html seems a bit out of date for some stuff but is still useful.

I wish the closure javascript style would catch on more but I doubt that is going to happen given how annoying it is to write by hand. Thankfully CLJS does that for us.

I would choose a Closure compatible library over any other any day, :advanced optimizations is just too good to ignore.

But that being said there are a lot of things the Closure lib does not cover and optimizing file sizes is the most important thing after all. So pikaday might actually be better, I can't say. The HTML generated by the goog stuff sometimes is a bit to "nostalgic" since it was built for IE6 days so that might not be ideal in some cases. Generally the goog.ui.* stuff looks a bit "old" compared to some of the newer stuff, at least with stock CSS.

Always best to consider all options and choose the one that makes the most sense. I'm just under the impression that most CLJS users are not aware of most of the stuff Closure actually has to offer.

Cheers,
/thomas


PS: not a cljs-time user but it seems to reimplement all/most of goog.i18n.DateTimeFormat
Post by Tim Gilbert
Hi Thomas, thanks for the feedback!
The goog.* libraries are still a bit of a black box to me, but you're right, I should look into them more since they don't introduce an external dependency and are built right into the Closure compiler.
On a more philosophical level, I'm not totally crazy about tying the ClojureScript ecosystem so directly to the Closure libraries, as opposed to the compiler, since (at least in theory) a different JS compiler could be released which didn't have those libraries as a dependency. I generally take a pragmatic viewpoint towards these things, though, and obviously a lot of time went into making and testing the Closure libraries and they should be used if they can. I just sometimes wish they seemed a little less like an internal Google tool that somebody accidentally pushed to github one day.
Anyways, I went with Pikaday out of lassitude as much as anything else, since it already has a cljsjs entry, and following that same train of thought it's even less effort to use the Google stuff, so I'll definitely look into it. I've also been thinking about using cljs-time in the public interface, and that uses goog.date.* libraries, so that's another nudge in the Closure direction.
Also, thanks for publishing those demos, they are quite helpful.
Tim
Post by Thomas Heller
Hey Tim,
I have no real feedback for you since I don't use Reagent or Om but thought I should mention that it might be better to leverage what the Closure Library has to offer before grabbing external Javascript.
The Closure Library comes with a full fledged DatePicker that is fully internationalized. Couldn't find the official demos so I uploaded them on my server [1]. See [2],[3],[4] for DatePicker demos.
The advantage of using Closure compliant Javascript is that it fully supports the :advanced compilation mode and will properly eliminate unused code, thus resulting in smaller files. The code generally is also well tested and documented since it is used in many Google Products.
There is a lot more stuff in Closure that doesn't have demos so I'd recommend browsing the code [5] and maybe grep for what you are looking for. I pretty much found everything I ever needed in there.
IMHO non-Closure JS should pretty much be the last resort not the first choice.
HTH,
/thomas
[1] http://www.zilence.net/closure-library/closure/goog/demos/
[2] http://www.zilence.net/closure-library/closure/goog/demos/datepicker.html
[3] http://www.zilence.net/closure-library/closure/goog/demos/inputdatepicker.html
[4] http://www.zilence.net/closure-library/closure/goog/demos/popupdatepicker.html
[5] https://github.com/google/closure-library
Post by Tim Gilbert
Hi all... I have just released cljs-pikaday, which is a ClojureScript interface to the Pikaday javascript date-picker.
https://github.com/timgilbert/cljs-pikaday/
It's a pretty simple little library in its early stages. Right now there's just a reagent interface where you can pass an atom into a component which will be updated when the user selects a date.
http://timgilbert.github.io/cljs-pikaday/reagent-example/
I'm planning to add an Om interface to it, as well as a nicer interface for re-frame.
This is my first published ClojureScript library, so any feedback on the design or implementation would be welcome. (I've also since realized that there are approximately 3 million javascript date-pickers out there with various features, so the name might be unfortunate if I switch to another implementation, but oh well.)
Tim
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Shaun Mahood
2015-04-05 22:11:28 UTC
Permalink
Thomas, have you got any good resources for working with Closure in Cljs? I've tried to figure it out and read a decent amount but have found it difficult to get the hang of.
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Thomas Heller
2015-04-05 22:50:28 UTC
Permalink
Post by Shaun Mahood
Thomas, have you got any good resources for working with Closure in Cljs? I've tried to figure it out and read a decent amount but have found it difficult to get the hang of.
Apart from the docs I linked not really. The demos guided me through pretty much all of it, sometimes the tests help too.

What do you want to use?
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Tim Gilbert
2015-04-06 14:21:42 UTC
Permalink
I have found http://closureplease.com/ to be a fairly useful collection of resources, though none of it is ClojureScript-specific. There was also an O'Reilly book on Closure published in 2010 which seems to have a fair bit of coverage of the library, judging by the table of contents.

There is also a closure-library mailing list, though it doesn't get a ton of traffic:

https://groups.google.com/forum/#!topic/closure-library-discuss/

The sentiment on there seems to be that the goog.ui stuff is widely used inside Google, but "increasingly not the focus of development on Closure." [1] (Ancedotally, I've heard from googlers that the libraries aren't widely loved within the company, but it's a big company so who knows.)

In positive news, it does sound like people inside the Googleplex are aware of the state of the public docs and are working on fixing them (or at least on a system to generate docs). [2]

[1] https://groups.google.com/d/msg/closure-library-discuss/4euIHT-_FHs/tRDQfVneRH8J
[2] https://groups.google.com/d/msg/closure-library-discuss/Gn8vqt-aHWM/dvyL7eyJkd0J
Post by Shaun Mahood
Thomas, have you got any good resources for working with Closure in Cljs? I've tried to figure it out and read a decent amount but have found it difficult to get the hang of.
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Khalid Jebbari
2015-04-07 14:57:59 UTC
Permalink
Thx for the link to closureplease. Will help a lot !
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Noam Ben-Ari
2015-04-27 12:19:16 UTC
Permalink
Hi,
Just wanted to let you know that I am using it successfully in a project right now. It came out at a good time for me, so thanks!
Post by Tim Gilbert
Hi all... I have just released cljs-pikaday, which is a ClojureScript interface to the Pikaday javascript date-picker.
https://github.com/timgilbert/cljs-pikaday/
It's a pretty simple little library in its early stages. Right now there's just a reagent interface where you can pass an atom into a component which will be updated when the user selects a date.
http://timgilbert.github.io/cljs-pikaday/reagent-example/
I'm planning to add an Om interface to it, as well as a nicer interface for re-frame.
This is my first published ClojureScript library, so any feedback on the design or implementation would be welcome. (I've also since realized that there are approximately 3 million javascript date-pickers out there with various features, so the name might be unfortunate if I switch to another implementation, but oh well.)
Tim
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Loading...