Extract Tina Form Logic into new library

First of all, I would like to say that you guys have built a mazing open source project.
However, during using TinaCMS, I noticed the vision of TinaCMS is quite big and there are some things that I don’t need on my project. In addition, I would like to adjust some changes to fit with my purpose.

That’s why I have created tina-form (https://github.com/vcoder4c/tina-form) and I did use some concepts, ideas from tinacms.

Do you mind if I take that name (tina-form) for this project? I just think I should ask before publishing. However, any feedback is welcome.

Thank you.

Hi @daniel_doan,

Thanks for the accolades! I’m glad you are interested in Tina.

Unfortunately, I have to put on my Bad Guy Hat for a moment and ask that you do not publish this library in its current state.

Several files in this project have code that has been copied from Tina. While reproduction and modification are absolutely permitted, they must carry the original license and notice of modification. This is explained in the Apache 2.0 License attached to the tinacms repo.

Additionally, I would politely ask that you do not use the name tina-form for this project.

Anyway, I appreciate you posting this here and asking us about it. Looping us in tells me that you aren’t doing this in bad faith, it’s just a simple mistake. These things happen!

With that out of the way, let’s talk about the specific problems you’re looking to solve here! We’ve made an effort to architect Tina in a way that gives developers a lot of power via composition and extension, instead of requiring them to modify core code directly. It’s possible you don’t need to frankenstein your own version of Tina at all. If you can explain more about what you want to do, we can try to give you some advice.

Hi @dj

Thanks for your feedback.
I think for general, the most thing that concerns you is why I need to clone it, right? I have some reasons.

  1. The form is attached as a plugin on TinaCMS, but I don’t really like this way because the form contains data, I think plugin should not contain data. But for your use case, I think it’s a good way to do.
  2. Let’s talk about composite field: list and group-list. They are both array. But group list is an array of composite type (group). And list just support some primary types (text, textarea, number and select). So, it means if user write a new primary type, such as location (long, lat) for example. They can not use it with list.
    On my implementation, I replaced group, list, group-list by object and array and also offer the way for user to define their new type is composite or primary (expendable or not).
  3. The next thing is also composite type. For group and group-list, TinaCMS is using FormPortal. But there is a UI bug there. If we have a long form (sidebar is scrolling), at the end of the form is a group field. Then, when user click on that group field, from user perspective, there is nothing change because the panel is expanded at the top of form, but user can not see it. I have reproduced that bug at https://codesandbox.io/s/peaceful-kalam-hlzoh)

In my implementation, I tried to fix but I can not find a better solution. And I realized collapse component can be a better approach. So, I replaced panel by collapse in my implementation. But for TinaCMS, I think this solution can be not a good way to fix.

  1. In my own project, I want to replace some UI components (such as AddBlockComponent, BlockSetting, Sidebar) like this thread (Using a modal to add a new component)

But seem we can not do that with TinaCMS at this moment. This is the most reason why I want to extract the form logic into a new library. Then I can control where and how I display the form.

For this point, actually, at the beginning, I intend to name it as form-composer. Because this name should be the right one to explain what I want to implement. But I think I have learn a lot from TinaCMS, so I want to name it as tina-form. It’s the way I want to say that I built this library with what I learn from Tina.