-
Notifications
You must be signed in to change notification settings - Fork 60
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
replace minimatch dependency with glob-to-regexp (#52) #55
Conversation
🙌 Thank you very much, @ioss. I decided to use
In general, I don't recommend using the In the meanwhile, the package you found seems to work like a charm. |
Well it should already be better as the version before as I pulled the pattern generation one level up. Ok, nevertheless to memoizing: Case 1: We have one value to match: memoize-one would be an option or a custom solution with "cache + key" on the instance too. So the interesting case is case 2. I think, we should hook into the lifecycle of the component, as we only have to invalidate the cache, if the props of the components change. What do you think? I noticed, that the Action component does not allow for glob-patterns. Is this intentional?
I'd be happy to create a second PR, after we have decided on the how. |
+1, thanks!
Yes, because actions are labels/strings and they can't be nested. I agree there are different places where we could apply the optimization, using memoization or a cache. Thank you very much one more time for finding this |
Ok, let me know, if / when you need help. |
Hey @MicheleBertoli any plans on making a release with this soon? |
Hey @gutosanches, I'm planning to make some other changes to the library (improvements, API breaking changes) and release a new major very soon. |
@MicheleBertoli This actually brings up a question I have for a while now. It's true that the use of TBH, I have been using it myself for a while (all over, in fact) and given that I'm still getting started with FSMs, a completely decoupled FSM is still a bit far from what I can grasp right now. I see the reasoning behind it, but I just can't visualise yet how it all would work and I'd even offer a PR to cover it in the README, but without knowing how though... I can't. 😄 Also, before reading this here and another comment on the EDIT: For a bit of background, when I meant that not using Then again, may be just that I need to take some time and start from scratch in terms of my understanding of the library intents. In any case, thanks for the help! |
Hey @alexandrethsilva, For example, you can't easily change the shape of the machine (e.g. adding a new state in between two existing state) without breaking the UI if you use You mentioned redux in a comment, I recommend you give this a go - it might help understanding the decoupling concept. Thank you very much! |
@MicheleBertoli I know I'm quite late here, but just wanted to thank you for the feedback. It didn't go unnoticed. 😄 |
This fixes (#52) the react-native problem by replacing minimatch with glob-to-regexp.
It should also shave of some KBs from the package.
I haven't really reviewed glob-to-regexp, but it seems fairly simple and all existing tests are still passing.
While this is a quick fix to be able to use react-automata in react-native without patching minimatch, I'd consider: