Closed RyanCCollins closed 7 years ago
@karatechops
I've had to update the grommet flowtypes a few times over this last week. I've added the flowtyped folder to the .gitignore and have updated the flowconfig quite extensively as well to deal with the module not found errors.
Please make sure to flow-typed install
to install the type dependencies for the project. If you have any errors while working with the flow grommet types, please report them here so I can fix them expediently.
Also, I've figured out how to get Flow working in editors. If you find that it's not working in your editor, you may need to set the path to the Flow binary for the editor plugin you are using. It would be: ./node_modules/.bin/flow
. If you find that it's still now working, you can run the flow binary from the commandline to get a picture of what Flow is doing. Also, try running flow --help
to see the options for debugging. You can print out an AST, for example.
I'll be sure to test flow locally next week. In in the meantime, I think we need to lock Grommet at 1.1.0 for flow-typed install
to work properly as I currently get the error -
• Found 81 dependencies in package.json. Searching for libdefs...
UNCAUGHT ERROR: TypeError: Invalid comparator: https://github.com/grommet/grommet/tarball/stable
Edit: I see you mentioned this in #43
Additionally while browsing the Flow documentation I noticed this -
Once libdefs have been installed, we recommend that you check them in to your project’s repo. Libdefs in the flow-typed repository may be improved over time (fixing a bug, more precise types, etc). If this happens for a libdef that you depend on, you’ll want to have control over when that update is applied to your project. Periodically you can run flow-typed update to download any libdef updates, verify that your project still typechecks, and the commit the updates.
This seems pretty logical.
Also a note on the npm run setup
script, if the user does not have flow-typed installed this will return an error. If flow-typed was a dev dependency and we ran npm i
first then we could resolve this error. I'd like to cover our bases for beginner's new to flow. I'm not sure what the best route would be without adding flow-typed as a dev dependency.
Yeah good call! I will take care of this then.
I will also try to lock us into grommet 1.1.0 as long as there are no breaking changes
The flow deps are now checked into the repo, but the grommet-cms alias issue still persists. I will work on that this week.
Still a work in progress, but I will dig into it today.
Got this fixed in the fix_flow_fix_me branch and am going to merge into my latest PR.
See #64
As mentioned in #38 there is still one outstanding issue with Flow and that is that it doesn't recognize the alias for grommet-cms. I've attempted to fix it following the guide, located here, to no avail. We need to get this resolved and remove the workaround comments
// $FlowFixMe
. With this workaround, the Flow typechecking should be totally working.