Partas.Solid 0.1.0

Suggested Alternatives

Partas.Solid 0.2.10

Additional Details

Previous versions have missing, or incorrect transformations in uncommon but vital use cases.

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Partas.Solid" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Partas.Solid" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Partas.Solid" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Partas.Solid --version 0.1.0
                    
#r "nuget: Partas.Solid, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Partas.Solid&version=0.1.0
                    
Install Partas.Solid as a Cake Addin
#tool nuget:?package=Partas.Solid&version=0.1.0
                    
Install Partas.Solid as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Init