-
Notifications
You must be signed in to change notification settings - Fork 4
fix issue jsonrpc id files mismatch with full reload #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
93bde1d
af329c2
e163f67
6ff6216
ce01129
42d9b7f
c57b3c6
87c6369
c1b30fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. | |
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) from version [0.1.0] moving forward. | ||
|
|
||
| ## [0.2.1] - 2025-06-28 | ||
| ### Fixed | ||
| - Bug fix targeting issue ([#53](https://github.com/fable-compiler/vite-plugin-fable/issues/53)) as log warn and no crash, for protocol error in json rpc serialization when there is id count mismatch | ||
| - removed Nojaf.React bindings nuget package and using Feliz instead for sample-project, as it is what is most used in community projects and suggested by official fable docs for React. | ||
| - pr ([#55](https://github.com/fable-compiler/vite-plugin-fable/pull/55)) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added change log entries |
||
|
|
||
| ## [0.2.0] - 2025-06-24 | ||
| ### Changed | ||
| - 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)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -414,6 +414,28 @@ export default function fablePlugin(userConfig) { | |
| state.dotnetProcess.stdout, | ||
| ); | ||
|
|
||
| if (process.env.VITE_PLUGIN_FABLE_DEBUG) { | ||
| state.endpoint.on("error", (...args) => { | ||
| logDebug("protocol", `[fable] error event args: ${args.map(a => typeof a + ': ' + JSON.stringify(a)).join(" | ")}`); | ||
| }); | ||
| } | ||
|
|
||
| // Attach protocol-level error handler | ||
| state.endpoint.on("error", async (err) => { | ||
| if (err && /id mismatch/.test(err)) { | ||
| logWarn( | ||
| "protocol", | ||
| `error from JSONRPCEndpoint: ${ | ||
| err && err.message ? err.message : err | ||
| }` | ||
| ); | ||
| } | ||
| else { | ||
| logError("unknown", `error: ${err}, ${err.code}, ${err.context ?? "no context"}`); | ||
| } | ||
| }); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated handling of error |
||
|
|
||
|
|
||
| if (state.isBuild) { | ||
| await projectChanged( | ||
| this.addWatchFile.bind(this), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,14 +10,14 @@ | |
| <ItemGroup> | ||
| <PackageReference Include="Fable.Browser.Dom" Version="2.14.0" /> | ||
| <PackageReference Include="Fable.Core" Version="4.3.0" /> | ||
| <PackageReference Include="Nojaf.Fable.React" Version="0.0.2" /> | ||
| <PackageReference Include="Feliz" Version="2.9.0" /> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update to standard fable Feliz remove Nojaf.Fable.React experimental package from sample |
||
| <PackageReference Include="Thoth.Json" Version="10.2.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="Math.fs" /> | ||
| <Compile Include="Component.fsi" /> | ||
| <Compile Include="Component.fs" /> | ||
| <Compile Include="./components/TestComponent.fs" /> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added an external component as the issue only happens when there is at least one component importing another it seems, not only with a root component |
||
| <Compile Include="RootComponent.fs" /> | ||
| <Compile Include="Library.fs" /> | ||
| </ItemGroup> | ||
| </Project> | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| module Components.RootComponent | ||
|
|
||
| open Feliz | ||
| open Fable.Core | ||
|
|
||
| JsInterop.importSideEffects "./app.css" | ||
|
|
||
|
|
||
| [<ReactComponent>] | ||
| let El () = | ||
| let count, setCount = React.useState 0 | ||
| React.fragment [ | ||
| Test.El({| name = "Test" |}) | ||
| Html.h1 "Vite fable plugin rocks!" | ||
| Html.button [ | ||
| prop.onClick (fun _ -> setCount (count + 1)) | ||
| prop.text $"Current state {count}" | ||
| ] | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,4 +41,9 @@ h1 { | |
| box-shadow: 0px 3px 3px 0px rgba(0,0,0,0.25); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #test { | ||
| color: red; | ||
| background-color: yellow; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| module Components.Test | ||
|
|
||
| open Feliz | ||
| open Fable.Core | ||
|
|
||
| // for editor highlight: alfonsogarciacaro.vscode-template-fsharp-highlight | ||
| [<Erase>] | ||
| let inline css s = s | ||
|
|
||
| [<ReactComponent>] | ||
| let El (props: {| name: string |}) = | ||
| let spinCss = css "@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }" | ||
| React.fragment [ | ||
| Html.div [ | ||
| prop.style [ | ||
| style.backgroundColor "yellow" | ||
| style.animationName "spin" | ||
| style.animationDuration 3 | ||
| style.animationIterationCount.initial | ||
| style.animationTimingFunction.linear | ||
| ] | ||
| prop.children [ | ||
| Html.h1 $"My name is: {props.name}!" | ||
| ] | ||
| ] | ||
| Html.style spinCss | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| "type": "module", | ||
| "scripts": { | ||
| "dev": "bunx --bun vite", | ||
| "dev:debug": "VITE_PLUGIN_FABLE_DEBUG=1 bunx --bun vite", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added dev debug script |
||
| "build": "bunx --bun vite build", | ||
| "preview": "bunx --bun vite preview" | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changelog entry lacks consistency. Please adhere to a uniform format and avoid trends.
Additionally, it appears that not many fixes are being made. This could be misleading for end-users, so I would prefer to follow the updates in your other PR.