Skip to content

Commit 6314ed4

Browse files
committed
Modernize toolchain: .NET 10, Fable 5.14, Vite 8, Bun workspace
Bring the project back to current versions of everything it builds on and restructure the repository as a Bun workspace. No plugin behaviour changes apart from the JSX transform backend. .NET side - Target net10.0 for Fable.Daemon and its tests; global.json pins SDK 10.0.400. Fable.Compiler 5.14.1 only ships net10.0, so the .NET 10 runtime is now required at install time. - Upgrade Fable.Compiler 5.0.0-alpha.13 -> 5.14.1, Fable.AST -> 5.0.0 and the transitive pins that come with it (FSharp.Core 10.1.203, StreamJsonRpc 2.25.29, MessagePack 2.5.302, Nerdbank.Streams 2.13.31). Drop the explicit System.Text.Json reference now provided by the SDK. - Replace CoolCatCracking with Fable's own MSBuildCrackerResolver. The new ProjectCracking.fs keeps what Fable's resolver lacks: the design time build cache, the fable_modules compile cache and the list of MSBuild files the plugin watches. CliArgs.NoRestore is now false because Fable's resolver uses it to decide whether to pass /restore. - Decode the MSBuild JSON in Caching.fs with System.Text.Json and remove the Thoth.Json.* dependencies. - MSBuild.fs no longer gives up after five seconds and fails on a non-zero exit code instead of silently continuing with partial output. - Keep cracking.fsx as a scratch script; it is executable and takes the fsproj as its last argument. - dotnet tools: Fantomas 8.0.0-alpha-025, fsdocs-tool 22.1.0, dotnet-outdated-tool 4.8.1. Sources reformatted with Fantomas 8. JavaScript side - Vite 8 (rolldown) as peer dependency. The JSX post-transform uses Vite's transformWithOxc instead of a direct esbuild dependency; the jsx plugin option keeps its 'transform' | 'preserve' | 'automatic' surface. - Update all npm dependencies (@babel/code-frame 8, ts-lsp-client 1.1.1, TypeScript 7, @types/node 26; React 19, @vitejs/plugin-react 6 and vite-plugin-inspect 12 in the sample) and @fable-org/fable-library-js 2.5.1 to match the compiler. - Locate fable-library with import.meta.resolve instead of guessing node_modules paths, so hoisted, isolated and pnpm-style layouts all work. - Replace Prettier with oxfmt (bun run format / format:check). Repository layout - Bun workspace with the isolated linker: the publishable package lives in packages/vite-plugin-fable, sample-project depends on it via workspace:*, and shared versions (vite, vite-plugin-inspect, fable-library-js) are declared once in the root catalog. Single lockfile at the root. - Directory.*.props stay at the repo root; prepublishOnly copies them into the package because the consumer-side postinstall still runs dotnet publish. The changelog updater moves to scripts/. - .gitignore: un-ignore /packages/* (the NuGet template rule matched it). CI - Actions bumped to current majors (checkout v7, setup-bun v2, setup-dotnet v6, upload-pages-artifact v5, deploy-pages v5); setup-dotnet reads global.json. - New "Check formatting" step (oxfmt + dotnet fantomas check) and the sample build step now fails on a real error instead of grepping the output. Also adds ROADMAP.md with the remaining action items (postinstall distribution, Vite lifecycle/HMR audit, F# rewrite of the plugin, .fsi change detection).
1 parent 9ac3567 commit 6314ed4

42 files changed

Lines changed: 662 additions & 791 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/dotnet-tools.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,18 @@
44
"tools": {
55
"fantomas": {
66
"version": "8.0.0-alpha-025",
7-
"commands": [
8-
"fantomas"
9-
],
7+
"commands": ["fantomas"],
108
"rollForward": false
119
},
1210
"fsdocs-tool": {
1311
"version": "22.1.0",
14-
"commands": [
15-
"fsdocs"
16-
],
12+
"commands": ["fsdocs"],
1713
"rollForward": false
1814
},
1915
"dotnet-outdated-tool": {
2016
"version": "4.8.1",
21-
"commands": [
22-
"dotnet-outdated"
23-
],
17+
"commands": ["dotnet-outdated"],
2418
"rollForward": false
2519
}
2620
}
27-
}
21+
}

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Main
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66

77
permissions:
88
contents: read
@@ -27,23 +27,23 @@ jobs:
2727
- name: Restore tools
2828
run: dotnet tool restore
2929

30-
- name: Check formatting
31-
run: dotnet fantomas check .
32-
3330
- name: Restore solution
3431
run: dotnet restore
3532

3633
- name: Install node_modules
3734
run: bun install --frozen-lockfile
3835

36+
- name: Check formatting
37+
run: bun run format:check
38+
3939
- name: TypeScript check
4040
run: bun run lint
4141

4242
- name: Build daemon
43-
run : bun run postinstall
43+
run: bun run --cwd packages/vite-plugin-fable postinstall
4444

4545
- name: Build docs
46-
run: dotnet fsdocs build --noapidocs --projects "$(pwd)/Fable.Daemon/Fable.Daemon.fsproj"
46+
run: dotnet fsdocs build --noapidocs --projects "$(pwd)/packages/vite-plugin-fable/Fable.Daemon/Fable.Daemon.fsproj"
4747

4848
- name: Upload artifact
4949
uses: actions/upload-pages-artifact@v5

.github/workflows/pr.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: PR
22

3-
on: [ pull_request ]
3+
on: [pull_request]
44

55
jobs:
66
build:
@@ -20,24 +20,24 @@ jobs:
2020
- name: Restore tools
2121
run: dotnet tool restore
2222

23-
- name: Check formatting
24-
run: dotnet fantomas check .
25-
2623
- name: Restore solution
2724
run: dotnet restore
2825

2926
- name: Install node_modules
3027
run: bun install --frozen-lockfile
3128

29+
- name: Check formatting
30+
run: bun run format:check
31+
3232
- name: TypeScript check
3333
run: bun run lint
3434

3535
- name: Build daemon
36-
run : bun run postinstall
36+
run: bun run --cwd packages/vite-plugin-fable postinstall
3737

3838
- name: Build sample
39-
run: bun i && bun run build 2>&1 | grep -i "error" && exit 1 || true
39+
run: bun run build
4040
working-directory: ./sample-project
4141

4242
- name: Build docs
43-
run: dotnet fsdocs build --noapidocs --projects "$(pwd)/Fable.Daemon/Fable.Daemon.fsproj"
43+
run: dotnet fsdocs build --noapidocs --projects "$(pwd)/packages/vite-plugin-fable/Fable.Daemon/Fable.Daemon.fsproj"

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ PublishScripts/
206206
**/[Pp]ackages/*
207207
# except build/, which is used as an MSBuild target.
208208
!**/[Pp]ackages/build/
209+
# the Bun workspace packages of this repo
210+
!/packages/*
209211
# Uncomment if necessary however generally it will be regenerated when needed
210212
#!**/[Pp]ackages/repositories.config
211213
# NuGet v3's project.json files produces more ignorable files
@@ -489,4 +491,7 @@ tmp/
489491
output/
490492

