3 ms·
ReactML
I've been wondering if there's an easier way to build React apps. I had worked with UIL/Motif (almost 30 years ago now) and XUL from Mozilla which attempted to separate logic from view specifications. I was wondering if we could come up with similar thing for React, which would significantly speed up development process, especially during the prototyping stages of a project.
This project tries to store all state data in a redux store, and keeps all the views "pure" with no state. All properties for views come from the redux state or are statically supplied.
I think this approach has the potential to significantly simplify React and React-native based projects, but I would like to hear from others who may have tried similar approaches; I am particularly interested in any gotchas with this approach.
https://github.com/devpkiconix/reactml/blob/master/README.md
- acemarke 8y agoHi, I'm a Redux maintainer. While it's certainly _possible_ to keep literally all your app's state in Redux, that's usually not the best choice. I can understand why some people choose to do so, but to me that's usually overly dogmatic and not sufficiently flexible. See the Redux FAQ entry on deciding what values to actually keep in Redux: https://redux.js.org/faq/organizingstate#do-i-have-to-put-all-my-state-into-redux-should-i-ever-use-reacts-setstate https://redux.js.org/faq/organizingstate#do-i-have-to-put-al... .
- devpkiconix 8y agoThank you for taking the time to comment. My main goal here is to simplify developer experience without compromising on performance, flexibility etc. Storing all state and props calculations outside of views (i.e. redux) allows for nice separation of concerns, and focus separately on the view development/maintenance and the state/props logic - at least that's the idea. I think if we wrap this reactml project in an NPM package, then developers should be able to prototype quickly using only a YML file and maybe a few javascript functions - without setting up boilerplate projects, redux setup, setting up component libraries etc. The model I've used in the reactml project still allows for custom components to be used in the view specification (using YML) so any complex components can still have their own state management, so use of "redux for all state" isn't quite accurate, it only applies to the components used in the YML spec. Does anyone know of any similar projects? If there's something similar already available, I'd rather just use it...