Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIO-7733: type the form component #558

Closed
wants to merge 23 commits into from

Conversation

brendanbond
Copy link
Contributor

@brendanbond brendanbond commented Feb 23, 2024

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-7733

Description

General Updates

  1. Updates the build system to use tsc rather than babel
  2. Removes unused dependencies
  3. Removes test runner dependencies (updated tests to follow!)
  4. Updates eslint ergonomics to ensure React best practices
  5. Pulls EventEmitter from @formio/js
  6. Updates documentation
  7. Removes stale types
  8. Removes stale tests
  9. Adds jest and @testing-library/react so we can write and maintain a modern test suite

Updates to <Form />

  1. Fully types the component and its props
  2. Reorgs the code so as not to instantiate utility functions in the render function
  3. Updates the src prop to resemble the createForm API (i.e. it takes either a form definition or a form url)
  4. Renames some props to conform to idiomatic prop names (see below)
  5. Consolidates effect functions
  6. Updates the render element ref to use useRef

Breaking Changes / Backwards Compatibility

Generally speaking the goal is to be backwards compatible here (see e.g. the getEffectiveProps function), but I would point the reviewer specifically towards the EventEmitter change and broadly towards testing this PR in your own existing application so we can be sure that everything works properly.

Dependencies

How has this PR been tested?

I've loaded this PR into a simple Next.js application to ensure everything works as expected. Also, now that we've moved away from karma, I expect to add more tests in the next major PR to this library.

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@gyanendrasinghpanwar
Copy link

gyanendrasinghpanwar commented Mar 20, 2024

@brendanbond Do we need PR to type the FormBuilder ? I do have experience with it.

@brendanbond
Copy link
Contributor Author

@gyanendrasinghpanwar I started that today, perhaps since i'm going from top to bottom you could go bottom to top and meet in the middle, maybe you could start typing FormGrid?

@gyanendrasinghpanwar
Copy link

@brendanbond Absolutely, sounds like a solid plan! I'm ready to collaborate on getting the builder ready. Going from bottom to top works for me. Once we've got that sorted, we can dive into FormGrid or FormEdit. Feel free to share any suggestions or preferences along the way.

@brendanbond brendanbond mentioned this pull request Apr 22, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants