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

event-based ref-based inline editing #1749

Merged
merged 19 commits into from Feb 18, 2021
Merged

event-based ref-based inline editing #1749

merged 19 commits into from Feb 18, 2021

Conversation

dwalkr
Copy link
Contributor

@dwalkr dwalkr commented Feb 18, 2021

Implements useFieldRef by attaching handlers to whatever DOM element the ref is mounted to, and sending events over the event bus.

@dwalkr dwalkr requested a review from a team as a code owner February 18, 2021 17:01
@dwalkr dwalkr requested review from a team and jeffsee55 and removed request for a team February 18, 2021 17:01
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2021

Warnings
⚠️

packages/@tinacms/forms was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

Modified Packages

The following packages were modified by this pull request:

  • react-tinacms-inline
  • @tinacms/forms

Generated by 🚫 dangerJS against e6517e5

@jeffsee55
Copy link
Member

This is working nicely for me, so we're really getting at 2 things here, right?:

  1. Continuing to push the form system into event-based architecture. I really like the idea of abstracting away final form's API behind our event system. The one thing that's bugging me about it is the lack of types, I realize that's part of a larger conversation, and I love the 2-way editing this enables with the sidebar. For the larger conversation - I think we could mimic a typed event system like you can find in xstate. The type of the event is static, while the event payload determines the details (like which form/field the event is for), for example. In this machine, the CHANGE event must receive a value https://codesandbox.io/s/beautiful-kirch-vcj11?file=/src/index.ts

  2. The inline API feels good to me, I think the biggest takeaway is the useInlineRef and <InlineForm> could be way higher up in the tree from where the ref is being attached, to me this is a good thing. Meaning your component needs 2 things to be inline-friendly, a ref and the value, and that's it. So it's more friendly to a design system integration. I know there's a lot more to discuss regarding field groups and blocks, etc. But I like it so far

@dwalkr dwalkr mentioned this pull request Aug 18, 2021
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

2 participants