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: React Updates #568

Merged
merged 19 commits into from
Jun 18, 2024
Merged

FIO-7733: React Updates #568

merged 19 commits into from
Jun 18, 2024

Conversation

brendanbond
Copy link
Contributor

@brendanbond brendanbond commented May 28, 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 (enzyme) in favor of @testing-library/react
  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 Components (<Form />, <FormBuilder />, <FormGrid />, <SubmissionGrid>)

  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 and instance state to use React reference values
  7. Introduces useFormioContext and usePagination hooks
  8. Introduces a styling API that decouples each component from Bootstrap

Breaking Changes / Backwards Compatibility

**** PLEASE READ **** This update introduces a number of breaking changes to the library, namely in the form of new hooks, new context consumer requirements for the <FormGrid />, <FormEdit />, and <SubmissionGrid /> components, and updated prop names. Additionally, the new styling API for <FormGrid />, <FormEdit />, and <SubmissionGrid /> are no longer coupled to Boostrap - anyone using those components will need to re-style them.

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. I did however add a small few tests.

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

* Rewrites of the major components (Form, FormBuilder, FormGrid,
  SubmissionGrid, etc.) to idiomatic React and Typescript
* Tooling updates (eslint, typescript, no more babel, etc.)
* Many more...
@travist travist merged commit 7c4f8a7 into master Jun 18, 2024
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.

None yet

4 participants