Closed jmarceli closed 8 years ago
I've manage to made a sample redux-form
integration. Here is the repo https://github.com/jmarceli/redux-elm-form. If you will have some spare time please take a look and tell me if it suits you. If so I can make some pull requests to the documentation section and explain the integration. Probably there should be separate chapter called "Integration with other packages" or something like that.
I know that storing forms outside regular Elm tree is not the way it should be handled but this is the only (successful) way of integrating redux-form
(I have no luck with trying to make separate form for each component - but it might be possible).
A couple of issues I come across while making this sample app:
redux-elm/view
in other case sagas won't be triggered (it might be worth documenting, if it's not yet documented)redux-form
are not hot reloaded, they loose all entered data during reload (I don't know how to fix this)Hello, I really appreciate what you did here. I am working on this issue today and came to basically same implementation. However, I am not sure how much aware you are of v6
of redux-form
since there will be many breaking changes which will basically not allow this approach.
My main concern is that in v6, only fields will be connect
ed not the entire form
, the issue is though that there's no simple way to provide the field with wrapped dispatch function. I am thinking about filing an issue to redux-form
repo.
Hi. I'm aware that it will be v6 but I didn't check how much changes it will bring. It's definitely good idea to submit an issue, but I don't know if eventually it will be necessary to provide some Elm-compatible implementation of the forms (or some kind of adapter for redux-form
).
Offtopic question: Do you manage to run/deliver any production services based on redux-elm
? I'm asking because I have to write an app for the client and composability of the Elm Architecture seems to be a good solution.
@jmarceli after deep understanding of how redux-form
works I've decided to send a PR, https://github.com/erikras/redux-form/pull/1154 let's see where it gets us.
OT answer: Yes, we are in the middle of implementing universal web app which is using redux-elm
and so far we are happy with the architecture.
Thanks for handling this issue. I think that my current level of knowledge won't allow me to create valuable pull request for redux-form
project.
@tomkis1 maybe I solve the redux-form v6 issue without any modifications to the library. Please take a look at: https://github.com/jmarceli/redux-elm-form/tree/redux_form_v6
I'm not sure if wrapping a form in subcomponent solves all the issues but it allows me to handle form submit with redux-elm custom dispatcher (which was the problem as far as I know).
So we've come up with a conclusion that redux-form
is quite opinionated library even in plain redux
which makes it even more difficult to integrate with redux-elm
. Maybe more focused library would do the trick better.
Like in any other framework there has to be some simple way of handling forms. Until now I was using redux-form but it is not "compatible" with Elm Architecture idea. What do you think about that? Do know any alternatives which might be used with redux-elm?