for overmind v15.1.2 & react v16.8.1 using @garth's overmind-forms
package
- this repo: https://github.com/100ideas/overmind-forms-demo/
- codesandbox demo
- learn about overmind: https://overmindjs.org
- patched overmind-forms repo: https://github.com/100ideas/overmind-forms
- future of overmind-forms: garth/overmind-forms#1 (comment)
- similar / better than overmind-forms?:
- overmind discord chat https://discord.gg/nByU3ZE)
Note: you may need to use a patched version of overmind-forms
- see below
overmind-forms
documentation here: https://github.com/garth/overmind-forms
Related/better: https://github.com/garth/state-forms. I integrated some of the validation code from state-forms
into the src/overmind/login
form code for this demo. It would probably be better to just adapt state-forms to overmind since it looks like its used more broadly.
this folder is a fork of source code of the overmind-forms node package with small patch.
- original: https://github.com/garth/overmind-forms
- patch: https://github.com/100ideas/overmind-forms
- demo repo: https://github.com/100ideas/overmind-forms-demo/ (see codesandbox_v1 branch)
- codesandbox demo
had to merge hack
branch into master
branch of my fork of overmind-forms
since codesandbox can't handle references to node packages on github that include a branch or commit, ie:
// in package.json
"dependencies": { // what happens on codesandbox?
"overmind-forms": "100ideas/overmind-forms#hack", // fail - desired branch
"overmind-forms": "100ideas/overmind-forms#70fdc88", // fail - commit-ish of hack
"overmind-forms": "100ideas/overmind-forms", // works - but is master branch
I also noticed codesandbox having trouble compiling the typescript source of the package on install (since this demo repo is a js create-react-app template and somewhere or other not all the right ts / babel deps are getting specified).
So over in my fork of overmind-forms
, I un-gitignored the built directories (es/
, lib/
), added them to the repo, and disabled the build directives triggered by the prepare
script in the packages' package.json
. That worked for codesandbox.
didn't end up doing this because would require manually syncing patch directory with changes to fork repo, but it works
$ tree -L 1 .
.
├── overmind-forms/
└── overmind-forms-example/
$ cd overmind-forms-example
$ mkdir patch
$ cp -r overmind-forms patch/
// package.json
//...
"dependencies": {
"overmind": "15.1.2",
"overmind-react": "16.1.3",
// "overmind-forms": "100ideas/overmind-forms",
//...
},
"peerDependencies": {
"overmind-forms": "100ideas/overmind-forms#hack",
},
"scripts": {
"postinstall": "cp -r patch/overmind-forms node_modules/",
// ...
see https://github.com/100ideas/overmind-forms for details of patch and instructions for developing locally.
in case of problems on codesandbox, try the codesandbox_v1
branch, hopefully it still works over there. https://github.com/100ideas/overmind-forms-demo/tree/codesandbox_v1