darwin / plastic

An experimental structural editor for ClojureScript
MIT License
147 stars 4 forks source link

Happy Building #3

Closed hellonico closed 9 years ago

hellonico commented 9 years ago

Just randomly stumbled here, tried to compile everything, and ran into Maximum call stack size exceeded:

screen shot 2015-08-25 at 10 12 59 am

I know this is not ready for usage, but I thought you may had seen this during your dev cycles.

darwin commented 9 years ago

Go to theSources tab of devtools and check breakpoint "pause" icon and "Pause On Caught Exceptions". I would like to see the stack traces.

Also what is very strange is the first error. It didn't find _build/worker/goog/base.js.

Did you run ./script/figwheel.sh as documented here? By default it should start :dev build profile, which is compiling into _build/main/... (respectively into _dev_build/main - _dev_build should be a symlink to _build - please make sure you didn't lose symlinks when cloning the repo)

This is output from my figwheel:

./script/figwheel.sh
Figwheel: Starting server at http://localhost:7000
Focusing on build ids: dev
Compiling "../lib/_dev_build/main/plastic.js" from ["checkouts/re-frame/src" "checkouts/reagent/src" "checkouts/rewrite-cljs/src" "src/macros" "src/env" "src/dev" "src/common" "src/main" "src/worker"]...
Compile basic sources, elapsed time: 9007.239094 msecs
Add dependencies, elapsed time: 7148.526923 msecs
Successfully compiled "../lib/_dev_build/main/plastic.js" in 16.326 seconds.
Started Figwheel autobuilder

Launching ClojureScript REPL for build: dev
Figwheel Controls:
          (stop-autobuild)                ;; stops Figwheel autobuilder
          (start-autobuild [id ...])      ;; starts autobuilder focused on optional ids
          (switch-to-build id ...)        ;; switches autobuilder to different build
          (reset-autobuild)               ;; stops, cleans, and starts autobuilder
          (build-once [id ...])           ;; builds source one time
          (clean-builds [id ..])          ;; deletes compiled cljs target files
          (fig-status)                    ;; displays current state of system
          (add-dep [org.om/om "0.8.1"]) ;; add a dependency. very experimental
  Switch REPL build focus:
          :cljs/quit                      ;; allows you to switch REPL to another build
    Docs: (doc function-name-here)
    Exit: Control+C or :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when figwheel connects to your application
To quit, type: :cljs/quit
cljs.user=>
darwin commented 9 years ago

The problem was a rare situation when figwheel decided to live-reload figwheel.cljs. ns-to-js-file function then ended up calling itself into infinite recursion.

As I wrote here, figwheel can go crazy. It is better to kill atom and launch it again cleanly.

hellonico commented 9 years ago

hmmm ... sorry for that. You are right.

It was documented indeed, but I simply started figwheel without giving the ids. So

./script/figwheel.sh main worker

Made it work. Thank you for the quick turnaround !

hellonico commented 9 years ago

Quick question, any way to insert text right now or is it only read only ?

screen shot 2015-08-26 at 1 16 49 pm

darwin commented 9 years ago

./script/figwheel.sh should work just fine. I think the likely problem was that you didn't wait for figwheel to fully start. On slower machines it can take up to one minute.

It is possible to edit the the text. CTRL+arrows perform structural movement, CTRL+down arrow opens inline editing if you are on a leaf token in the structural tree. You can also insert new token with SPACE or pressing opening bracket ( [ { etc.

Look here for current keyboard mappings: https://github.com/darwin/plastic/blob/master/keymaps/plastic.cson