GithubHelp home page GithubHelp logo

day8 / re-frame-10x Goto Github PK

View Code? Open in Web Editor NEW
624.0 19.0 68.0 17.66 MB

A debugging dashboard for re-frame. X-ray vision as tooling.

License: MIT License

Clojure 99.66% Shell 0.08% CSS 0.26%
re-frame tracing debugging reagent

re-frame-10x's People

Contributors

daiyi avatar danielcompton avatar darwin avatar deraen avatar dexterminator avatar dijonkitchen avatar dpsutton avatar gadfly361 avatar gnl avatar gregg8 avatar heralden avatar hipitihop avatar hugoleodev avatar jacekschae avatar kimo-k avatar lwhorton avatar mainej avatar marianafantini avatar mawiraike avatar mhuebert avatar mike-thompson-day8 avatar mynomoto avatar palfrey avatar quezion avatar rlovtangen avatar sardtok avatar shen-tian avatar smee avatar solatis avatar superstructor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

re-frame-10x's Issues

Make CSS not inline

Possible solutions:

This is a prerequisite for #17, because the panel is currently picking up styles from its parent window, so we need to add a CSS-reset, which would be very unwieldy inline (though I suppose it's totally possible).

Edit: We will use clojure macro to read a CSS file (improving the current way, in which we are defining CSS in a string within cljs), and a separate issue is made to introduce CSS preprocessing!

Fix hiccup rendering of operation names

  • re-frame operation names in the form of [:idle :add-event] are incorrectly being interpreted as hiccup
  • change to extract operation name only
  • possible form for operation names:
    • ReagentInput
    • vector of keywords: [:idle :add-event]
    • keyword: :pieces

Handle changing window viewport size when trace window is hidden

