Fork me on GitHub
#clojurescript
<
2019-03-29
>
mfikes00:03:18

Different platform, but similar

ag00:03:52

Yeah seems to be a similar issue, thanks Mike

gklijs06:03:54

Does anyone have experience using web components in a complex clojure script application? Saw a presentation about Stencil yesterday with witch you can easily make 'pure' web components.

gklijs07:03:04

I guess react/re-frame is not really a viable option, https://reactjs.org/docs/web-components.html

thheller10:03:16

react is basically a different solution to the same problem so it doesn't make too much sense to combine them

thheller10:03:32

you are better of either doing everything in react (or any of the CLJS wrappers) or not at all

thheller10:03:06

using 3rd party web components is easy since as far as react is concerned those are only html elements

gklijs11:03:38

I'm not really sure if just cljs and webcomponent are a good fit. You could do some routing and state management in cljs I guest, and use interop/closure to put the elements on the page.

thheller11:03:26

web components are sort of OOP and about isolation so that each component has its own world

thheller11:03:44

that absolutely doesn't fit into things like re-frame as thats a completely separate world

thheller11:03:21

it is not so much about CLJS and webcomponents being a good fit. React isn't a good fit. CLJS would work just fine.

gklijs17:03:32

Slow the first time, or just always. I can imagine them being a little slower since they are lazy loaded.

tianshu12:03:29

is the type inference feature in clojurescript possible for clojure?

souenzzo15:03:50

(defprotocol ILocalStorage
  (set-item [this id value])
  (get-item [this id]))

(extend-protocol ILocalStorage
  "? js/localStorage ?"
  (set-item [this id value]
    (.setItem this id value))
  (get-item [this id]
    (.getItem this id)))
What shoud I out in "? js/localStorage ?" ?

souenzzo16:03:45

my this is just a cljs local name. In cljs, to access this, you need to use as-this

lilactown15:03:49

I'm not sure you can do that @souenzzo

lilactown15:03:22

you could try extending js/Storage? at least that's what exists in Chrome

lilactown15:03:04

you can try calling goog/typeOf on js/localStorage to see what it says

souenzzo16:03:25

returns "object", but it's working

souenzzo16:03:04

I'm using js/window.Storage and it's working

๐Ÿ‘ 4
orestis18:03:47

> Can we avoid using methods on prototypes and instead call it with an argument - like we do in the newer code? function isPassive(context: DOMEventResponderContext){ ... } Methods are much harder to analyze for GCC and requires a virtual dispatch for every call. With stand alone functions we can feel good about getting automatic inlining and DCE with use of future feature flags and such.

orestis19:03:09

This is on some new code that is being discussed, but I canโ€™t imagine worrying about GCC for new code if old code isnโ€™t also GCC friendly?

thheller19:03:36

@orestis I think they use GCC to create the minified build published to npm

thheller19:03:50

they still don't publish raw sources to npm so really doesn't matter what they use

orestis19:03:36

Oh that makes sense.

paul93122419:03:52

Hello guys. I just got started with re-natal. I tried going through the README, but react-native run-ios fails with:

paul93122419:03:43

On ios simulator I see only the home screen, where is the error?

paul93122419:03:28

Apple Mach-O Linker Error Group is the root of errors, after I tried to compile in XCode

paul93122419:03:46

well, my xcode is up to date, now I am playing around with architectures. To be honest I thought it will be as easy as webdev. Like lein new reagent ๐Ÿ˜„

paul93122420:03:44

this is my last errors, I repaired everything what I could: Undefined symbols for architecture i386: "OBJCCLASS_$_RCTBundleURLProvider", referenced from: objc-class-ref in AppDelegate.o "OBJCCLASS_$_RCTRootView", referenced from: objc-class-ref in AppDelegate.o

paul93122421:03:37

okay, I tried the Expo approach, and it works beautifully, anyway, thanks ๐Ÿ™‚

dpsutton19:03:24

@thheller would raw sources on npm be helpful? allow it all through gcc?

thheller19:03:29

in theory if everything on npm was standards compliant ES6+ we would have no issue doing :advanced compilation for all of npm

dpsutton19:03:33

perhaps we can open an issue?

thheller19:03:35

but since that is never gonna happen not really

dpsutton19:03:43

at least for react i mean?

thheller19:03:54

doesn't matter really. its sort of all or nothing

๐Ÿ‘ 4
orestis19:03:15

Google Closure Compiler

orestis19:03:09

Yeah a mistake everyone has made once ๐Ÿ˜„

john21:03:47

Getting the data_readers file to work in all cases is hard

john21:03:47

Trying to use a tagged reader that comes from another project, required in via a :local/root "../blah" coordinate

john21:03:26

Hard to debug things when data readers are being interpreted