This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-14
Channels
- # beginners (74)
- # boot (1)
- # cider (6)
- # clj-kondo (8)
- # cljs-dev (30)
- # clojure (195)
- # clojure-ecuador (1)
- # clojure-europe (2)
- # clojure-italy (51)
- # clojure-nl (47)
- # clojure-spec (9)
- # clojure-sweden (27)
- # clojure-uk (63)
- # clojurescript (84)
- # cursive (41)
- # datascript (17)
- # datomic (16)
- # docker (1)
- # emacs (10)
- # events (2)
- # graalvm (2)
- # graphql (37)
- # juxt (2)
- # nrepl (20)
- # nyc (2)
- # off-topic (26)
- # onyx (3)
- # pedestal (4)
- # perun (19)
- # planck (1)
- # reagent (9)
- # reitit (4)
- # shadow-cljs (208)
- # spacemacs (6)
- # tools-deps (4)
hello, after some discussion in #clojurescript I think its worth to bring the discussion here, its about how to use JS libraries that depend on the JS native class system, currently there seems to be no way to extend on of those such classes and call its parent constructor (which is accessible via super
in JS). This looks like a gap because makes very dificult to use those libraries with CLJS, is there some way to do it that I'm missing? or is there any plans on how we are going to handle this in the future? You can follow the original discussion from: https://clojurians.slack.com/archives/C03S1L9DN/p1557803014008100
@wilkerlucio far as I know ES6 classes can be decomposed into ES5 patterns
@dnolen I hit a limitation wall I think, seems like there is no way to unwrap the super
call when the class is defined with native class system, @lilactown also pointed an article talking about this https://clojurians.slack.com/archives/C03S1L9DN/p1557805806015700
this is the gist of the problem:
@wilkerlucio I would read through this first and tell me what you think
nice, that seems like an exit 🙂
thanks for pointing the resource, I'll try following the tips there and see if I can get it to work
@dnolen I did some tries, but no suggested solution can fix the problem of calling a native class constructor, the only way I found to get around is falling back to writing the classes in JS and loading that back again in cljs, I did open the issue: https://dev.clojure.org/jira/browse/CLJS-3084
@wilkerlucio one thing we will have to consider is exactly how deep the support will be
also it's worth thinking about comparing to just writing this kind of stuff in JavaScript
yeah, that deserves some though, some way to make calling of super
idiomatic, I can try start working out some syntax propositions and post in the ticket
sure, I understand, I'm just trying to think around this because that's the blocker, but I understand its about generic class generation