-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClojureScript: fipp interacts badly with console.log as default print strategy #84
Comments
If you print What javascript environment are you running in? |
first of all thanks for taking the time to answer 🙏 (fipp.edn/pprint [123 234 345] {:width 100})
(cljs.core/*print-fn*
(with-out-str
(fipp.edn/pprint [123 234 345] {:width 100}))) outputs
so it looks like I get one "token" per line ? I suspected it might be a problem with I run the JS with |
The second call appears to be working, which implies to me that something is wrong with the default print-fn. What does Is it:
Or is it If the former, this is because the default print function is likely set to something like |
alright thanks for pointing me in this direction
I looked at however, reading the implementation of |
This must have changed over the years, since it used to use The workaround is simple: (defn pp [x]
(println (with-out-str (fipp.edn/pprint x)))) I've renamed this issue to capture the broader problem. Fundamentally, fipp is intended to be streamable, and so ultimately does I'm not super involved in the community anymore, so I'm not going to spearhead this investigation/fix, but happy to receive feedback/guidance and code here. |
hello again, first of all thanks for your time on this issue 🙏 I continued my own developement using fipp with I'm a bit of a noob in clojure(script) myself so probably not the best person to drive a fix over this 😅 but I agree with your assessment, and from what I understand Clojurescript must do something along those line with their Maybe the issue will be useful in case someone stumble on this behaviour too. See you, and thanks for |
So I apologize if this is a silly question, but I'm trying to use fipp in clojurescript and it prints a single character per line, with options like
width
having no effect.Funily enough, if I capture the output in a string and print it, everything is fine 😅
outputs
I tried this in node and my browser, using shadow-cljs to build the project
I've setup a basic projet to show this behaviour
https://github.com/eauc/test-fipp
any idea what I'm doing wrong ? thanks in advance 🙏
The text was updated successfully, but these errors were encountered: