framework
framework copied to clipboard
Framework components + code-style
-
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.
- 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.
- Not against. Currently, on local development I run the
watch
script and any time I need to push completed code, I run theproduction
script and then push. - Yes, we can add prettier for JS code styling. On the PHP side there is php-cs-fixer configuration.
- 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).