When re-frame-trace is hidden, it is just moved to the right hand edge of the screen, so it can smoothly animate on when it is unhidden. However if you change the size of the window (say by making it wider, or removing Chrome Devtools, the tracing window stays in it's fixed position. It would be good for it to reset it's position to the right hand side of the window whenever the viewport size changes.

More intuitive time filtering

Ideas

  • have the time filter be a slider rather than a textbox, so you can see immediate feedback of how many events are passing the threshold you're adjusting.
  • sort by time by clicking the header name

Improve performance of string handling

The string.split and string/includes? calls get very expensive when there are a large number of them. We should look into a cheaper way of doing this, perhaps by creating another Reagent function which returns a vector of the component hierarchy, rather than a string.

Dock component

  • Automatically scroll to bottom when new info gets added
  • Rotate around different screen edges
  • Handle resizing better (using Facebook's Dom Mouse Move lib?)

Print dispatched params for event traces

Currently, the extra info under each trace is the metadata.

screenshot from 2017-08-16 10-55-40

See above: the metadata for the :event trace is empty because the event doesn't have metadata!

The :event traces extra info should instead show the dispatched event params, because this is something that people often println to check.

React Native support?

Based on my reading of the source, this seems to be web-focused. The tracing aspect of it, and monkey patching of Reagent, should be portable though, I think. Is there any plan to support React Native, or make this modular so it can be reused by someone looking to build a similar UI for React Native?

I see that re-frame.trace exists, and is used here, but the debugging documentation seems dated and doesn't mention it. I could really use this detailed tracing and would appreciate any suggestions.

Fix logging data structures to console

  • steps to reproduce: click on data structure to print to console
  • following error occurs for all operation type details except for event details:
    CLJS DevTools internal error: TypeError: Cannot use 'in' operator to search for 'constructor' in rx10

Improve the node viewer

At the moment the node viewer is a bit unpredictable when things change. It needs someone to really get in to D3 and the Reagent lifecycle to understand what's going on.

Display fully qualified namespace for events in traces

  • for bigger applications, it is common to have similar event names across multiple namespaces
  • that makes it harder to understand where event is being dispatched
  • suggestion: display fully qualified namespace for events

Bounded, more efficient pprint function

When printing the tags for a trace, some of them may get very large. As a quick and dirty fix for #52 before that is completed, a bounded pprint function could be created. This would be the same as pprint, but when printing each top-level keys value, it would only print the first (say) 200 characters, and if the limit was hit, add a trailing elipsis.

This would be more efficient than our current implementation which pprints the entire datastructure, then trims the string. It would also be more useful as it would show at least part of each key, rather than one big value dominating the rest of the string.

Another option to do perhaps in conjunction with the idea above is to use fipp as it is much faster. We still want to not print the whole string though, as the string might get way too big.

Filter by trace types

As part of the filtering options, present a list of trace categories to be shown /hidden.

The list could be a checklist, or maybe some pills to be toggled.

Categories:

  • re-frame internal
  • reagent rendering
  • application events
  • subscriptions
  • ???

filtering polish

some things that need to be implemented to polish the filter functionality:

for traces filtered by milliseconds:

  • at the moment, it is possible to enter several slower-than filters
    • either disable adding a new slower-than filter if another one is already in the list
    • or apply only filter that has been entered last

for traces filtered by words:

  • prevent adding duplicate search queries

Save filter sets

Allow users to save filter sets, and choose filter defaults for when the panel first opens.

We have no idea what this might look like UI-wise, so this is a super nice-to-have-in-the-future type of task.

Add information about source-paths to the readme

We ran into a couple interesting questions over the last weeks where the answer was "source-paths":

  1. How does re-frame-trace build?? I don't see anything in the project.clj that looks like it will build.

    Answer: when you add a path to the :source-paths of the test project used to develop the trace panel against, figwheel of the test project will know to watch and build it too! So cool!

  2. Why are changes in my local re-frame repo reflected in the example project? Shouldn't it be pulling from clojars?

    Answer: It's because if you are using the example project that lives in the re-frame repo, it has the local re-frame repo in the :source-paths! (as "../../src").

This might be helpful in the readme! I'm sure this is something many clojure developers are familiar with, but I myself learned it during the course of this project, so others might benefit too.

Data browser

One of the challenges with this tool is effectively viewing the data. Oftentimes dispatched events are very large, and it is not efficient or useful to pretty print it all to a string at once. Having a live data structure browser that could be used to progressively unpack event tags, and to view app-db would be a really really great feature.

Dirac has a really great implementation of this, and re-frisk also has a data browser (but it's not quite as fully featured as Dirac's).

https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview

http://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html
https://gist.github.com/mattzeunert/a9a5aebc736f9f30e53f

Development: where do CSS files go?

Originally, the LESS and CSS files were in src/day8/re_frame/trace/css and src/day8/re_frame/trace/less.

Then, they were both moved to resources/day8/re_frame/trace because it's more proper naming convention to places styles into the resources folder.

However, now the host project can't find the CSS, because we gave instructions to change the source-paths to look like this:

:source-paths ["src" "../../src" "checkouts/re-frame-trace/src"]

and resources sits outside of this.

Which is a preferable fix?

  1. adding "checkouts/re-frame-trace/resources" to :source-paths
  2. moving the LESS and CSS files back into src/day8/re_frame/trace

Actionable item: update the README and/or file locations to reflect the decision made here!

Add an id for the re-frame-trace div

This will allow you to grab it later on when re-rendering it if you're developing re-frame-trace. The id should be sufficiently unique to be unlikely to collide with anything else.

Edit app-state

Text, integers, and booleans should be editable in the app-state browser tab!

Better filtering

Filtering is quite crude at the moment, it would be good to have better mechanisms for filtering.

Epochs

Epochs are defined as being the bounds between an event being fired, and all subsequent events, db updates, subscriptions, and renders being run. This is inherently a little bit of a fuzzy concept, as there may be events added to the re-frame event queue by async network activity which becomes part of the epoch, even though it is logically separate. For developing and debugging purposes to show the separation of events this is good enough.

How do we know when we are in a new epoch? How do we know when it is finished? Just based on events? Should there be something fired at the end of the render?

We also want to show in the trace view the bounds of each epoch.

Use CSS preprocessing

Isolating trace panel and host project styles is pretty gnarly at this juncture. We have two problems:

  1. prevent trace panel styles from interfering with the host project
  2. prevent host project styles from interfering with the trace panel

Previously, we were addressing 1) in a painful way, which is manually writing out the name-spacing CSS class every single time we define a new style. Preprocessing makes this much much nicer.

Preprocessing doesn't address 2), but it would certainly make it easier to do a more complete job of making sure we properly overwrite all host panel CSS.

LESS or SASS?

I was looking for the best way to use SASS in clojure projects, and it seems most of them require you to have Ruby installed, or at least their readmes claim as much. I didn't want to deal with that kind of overhead.

LESS did not require the developer to install Ruby, so I am going with LESS.

I also looked at re-frame-template for inspiration and noticed SASS option was removed a couple weeks ago due to compatibility issues: day8/re-frame-template@5ee0540

That aside, LESS is less draconian and so it's more friendly to develop with for people who have just a bit of experience with CSS, so figured it wasn't that much of a loss.

Tree view for traces

web-screenshot

Be able to help users answer the question "Why did that sub fire?". We have some of the information from the hierarchy by chained subs (although not all data dependencies go through chained subs).

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.