jasongilman / proto-repl

A Clojure Development Environment package for the Atom editor
https://atom.io/packages/proto-repl
MIT License
563 stars 50 forks source link

Remove global goog #232

Closed mauricioszabo closed 7 years ago

mauricioszabo commented 7 years ago

Fixes: https://github.com/jasongilman/proto-repl/issues/231

I know this is a kinda scary PR (after all, there are 126k deleted lines!), so I'll explain what I did:

There are two interesting options to compile ClojureScript - :output-wrapper true wraps resulting Javascript in (function() { })();, so that variables will not become global. This means that goog will not be exposed, and will not interfere with other packages that need to use it in the development process. The side-effect is that compilation will generate a single file - so, I've added two compilation rules for ClojureScript - one for edn_reader and other for self_hosted.

For self-hosted, I added a main entrypoint (otherwise node complains). It's the same as edn_reader - just an empty fn.

For some reason, proto-repl-charts was not downloading, so I upgraded the version in project.clj too, and then things compiled fine. I tested most of the functions (edn parsing, evaluation, self-hosting REPL, auto-complete) and they seem to work fine.

jasongilman commented 7 years ago

Thanks for this pull request. I'm glad you were able to find those settings for ClojureScript. I'm busy in the evenings with some work tasks but I should be able to take a look at this pull request, test, and merge in a couple days.

jasongilman commented 7 years ago

This works for me. Thanks again!