Comments (4)
I was always thinking about building something like this (maybe around a year ago) but never putting real effort to do it. Yesterday I decided to give another try, and somehow find this, incredible.
(I screenshot this to show my excitement with co-workers last night)
I integrated and it immediately brings benefits to my last project by saving my time debugging selectors input/output. My next project will definitely use this, I can foresee this saves me tons of time debugging and console.log
ing.
My most favorite features:
- Clicking to a node highlights it dependences and dependents.
- Work with "time travel" feature in Redux Devtool (using slider)!
- Showing recompute count for each selectors.
If there is anything I could help, here are some feedbacks:
- Exception handling: Sometimes it shows "Could not load selector graph", I figure out it is because
__RESELECT_TOOLS__.selectorGraph()
was throwing exceptions (null handling issue in selector logic), after fixing it all, I could get the graph rendered nicely. To improve this, I we should have a try/catch in this line https://github.com/skortchmark9/reselect-tools/blob/master/src/index.js#L59 and then in the output panel, we can show the exception detail. - Selector name conflict: We should somehow supports namespace to avoid naming conflict (many selectors could have a same name in large apps). I was doing this:
const withNamespace = (namespace, selectors) => {
const keys = Object.keys(selectors);
const newObj = {};
keys.forEach(key => {
newObj[namespace + '/' + key] = selectors[key];
});
return newObj;
};
ReselectTools.registerSelectors({
...withNamespace('auth', selectors1),
...withNamespace('tnx', selectors2),
});
We should consider adding a built-in API to register selectors with namespace.
- We could arrange the graph nicer, need some spacing for the selector names.
- Could be nicer if we can somehow resolve the selector names without
registerSelectors
for each selectors files (less step) - I don't know how yet but I can "feel" we can do that.
I could send PR if you have a contribution guide.
from reselect-tools.
Wow so helpful! Thanks dude! These are all really great ideas. I'd take a PR for basically any of them - I don't have a contribution guide but I'd be down to do a code review. I'd just ask that:
- you keep the test coverage about where it is
- update the README to document any new features/api you add.
I thought quite a bit about 4.) and I couldn't think of a good way to do it that would work in a minified / uglified build. If you're not minifying, then you can get pretty far doing introspection on the function name, or on the names of the arguments of a descendant selector.
from reselect-tools.
Awwww how nice! Are you using it in your app? Did you solve any problems with it?
from reselect-tools.
Of these four, I think the most necessary improvement is the exception handling in selectorGraph(). I've definitely seen selector exceptions be swallowed before in unpleasant ways and it would be great to expose them better. I'll break off a new issue for that, but I'm going to close this one down.
from reselect-tools.
Related Issues (20)
- Instrument on Demand
- Support for re-reselect HOT 4
- Support for iframes HOT 2
- Can't open dev tools window HOT 5
- Combine extension and library repos HOT 3
- Support groups of selectors HOT 2
- Feature Request: Reset "Recomputations" Count HOT 2
- `ReselectTools.registerSelectors()` fails if the given object has a null value property HOT 2
- Support Immutable values HOT 11
- Graph is incorrect. There are no arrows on the graph. HOT 3
- Request to update repository with version 0.0.2 from Chrome App Store HOT 5
- support for typescript
- Graph is missing. No edges HOT 5
- Crashes chrome profiler
- Absent Reselect panel in Chrome HOT 2
- Add selector computation timings to JSON output
- How to graph selector factories?
- Reselect Debugger for React Native Flipper
- Extension marked as malware by Google
- Chrome Extensions devtool link is broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reselect-tools.