Giter VIP home page Giter VIP logo

Comments (5)

darwin avatar darwin commented on August 17, 2024

It could be possible, but I'm afraid I'm not going to override standard formatters for strings. That feels too intrusive. I'm afraid we could open a can of worms by trying to take over DevTools's job of formatting raw JS strings.

from cljs-devtools.

darwin avatar darwin commented on August 17, 2024

I could implement a helper function which would "mark" a raw javascript thing as something to be printed by cljs-devtool's formatter. So you would explicitly ask for it to be rendered in cljs-devtools-way.

Similar to envelope: https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/toolbox.cljs#L5

from cljs-devtools.

danielcompton avatar danielcompton commented on August 17, 2024

Hmm, not sure if the cure would be worse than the disease.

from cljs-devtools.

darwin avatar darwin commented on August 17, 2024

I just did some quick tests and DevTools do not call custom formatters for primitive values like numbers, nulls or strings. I get a chance to format input only if it is wrapped in some non-primitive value (javascript object).

Also I noticed pretty weird behaviour of console formatting for strings. If the first argument to console.log is formatting string, then all following strings are black without quotes (they get rendered by string formatting routine). If the first argument is something else then strings are red with black quotes around them (they get rendered as objects with their internal string formatter).

I think it can be explained by two different rendering paths taken with formatting string and without it. But it is confusing at least.

from cljs-devtools.

darwin avatar darwin commented on August 17, 2024

here is a screenshot from this page:

from cljs-devtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.