framework icon indicating copy to clipboard operation
framework copied to clipboard

Framework components + code-style

Open ramon-villain opened this issue 6 years ago • 1 comments

  • Do you have any thoughts about adding tests to React components, perhaps using RTL or enzyme?

  • What do you think about adding a "pre-commit" hook to run the production script + linting/coverage? This way we can ensure that Typescript is passing, the pushed dist is in production mode, check code coverage…

  • What do you think about adding a "code-formatter" to the project (https://prettier.io/), it makes contributing easier, so the project's code-style is defined and applicable to everyone's code regardless of the IDE settings or personal preferences of the developer. (We can also plug prettier into the pre-commit hook that I mentioned above)

  • How big do you imagine the Field's component lib? I think we can deliver more options (internal links, embeds, toggle, range, taxonomy, posts, pages…), but I'm not sure if you have plans to have this as part of the framework.

ramon-villain avatar Feb 10 '19 23:02 ramon-villain

  1. No ideas yet, I only scratch the surface of Js unit tests with Jest so I'm open to any suggestions for component testing. I switched to TypeScript to limit code issues as well to kind of compensate the lack of test coverage.
  2. Not against. Currently, on local development I run the watch script and any time I need to push completed code, I run the production script and then push.
  3. Yes, we can add prettier for JS code styling. On the PHP side there is php-cs-fixer configuration.
  4. No big plans yet for the field API. I refactored the basics fields and I try to provide an API so we can extend anything and keep adding new fields as requested. Open to new fields suggestions, recently people are asking for an association field (sort of post-to-post field).

jlambe avatar Feb 11 '19 08:02 jlambe