Swate.Components 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Swate.Components --version 2.0.0
                    
NuGet\Install-Package Swate.Components -Version 2.0.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="Swate.Components" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Swate.Components" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Swate.Components" />
                    
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 Swate.Components --version 2.0.0
                    
#r "nuget: Swate.Components, 2.0.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.
#:package Swate.Components@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Swate.Components&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Swate.Components&version=2.0.0
                    
Install as a Cake Tool

Components

Local Dev

Tests

  1. Once: npm test
  2. Watch: npm run test:watch

Playground

npm start

Run Storybook

npm run storybook

Build Storybook

npm run build:storybook

Build Npm Package

npm run build

Test Npm Package

npm pack can be used to locally test the npm package before publishing it. It creates a .tgz file in the ./src folder. MUST run npm run build first to transpile the f# code and bundle the js code.

Can be references like this in a react test repo after moving the .tgz file to the test repo:

"dependencies": {
    "@nfdi4plants/swate-components": "file:./nfdi4plants-swate-components-2.0.2.tgz",
    "react": "^19.1.0",
    "react-dom": "^19.1.0"
  },

Build .NET Package

npm run build:net

Release

.NET
  1. Update version in ./src/Components.fsproj
  2. npm run build:net (creates tailwind style css and packs nuget package)
  3. Upload nuget package from ./src/bin/Releases
NPM
  1. Release normally and copy <new_version> from console output.
  2. npm version <new_version> --no-git-tag-version
  3. npm run build (transpiles with fable, creates tsc types, and bundles with rollup)
  4. (Due to #701) replace @layer base with @layer swt-base in dist/swate-components.css
  5. npm publish --access public [--tag next] (Use --tag next for prerelease)
Background info:

<details> <summary>Requirements</summary>

  1. Library MUST include swate styling via .css file.
  2. Library MUST be readable code (not minified) for easier debugging.
  3. Library MUST be tree-shakeable.
  4. Library MUST include proper TypeScript types.
  5. Library MUST preserve individual files to support dynamic imports in larger components (keyword preserveModules).

</details>

Question: Why transpile to src/dist, instead of using the fable transpiled files next to the f# files?

Answer: Because otherwise the vite tsc compiler cannot find the f# code from Swate.Components.Shared. By giving fable a specific output dir src/dist, all code, including the f# code from Swate.Components.Shared, is in one place and tsc can find it.

Question: Why use a bundler, instead of uploading raw files.

Answer: some F# fable libraries use native .js files. These are difficult to copy to the correct locations using tsc or other "bundle" mechanisms without actually bundling the files. Rollup (used by vite) is a bundler that can handle this and also supports tree-shaking and other optimizations.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 31 7/15/2026
2.0.1 38 7/14/2026
2.0.0 40 7/14/2026
1.0.7 110 1/8/2026
1.0.6 411 11/20/2025
1.0.5 405 11/20/2025
1.0.4 395 11/20/2025
1.0.3 347 11/17/2025
1.0.2 201 10/30/2025
1.0.1 207 10/29/2025
1.0.0 212 10/29/2025
1.0.0-rc.12 193 10/28/2025
1.0.0-rc.11 179 10/28/2025
1.0.0-rc.10 194 10/27/2025
1.0.0-rc.9 186 10/20/2025
1.0.0-rc.8 176 10/9/2025
1.0.0-rc.7 285 9/19/2025
1.0.0-rc.5 184 9/8/2025
1.0.0-rc.4 182 9/8/2025
1.0.0-rc.3 148 9/5/2025
Loading failed