[ClojureScript] Re: Can't use React from a CDN with reagent 0.8.0-alpha2 without vendoring externs

2018-03-12 Thread Jonathan Fischer
This dates back to over a year ago, but here's what I did to use React 
15.1.0 from a CDN when using Reagent 0.7:

My Reagent dependency in project.clj looks like this:

 [reagent "0.7.0" :exclusions [cljsjs/react
   cljsjs/react-dom
   cljsjs/react-dom-server]]

Then I just created a set of dummy namespaces in my source tree to fake out 
the compiler:

solace:eris2 jfischer$ find src/cljsjs
src/cljsjs
src/cljsjs/react.cljs
src/cljsjs/react
src/cljsjs/react/dom.cljs
src/cljsjs/react/dom
src/cljsjs/react/dom/server.cljs

solace:eris2 jfischer$ cat src/cljsjs/react.cljs
(ns cljsjs.react
  "Dummy namespace to let me exclude React from my compiled output.")

And in my HTML loaded React from the CDN:

https://unpkg.com/react@15.1.0/dist/react.min.js";>
https://unpkg.com/react-dom@15.1.0/dist/react-dom.min.js";>


On Monday, March 5, 2018 at 11:02:53 PM UTC-8, al...@hill.net.au wrote:
>
> Hi all,
>
> I want to use reagent 0.8 with an external React 16, available as 
> `window.React` (equivalent to using React from a CDN, but in reality built 
> and exported from a separate webpack bundle).
>
> My goal is to build a bundle which uses React, ReactDOM and 
> createReactClass from the window object, instead of inlining its own copies 
> of those libraries.
>
> I talked to @Deraen about this on Slack a couple of months ago who helped 
> me get this working. I'm currently able to build a bundle as described 
> above, but I have to vendor in all the extern files from the relevant 
> cljsjs React libraries, and add them to :exclusions. My :compiler key in my 
> cljsbuild config looks like this:
>
>:foreign-libs [{:file "src/js/empty.js"
>:provides ["react" "react-dom" "create-react-class" 
> "react-dom/server"]
>:requires []
>:global-exports {react React
> react-dom ReactDOM
> create-react-class createReactClass
> react-dom/server ReactDOMServer}}]
>:externs ["src/js/externs/react.ext.js"
>  "src/js/externs/react-dom.ext.js"
>  "src/js/externs/create-react-class.ext.js"]
>
> He thought at the time that it should be possible without the externs and 
> :exclusions, as mentioned on this page: 
> https://github.com/reagent-project/reagent/blob/master/docs/0.8-upgrade.md#browser---loading-react-from-cdnjs-or-custom-webpack-bundle
>
> > it should be possible to override the Cljsjs foreign-libs, while still 
> using externs from Cljsjs packages.
>
> But I can't figure it out - if I don't exclude the cljsjs libraries, I get 
> a bundle with React 15 built-in, and if I do exclude them, the bundle is 
> broken because the externs are missing and the names get eaten by the 
> closure compiler.
>
> Is there any way around having to commit the externs?
>
> Thanks,
> Alex
>
>

-- 
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] Re: Has anyone tried the quickstart guide lately?

2018-03-12 Thread David Nolen
While the forthcoming Quick Start is an improvement we do want the old
Quick Start to work until it's ready :) We don't get many reports about the
original Quick Start not working these days so that needs to be taken into
consideration here.

For the OP, if you're encountering trouble it's important to enumerate the
precise steps that lead to the failure, newcomers sometimes diverge from
the instructions for one reason or another and this nearly always leads to
simple mistakes. If you're looking for some realtime help I recommend Slack
or IRC.

HTH,
David

On Mon, Mar 12, 2018 at 10:13 AM, Dave Liepmann 
wrote:

