Clojurians
#proton
<
2016-07-10
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

robbyoconnor03:07:21

Why is proton so slow to start?

robbyoconnor03:07:40

it makes atom's startup slowwwwwwwwwwwwww

dvcrn05:07:05

@robbyoconnor: it does?

dvcrn05:07:18

just recently or always?

robbyoconnor05:07:41

Has always been

robbyoconnor05:07:54

I seem to only be comfortable in emacs

tgg11:07:29

Hey @dvcrn, I’m running build/dev-repl but keep getting Uncaught Error: Namespace "cljs.repl" already declared. when an atom instance connects; is this something you’ve seen before?

tgg11:07:02

Looks like it’s colliding with proto-repl?

dvcrn11:07:48

yep correct it’s colliding

dvcrn11:07:54

but proton should have been already updated

dvcrn11:07:00

are you on latest master?

tgg11:07:23

What do you mean by already updated?

dvcrn11:07:36

for that problem. the repl for proton should run under a different namespace

dvcrn11:07:37

let me check

tgg11:07:04

almost definitely something I’m doing; just can’t puzzle out what it is!

tgg11:07:58

Interesting; thanks for the pointer @dvcrn will keep digging through

tgg11:07:24

Guessing proto-repl isn’t doing this ☝️ 😐

dvcrn11:07:08

hrrm I’m getting the same error. Something must have changed in the previous commits

dvcrn11:07:16

so it’s not your fault 😛

tgg11:07:59

gonna try rolling back proto-repl; just to isolate off their latest change

dvcrn11:07:04

ping @thheller as well. Any idea how we can get rid of Uncaught Error: Namespace "cljs.repl" already declared. once and for all?

tgg12:07:24

@dvcrn am I right in thinking that error will prevent the freshly compiled js from being loaded?

thheller13:07:34

@dvcrn @tgg the conflict should have been fixed for proton itself. If there are however multiple different cljs-based plugins being installed are bets are off

thheller13:07:43

since they will conflict with each other but not proton

thheller13:07:58

@tgg which plugins do you have installed?

tgg13:07:01

Community Packages (52) /Users/timgreene/.atom/packages
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── blame
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── git-history
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── relat[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

└── (empty)

thheller13:07:27

do you by any chance know which are written in cljs? 😛

tgg13:07:04

time for bisecting my plugins!

tgg13:07:11

unless it's in the package.json...

thheller13:07:30

I know that proto-repl uses some cljs, now just need to find the second one 😛

tgg13:07:41

ag .cljs -l | grep -oP "^.*?/" | uniq
file-icons/
Parinfer/
proto-repl/
release-notes/
vim-mode-plus/

tgg13:07:02

not conclusive but... hmm

thheller13:07:38

if you disable all but one the error should disappeear

thheller13:07:41

although none of these probably have a legitimate reason to ship with cljs.repl

thheller13:07:48

except for proto-repl maybe 😉

thheller13:07:03

so it comes down to the packaging of these plugins

tgg13:07:19

Goes away with disabling proto-repl

tgg13:07:33

this was the stack trace btw:

Error: Namespace "cljs.repl" already declared.
    at Error (native)
    at Object.goog.provide (/Users/timgreene/.atom/packages/proto-repl/lib/proto_repl/goog/base.js:273:13)
    at file:///Users/timgreene/Dropbox/Workspaces/github.com/proton/plugin/lib/cljs-runtime/cljs/repl.js?r=0.4816631136265521:1:6

tgg13:07:50

looks like it is a bad interaction between proto-repl + proton 😞

thheller13:07:48

hmm none of the plugins you listed are written in cljs (except proto-repl)

thheller13:07:15

hmm that should work then

thheller13:07:57

file:///Users/timgreene/Dropbox/Workspaces/github.com/proton/plugin/lib/proton.js

thheller13:07:46

can you gist that somewhere?

thheller13:07:44

hmm looks like it is supposed to

thheller13:07:03

hmm let me fire up atom

thheller13:07:19

clojure.lang.ExceptionInfo: NS:proton.core has duplicate require/use for clojure.string at line 1 proton/core.cljs

thheller13:07:31

you don't get this error when launching dev-repl?

thheller13:07:35

nevermind 😛

tgg13:07:21

It's not a major deal to disable proto-repl to develop proton really

thheller13:07:54

hmm I figured it out

thheller13:07:00

totally my mistake 😛

tgg13:07:18

what was it?

thheller13:07:19

technically the repl is broken as well

tgg13:07:40

is it the unnamespaced goog in repl.cljs?

thheller13:07:55

and no 😛

thheller13:07:21

the issue is that the main plugin.js file sets up global.PROTON to use are the environment

thheller13:07:55

but the repl itself just uses global

tgg13:07:12

yeaah makes sense

thheller13:07:21

that is why the Uncaught ReferenceError: goog is not defined when loading the cljs/repl.js

tgg13:07:20

how to work around it? do we need to modify the cljs.core assets?

thheller13:07:23

it works in the proton.js since all files are in there and no extra files are loaded

thheller13:07:30

probably need to do the same trick proton.js does

thheller13:07:57

prepend each file with

thheller13:07:12

var goog = global.PROTON.goog;

thheller13:07:36

and then pull in names from global to local

thheller13:07:16

as proton.js does

thheller13:07:20

var cljs = goog.getObjectByName('cljs');
cljs.core = goog.getObjectByName('cljs.core');
cljs.core.async = goog.getObjectByName('cljs.core.async');

tgg13:07:48

oh nice, you're the author of shadow-build?

thheller13:07:00

yeah that fixes things

thheller13:07:32

just need to figure out how to make the REPL load process aware of it 😛

thheller13:07:04

ok should be simple. will fix later, gotta go now.

tgg13:07:17

sure thing! thanks for your help!

tgg14:07:42

Just for posterity I added:

var goog = global.PROTON.goog;
var cljs = goog.getObjectByName('cljs');
var proton = goog.getObjectByName('proton');
to the top of proton/plugin/lib/cljs-runtime/cljs/core/repl.js as a workaround

tgg14:07:53

in case that helps anyone else

thheller18:07:17

@tgg @dvcrn try with [thheller/shadow-build "1.0.213"], I'm not entirely sure that is works for all cases

thheller18:07:46

but I get no conflicts with proto-repl, see if it works for you

tgg21:07:12

nice; lgtm!