Skip to content

Conversation

@lukasberanek-tpa
Copy link

Pretty self-explanatory:
ignore console.warn in case the target or source is not found.

@pierpo
Copy link
Owner

pierpo commented Nov 6, 2023

Hey! Thank you for the contribution.
I wonder if this is the right approach. Maybe we should have a dev mode and a prod mode that ignores warnings?

I'm not sure about the feasibility of a dev mode/prod mode for a library though. I'm not sure we can use process.env.NODE_ENV in all cases 🤔 (it assumes that people are bundling the lib - which is probably always the case haha)

@lukasberanek-tpa
Copy link
Author

Unfortunately this won't fix my "problem":
I have two tables next to each other with multiple pages that I can click through. A row from one table can be connect to multiple rows in the other table. The problem is that these can be "hidden" in another page of the other table. Therefore I just create the relations in the first table without checking if they are actually visible in the other table.

@pierpo
Copy link
Owner

pierpo commented Nov 8, 2023

In that case, maybe we should ignore all warnings by default, and set a isDebug context with a props on ArcherContainer once, defaulting to false. That would make more sense :)

It's a breaking change though, but a minor one.

@lukasberanek-tpa
Copy link
Author

I actually think that the warning is a good indicator for the majority of use cases. Obviously I found one where it's not desired :)

Maybe we have to combine our suggestions by adding

isDebug: props.isDebug ?? process.env.NODE_ENV !== "production"

on the context.
This combines both:

  • overriding via isDebug={false} in the props (like I would do)
  • only show warnings during development

What do you think?

@nethajiunjanai
Copy link

@pierpo Do we have any update on this? Even I want to get rid of these warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants