proton 2016-07-10

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?

Looks like it’s colliding with proto-repl?

yep correct it’s colliding

but proton should have been already updated

are you on latest master?

What do you mean by already updated?

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

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

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

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

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

so it’s not your fault 😛

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

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

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

@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

since they will conflict with each other but not proton

@tgg which plugins do you have installed?

Community Packages (52) /Users/timgreene/.atom/packages
├── Parinfer@1.15.0
├── advanced-open-file@0.16.3
├── atom-alignment@0.12.1
├── atom-beautify@0.29.9
├── atom-dark-fusion-syntax@1.1.0
├── atom-material-syntax@0.4.6
├── atom-material-ui@1.2.13
├── atomatigit@1.5.5
├── autocomplete-paths@1.0.2
├── autoupdate-packages@1.3.1
├── battery-status@0.11.0
├── blame
├── busy@0.5.0
├── comment-commander@0.2.0
├── easy-motion-redux@1.1.1
├── environment@1.2.0
├── ex-mode@0.10.0
├── expand-region@0.2.4
├── file-icons@1.7.16
├── git-history
├── git-plus@5.16.2
├── golden-ratio@0.3.0
├── highlight-line@0.11.1
├── highlight-selected@0.11.2
├── ink@0.4.4
├── language-diff@0.4.0
├── language-pixie@0.22.0
├── language-racket@0.4.0
├── language-scheme@1.4.0
├── language-terraform@0.7.4
├── last-cursor-position@0.9.0
├── lines@0.13.1
├── linter@1.11.14
├── linter-clojure@1.1.2
├── maximize-panes@0.2.0
├── merge-conflicts@1.4.4
├── move-panes@0.2.0
├── nucleus-dark-ui@0.9.0
├── project-plus@0.9.0
├── proto-repl@1.2.0
├── proton-mode@0.11.0
├── recent-files-fuzzy-finder@0.2.4
├── relative-numbers@0.5.1
├── release-notes@0.53.0
├── tab-switcher@1.5.3
├── theme-switch@0.4.0
├── time-status@1.1.2
├── todo-show@1.6.0
├── tomorrow-night-eighties-syntax@0.13.0
├── vim-mode-plus@0.46.0
├── vim-mode-plus-ex-mode@0.4.0
└── zentabs@0.8.7

└── (empty)

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

time for bisecting my plugins!

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

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

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

not conclusive but... hmm

if you disable all but one the error should disappeear

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

except for proto-repl maybe 😉

so it comes down to the packaging of these plugins

Goes away with disabling proto-repl

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

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

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

hmm that should work then

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

can you gist that somewhere?

hmm looks like it is supposed to

hmm let me fire up atom

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

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

nevermind 😛

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

hmm I figured it out

totally my mistake 😛

technically the repl is broken as well

is it the unnamespaced goog in repl.cljs?

and no 😛

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

but the repl itself just uses global

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

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

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

probably need to do the same trick proton.js does

prepend each file with

var goog = global.PROTON.goog;

and then pull in names from global to local

as proton.js does

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

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

yeah that fixes things

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

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

sure thing! thanks for your help!

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

in case that helps anyone else

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

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

Why is proton so slow to start?

it makes atom's startup slowwwwwwwwwwwwww

just recently or always?

I seem to only be comfortable in emacs