Fork me on GitHub
#cljsjs
<
2016-12-13
>
martinklepsch09:12:06

@ashnur re .inc.js: the package task finds the important files for a package by their file extensions

Aron09:12:30

i see, but because .inc.js was not in the example i copied, this looks strange

Aron10:12:53

i did read that up until the part i am dealing with now: boot packages

Aron10:12:10

so i have the externs file and everything what's written before it, that was easy

martinklepsch10:12:27

in the blockapps line I linked the compiled JS file (the one you want to load in your app is moved from it's location to cljsjs/.../blockapps.inc.js

martinklepsch10:12:56

once you have your compiled file you can take a look at that sift task invocation

Aron10:12:47

Writing jsnetworkx-0.3.4-0.jar...

Aron10:12:56

i have no idea if it works or not but no errors

martinklepsch10:12:21

if you show me your build.boot again I can take a look if it looks proper

Aron10:12:05

writing boot package install target creates a target directory with the jar

Aron10:12:16

now i just have to try to require it i think

martinklepsch10:12:26

you can inspect the contents of jars with jar tf some.jar btw

Aron10:12:47

i have to upgrade lein

Aron10:12:53

then i will try to require it

martinklepsch10:12:30

@ashnur does the downloaded zip include a JS file that is meant to be used in a browser (i.e. via a script tag)?

martinklepsch10:12:50

In this case you don't need the whole build-blockapps task

Aron10:12:21

i think it has, but the package json also has build tasks and i plan on using the output of that if i get there

Aron10:12:54

maybe i shouldn't use the arch linux lein package, they didn't upgrade it yet it seems

Aron11:12:55

@martinklepsch so, after boot package install target, and writing [cljsjs/jsnetworkx "0.3.4"] in the :dependencies, what else do I need to be able to use this locally?

martinklepsch11:12:09

you need to require it in your code otherwise it's not added to the build (because nothing depends on it)

martinklepsch11:12:48

and then add a require like (:require [cljsjs.jsnetworkx]) to one of your namespaces

Aron11:12:59

it just says this

Could not find artifact cljsjs:jsnetworkx:jar:0.3.4 in central ()
Could not find artifact cljsjs:jsnetworkx:jar:0.3.4 in clojars ()
This could be due to a typo in :dependencies or network issues.

martinklepsch11:12:11

be aware that you cannot alias these namespaces or refer things in those namespaces. They're "synthetic"

Aron11:12:15

updated the name of course 🙂

Aron11:12:28

ok, i don't know what synthetic means

Aron11:12:36

i am not trying anything weird afaik

martinklepsch11:12:54

ls ~/.m2/repository/cljsjs/

martinklepsch11:12:20

not important to understand, just don't forget that you cannot use :as and :refer with these namespaces

Aron11:12:20

boot-cljsjs d3 jsnetworkx react react-dom react-dom-server

Aron11:12:31

ok, i will keep in mind, thx

martinklepsch11:12:40

what's in the jsnetworkx dir?

martinklepsch11:12:54

ah. The version is missing the -0

martinklepsch11:12:11

[cljsjs/jsnetworkx "0.3.4-0"]

Aron11:12:14

0.3.4 0.3.4-0 maven-metadata-local.xml

Aron11:12:16

trying it

martinklepsch11:12:37

when you run the install task it will print the used version (you can check next time)

Aron11:12:56

yes, it works now, thanks again

Aron11:12:14

oh, it might be actually done

Aron11:12:49

it works, but i am still not entirely happy about it. it bothers me that although i am requiring cljsjs/jsnetworkx i have to use js/jsnx if i want to reach the required module

martinklepsch11:12:26

That's how the world works (right now) 😄

Aron11:12:50

that was never a good enough answer for me 😄

Aron11:12:56

especially in the case of learning projects

Aron11:12:10

if i had to to this for money, i don't waste this much time on using a js lib 😄

martinklepsch11:12:11

You can contribute to the Google Closure Compiler and ClojureScript compiler. There's work underway to convert various forms of JS to compatible modules which you could then use with :as :refer etc

Aron11:12:52

"you can contribute" right 😄

Aron11:12:15

you mean that there is nothing blocking me besides the shortness of an average human lifetime 😄

martinklepsch11:12:34

That constraint applies to all of us 🙂

Aron11:12:43

not to the same degree

martinklepsch11:12:09

Not sure I follow?

martinklepsch11:12:23

Some people don't die? 😄

Aron11:12:53

well, the difference between me and someone who contributed to google closure compiler and clojurescript compiler is perhaps bigger than the difference between me and my 90 year old grandmother

Aron11:12:03

at least from the perspective of how much each of us can help

martinklepsch11:12:30

sure but they paid for that ability with a lot of time and commitment

martinklepsch11:12:45

not doing other things 😉

Aron11:12:55

having time to learn is a privilege, not one that most people have access to

martinklepsch11:12:58

True. Although not sure what you're getting at?

Aron11:12:11

well, we got very fast into philosophy, sorry 🙂

Aron11:12:49

i am just saying that i don't see when i would have time and energy and ultimately motivation to learn what is required for those projects

Aron11:12:20

especially how hard clojurescript is even though i've been using datascript for more than a year and mori more than even that

martinklepsch11:12:20

If you think you don't have time to contribute that's fine. No one is expecting anyone to work on any of this stuff.

martinklepsch11:12:25

Everyone has their individual priorities and that's something we all have to respect.

Aron11:12:21

yeah, this is why we got into philosophy, the way you describe it sounds as if i had a choice 😛

Aron11:12:49

anyway, not important ultimately

martinklepsch11:12:31

Dunno, you always have a choice no? Just sometimes the downside is too big

Aron11:12:38

that's the myth

Aron11:12:09

i believe that there are no actual choices, more like situations when there are some flexibility in what we do, but not much

Aron11:12:20

circumstances define most of our actions, etc.

Aron11:12:08

not saying there is no free will, but it's free in the sense that it's not tied up, not in the sense that it has no or few limitations. actually, there are way way more limitations of our brains that most people even allow to be discussed

Aron11:12:52

but again, that's the philosophy part. for me, this is just learning now, i want to use clojurescript reagent datascript canvas + d3 and now this jsnx too

Aron11:12:25

i focus on short term goals like these, and when this is done, i have a list from which i choose, and sometimes i add to that list but it has dozens of items already 🙂

Aron11:12:48

i remember these were the first lectures i saw that made me think about these things in depth

Aron11:12:03

https://www.youtube.com/watch?v=80R3goexOew and this was the latest and greatest. Ignore mostly everyone but what Carol Rovane talks about 🙂

Aron11:12:19

and now you might think, "aha, that's why he has no time" 😛