491493
# VSCode
492-
.vscode/
494+
.vscode/
495+
# copied from the repo root by prepublishOnly
496+
/packages/vite-plugin-fable/Directory.Build.props
497+
/packages/vite-plugin-fable/Directory.Packages.props

.oxfmtrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": [
4+
"**/bin/**",
5+
"**/obj/**",
6+
"**/artifacts/**",
7+
"**/fable_modules/**",
8+
"output/**",
9+
"docs/content/**"
10+
]
11+
}

CHANGELOG.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) from version [0.1.0] moving forward.
77

88
## [Unreleased]
9+
910
### Changed
11+
1012
- Fable.Daemon now targets `net10.0`; the .NET 10 runtime is required.
1113
- Updated Fable.Compiler to 5.14.1 and `@fable-org/fable-library-js` to 2.5.1.
1214
- Project cracking now delegates to Fable's own `MSBuildCrackerResolver`. The design time build cache and watched MSBuild files are kept in `ProjectCracking.fs`; `CoolCatCracking.fs` was removed.
@@ -15,118 +17,174 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1517
- Sample project targets `net10.0`.
1618
- GitHub Actions updated to their latest major versions and the workflows read the SDK version from `global.json`.
1719
- dotnet tools updated: Fantomas 8.0.0-alpha-025, fsdocs-tool 22.1.0, dotnet-outdated-tool 4.8.1. Sources reformatted with Fantomas 8 and CI now runs `dotnet fantomas check .`.
20+
- Vite 8 is the peer dependency. The JSX transform after Fable compilation uses Vite's `transformWithOxc` (rolldown/oxc); `esbuild` is no longer a peer dependency.
21+
- All JavaScript dependencies updated (`@babel/code-frame` 8, `ts-lsp-client` 1.1.1, TypeScript 7, React 19 and `@vitejs/plugin-react` 6 in the sample).
22+
- The repository is a Bun workspace with isolated installs: the plugin lives in `packages/vite-plugin-fable` and `sample-project` depends on it via `workspace:*`. `Directory.*.props` stay at the repo root and are copied into the package by `prepublishOnly`; the changelog updater lives in `scripts/`. Shared versions (`vite`, `vite-plugin-inspect`, `@fable-org/fable-library-js`) are declared once in the root workspace catalog and referenced as `catalog:`.
23+
- `fable-library` is located with `import.meta.resolve` instead of guessing `node_modules` paths.
24+
- Prettier replaced by oxfmt (`bun run format`, `bun run format:check`).
1825

