Tinacms Developer Docs

16 May 2024

This meeting primarily revolves around debugging and handling issues within TinaCMS, with a focus on validation, form management, and local storage integration. Here’s a summary of the main topics discussed:

🤖🤖

  • Watch the recording
  • ❌ No Loop Link for this meeting
  1. Bug Fixes and Validation:

    • The team worked through a bug related to a "maximum call stack exceeded" error, which arose from continuous looping due to UUIDs triggering re-renders. They addressed this by wrapping the logic in useMemo.
    • Validation issues were identified, especially with required fields and the handling of empty values from local storage. They explored setting fields to undefined to trigger validation and examined the differences in behavior across pages and content types.
  2. Testing and Final Form Limitations:

    • Testing for form-related functionality was discussed, with Jeff mentioning existing smoke tests in Cypress and the challenges of using React Testing Library due to Tina’s context-driven, modular architecture.
    • The team also highlighted limitations in Final Form, which TinaCMS uses for form handling, including issues with lifecycle events and lack of control over what triggers onChange.
  3. Local Storage and State Management:

    • They examined how local storage values interact with form validation and state, specifically where loaded values sometimes bypass validation. To address this, they discussed forcing fields to be marked as "touched" to ensure validation runs.
  4. Implementation Approaches and Workarounds:

    • Jeff suggested trying useMemo removal for simplifying the logic, though they ultimately implemented a setTimeout workaround to delay the state update, which seemed effective.
    • They also discussed using a UUID-based slug generation approach, which sometimes led to issues with Final Form’s onChange triggering excessively.
  5. Future Improvements:

    • Jeff mentioned taking a deeper look at the pull requests for potential adjustments. He also touched on his future availability and contract work with TinaCMS.

The discussion emphasized troubleshooting specific issues with TinaCMS form validation and explored improvements for robust handling of dynamic form data.