Fork me on GitHub
#clojurescript
<
2018-08-24
>
richiardiandrea02:08:37

@ackerleytng I am interested in knowing why you decided against. I am currently using ClojureScript for lamdba functions. Have you profiled how much the size of the compiled JavaScript influences lamdba runtime or startup?

richiardiandrea02:08:30

I myself have not but I do not think size neither really matters for runtime nor startup

johnj02:08:41

@richiardiandrea and you don't have any startup issues?

richiardiandrea02:08:18

Which issues are we talking about? Do you mean time? Function code is cached and if the lamdba is warm you never have to startup again. Having said that I did not perform any measurements of startup time vs zip size

johnj03:08:31

I guess the issue for some is the getting warm part, where code size does affect execution time

johnj03:08:17

but I understand some applications can afford that

richiardiandrea03:08:06

I have yet to see a non-warm lamdba during normal app life. I would not try to optimize for that use

richiardiandrea03:08:11

Also, usually on AWS the js file is one for all the lamdbas so they are effectively fetching it (and they cache it for you) for at least one call

Karol Wójcik05:08:30

Every concurrent execution of aws lambda has cold start. IMO the clojurescript is not the problem here because a lot of people use webpack so their bundle has higher siz than cljs one

ackerleytng03:08:34

@richiardiandrea i guess it's mainly because i have a hard 100kb limit, as imposed by http://webtask.io. how big are your compiled javascript files?

richiardiandrea03:08:15

In this order of megabytes - webtask's limit feels very odd. I will investigate that

Karol Wójcik05:08:24

@ackerleytng could you please share your code?

kwladyka06:08:04

Can you recommend something to read about best practices for module development? Especially about how to try version on my hard drive during development as dependency in another project. Also I want to give developers example of projects depend on this module. Should I make separate repositories or create folder “examples” in module repository?

kwladyka09:08:30

So silence… what happen to everybody? Friday? 😉

hlolli10:08:18

@kwladyka you could do npm link, to globally install npm module youre developing, its basicslly a symbolic link to a directory, or do you want to access multiple versions locally?

hlolli10:08:38

In that case, you could always ask your companys sysadmin to set up verdaccio.

kwladyka10:08:44

I need to change repo of module and use it as dependency in example, so I need only version from my local hard drive during development

kwladyka10:08:40

hmm symbolic link can be a solution, but not sure how to link cljs module to node_modules in correct way to use it as dependency in project.clj?

hlolli10:08:58

Hmm, what do you mean by cljs module. Because the idea is that you compile the cljs to js before requireing it from node_modules

hlolli10:08:21

Otherwise you can always just use maven

hlolli10:08:33

For local jars in development

hlolli10:08:40

Food on the table brb

kwladyka10:08:03

I mean the obvious solution looks like use it in :dependecies in project.clj

kwladyka10:08:31

No reason to make node_module dependency from that

kwladyka10:08:48

thx, I am going to read what is it 🙂

kwladyka10:08:46

Is it a way to do it the same with shadow-cljs?

kwladyka10:08:01

Ah I remember this checkouts… I was reading about it a long time ago

thheller10:08:22

nothing built-in no. you can just add the :source-paths though

thheller10:08:44

:source-paths ["src/main" "checkouts/foo/src/main"]

funkrider16:08:38

hi - has anybody had success using React.createRef() and om-next components? I seem to be having issues with the ref that I create not being bound to the DOM object due to the lifecycle in React. I am reluctant to use the string refs as they are supposedly going to be deprecated.

melodylane17:08:37

So I'm trying to update cljs-react-material-ui to 1.4 which is what cljsjs.material-ui is on atm. I'm wondering if there is a good way to update a library as you're using it in another project. So far it seems that I need to rebuild my project every time I make a change to the library. The only solution I can think of is to build the library source as part of my project which doesn't seem ideal. Anyone been in this kinda situation before?

nenadalm17:08:11

I have example project in the library repository which has the library in sources: https://github.com/imatic/re-frame-form/blob/e4f2ca430dc83e3e9d78402c4dddee3a8ddb9480/examples/re-frame-form/project.clj#L22 Bad thing is that you have to copy-paste dependencies from the library. I noticed though that Metosin is using some plugin lein-parent: https://github.com/metosin/reitit/blob/d13dab9e32876d4361a52b59cc3a117353f28a09/modules/reitit-ring/project.clj#L7 (https://github.com/achin/lein-parent) which seems to be able to inherit project.clj from the library (I didn't test it yet though).

melodylane17:08:05

interesting. Thank you!

funkrider17:08:18

hey @lane are you trying to use a different version of material-ui in two different projects?

melodylane18:08:58

@funkrider nope, pretty much just working with a template. I'm planning to use material-ui for a project, but I wanted to use a newer version. That lead me to start updating cljs-react-material-ui so that I could use 1.4 for this project.

melodylane18:08:52

I was just thinking it'd be nice to run the example code while updating the library

melodylane18:08:03

Since it helps me figure out what I need to change in the library

melodylane18:08:23

side note, when we have cljs libraries that are basically just wrappers for js libraries, wouldn't it make sense to version the library based on the version of the js library that it uses?

funkrider18:08:02

I see [cljsjs/material-ui "1.4.0-0"] on http://cljsjs.github.io/

funkrider18:08:20

you can just go ahead and use that as a ref in your project and your good to go i think?

melodylane18:08:33

Yep, that one is good to go. The one I'm referencing, cljs-react-material-ui is basically just reagent adaptation and some other helpers so that you can do, for example, (color :blue200) rather than (aget js/MaterialUIColors "blue" "200")

melodylane18:08:44

and so when i finish updating it I'll probably upload a jar somewhere so that other folks can use the updated version. I was just wondering if there's any downside to me making the version match the cljsjs/material-ui version

Michael Thurmond23:08:31

I'm trying to get his in my cljs ns `<script type="text/javascript"> window.onload = function () { var gridViewScroll = new GridViewScroll({ elementID : "gvMain" // Target element id }); gridViewScroll.enhance(); } </script>`

Michael Thurmond23:08:18

and here is my handler `clojure (defn on-load-hander [] (prn "onload handler mt") (reset! my-table (js/GridViewScroll. (clj->js {:elementID "test" :freezeColumn true :freezeColumnCssClass "GridViewScrollItemFreeze" :freezeHeaderRowCount 1 :freezeColumnCount 1 :onscroll (fn [scrollTop scrollLeft]) }))) (prn @my-table) (prn (js->clj @my-table)) (prn (aget (js->clj @my-table) "GridViewScroll")) (js-invoke @my-table "enhance") ;(prn (js->clj @my-table)) ;(prn (clj->js @my-table)) ;(prn (aget (clj->js @my-table) (clj->js :elementID))) ;(prn (aget (clj->js @my-table) (js->clj :elementID))) ;(prn (aget @my-table "elementID")) ;(prn (aget (clj->js @my-table) "elementID")) ; (prn (aget (js->clj @my-table) "elementID")) ) `

Michael Thurmond23:08:32

for some reason I'm having trouble refrencing my-table atom and viwiew the properties to see if gridviewscroll was actually created