> Please reconsider introducing yourself with a phrase like "dismal
> failure". Regardless of how you feel about it in the heat of frustration,
> people who worked hard on that document are here. Let's be kind to each
> other.
>
> I have no direct troubleshooting advice, but consider that the entire
> Quickstart is being massively rewritten:
>
> https://www.reddit.com/r/Clojure/comments/81yk2a/
> clojurescript_110x_new_quick_start_feedback/
>
> https://clojureverse.org/t/clojurescript-1-10-x-new-
> quick-start-feedback-please/1679
>
> https://twitter.com/swannodette/status/970140813727584256
>
> Cheers.
> —Dave
>
>
> On Monday, March 12, 2018 at 4:01:19 AM UTC+1, Robbie Huffman wrote:
>>
>> It's a dismal failure.
>>
>> Yes, the first line of build.clj is (require 'cljs.build.api)
>>
>> => java -cp cljs.jar:src clojure.main build.clj
>> Exception in thread "main" java.io.FileNotFoundException: build.clj (No
>> such file or directory)
>>
>> Yes, java is:
>> > java -version
>> java version "1.8.0_161"
>> Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
>> Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
>>
>> --
> 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.


[ClojureScript] Re: Has anyone tried the quickstart guide lately?

2018-03-12 Thread Dave Liepmann
Please reconsider introducing yourself with a phrase like "dismal failure". 
Regardless of how you feel about it in the heat of frustration, people who 
worked hard on that document are here. Let's be kind to each other.

I have no direct troubleshooting advice, but consider that the entire 
Quickstart is being massively rewritten:

https://www.reddit.com/r/Clojure/comments/81yk2a/clojurescript_110x_new_quick_start_feedback/

https://clojureverse.org/t/clojurescript-1-10-x-new-quick-start-feedback-please/1679

https://twitter.com/swannodette/status/970140813727584256

Cheers.
—Dave

On Monday, March 12, 2018 at 4:01:19 AM UTC+1, Robbie Huffman wrote:
>
> It's a dismal failure.
>
> Yes, the first line of build.clj is (require 'cljs.build.api)
>
> => java -cp cljs.jar:src clojure.main build.clj
> Exception in thread "main" java.io.FileNotFoundException: build.clj (No 
> such file or directory)
>
> Yes, java is:
> > java -version
> java version "1.8.0_161"
> Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
>
>

-- 
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] Has anyone tried the quickstart guide lately?

2018-03-12 Thread Zane Shelby
I just ran through the the quick start up until the first compilation step and 
didn't encounter any issues ( https://asciinema.org/a/uddTjAjUQVUuwnVGO3AQ1S5wP 
). Are you sure you're invoking java from the same directory in which you 
created build.clj ?

On Sun, Mar 11, 2018 at 10:05 PM, Robbie Huffman < robbie.huff...@gmail.com > 
wrote:

> 
> It's a dismal failure.
> 
> Yes, the first line of build.clj is (require ' cljs. build. api (
> http://cljs.build.api/ ) )
> 
> => java -cp cljs.jar:src clojure.main build.clj
> Exception in thread "main" java. io. FileNotFoundException (
> http://java.io.filenotfoundexception/ ) : build.clj (No such file or
> directory)
> 
> Yes, java is:
> > java -version
> java version "1.8.0_161"
> Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
> 
> 
> 
> 
> 
> 
> --
> 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+unsubscribe@ googlegroups. com (
> clojurescript+unsubscr...@googlegroups.com ).
> To post to this group, send email to clojurescript@ googlegroups. com (
> clojurescript@googlegroups.com ).
> Visit this group at https:/ / groups. google. com/ group/ clojurescript (
> 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.


[ClojureScript] [reagent] react-beautiful-dnd question

2018-03-12 Thread Boris Kourtoukov
I am trying to translate this Beautiful Drag and Drop's simple example: 
https://github.com/atlassian/react-beautiful-dnd/blob/master/stories/src/simple/simple.jsx

Everything works well until I get into the inner "Draggables", what is the 
appropriate way to write the following in Reagent: 
https://github.com/atlassian/react-beautiful-dnd/blob/master/stories/src/simple/simple.jsx#L79-L87

Specifically the `:ref` fields seem to not function as expected if I just 
do `(aget droppable-provided "innerRef")` 

As an aside has anyone had any luck with Beautiful Drag and Drop? 

Also if someone hasn't seen it yet, this is a super helpful tool for larger 
JSX components: https://github.com/madvas/jsx-to-clojurescript

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 https://groups.google.com/group/clojurescript.