Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

improve debug omitProps option #88

Closed
sibelius opened this issue Dec 4, 2019 · 1 comment
Closed

improve debug omitProps option #88

sibelius opened this issue Dec 4, 2019 · 1 comment

Comments

@sibelius
Copy link
Contributor

sibelius commented Dec 4, 2019

Describe the feature you'd like:

related to this one #70

but I'd like to go deep

We are using Relay in our app, and each fragment has a __fragmentOwner data that could be very large

we want to remove this __fragmentOwner and even more inside props when pretty printing with debug() calls

examples:

sections={
                        Array [
                          Object {
                            "data": Array [
                              Object {
                                "node": Object {
                                  "__fragmentOwner": Object {
                                    "identifier": "query MyestQuery(
....

this is very big (more than 100 lines in terminal)

}>

Suggested implementation:

We can have something like this a sanitizeObject/value that run on value of props - similar to this one https://github.com/entria/entria-fullstack/blob/master/packages/server/test/helper.js#L131

it is a recursive solution

Describe alternatives you've considered:

another solution would be to omit the whole prop all together

Teachability, Documentation, Adoption, Migration Strategy:

@bcarroll22
Copy link
Collaborator

Hmm I’m not sure I want that feature to get that heavy. Let me think about it for a while.

My thought process right now is, this helper isn’t really intended to read or parse your props, just filter specific ones out. If you don’t want to see that huge output, it seems like you could just filter sections out of debug, right? It just seems like it’s a little out of scope 🤔

@TAGraves what do you think?

One last thing now that I’m thinking about it, unless it’s passing the sections prop to host nodes it shouldn’t be in debug output anyways. Only things like View and Text should be in debug, what components are the fragments even being included in?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants