[ClojureScript] ANN: Tongue, DYI i18n library for Clojure/Script
Tongue is a do-it-yourself i18n library for Clojure and ClojureScript. Tongue is very simple yet capable: - Dictionaries are just Clojure maps. - Translations are either strings, template strings or arbitrary functions. - No additional build steps, no runtime resource loading. - It comes with no built-in knowledge of world locales. It has all the tooling for you to define locales yourself though. - Pure Clojure implementation, no dependencies. - Can be used from both Clojure and ClojureScript. In contrast with other i18n solutions relying on complex and limiting string-based syntax for defining pluralization, wording, special cases etc, Tongue lets you use arbitrary functions. It gives you convenience, code reuse and endless possibilities. As a result you have a library that handles exaclty your case well with as much detail and precision as you need. https://github.com/tonsky/tongue -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.
[ClojureScript] Re: ANN: ClojureScript 1.7.170, Enhanced Build Pipeline
On Monday, November 23, 2015 at 4:12:54 PM UTC+6, Nikita Prokopov wrote: > Any advice what to do with deps.cljs? > > Exception in thread "main" java.lang.AssertionError: No ns form found in > /Users/prokopov/Dropbox/ws/cognician/c3/src/deps.cljs, > compiling:(/private/var/folders/0h/9vv4g3d955l6ctwwl4k9xjy4gn/T/form-init7898631568113094426.clj:1:125) > > $ cat src/deps.cljs > { > :externs ["cognician/chat/externs.js"] > } > $ > > I’m using CLJS 1.7.170 and lein-cljsbuild 1.1.1 Looks like cljsbuild issue: https://github.com/emezeske/lein-cljsbuild/pull/428 -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: ANN: ClojureScript 1.7.170, Enhanced Build Pipeline
Any advice what to do with deps.cljs? Exception in thread "main" java.lang.AssertionError: No ns form found in /Users/prokopov/Dropbox/ws/cognician/c3/src/deps.cljs, compiling:(/private/var/folders/0h/9vv4g3d955l6ctwwl4k9xjy4gn/T/form-init7898631568113094426.clj:1:125) $ cat src/deps.cljs { :externs ["cognician/chat/externs.js"] } $ I’m using CLJS 1.7.170 and lein-cljsbuild 1.1.1 -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Re: ANN: DataScript, in-memory database and datalog queries in ClojureScript
On Tuesday, October 27, 2015 at 9:39:00 PM UTC+6, kovas boguta wrote: > Checking in with Datascript and impressed with the progress. Very cool > that its cljc now. > > I'd love to see Datascript being able to query large static datasets. > In general Datascript is interesting for doing the things Datomic > doesnt do. > > Forget all the transactor/coordination/live-merge stuff. Lets assume I > just map-reduced some dataset into various datom indices, and now I > want to query&navigate it. Wikidata comes to mind for me. > > Looking at the code, it looks like there is some pluggability wrt the > source of datoms, so it seems doable for someone who knows the > codebase ;) > > I've definitely encountered a number of other people with this use > case. Love datomic datalog, love navigation, love direct data access, > don't love the 10 billion datom limit and dont need transactions. > > > > > > > > > > > > > > > > > > > > > On Tue, Oct 27, 2015 at 7:40 AM, Robin Heggelund Hansen > wrote: > > One thing to keep in mind is that a datomic peer retrieves "the index" when > > it first connects to a transactor. The peer can use this to get a picture > > of what is available, and thus what it can retrieve when running queries. > > Another thing to keep in mind is that a datomic peer receives every change > > from the transactor, so that it is always up to date. > > > > Browsers don't need access to the entire database, just the relevant data > > for a particular client. What you can do is to connect to the backend using > > websockets. When you first connect, you ask for all relevant data for this > > particular user. After that, the backend can push updates for this > > particular user, to keep the client up to date. > > > > -- > > 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+unsubscr...@googlegroups.com. > > To post to this group, send email to clojurescript@googlegroups.com. > > Visit this group at http://groups.google.com/group/clojurescript. In theory, yes, queries should work on any dataset provided it implements some basic protocol. In practice, I have to build an example of that to see what pieces are missing at the moment. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: ANN: DataScript, in-memory database and datalog queries in ClojureScript
On Tuesday, October 27, 2015 at 4:05:04 PM UTC+6, Scott Klarenbach wrote: > On Thursday, April 24, 2014 at 11:18:06 PM UTC-7, Nikita Prokopov wrote: > > Hi! > > > > I’m glad to announce my new library, DataScript. > > > > It’s an open-source, from-the-scratch implementation of in-memory immutable > > database aimed at ClojureScript with API and data model designed after > > Datomic. Full-featured Datalog queries included. > > > > Library is here: https://github.com/tonsky/datascript > > > > Also check out this blog post about why you may need a database in a > > browser: http://tonsky.me/blog/decomposing-web-app-development/ > > > > Feedback welcome! > > Hello, > > Very helpful library Nikita. > > I wonder what would be required to enable datascript to act more like a > datomic peer, which holds, say, part of the db in browser memory, and then > goes back to the server to fetch new segments if it can't serve the query > from browser cache. Older entries in the cache get gc'd and the system can > operate on dbs of any size. > > I realize this wasn't a design goal of datascript, and am just looking for > insights into how it might be possible. I guess a more fundamental question > is: how does a datomic peer know when the segments to complete its query are > not present in cache? And can we emulate this in datascript? Requesting segments on-demand is, in theory, possible. DataScript is written to support queries over data source protocol, which can be a DB (we can then utilize indexes), collection (full scans) or something user-specific. I don’t have working example of that at the moment, but from design perspective, plugging in custom data source with, e.g., on-demand segment loader, is possible. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] weird clojurescript encoding of UUID from transit
Sorry, I haven’t finished previous letter. If Cognitect depends so much on hi/low bits functions, you can _opt in_ to using your own UUID type. Clean, simple and predictable by default, opt-in optimizations when you need them. Are there any issues with that approach? This issue ate a lot of my own time, since then, at least two other people was hurt as well. It would be great to see it fixed. With respect, Nikita. On Mon, Sep 28, 2015 at 12:08 AM Nikita Prokopov wrote: > Why don’t just do simple and no surprise thing first (return > cljs.core/UUID), and make optimizations optional? > > Transit’s UUIDs are not even performance optimization: every time you want > to compare/hash/equiv them, this code is called > https://github.com/cognitect/transit-js/blob/master/src/com/cognitect/transit/types.js#L286-L298. > toString is very much not free on transit’s UUIDs, but it _is_ free on cljs > UUIDs. Additional time is also spent on read for _every_ instance of UUID > to convert it to hi/low bit format — and for most people out there for most > of the times, they will never get any benefits from that. > > A lot of effort has been spent already, and you can spend some more, > making it look like these two are in fact the same type (in the end, they > will never be anyways), but I don’t see any justification for that. What’s > that important reason that explains why we’re making things more > complicated that they should be? > > > > On Sun, Sep 27, 2015 at 9:38 PM David Nolen > wrote: > >> Transit's UUID stores the byte representation and provides methods for >> accessing the lower and higher bits, cljs.core's UUID is just a simple >> wrapper around a string. >> >> Transit provides a uuid? predicate for this reason. Though perhaps it >> would be better to provide a marker protocol in cljs.core instead for this >> case a la IRecord and test this in cljs.core/uuid? >> >> >> David >> >> On Sat, Sep 26, 2015 at 6:13 PM, Jamie Orchard-Hays >> wrote: >> >>> Why *does* Transit have another UUID type? I was surprised to see that. >>> >>> >>> > On Sep 26, 2015, at 6:06 PM, Nikita Prokopov >>> wrote: >>> > >>> > Having two UUID types around is not a good idea. Transit shouldn’t >>> have its own type, but since it’s there, I recommend re-configure transit >>> reader to always read native CLJS UUIDs: >>> > >>> > (defn read-transit-str [s] >>> > (t/read (t/reader :json { :handlers {"u" cljs.core/uuid} }) s)) >>> > >>> > You‘ll save yourself A LOT of headache, trust me >>> > >>> > -- >>> > 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+unsubscr...@googlegroups.com. >>> > To post to this group, send email to clojurescript@googlegroups.com. >>> > Visit this group at http://groups.google.com/group/clojurescript. >>> >>> -- >>> 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+unsubscr...@googlegroups.com. >>> To post to this group, send email to clojurescript@googlegroups.com. >>> Visit this group at http://groups.google.com/group/clojurescript. >>> >> >> -- >> Note that posts from new members are moderated - please be patient with >> your first post. >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "ClojureScript" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/clojurescript/_B52tadgUgw/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> clojurescript+unsubscr...@googlegroups.com. >> To post to this group, send email to clojurescript@googlegroups.com. >> Visit this group at http://groups.google.com/group/clojurescript. >> > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] weird clojurescript encoding of UUID from transit
Why don’t just do simple and no surprise thing first (return cljs.core/UUID), and make optimizations optional? Transit’s UUIDs are not even performance optimization: every time you want to compare/hash/equiv them, this code is called https://github.com/cognitect/transit-js/blob/master/src/com/cognitect/transit/types.js#L286-L298. toString is very much not free on transit’s UUIDs, but it _is_ free on cljs UUIDs. Additional time is also spent on read for _every_ instance of UUID to convert it to hi/low bit format — and for most people out there for most of the times, they will never get any benefits from that. A lot of effort has been spent already, and you can spend some more, making it look like these two are in fact the same type (in the end, they will never be anyways), but I don’t see any justification for that. What’s that important reason that explains why we’re making things more complicated that they should be? On Sun, Sep 27, 2015 at 9:38 PM David Nolen wrote: > Transit's UUID stores the byte representation and provides methods for > accessing the lower and higher bits, cljs.core's UUID is just a simple > wrapper around a string. > > Transit provides a uuid? predicate for this reason. Though perhaps it > would be better to provide a marker protocol in cljs.core instead for this > case a la IRecord and test this in cljs.core/uuid? > > > David > > On Sat, Sep 26, 2015 at 6:13 PM, Jamie Orchard-Hays > wrote: > >> Why *does* Transit have another UUID type? I was surprised to see that. >> >> >> > On Sep 26, 2015, at 6:06 PM, Nikita Prokopov >> wrote: >> > >> > Having two UUID types around is not a good idea. Transit shouldn’t have >> its own type, but since it’s there, I recommend re-configure transit reader >> to always read native CLJS UUIDs: >> > >> > (defn read-transit-str [s] >> > (t/read (t/reader :json { :handlers {"u" cljs.core/uuid} }) s)) >> > >> > You‘ll save yourself A LOT of headache, trust me >> > >> > -- >> > 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+unsubscr...@googlegroups.com. >> > To post to this group, send email to clojurescript@googlegroups.com. >> > Visit this group at http://groups.google.com/group/clojurescript. >> >> -- >> 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+unsubscr...@googlegroups.com. >> To post to this group, send email to clojurescript@googlegroups.com. >> Visit this group at http://groups.google.com/group/clojurescript. >> > > -- > Note that posts from new members are moderated - please be patient with > your first post. > --- > You received this message because you are subscribed to a topic in the > Google Groups "ClojureScript" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojurescript/_B52tadgUgw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] weird clojurescript encoding of UUID from transit
Having two UUID types around is not a good idea. Transit shouldn’t have its own type, but since it’s there, I recommend re-configure transit reader to always read native CLJS UUIDs: (defn read-transit-str [s] (t/read (t/reader :json { :handlers {"u" cljs.core/uuid} }) s)) You‘ll save yourself A LOT of headache, trust me -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] [ANN] Rum: new ClojureScript wrapper for React. Decomplected, extensible, simple
Matt, if you keep all your state in Reagent atoms, that’s perfectly fine, you’ll probably get no benefits from moving to Rum. Rum idea is not to lock you down to a single storage model. Sometimes your dataflow is trickier that just atoms, e.g. you need components to react to DataScript events, core.async channels, ajax/websocket/webworker callbacks. In that case Rum provides well-defined API and set of basic building blocks to write components you need to. Conceptually Rum is on the same level of abstraction as Reagent or Om, but it offers additional promise: lower-level details are well-defined and open for extensions. Nikita. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] [ANN] Rum: new ClojureScript wrapper for React. Decomplected, extensible, simple
Mike, thanks for the kind words. Make sure you’re using Rum 0.1.1 — just pushed couple of important bugfixes https://github.com/tonsky/rum#changes Nikita. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] [ANN] Rum: new ClojureScript wrapper for React. Decomplected, extensible, simple
The main idea is that I wanted to hack my own component’s behaviors, but both Om, Reagent and even Quiescent came with something built-in, and change that was impossible without rewriting internals. So what I ended up doing is a very thin wrapper and a couple of convenient functions for work with React in CLJS. Main difference is that contract on custom component building (mixins) is also considered to be part of API in Rum. So Rum is in some sense more low-level because it doesn’t sell you one true component model. Benefit of that is that it’s more customizable, integration with third-party models is simpler (you use storage/model you want and write component to support that, unlike other solutions which dictate how to store app state), and you can mix different kinds of components in one app. Rum comes with already-built types of components which emulate behavior found in Quiescent, Reagent and Quiescent. They were built using the same public API any Rum user can use. No internals hacking. I think it means abstraction is good enough and decomplection was made in the right place. I’m also very proud they take, like, 10-30 lines of code each. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] [ANN] Rum: new ClojureScript wrapper for React. Decomplected, extensible, simple
Ian, thanks! About polishing — not sure yet. I think I should develop at least couple of non-trivial apps before sharp edges show themselves. Also there’s this subtle moment about state migration (when new component of the same type is created on top of existing one, mount/unmount does not happen, but properties somehow have to merge). It might be a potential source of leaks, so it have to be carefully managed. Nikita -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: Being productive with clojurescript
Arnaud, what’s wrong with LightTable? I use it for CLJS development, it works fine, live evaluation is here, watches are working, results are displayed inline. It needs open browser and a connection string added to the html page, but otherwise it works, at least for me. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] [ANN] Rum: new ClojureScript wrapper for React. Decomplected, extensible, simple
Hi everybody! I want to announce a preview of new CLJS UI library based on React. It aims to replace Om, Quiescent, Reagent and Freeactive. Yes, all at once :) Neither API nor Implementation are polished yet, but I believe Rum provides interesting model for building UI components and applications. At least I was able to reproduce what other frameworks are offering on top of basic Rum API. Anyway, check out source code and extensive readme: https://github.com/tonsky/rum Thanks! -- Nikita -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: Standard way to provide externs for library authors
I feel that managing CSS inclusion and third-party JS lib minification is kind of out of scope for CLJS compiler. Yes, these problems exists, but they are very broad, with a lot of solutions. I’m not sure we should try to solve them in CLJS compiler. I’m not even sure “preamble” feature should belong to CLJS compiler. The goal of CLJS is get .cljs sources in and produce executable .js code out. How this .js will be used depends on your app: you might include it as is, you might concatenate it with libs (preabmle), etc. :externs are important because without them libraries would not compile into executable .js source, therefore should be addressed somehow in compiler. Managing JS dependencies, minification, concatenation etc has, in my opinion, nothing to do with compilation. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Standard way to provide externs for library authors
deps.cljs more or less works, at least for my use case (one extern file). 1) I found that path to externs file should be unique across all dependencies. I think it’s counter-intuitive, and may lead to serious problems in the future. E.g. two different lib authors decide to use name `externs.js` for their libs, and everything is fine until somebody decides to use both of them libs. From technical point of view, we can distinguish these externs (they come from different libs), but current compiler implementation fails, and not in a very gracious way. I created repo reproducing the issue: https://github.com/tonsky/clojurescript_deps_test. Should I create a ticket/submit a patch somewhere? 2) I believe deps.cljs should be promoted to official convention, so other build tools may start relying on it. It would help if most popular CLJS projects will adopt this (e.g. swannodette/react-cljs could use it as an example. DataScript already uses it) 3) I can’t anything about feature completness of :libs and :foreign-libs in deps.cljs (don’t know the use-cases) Nikita. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Standard way to provide externs for library authors
Micha, I don’t understand what kind of optimization we’re talking about. If I understand correctly, boot v2 scans every jar for the mask `*.jar!/hoplon/include/**/*.ext.js`. My proposal is to scan each jar for a single possible path `*.jar!/externs.js`. Current `:externs` directive in lein-cljsbuild _does_ scan all the jars for the path you’ve specified for it (e.g. if you put :externs ["react/externs/react.js"] it will scan entire classpath for this path). So at least we’re not making things worse. Also, as the content of the jar (non-snapshot at least) is immutable, we can cache this information heavily. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Standard way to provide externs for library authors
Agree that should be on compiler level. Relying to third-party solution does not improve situation: without them, I have a possibility to forget to include externs, with third-party solutions I have a possibility to forget to include them (also library author will have to choose whose convention to support). My proposal: Cljs-compiler should just include every 'externs.js' file it can found on the classpath on top level. Library authors: just include externs.js to the jar at top level Library consumers: just add dependency (as you normally do) and it’ll put externs.js to the classpath where it could be seen by compiler. Any thoughts? Who can make such a decision? I can work on an implementation. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Standard way to provide externs for library authors
Hi! Right now lein-cljsbuild allows for externs to be specified on user side. E.g. I’m building app with react-cljs, I add dependency, but there’s also a second step: I need to put :externs ["react/externs/react.js"] into _my_ project.clj. This is tedious and easy to forget, leading to a lot of confusion (I developed for 2 month and everything was fine, then I turn on advanced build and nothing works). On the other hand, conceptually, externs are part of a library, not my user code. So, if library author thinks his library needs externs, he specifies it and packs externs along with library code, and they’re automatically used when I add dependency. So as a user I don’t manage external deps’ externs at all. As Thomas Heller puts it, it might be [a quality of life change](https://github.com/tonsky/datascript/issues/30#issuecomment-62253696). Any thought on it? Maybe there’s already a way to do that? Nikita. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] ANN: DataScript, in-memory database and datalog queries in ClojureScript
Yes, 30k should be fine. But let's see where optimisations can lead us. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Re: ANN: DataScript, in-memory database and datalog queries in ClojureScript
Hi Dmitry! I cannot tell you memory footprint because I'm working on underlying structure rewrite at the moment. Future-proof and simplest way is just to get all datoms and persist them using EDN or more efficient serializer. On app start, read all datoms and create new DB from them. DataScript was intended for small datasets limited by browser memory, so it shouln't be a problem. There's currently no API call for such thing as "get all datoms". It'll be something similar to Datomic's "datoms" or "seek-datoms" calls, I'm planning to add this in next one or two versions. If you need this right now, feel free to hack into implementation, it should be easy to change that later. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] ANN: DataScript 0.1.4, with vanilla JS bindings
Hi! DataScript 0.1.4 is out, usable from vanilla JS runtime with zero dependencies More info here: https://github.com/tonsky/datascript#using-from-vanilla-js Usage examples here: https://github.com/tonsky/datascript/blob/master/test/js/js.html Full 0.1.4 changelog: - Transactor functions via :db.fn/call (thx @thegeez) - Vanilla JS API bindings - Schema keywords namespaced on a par with Datomic Next stop: performance and optimizations -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] ANN: DataScript, in-memory database and datalog queries in ClojureScript
Dave, yes, that's again exactly what I was thinking about :) It'll mean to reverse-analyze the query, but looks like it's easier to do with Datalog than with SQL for example, and maybe even possible. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] ANN: DataScript, in-memory database and datalog queries in ClojureScript
Guys, please don't be too optimistic about performace so far. My goal is definetly to support tens of thousands datoms, but right now I've spent about 0 time on performace, so potential is unknown. My first milestone is to reach near native filter/group-by/get-in speed and then look where we can improve from there. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] ANN: DataScript, in-memory database and datalog queries in ClojureScript
Dylan, can you give a little sneak peak on what your app is doing with 5000+ objects on client side? I feel like it's where DataScript should be aimed at, but failed to imagine a use case beyond 100-500 entites. For Om integration, see what Dave Dixon is doing -- filtering tx-report queue with the same datalog query and trigger query re-run and component re-render seems like a decent approach. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] ANN: DataScript, in-memory database and datalog queries in ClojureScript
Thanks Dave! This approach is almost exactly what I had in mind when thinking about how to glue DB and rendering together (bind/unbind especially). Actually, idea of reverse transactions is something I couldn't imagine before seeing you code. I now see how it optimizes re-rendering on undo operations. You probably also need to do `reverse` on tx-data when reverting transaction. Thanks for the inspiration! -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: ANN: DataScript, in-memory database and datalog queries in ClojureScript
суббота, 26 апреля 2014 г., 1:31:52 UTC+7 пользователь Daniel Neal написал: > Is this something that could potentially work *with* Om or is it going down a > different road? > > I'm really enjoying Om for client side work but totally love the idea of > being able to do database-like queries over the application state as you > describe. I thinks DataScript is something that can be used instead of Om cursors. Of course you can mix, it’s just a library. But for proper integration cursors will be just a dead weight, so it would be easier to integrate with pure React or some thin wrapper around React like Quiescent. But that’s just my opinion, David already started to toy with Om integration :) -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] ANN: DataScript, in-memory database and datalog queries in ClojureScript
Hi! I’m glad to announce my new library, DataScript. It’s an open-source, from-the-scratch implementation of in-memory immutable database aimed at ClojureScript with API and data model designed after Datomic. Full-featured Datalog queries included. Library is here: https://github.com/tonsky/datascript Also check out this blog post about why you may need a database in a browser: http://tonsky.me/blog/decomposing-web-app-development/ Feedback welcome! -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Om cursors explained
Thanks David — I understand now :) Please check my summary of our discussion here: https://github.com/swannodette/om/wiki/Cursors > What I'm working on has nothing to do with passing N cursors to a component: > (om/build foo-view {:cursor-a cursor-a :cursor-b cursor-b}) > Works today. This does not in anyway address the problems I've been talking > about. This still requires you to pass everything top down - `foo-view` may > very well not care about `:cursor-b` yet is forced to receive it just so some > child can take it. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Om cursors explained
> What to do if component depends on two or more cursors? For example, I render > game field and have state like this: {:selected [17 18], :field [[...], > ...]}. But each cell view depends only on one field cell and on selected > coordinates, e.g. on two cursors: [:selected] and [:field 5 2]. > > Not really sure what you're asking, but this just works. This is what's Daniel Kersten is asking in sibling thread, but I cannot understand your answers, sometimes you say it's already works, and sometimes you say it's something you work on. Here's an example: (def state (atom {:selected [0 0], :field [[["a"] ["b"] ["c"] ["d"]], ...]})) (defn cell-view [??? owner] ... (render [_] ... access to both field and selected)) Now, to create two cursors, I do: (render [_] (let [c1 (get-in cursor [:selected]) c2 (get-in cursor [:field])] (om/build cell-view ??? {:init-state {:coords [0 0]}}))) The question is, how I can pass these two cursors to my cell-view? It only takes one. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Re: Om cursors explained
Hi David, thanks for the answer. I’d like to contribute on documentation about cursors, but first can we check if I get this right? Here’s what I understood from answers here & from source code: You keep all your application state in a single atom. Components, however, do not depend on the whole atom, they get modifable parts of it via cursors. The idea of cursors is to provide part of the modifiable state for reusable components. For example, text input component needs one string as parameter (initial value) and some place where to put new value once user changed it on a page. Cursor provides both. Cursors are also used to specify component dependency on a state. Each component get one cursor at construction time and will be automatically re-rendered when value underneath his cursor changes. Root component get cursor created from atom itself. Atom and cursors derived from it stay in sync on modification. There’re only two types of cursors: maps and vectors. There’re two ways to get value from a cursor: During render phase, cursors support all basic map/vector interfaces, so you can get/get-in in them, check for keys, etc. If you do get/get-in on a cursor and result is again map/vector, it’ll be a cursor too. Otherwise, it’ll be an ordinary value. Outside render phase, you can deref cursor and get ordinary map/vector (not cursor!). To get cursor that points at primitive value, wrap it into vector of 1 element: (def state (atom {:timer [0]})) transact! is avaliable at both inside and outside of render. What’s not clear for me: David, you often mentioned that outside render phase, you cannot do anything with cursors besides deref/update/transact. But for me these operations covers everything we need. Can you name what operations are prohibited outside render phase? Also you mentioned that there’s two type of values underneath cursor: stale value and current value. Can you describe via which calls they can be accessed? Actually, whole state consistency semantic is not clear. What are points when state can be changed? Which changes and when become visible and for whom? For example, if I transact inside render, will I see changes in render afterwards? It would be nice to have it described in several basic principles. What to do if component depends on two or more cursors? For example, I render game field and have state like this: {:selected [17 18], :field [[...], ...]}. But each cell view depends only on one field cell and on selected coordinates, e.g. on two cursors: [:selected] and [:field 5 2]. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Om cursors explained
Hi! I’ve tried to get through Om tutorials and cursors are still most mysterious part of it for me. I mean, idea is clear, but practice is filled with a lot of pitfalls. I'm looking for help in understanding them. These are the questions I believe could make nice introduction and help people like me understand the idea fully: what’s cursor what operation does it support how and when to update the cursor, how changes are propagated to the core state (atom) how to create a cursor from atom how to convert cursor to data how to create cursor from cursor how are cursors related to render, why render is so special for them how exactly component state is dependent on a cursor what’s the role of IValue and ICloneable in cursors life? why do we have to implement ICloneable on Strings (in an immutable language!) in order for cursors to work? Looking for answers. Thanks! -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Om cursrors explained
Hi! I’ve tried to get through Om tutorials and cursors are still most mysterious part of it for me. I mean, idea is clear, but practice is filled with a lot of pitfalls. I'm looking for help in understanding them. These are the questions I believe could make nice introduction and help people like me understand the idea fully: what’s cursor what operation does it support how and when to update the cursor, how changes are propagated to the core state (atom) how to create a cursor from atom how to convert cursor to data how to create cursor from cursor how are cursors related to render, why render is so special for them how exactly component state is dependent on a cursor what’s the role of IValue and ICloneable in cursors life? why do we have to implement ICloneable on Strings (in an immutable language!) in order for cursors to work? Looking for answers. Thanks! -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: ANN: Om, a ClojureScript binding to Facebook's React
Hi David, cool work, Just wondering, why in todomvc you rely so heavily onto #js literals, and prefer dsl-like syntax (dom/...) instead of some declarative markup like hiccup? Is it because of performance reasons? Thanks! -- 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+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.