-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Add react-tap-event-plugin to components that need it #3068
Comments
I did a bit of digging And it seems react doesn't allow plugins with the same name to be registered more than once here And since we have module caching, it's safe to inject the I personally like this solution as we can reduce a huge amount of noise in issues. and the only overhead would be attempting to inject just a couple of times more, which is really negligible. 👍 For this awesome solution 😁 BUT! |
After starting #3064, I also wondered if it'd be easy enough to just implement what @mbrookes suggested here. My only thought was maybe it would be too magical and it'd be a change we'd have to consider carefully. I'm definitely open to this approach though if everyone agrees. My immediate but not terribly pressing (and definitely debatable) concerns were:
|
My thoughts on your concerns:
|
I agree with @mbrookes On this one. the version 1.0 is going to take a lot of time. and it will be like 2 lines per component page. easily removable with P.S. It doesn't |
What about people how are using material-ui as a standalone package, with a CDN for instance ? Otherwise, I like the @mbrookes proposal 👍. |
I didn't think that was possible at the moment, but even if so, surely it's no different than the React peer dependency? |
guys do you think doing this will fix #1192 or make it worse 😁 |
Mm, I'm not sure, my guess it wouldn't help or hurt 😄. It still seems like some people have an issue with |
Sounds good to me 👍 I'm good with this approach, though haven't settled on an implementation yet.
I think more components need this plugin than not. Do you think it'd be alright to just call it in |
Well |
Resolves mui#3068 Signed-off-by: Neil Gabbadon <[email protected]>
Resolves mui#3068 Signed-off-by: Neil Gabbadon <[email protected]>
Yeah, I'm not sure either. I tested it an it appears to work (it's in #3079). But maybe we should investigate whether there are other issues that I'm not considering. |
Wow that was fast 👍 👍 Thanks a lot 😁 |
So there was just an update to the https://github.com/zilverline/react-tap-event-plugin#ignoring-ghost-clicks I'm not saying we shouldn't pursue this idea anymore, but this is an example of why coupling this plugin in our library might cause issues. 😁 For example, the current implementation in #3079 calls |
Damn! We should definitely go back to the warning now -_- I didn't expect to see a configuration on that thing :D :D @mbrookes Unfortunately we can't implement this anymore. |
Didn't see that coming, but it's no big deal. If a user wants to use that feature, they just call #3079 doesn't break anything. |
Yeah we'll have to look into this more. Looking at source I think if they called If we pursue this, we may have to use a combination of #3079 and #3064 to check if the plugin is already registered before calling |
There still be may be a way to do this properly and safely, and we can continue to investigate. But I just think features like this have to be considered and implemented very carefully. For example, developers have ran into trouble when auto-prefixing was not configurable. I just want to make sure we don't make same mistake with different libraries 😁. |
If i'm reading the Worth double-checking, but I think we're good. |
@mbrookes Yeah ultimately we're probably just going to have to test it to confirm. But it seems like React plugin hub isn't just using the name to check, it's also using the Plugin instance. Since the But even so, if it doesn't throw the warning, React overwrites the existing plugin with the new one passed. So users calling it first won't solve the problem. |
Hm, yes, I see what you mean. Well then a combination of your two approaches seems like a good strategy. Over to you! 😄 |
Haha yes, I'll give that a shot and update the PR 😄 |
Hi, I've suddenly started getting this error, is it related to this issue? edit: It only seems to happen when I require my React application in node with edit2: My edge case gets narrower and narrower, my problem seems to be that I'm using |
+1
|
I think we've decided against doing this automatically but I'm still open to implementing a warning. |
Any reason we can't just add react-tap-event-plugin to the components that need it? It seems like this would be the simplest way to solve this recurring issue!
The text was updated successfully, but these errors were encountered: