Closed ArtemyB closed 11 months ago
Thanks a lot @ArtemyB for the this change, it looks reasonable to me. I'll merge and publish sometime this week π
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 π
Great, thanks π I'll be using it in my projects and observing how it goes π
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
andFeliz.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 theReact
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:
Feliz.DateParsing
,Feliz.Helpers
,Feliz.ReactInterop
modules to separate files.Feliz.Internal
internal type into a module and move it to a separate file. Make the module public to allow its definitions being called from the publicReact
type's inline members.useEffect
method definition inFeliz.ReactApi.IReactApi
interface.ReactInterop
binding definitions to the attribute-based to ensure the correct import statements generated by Fable (otherwise, the path to "ReactInterop.js" will be relative to the "Feliz" package root and not to the root of the referencing site).Feliz.Helpers.optDispose
function not inline - to reduce the amount of Feliz transpiled code.Feliz.React
type inline, and for those that contain some custom logic (beyond the trivial bindings) move the logic into the separate functions of theFeliz.Internal
module. This way, theReact
type won't be present in the transpiled code.Feliz.ReactInterop
module access modifier frominternal
topublic
to allow its definitions being called from the publicReact
type's inline members.