1926
### Fixed
27+
2028
- `dotnet msbuild` invocations for the cache key no longer give up after 5 seconds and now fail on a non-zero exit code.
2129

2230
## [0.2.1] - 2025-10-23
31+
2332
### Changed
33+
2434
- Removed caret range from ts-lsp-client to use version 1.0.4, pr ([#59](https://github.com/fable-compiler/vite-plugin-fable/pull/59)), targets issue ([#58](https://github.com/fable-compiler/vite-plugin-fable/issues/58))
2535

2636
## [0.2.0] - 2025-06-24
37+
2738
### Changed
28-
- Upgrade to Vite 7.0.0 as peer dependency and adjust transform hook to use latest filter property, pr ([#49](https://github.com/fable-compiler/vite-plugin-fable/pull/49)), targets issue ([#39]([#39](https://github.com/fable-compiler/vite-plugin-fable/issues/39))
39+
40+
- Upgrade to Vite 7.0.0 as peer dependency and adjust transform hook to use latest filter property, pr ([#49](https://github.com/fable-compiler/vite-plugin-fable/pull/49)), targets issue ([#39](<[#39](https://github.com/fable-compiler/vite-plugin-fable/issues/39)>)
2941

3042
## [0.1.1] - 2025-06-03
43+
3144
### Fixed
45+
3246
- Support `major` roll forward dotnet versions of runtime for Fable.Daemon, pr ([#46](https://github.com/fable-compiler/vite-plugin-fable/pull/46)), targets issue ([#44](https://github.com/fable-compiler/vite-plugin-fable/issues/44))
3347

3448
## [0.1.0] - 2025-05-22
49+
3550
### Changed
51+
3652
- bumping version and package release for changelog sync
3753

3854
## [0.0.37] - 2025-05-10
55+
3956
### Changed
57+
4058
- Fable.Compiler updated to 5.0.0-alpha.13 ([#38](https://github.com/fable-compiler/vite-plugin-fable/pull/38))
4159
- Added caret range to fable-library-js ([#38](https://github.com/fable-compiler/vite-plugin-fable/pull/38))
4260
- Updated fable-library-js to 2.0.0-beta.3 ([#38](https://github.com/fable-compiler/vite-plugin-fable/pull/38))
4361

4462
## [0.0.36] - 2025-05-07
63+
4564
### Changed
65+
4666
- Updated fable-library-js to ^2.0.0-beta.3 ([#38](https://github.com/fable-compiler/vite-plugin-fable/pull/38))
4767

4868
## [0.0.35] - 2025-04-30
69+
4970
### Added
71+
5072
- Added README for Fable Daemon ([#34](https://github.com/fable-compiler/vite-plugin-fable/pull/34))
5173

5274
## [0.0.34] - 2025-04-20
75+
5376
### Changed
77+
5478
- Upgrade to latest Fable.Compiler and Fable.AST ([#13](https://github.com/fable-compiler/vite-plugin-fable/pull/13))
5579

5680
## [0.0.33] - 2025-04-10
81+
5782
### Changed
83+
5884
- Update node dependencies and bump version
5985

6086
## [0.0.32] - 2025-03-30
87+
6188
### Fixed
89+
6290
- Fix Thoth.Json usage ([#23](https://github.com/fable-compiler/vite-plugin-fable/pull/23))
6391

6492
## [0.0.31] - 2025-03-15
93+
6594
### Added
95+
6696
- Error overlay for development ([#8](https://github.com/fable-compiler/vite-plugin-fable/pull/8))
6797

6898
## [0.0.30] - 2025-03-01
99+
69100
### Added
101+
70102
- Vite 6 support ([#11](https://github.com/fable-compiler/vite-plugin-fable/pull/11))
71103

72104
## [0.0.29] - 2025-02-20
105+
73106
### Changed
107+
74108
- Improved diagnostics ([#3](https://github.com/fable-compiler/vite-plugin-fable/pull/3))
75109

76110
## [0.0.28] - 2025-02-10
111+
77112
### Added
113+
78114
- Debug viewer ([#5](https://github.com/fable-compiler/vite-plugin-fable/pull/5))
79115

80116
## [0.0.27] - 2025-01-30
117+
81118
### Changed
119+
82120
- Combine file changes for faster rebuilds ([#6](https://github.com/fable-compiler/vite-plugin-fable/pull/6))
83121

84122
## [0.0.26] - 2025-01-15
123+
85124
### Added
125+
86126
- Project options cache ([#2](https://github.com/fable-compiler/vite-plugin-fable/pull/2))
87127

88128
## [0.0.25] - 2025-01-05
129+
89130
### Added
131+
90132
- Support for arm64 architecture in postinstall ([#1](https://github.com/fable-compiler/vite-plugin-fable/pull/1))
91133

92134
## [0.0.24] - 2024-03-02
135+
93136
### Changed
137+
94138
- Improved endpoint call control via shared pending changes subscription.
95139
- Various internal improvements and bug fixes.
96140

97141
## [0.0.22] - 2024-02-28
142+
98143
### Changed
144+
99145
- Update Fable.Compiler to 4.0.0-alpha-008.
100146
- Update TypeScript and include debug folder.
101147

102148
## [0.0.20] - 2024-02-26
149+
103150
### Changed
151+
104152
- Handle F# changes via handleHotUpdate callback.
105153
- Improved file change tracking and project cache key logic.
106154

107155
## [0.0.18] - 2024-02-25
156+
108157
### Changed
158+
109159
- Only send sourceFiles list of FSharpProjectOptions to plugin.
110160
- Additional logging and reuse of CrackerOptions.
111161

112162
## [0.0.16] - 2024-02-24
163+
113164
### Added
165+
114166
- Debug documentation and error overlay prototype.
115167
- Initial debug page setup.
116168

117169
## [0.0.7] - 2024-02-13
170+
118171
### Added
172+
119173
- Diagnostics support ([#3](https://github.com/fable-compiler/vite-plugin-fable/pull/3)).
120174
- Use @fable-org/fable-library-js.
121175

122176
## [0.0.3] - 2024-02-05
177+
123178
### Added
179+
124180
- Thoth.Json support.
125181
- Initial cache key setup for project configuration.
126182
- Initial caching for design time build.
127183

128184
## [0.0.1] - 2023-10-28
185+
129186
### Added
187+
130188
- Initial implementation of Vite plugin for Fable.
131189
- Basic F# file compilation and integration with Vite build.
132190
- Early support for project file watching and hot reload.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
[![NPM Version](https://img.shields.io/npm/v/vite-plugin-fable)](https://www.npmjs.com/package/vite-plugin-fable)
44

5-
65
<img alt="vite-plugin-fable logo" src="https://github.com/fable-compiler/vite-plugin-fable/blob/main/docs/img/logo.png?raw=true" height="300"></img>
76

87
> [!IMPORTANT]
98
> This project is up for adoption. I'm looking for eager people to maintain this.<br>Please open a [discussion](https://github.com/fable-compiler/vite-plugin-fable/discussions) if you are interested!
109
1110
## What is this?
1211

13-
Alright, the `tl;dr` is that I don't like the current way of how you can use [Fable](https://fable.io) with [Vite](https://vitejs.dev).
12+
Alright, the `tl;dr` is that I don't like the current way of how you can use [Fable](https://fable.io) with [Vite](https://vitejs.dev).
1413
I'm referring to the steps in the [get started with Vite](https://fable.io/docs/getting-started/javascript.html#browser), I don't like it and have an alternate take on it.
1514

1615
More thoughts on this can be read from the [documentation](https://fable.io/vite-plugin-fable/).
@@ -21,6 +20,7 @@ A first package was pushed to npm. This was merely to reserve the package name.
2120
You can read the code, that's is it for now.
2221

2322
### Recent Notes
23+
2424
Support for the latest .NET runtime was added in [v0.1.1](https://github.com/fable-compiler/vite-plugin-fable/blob/main/CHANGELOG.md#011---2025-06-03). Please upgrade to the latest version. Earlier versions may fail silently if the .NET 8 runtime is missing—see the changelog for details.
2525

2626
## Video

ROADMAP.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Order is a rough suggestion: the first three unblock building locally and shrink
2424

2525
## 2. Rethink `postinstall`
2626

27+
_2026-08-29: the repo is now a Bun workspace (`packages/vite-plugin-fable` + `sample-project`, isolated linker). `postinstall` still runs `dotnet publish` inside the package; the distribution question below is unchanged._
28+
2729
**Current state**
2830

2931
- `package.json` `postinstall` runs `dotnet publish Fable.Daemon/Fable.Daemon.fsproj -c Release --ucr -p:PublishReadyToRun=true -o ./bin` on the consumer's machine. The npm package therefore ships F# sources (`files` includes `Fable.Daemon/**/*.fs`, `Directory.*.props`) rather than a built daemon.
@@ -70,6 +72,8 @@ Order is a rough suggestion: the first three unblock building locally and shrink
7072

7173
## 4. Audit the Vite integration
7274

75+
_2026-08-29: on Vite 8 (rolldown). The JSX post-transform now uses `transformWithOxc` from Vite instead of a direct `esbuild` dependency; `fable-library` is located via `import.meta.resolve`. The lifecycle/HMR questions below are still open._
76+
7377
Questions to answer with the Vite 7 docs and, ideally, a small experiment in `sample-project`.
7478

7579
**Lifecycle**

0 commit comments

Comments
 (0)