Feliz icon indicating copy to clipboard operation
Feliz copied to clipboard

Plugin Feliz.HookAttribute expects v3.0 but currently running Fable v4.0.0-snake-island-alpha-009

Open nojaf opened this issue 2 years ago • 3 comments

Hello Zaid! I was curious about Fable 4 and I was bumping all my tools/packages inside my sample project. Turns out I can't use [<ReactComponent>] with the latest alpha?

.\src\fable_modules\Feliz.1.64.0\React.fs(1,1): error EXCEPTION: Plugin Feliz.HookAttribute expects v3.0 but currently running Fable v4.0.0-snake-island-alpha-009
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in C:\Users\alfon\repos\fsharp\src\fsharp\FSharp.Core\printf.fs:line 1439
   at [email protected](Input input, Attribute att) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\Global\Compiler.fs:line 156
   at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source) in C:\Users\alfon\repos\fsharp\src\fsharp\FSharp.Core\seq.fs:line 731
   at Fable.CompilerExt.Compiler.ApplyMemberCallPlugin(Compiler com, MemberFunctionOrValue memb, Expr expr) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\Global\Compiler.fs:line 166
   at Fable.Transforms.FSharp2Fable.Util.makeCallWithArgInfo(IFableCompiler com, Context ctx, FSharpOption`1 r, Type typ, FSharpOption`1 callee, FSharpMemberOrFunctionOrValue memb, CallInfo callInfo) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\FSharp2Fable.Util.fs:line 2215
   at Fable.Transforms.FSharp2Fable.Util.makeCallFrom(IFableCompiler com, Context ctx, FSharpOption`1 r, Type typ, FSharpList`1 genArgs, FSharpOption`1 callee, FSharpList`1 args, FSharpMemberOrFunctionOrValue memb) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\FSharp2Fable.Util.fs:line 2220
   at Fable.Transforms.FSharp2Fable.Compiler.transformExpr@731-42.Invoke(Context ctx) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\FSharp2Fable.fs:line 731
   at MonadicTrampoline.run[a](Thunk`1 _arg1) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\MonadicTrampoline.fs:line 8
   at Fable.Transforms.FSharp2Fable.Compiler.transformMemberFunction(IFableCompiler com, Context ctx, Boolean isPublic, String name, String fullDisplayName, FSharpMemberOrFunctionOrValue memb, FSharpList`1 args, FSharpExpr body) in C:\Users\alfon\repos\Fable\src\Fable.Transforms\FSharp2Fable.fs:line 1289

Is there any real restriction here? Or is the check of https://github.com/Zaid-Ajaj/Feliz/blob/295162276825b6e17cd8caac5d3f7ba8bc151ff8/Feliz.CompilerPlugins/ReactComponent.fs#L14 not taking alpha versions into account?

nojaf avatar Jun 02 '22 07:06 nojaf

Hmm, looks that way

https://github.com/fable-compiler/Fable/blob/dacbb6b51157ae01cbba3c835e0dd19e13b5dbdf/src/Fable.Transforms/Global/Compiler.fs#L79-L96

@alfonsogarciacaro any thoughts on this?

nojaf avatar Jun 02 '22 07:06 nojaf

@nojaf Plugins are not compatible yet, because they depend on the internal AST and this has changed with the major version. Once the AST settles (probably soon) we'll update the plugins :)

BTW, there are currently no changes for JS (besides JSX support, but this still needs to be tuned up for React) so it's no necessary to update your JS projects yet. I'm still pushing Fable 3 releases with any JS-related fix 👍

alfonsogarciacaro avatar Jun 02 '22 10:06 alfonsogarciacaro

Hey, thanks for clarifying this. I'll stick to the stable bits.

nojaf avatar Jun 02 '22 12:06 nojaf

@nojaf See #535

Zaid-Ajaj avatar Dec 25 '22 04:12 Zaid-Ajaj