Just released `next-flat-routes` for Next.js 🚀
Struggling with deeply nested routes in your Next.js app directory? This tool allows you to have a flat route structure.
Give it a try: https://t.co/whpUxMtAsw
#NextJS#JavaScript#WebDevelopment
@hissgoescobra@ElijahSchaffer I really respect your answer bro 🙏. Thank you for speaking up and being you. I’m happy that there are still humans like you that exist. Means there is still hope
@TAbrodi It’s about quickly getting something out to the user so that you can validate your assumptions early and learn the truth about what you are building, and then iterate on that feedback. It’s about that feedback loop.
@Levi7hart@AlexHormozi I think he is referring to@high level things. Like both of you being interested in fitness and entrepreneurship etc. It makes sense to be aligned at this level.
@lukemorales When I saw in the RFC that is how the new routing system was going to be, it’s the first time I considered moving to another framework. This pains my heart. Can’t imagine working on an app that would be structured like this.
@moonriseTK @TAbrodi@mcsee1 But if you are going to be supplying a mocked ui component to as a param to the component you are testing, then there is no difference. You are still mocking. So no need to setup a dependency injection system where it would not be idiomatic or easy to do so. Like in reactjs.
@moonriseTK @TAbrodi@mcsee1 I don’t disagree, but I don’t think you are getting my point. Even if you pass the ui component as param, you still need to test the component that is doing the passing… hence why you will end up needing a top level dependency injection system to facilitate proper testing.
@moonriseTK @TAbrodi@mcsee1 But there would be little to no difference if a mocked version of the ui component is being injected during the test for the same reasons. So why increase complexity by implementing a dependency injection system for the ui?
@moonriseTK @TAbrodi@mcsee1 Like a complex third party ui component that can't be easily controlled or interacted with in a testing context. In that scenario, mocking can be useful. Yes the code could potentially be architected so that that ui component dependency is injected as opposed to being hardcoded.
@moonriseTK @TAbrodi@mcsee1 This is fine if the service being mocked is one that will communicate externally with the system under test. Sometimes what needs mocking though is not an external entity, but an internal dependency that might be problematic in a testing scenario for some reason or the other.
@TAbrodi Ship in small iterations and aim to ship quickly in order to validate assumptions and get customer feedback early. You don’t want to have gone too far before learning from the customer (through actual usage) that you have misunderstood the requirements.
@TAbrodi@mcsee1 By mocking out a particular dependency, I’m verifying that the unit of code under test will behave in a particular manner if the dependency being mocked out behaves in a certain way, as defined by the mock. That is still valid testing.
@TAbrodi@mcsee1 You as the developer has to evaluate and make a decision as to when it makes sense to do or not do it. But to say that it never makes sense to do it, is inaccurate. The original tweet is making a blanket statement to suggest that it never makes sense to use mocks.
@TAbrodi@mcsee1 Yes mocking means that you aren’t testing real implementation but the fact that you aren’t at times testing the real implementation is not in and of itself a bad thing. It’s perfectly ok to choose to not test the real implementation of certain dependencies, for various reasons.