@ashnur re .inc.js: the package
task finds the important files for a package by their file extensions
i see, but because .inc.js was not in the example i copied, this looks strange
@ashnur have you read/walked through this: https://github.com/cljsjs/packages/wiki/Creating-Packages
😉 https://github.com/cljsjs/packages/blob/master/blockapps/build.boot#L43
i did read that up until the part i am dealing with now: boot packages
so i have the externs file and everything what's written before it, that was easy
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
once you have your compiled file you can take a look at that sift
task invocation
Writing jsnetworkx-0.3.4-0.jar...
i have no idea if it works or not but no errors
if you show me your build.boot
again I can take a look if it looks proper
https://gist.github.com/ashnur/5b21d929572bad24b5e26e09f8a27c24
writing boot package install target
creates a target directory with the jar
now i just have to try to require it i think
you can inspect the contents of jars with jar tf some.jar
btw
i have to upgrade lein
then i will try to require it
@ashnur does the downloaded zip include a JS file that is meant to be used in a browser (i.e. via a script tag)?
In this case you don't need the whole build-blockapps
task
🙂
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
maybe i shouldn't use the arch linux lein package, they didn't upgrade it yet it seems
@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?
you need to require it in your code otherwise it's not added to the build (because nothing depends on it)
https://gist.github.com/ashnur/5b21d929572bad24b5e26e09f8a27c24#file-build-boot-L45 — for that you should probably update the name here
and then add a require like (:require [cljsjs.jsnetworkx])
to one of your namespaces
it just says this
Could not find artifact cljsjs:jsnetworkx:jar:0.3.4 in central (<https://repo1.maven.org/maven2/>)
Could not find artifact cljsjs:jsnetworkx:jar:0.3.4 in clojars (<https://clojars.org/repo/>)
This could be due to a typo in :dependencies or network issues.
be aware that you cannot alias these namespaces or refer things in those namespaces. They're "synthetic"
updated the name of course 🙂
ok, i don't know what synthetic means
i am not trying anything weird afaik
ls ~/.m2/repository/cljsjs/
not important to understand, just don't forget that you cannot use :as
and :refer
with these namespaces
boot-cljsjs d3 jsnetworkx react react-dom react-dom-server
ok, i will keep in mind, thx
what's in the jsnetworkx dir?
ah. The version is missing the -0
[cljsjs/jsnetworkx "0.3.4-0"]
0.3.4 0.3.4-0 maven-metadata-local.xml
trying it
when you run the install
task it will print the used version (you can check next time)
yes, it works now, thanks again
oh, it might be actually done
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
That's how the world works (right now) 😄
that was never a good enough answer for me 😄
especially in the case of learning projects
if i had to to this for money, i don't waste this much time on using a js lib 😄
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
"you can contribute" right 😄
you mean that there is nothing blocking me besides the shortness of an average human lifetime 😄
That constraint applies to all of us 🙂
not to the same degree
Not sure I follow?
Some people don't die? 😄
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
at least from the perspective of how much each of us can help
sure but they paid for that ability with a lot of time and commitment
not doing other things 😉
having time to learn is a privilege, not one that most people have access to
True. Although not sure what you're getting at?
well, we got very fast into philosophy, sorry 🙂
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
especially how hard clojurescript is even though i've been using datascript for more than a year and mori more than even that
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.
Everyone has their individual priorities and that's something we all have to respect.
yeah, this is why we got into philosophy, the way you describe it sounds as if i had a choice 😛
anyway, not important ultimately
Dunno, you always have a choice no? Just sometimes the downside is too big
that's the myth
i believe that there are no actual choices, more like situations when there are some flexibility in what we do, but not much
circumstances define most of our actions, etc.
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
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
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 🙂
i remember these were the first lectures i saw that made me think about these things in depth
https://www.youtube.com/watch?v=80R3goexOew and this was the latest and greatest. Ignore mostly everyone but what Carol Rovane talks about 🙂
and now you might think, "aha, that's why he has no time" 😛