5 ms·
I’ve been doing React for years and haven’t experienced this. What kinds of apps are you building?
by christophilus 7y ago
I’ve been doing React for years and haven’t experienced this. What kinds of apps are you building?
- omegabravo 7y ago- web components - runtime plugins React is great if you stay in the design constraints, which is to be expected. This covers the vast majority of web apps. edit: [removed svg snippets] I think I was confused with WebComponents not supporting svg elements that don't include the root tag
- christophilus 7y agoThe app I currently work on is 100% runtime plugin based. React has not been an issue there at all. I haven’t tried using web components, though, so can’t speak to that.
- omegabravo 7y agoit's not impossible, I have something working with react-registry. With Vue it would work out of the box since it comes with a registry out of the box.
- gherkinnn 7y agoReact Router used to be a mess. And should I use Redux? I thought it’s not cool anymore. If I do, do I store everything in a global state? Maybe I’ll use Context and Hooks. Or was it HoCs? And what about mobX? I heard it’s like Vue. I like Vue. And I absolutely need something to handle requests. Saga? Maybe some GraphQL? Now that I have my views, my state, and my data, how do I test this? Jest or something else? But why write tests if I have Types! How to configure TS? A few any never hurt anyone, did they? Too many questions. I’ll let Create React App answer this for me. Or is it Gatsby? Or even Nextjs? Oh, and is Lodash the new Underscore? And what is different about those and Ramda? We need more FP! But how do I structure my Code? Dan “Daddy” Abramov tells us to organise it any old way. But how? [0] Angular and to a lesser extent Vue give you more direction. This is of course not inevitable in a React project, but it does take good technical leadership not to be hindered by analysis paralysis before you even set off. 0 - An exaggerated summary of what I gather on various forum and discussions.
- nicoburns 7y agoEveryone worries about these choices in react, but you don't need to, for most apps, they're all good choices: use redux or mobx, doesn't really matter. Use lodash or underscore, doesn't really matter. There are minor advantages to some of the tools, and the nice thing about the react ecosystem is that it lets you pick if you really need to, but for getting started, just pick one and move on. IMO this is highly preferrable to the angular world, where some things just can't done without digging through poorly documented internals (at least this was the case wirh v4 when I last used it)
- gherkinnn 7y agoI agree. And since much of that is often superfluous, you end up with a “minimal” setup. Though this does require at least one experienced dev to make those choices. And my experience tells me that fewer than 1 in 10 React devs can make those calls.
- kerkeslager 7y ago> Everyone worries about these choices in react, but you don't need to, for most apps, they're all good choices: use redux or mobx, doesn't really matter. Use lodash or underscore, doesn't really matter. I'd argue that they're all bad choices. Redux/Mobx are just causing you to use global state, which forces you into a single-page application anti-pattern. I've stopped using either and my code has become massively less complex. Lodash/Underscore are massive libraries that you end up using only a few functions from. Many of these functions can be written in <10 lines of code yourself, and some are equivalent to ones that already exist in newer versions of vanilla JS. In the latter case I'll often use polyfills, and remove them as support for the new features gets good enough.
- true_religion 7y agoMobx state is local by default. Observable are just scoped to the component they are created in.
- 7y ago