Partas.Solid
0.1.0
Previous versions have missing, or incorrect transformations in uncommon but vital use cases.
See the version list below for details.
dotnet add package Partas.Solid --version 0.1.0
NuGet\Install-Package Partas.Solid -Version 0.1.0
<PackageReference Include="Partas.Solid" Version="0.1.0" />
<PackageVersion Include="Partas.Solid" Version="0.1.0" />
<PackageReference Include="Partas.Solid" />
paket add Partas.Solid --version 0.1.0
#r "nuget: Partas.Solid, 0.1.0"
#addin nuget:?package=Partas.Solid&version=0.1.0
#tool nuget:?package=Partas.Solid&version=0.1.0
Partas.Solid
[!IMPORTANT] This is an opinionated fork of Oxpecker.Solid that enables experimental behaviours and patterns which I use in personal projects.
Until such a time as these types of behaviours/patterns are sought out by users, the behaviours will not be supported on the mainstream.
For this reason, I publish this as a means of allowing users to experiment or observe the patterns enabled and submit requests for it to be considered in the mainline.
Features
The feature set contained within this is a modified transformation or alternate transformation which can be applied to the type definitions of your tags/elements. This allows a UserDefined custom tag rather than only allowing Library Imported tags.
namespace Partas.Solid.Test
open Partas.Solid
open Fable.Core
type [<Erase>] CustomTag() =
inherit RegularNode()
[<SolidTypeComponent>]
member private props.typeDef () =
div() { "Hi" }
Compiles to
function CustomTag(props) {
return <div> Hi </div>;
}
We can now utilise this like any other tag:
module App
open Partas.Solid.Test
[<SolidTypeComponent>]
let App () =
CustomTag()
import { CustomTag } from "./Program.fs.jsx"
export function App() {
return <CustomTag />;
}
Which would render the Html
<div>Hi</div>
Ontop of the above, we also can pass properties down to nested children while maintaining reactivity:
[!TIP] Setting default properties and splitting properties/spreading now has all the mergeProps and splitProps abstracted away
type [<Erase>] CustomTag() =
inherit RegularNode()
[<SolidTypeComponent>]
member private props.typeDef () =
props.class' <- "DefaultClass" // setting properties will set the 'default'
div(class' = props.class') {
button(spreadObj = props)
}
function CustomTag(props) {
props = mergeProps({
class: "DefaultClass",
}, props);
const [local, others] = splitProps(props, ["class"]);
return <div class={local.class}>
<button {...others} />
</div>;
}
Rough Edges
Oxpecker.Solid is a great DSL and works for most use cases. However, I've encountered many rough edges when it comes to LibraryImports especially. In the process of developing these behaviours, I've fixed several of those issues. But in the process, perhaps I've created more.
If you do decide to play with this and find some odd behaviours, please let me know.
Usage
Installation
Will be uploaded to nuget soon(tm)
Attribute
Purposeful attribute change to allow simultaneous use from mainstream by changing [<SolidComponent>]
to [<SolidTypeComponent>]
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net9.0
- Fable.Browser.Dom (>= 2.18.1)
- Fable.Core (>= 4.4.0)
- FSharp.Core (>= 9.0.100)
- Partas.Solid.FablePlugin (>= 0.1.0)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Partas.Solid:
Package | Downloads |
---|---|
Partas.Solid.TanStack.Table
Bindings for TanStack.Table for Partas.Solid |
|
Partas.Solid.Corvu
Bindings for Solid-Corvu in Oxpecker.Solid Style compatible with Partas.Solid |
|
Partas.Solid.Cmdk
Bindings for Solid-Cmdk in Oxpecker.Solid Style compatible with Partas.Solid |
|
Partas.Solid.Kobalte
Bindings for Solid-Kobalte in Oxpecker.Solid Style compatible with Partas.Solid |
|
Partas.Solid.Primitives
Bindings for different packages in Solid-Primitives in Oxpecker.Solid Style compatible with Partas.Solid |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
0.2.27 | 151 | 3/22/2025 | |
0.2.26 | 66 | 3/22/2025 | |
0.2.25 | 59 | 3/22/2025 | |
0.2.24 | 88 | 3/21/2025 | |
0.2.23 | 112 | 3/21/2025 | |
0.2.22 | 168 | 3/20/2025 | |
0.2.21 | 130 | 3/20/2025 | |
0.2.20 | 133 | 3/20/2025 | |
0.2.19 | 135 | 3/19/2025 | |
0.2.18 | 124 | 3/16/2025 | |
0.2.17 | 123 | 3/16/2025 | |
0.2.16 | 105 | 3/14/2025 | |
0.2.15 | 124 | 3/14/2025 | |
0.2.14 | 143 | 3/12/2025 | |
0.2.13 | 154 | 3/12/2025 | |
0.2.12 | 148 | 3/12/2025 | |
0.2.11 | 150 | 3/11/2025 | |
0.2.10 | 167 | 3/9/2025 | |
0.2.9 | 229 | 3/9/2025 | |
0.2.8 | 237 | 3/9/2025 | |
0.2.7 | 235 | 3/9/2025 | |
0.2.6 | 260 | 3/8/2025 | |
0.2.5 | 278 | 3/7/2025 | |
0.2.4 | 279 | 3/7/2025 | |
0.2.3 | 262 | 3/7/2025 | |
0.2.2 | 258 | 3/7/2025 | |
0.2.1 | 270 | 3/7/2025 | |
0.2.0 | 280 | 3/6/2025 | |
0.1.0 | 180 | 3/1/2025 |
Init