Zaid-Ajaj / Feliz

A fresh retake of the React API in Fable and a collection of high-quality components to build React applications in F#, optimized for happiness
https://zaid-ajaj.github.io/Feliz/
MIT License
550 stars 83 forks source link

Refactor React hooks and APIs F# API to improve the transpilation output #591

Closed ArtemyB closed 11 months ago

ArtemyB commented 11 months ago

Solves #564

I haven't changed any publicly oriented F# API, i.e., module, type and function names are preserved. The only change kind of affects the public API is switching Feliz.ReactInterop and Feliz.Internal access modifiers to public , whereas, I suppose, they're not intended to be a part of the public F# API. But otherwise their functions cannot be referenced from the public inline functions of the React type that is an implied public API.

Furthermore, I haven't run any automated tests yet (don't know if they're up-to-date, actually). However, I've tried the new version with one of my projects that uses many of the APIs, and I haven't noticed any problems so far. At the same time, the hooks summary in the React Developer Tools did improved, i.e., there's no more entries with names like useReact_useMemo_... and with redundant nested hooks. Instead, there are clear hooks as they were written manually in JS.

The changes description:

Zaid-Ajaj commented 11 months ago

Thanks a lot @ArtemyB for the this change, it looks reasonable to me. I'll merge and publish sometime this week πŸ™

Zaid-Ajaj commented 11 months ago

Actually never mind, since this is a beta build, I've merged and published it as of 2.8.0-beta.0 πŸš€ please take it for a spin and if there are no problems we can publish a proper v2.8.0 version sometime soon πŸ˜„ thanks again for the PR πŸ™

ArtemyB commented 11 months ago

Great, thanks πŸ‘ I'll be using it in my projects and observing how it goes πŸ‘€