Skip to content

Comments

Refactor to improve JS output, use Fable.Package.SDK, relax package requirements#3

Open
ArtemyB wants to merge 2 commits intoSelectViewData:mainfrom
ArtemyB:fix/package-output
Open

Refactor to improve JS output, use Fable.Package.SDK, relax package requirements#3
ArtemyB wants to merge 2 commits intoSelectViewData:mainfrom
ArtemyB:fix/package-output

Conversation

@ArtemyB
Copy link

@ArtemyB ArtemyB commented Aug 25, 2024

1. Refactor hooks to make Fable's JS output cleaner

Hooks defined as static members are prefixed with class name, what makes their names too cluttered. To fix that, I've converted the hooks to module functions. And to preserve the same React-type static methods API, the type made Erased and all its methods made just as inline wrappers.

2. Use Fable.Package.SDK, relax .NET and FSharp.Core requirements.

.NET 8 and FSharp.Core v8 seems unnecessarily high requirements, so I relaxed them to .NET 6 and FSharp.Core v6.

ArtemyB added 2 commits August 9, 2024 16:26
- Introduce `Hooks` module with all the hooks moved there instead of being defined in the `React` type. This way, the generated JS is cleaner because module function names aren't mangled.
- Move `React` inline type extensions to a separate "Extensions" file.
- Remove `Hook` attributes from inline functions for their irrelevance.
- Target .NET 6 instead of .NET 8 to relax package requirements.
- Relax "FSharp.Core" dependency to v6.
- Introduce "Fable.Package.SDK"  package to facilitate project configuration for Fable.
- Bump package version to 0.2.1.
- [Example] Update "Feliz" to v2.8.0, update Fable to v4.7.0.
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.

1 participant