Fork me on GitHub
#cljs-dev
<
2016-11-14
>
bhauman20:11:01

@dnolen working on reloading preprocessed and compiled js. Current problem is compiler is emmiting module names defined with const

dnolen20:11:47

@bhauman that seems goofy

bhauman20:11:28

@dnolen Is that in GCL or our code?

dnolen20:11:01

@bhauman I think just a mistake in my demo?

dnolen20:11:33

just need to switch those

dnolen20:11:43

Components.js

dnolen20:11:47

I’m using const instead of var

bhauman20:11:47

oh i see it now

bhauman20:11:52

darn thanks

dnolen20:11:15

@bhauman np, exciting 🙂

anmonteiro20:11:00

can also probably be solved by specifying :language-out, no?

dnolen20:11:17

@anmonteiro in theory, but I haven’t been able to get that to work

bhauman20:11:20

@dnolen the Circle class definition is being emmitted as a const

dnolen20:11:12

@bhauman this might be a Closure bug, or a weird ES6 spec thing

bhauman20:11:12

so we don't use classes I guess

dnolen20:11:00

@bhauman I just tried over here

dnolen20:11:13

I don’t see the class being exported as const

bhauman20:11:21

hmmm really?

dnolen20:11:48

@bhauman definitely do not

dnolen20:11:58

this is using my es6-demo

bhauman20:11:55

oh yeah it's not a const ... it's a "class" which throws on redefinition

bhauman20:11:12

@dnolen so it behaves as a const

bhauman20:11:22

so again no classes

dnolen20:11:14

@bhauman not so fast 🙂

dnolen20:11:24

you just need to assign to a var

dnolen20:11:00

so much for JS being simple

bhauman20:11:24

well that looks weird as heck

bhauman20:11:56

@dnolen and it freaking works!!!!

bhauman20:11:54

and in a year will be the most asked question "Why don't classes reload?"

dnolen20:11:27

@bhauman in all seriousness this is great news

dnolen20:11:00

between this feature, npm module loading support via Closure, and the externs stuff I think 2017 is going to be “ClojureScript is a pretty awesome JS tool"

bhauman20:11:52

Awesome, there is progress on externs?

dnolen20:11:06

yes I have some working prototype code

dnolen20:11:21

and I merged some missing bits from Maria Geller’s GSoC work

dnolen20:11:51

probably a a couple of Fridays of my time and we can probably have something testable on master

dnolen20:11:36

@bhauman are you planning to ship the Figwheel tweaks anytime soon?

dnolen20:11:11

just let me know when you do - I would like to write a post about it - possibly an updated http://clojurescript.org guide

bhauman20:11:35

There are other changes that I need to make in order for this to be workable.

bhauman20:11:00

:watch-paths, :compile-paths, etc

dnolen20:11:01

gotcha - no rush

dnolen20:11:08

would like the post to be something people can try immediately w/o hassle

bhauman20:11:22

also I'm cheating a bit, in that I'm relying on the current convention of where the output file of a foreign lib is placed

dnolen20:11:40

@bhauman right that’s probably going to change

bhauman20:11:47

yeah I figured

dnolen20:11:48

necessarily so

bhauman20:11:53

as it's not robust

dnolen20:11:01

especially if we’re going to integrate with random JS stuff

dnolen20:11:17

we need to preserve paths to avoid clashes

bhauman20:11:23

absolutely

bhauman20:11:30

thats why I know its bad

bhauman20:11:49

I was thinking that you may want to preserve paths from the root of the project

bhauman20:11:56

or hash them

dnolen20:11:10

it’s pretty high on the list of issues - since a lot of stuff is blocked around it

dnolen20:11:24

probably won’t mess with hashing - just makes debugging harder

bhauman20:11:27

my underlying issue is that I have to have the :provides from the file

dnolen20:11:41

preserving path based on the root of the project is probably the simplest thing

bhauman20:11:47

or the $ seperated convention could work as well

dnolen20:11:06

we don’t control the module naming convention

dnolen20:11:11

Closure implementation detail

bhauman20:11:57

no I meant that instead of recreating the whole output path you could concat into a single dir with $

dnolen20:11:18

unlikely to do that

bhauman20:11:20

that way we can know the difference

dnolen20:11:28

just makes integration with browser tools uglier

dnolen20:11:31

harder to undersatnd

dnolen20:11:49

for stuff that doesn’t follow classpath conventions

dnolen20:11:55

location relative to project root is probably the best we can do

bhauman21:11:55

@dnolen I think I'm going to block on that issue as well

dnolen21:11:08

yes working around it is inadvisable 🙂