Re: [ClojureScript] Importing react components from clojurescript

2018-08-20 Thread Alan Thompson
Meant to paste the URL:   https://github.com/cloojure/cljs-template

Alan

On Mon, Aug 20, 2018 at 4:32 PM Alan Thompson  wrote:

> If you clone this template project it provides examples of 3 ways in
> "import" native JS code into a CLJS project (see "dino.js" etc).
>
> g...@github.com:cloojure/cljs-template.git
>
>
>
>
> On Mon, Aug 20, 2018 at 9:37 AM Dusan Miloradovic <
> dusan.milorado...@gmail.com> wrote:
>
>> I think the easiest way to do it is using the shadow-cljs. Here is the
>> example:
>> https://github.com/shadow-cljs/examples/tree/master/cljs-react-app
>>
>>
>>
>> On Mon, Aug 20, 2018 at 6:43 PM Quentin Le Guennec <
>> quentin.leguenn...@gmail.com> wrote:
>>
>>> It doesn't quite answer everything. I would like a full example of a
>>> project using a react javascript component. Do you have an idea where I
>>> could find that?
>>> On 8/20/18 3:09 AM, Philos Kim wrote:
>>>
>>> The react-flip-move library in the example is written in React
>>> JavaScript code.
>>>
>>> https://github.com/joshwcomeau/react-flip-move
>>>
>>> https://unpkg.com/react-flip-move@3.0.2/dist/react-flip-move.js
>>>
>>>
>>> 2018년 8월 19일 일요일 오후 10시 11분 30초 UTC+9, Quentin Le Guennec 님의 말:

 Hello, thanks for your answer

 That is not what I am looking for.

 I am trying to import javascript code into my clojurescript project.
 Something you would do with either `require` or `import` in javascript.

 The node module I need would have to be specified in `defproject`, then
 downloaded when I run `lein deps`

 Then in clojurescript, I would have access to that module.

 On 8/19/18 1:58 AM, Philos Kim wrote:
 > Recer to the section
 > 'Creating Reagent "Components" from React Components' of the
 following page.
 >
 >
 >
 https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md
 >

 --
>>> 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.
>>>
>>> --
>>> 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.
>>>
>> --
>> 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.
>>
>

-- 
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.


Re: [ClojureScript] Importing react components from clojurescript

2018-08-20 Thread Dusan Miloradovic
I think the easiest way to do it is using the shadow-cljs. Here is the
example: https://github.com/shadow-cljs/examples/tree/master/cljs-react-app



On Mon, Aug 20, 2018 at 6:43 PM Quentin Le Guennec <
quentin.leguenn...@gmail.com> wrote:

> It doesn't quite answer everything. I would like a full example of a
> project using a react javascript component. Do you have an idea where I
> could find that?
> On 8/20/18 3:09 AM, Philos Kim wrote:
>
> The react-flip-move library in the example is written in React JavaScript
> code.
>
> https://github.com/joshwcomeau/react-flip-move
>
> https://unpkg.com/react-flip-move@3.0.2/dist/react-flip-move.js
>
>
> 2018년 8월 19일 일요일 오후 10시 11분 30초 UTC+9, Quentin Le Guennec 님의 말:
>>
>> Hello, thanks for your answer
>>
>> That is not what I am looking for.
>>
>> I am trying to import javascript code into my clojurescript project.
>> Something you would do with either `require` or `import` in javascript.
>>
>> The node module I need would have to be specified in `defproject`, then
>> downloaded when I run `lein deps`
>>
>> Then in clojurescript, I would have access to that module.
>>
>> On 8/19/18 1:58 AM, Philos Kim wrote:
>> > Recer to the section
>> > 'Creating Reagent "Components" from React Components' of the following
>> page.
>> >
>> >
>> >
>> https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md
>> >
>>
>> --
> 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.
>
> --
> 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.
>

-- 
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.


Re: [ClojureScript] Importing react components from clojurescript

2018-08-20 Thread Philos Kim
https://github.com/cljsjs/packages/tree/master/react-flip-move

Add the following to :dependencies section in project.clj 

[cljsjs/react-flip-move "3.0.1-1"]


Your cljs code:

(ns application.core
  (:require cljsjs.react-flip-move))

(def flip-move (r/adapt-react-class js/FlipMove))

(defn my-list [data]
  [:div
[:ul
  [flip-move {:easing "cubic-bezier(0, 0.7, 0.8, 0.1)"}
(map (fn [[k v]] (vector :li {:key k} v)) (:list @data))]]

[:button.btn.btn-primary
  {:on-click #(swap! data update-in
 [:list] (fn [s]
   (into {} (shuffle (seq s)}
  "Shuffle"]])  

-- 
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.


Re: [ClojureScript] Importing react components from clojurescript

2018-08-20 Thread Quentin Le Guennec
It doesn't quite answer everything. I would like a full example of a
project using a react javascript component. Do you have an idea where I
could find that?

On 8/20/18 3:09 AM, Philos Kim wrote:
> The react-flip-move library in the example is written in React
> JavaScript code.
>
> https://github.com/joshwcomeau/react-flip-move
>
> https://unpkg.com/react-flip-move@3.0.2/dist/react-flip-move.js
>
>
> 2018년 8월 19일 일요일 오후 10시 11분 30초 UTC+9, Quentin Le Guennec 님의
> 말:
>
> Hello, thanks for your answer
>
> That is not what I am looking for.
>
> I am trying to import javascript code into my clojurescript project.
> Something you would do with either `require` or `import` in
> javascript.
>
> The node module I need would have to be specified in `defproject`,
> then
> downloaded when I run `lein deps`
>
> Then in clojurescript, I would have access to that module.
>
> On 8/19/18 1:58 AM, Philos Kim wrote:
> > Recer to the section
> > 'Creating Reagent "Components" from React Components' of the
> following page.
> >
> >
> >
> 
> https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md
> 
> 
>
> >
>
> -- 
> 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.

-- 
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.


signature.asc
Description: OpenPGP digital signature