CleverCloud / clever-components

Collection of Web Components by Clever Cloud
https://www.clever-cloud.com/doc/clever-components/
Apache License 2.0
215 stars 19 forks source link

feat(forms): add framework for `ElementInternals` support #1001

Closed pdesoyres-cc closed 2 weeks ago

pdesoyres-cc commented 3 months ago

What is this PR?

This PR adds support for ElementInternals. It makes our inputs (cc-input-text, cc-input-number, cc-input-date, cc-select) and our button (cc-button) implement the ElementInternals API.

With this PR you get the following improvements:

Also, it adds some utility codes that will make our lives better when dealing with forms inside high-level components:

Finally, this PR contains modifications on 3 high-level components containing a form (cc-email-list, cc-orga-member-list, cc-ssh-key-list). It implements form management using this new framework.

How to review?

After many in-sync meetings, you should have a good understanding of the key concepts manipulated in this PR.

Now,

github-actions[bot] commented 3 months ago

🔎 A preview has been automatically published : https://clever-components-preview.cellar-c2.services.clever-cloud.com/forms/init/index.html.

This preview will be deleted once this PR is closed.

roberttran-cc commented 2 months ago

Two random thoughts:

hsablonniere commented 2 months ago

Hey @pdesoyres-cc, nice work :muscle:

I went through the commits and files of this PR with lots of attention. Before that, I had to try the low level stuffs by myself (element internals and creating your own directives) to really understand the whole thing :wink:

I wrote many remarks and questions in a local file and I also tried a simplification in a branch. I'd like to try some refactorings with you in pair (or mob) programming sessions but I don't want to freeze this ongoing PR.

My proposition would be to discuss and settle the "breaking stuffs" first (the publicly available APIs, the ones used by smart components). Once we (the team) agree on something, we can merge. Then we can make iterative refactoring sessions together that don't break the code but (hopefully simplify it, decouple it or reduce the amount of code).

github-actions[bot] commented 2 weeks ago

🔎 The preview has been automatically deleted.