@mauricio.szabo Not sure if you can post videos I would love to see the video of the new console you're working on.
Of course, here it is.
The new console implementation is fully on reagent
, and I think it would be really easy to add something like "if you're printing a very big string, truncate it so it don't lock up Atom" or something
ah, that expand feature is awesome
There are also other features. For example, suppose you're refreshing your code and there's an error. The current REPL (on version 0.1.13) will return this:
If you look at the console tab, you'll see that there's no information at all. It's only on the Atom info that a serialized version of the error appears
right, i was subconsiously copying the error to track down the line
This is the new console. Also, on some new version of Chlorine I intend to add links to "goto file" on stacktraces too
i think that would remove a lot of cognitive load. I'm assuming go to file won't work in cljs
so, as a slight tangent, i saw you discussing inspect-block with sean corfield, the way he implemented it was by having a hook on the eval. Is it possible to nominate a more general hook/wrap like he did in inspect block with (wrap-in-rebl-submit). The use case i'm thinking of is to enable a repl driven refresh of reagent. eval-block -> (reagent-mount [root])
Maybe... I'm working on it, I'm thinking about integrating Orchard so it would give a richer experience on documentation, autocomplete, and goto var definition on both CLJ and CLJS files
it can however be used for including other things like sending output to rebl or running tests or w/e
or am i misunderstanding where the code runs
Yes, I'll probably go to that route. The current implementation only supports Clojure, but on next versions I'm making the code more generic so it can work with the "current" REPL
I'm also working more and more with ClojureScript, so these are becoming pain points for me too 🙂
i'm not too hung up on the code navigation for cljs i think. errors tend to be pretty easy to find if you give namespace and line numbers
yea, so where i've found this to be the biggest pain is in react native. i'm able to manually compile a function then run my mount function
or i can hit save, which runs a namespace refresh and then a mount hook, but it's much slower than just evaling a function and running mount
Yes, I'm currently using block comments to run it, something like:
#_
(r/mount [my-view] my-root)
And I keep evaluating over and over until I'm satisfied with the resulti've started doing that for iterating on single components as well, but iterating on a component while it's in the larger context of the page gets lost
for instance
(mount
[rn/view {:style {:margin-top 45}}
[rn/button {:title "hi" :on-press #()}]])
one more think on the console, having a button to clear would be useful. i don't have the muscle memory for binding the chlorine:clear-console command on a keybind yet
Yes, a toolbar would be useful too. I just don't know which more action the toolbar on the console could have besides "clear console"
collapse all?
like a truncate/untruncate outputs
i'll start paying attention to the things I actually do in the console and write them down. It's quite hard to notice when you're not in the moment
Great, that would help a lot! Truncation of "outputs" may be easy, but for results I don't think so... these things are independent from each other, but let's see if I can find some way around it 🙂
yea, i mean printed outputs. sometimes you get a screen full of errors but you don't want to clear the whole thing (in the terminal i mean)
@bronkhorst.chris Did you see how I'd refactored the inspect-related eval stuff? https://github.com/seancorfield/atom-chlorine-setup/blob/master/init.coffee#L50-L77 I think I posted a link before but can't remember.
Looks like great work on the new console @mauricio.szabo! I must admit I have the console squished down to just three lines at the bottom of the screen and mostly ignore it -- since all my results go into REBL which I have split-screen with Atom (Atom on the left, REBL on the right). About the only time I expand the console is to read a stacktrace for a compile or eval failure -- so having those via Atom pop-ups would be a nice enhancement (that's what I think I saw in those screen shots -- I'm about to watch the video)...
Nice. I like the separation of stdout/stderr. I guess I'd still rather have the error in a popup that I can either read or dismiss with esc
.
pprint last output
Great, I'll check if there's any way of adding a popup that can be dismissed. In fact, I was studying about the possibility of hiding the console tab completely, and only show it when necessary (sometimes I'm programming on small screens and I don't like the REPL cluttering things too). Currently I'm using a package called "Hey Pane" that maximizes / minimizes panes, but maybe a baked-in solution could be better
I think printed outputs truncation can be really easy to implement 🙂
Between inline results and REBL, I'd be very happy to hide the Console altogether -- as long as exceptions are displayed inline and/or via a popup.