Releases: fable-compiler/Fable
Releases · fable-compiler/Fable
5.0.0-rc.7
Added
- [Python/Beam] Add F# quotation support — construction, pattern matching, and evaluation via
LeafExpressionConverter.EvaluateQuotation(by @dbrattli) - [JS/TS] Add F# quotation support — construction, pattern matching, and evaluation (by @OnurGumus)
- [All] Add support for
Guid.CreateVersion7()andGuid.CreateVersion7(DateTimeOffset)(by @OnurGumus) - [All] Add missing
Array,List, andSeqrandom choice/shuffle/sample members and tests (by @ncave) - [Dart/Rust] Add missing
System.Randomimplementations and tests (by @ncave) - [Beam] Implement missing DateTimeOffset members, add DateOnly and TimeOnly support (by @dbrattli)
Fixed
- [All] Fix unnecessary object allocations during AST traversal when visiting
Importexpressions (by Repo Assist) - [Beam] Fix
System.Random.Next(0)implementation (by @ncave) - [Python] Fix
System.Randomseeded implementation (by @ncave) - [Beam] Fix
System.Randomseeded implementation to use per-instance state (by @dbrattli) - [Dart] Fix
Array.compareWithcomparing lengths before elements, producing wrong results for arrays with common prefixes (fixes #2961) - [Python] Fix unsafe option unwrapping in
DateTimeOffset.get_Offsetand regex replacements (by @dbrattli) - [All] Replace unsafe option
.Valueunwrapping with safe alternatives in Python/Replacements.fs and Rust/Fable2Rust.fs (code scanning alerts IONIDE-006) - [All] Add
[<return: Struct>]to partial active patterns in Dart and Rust targets to reduce allocations (code scanning alerts IONIDE-009) - [JS/TS] Fix
Guidto use cryptographically strong random values (by @ncave) - [Python] Fix
DateTimeOffsetmillisecond constructor and property (by @ncave) - [Python] Implement missing
DateTimeOffsetmembers and fix equality/comparison to use UTC-normalized instants (by @dbrattli) - [Python] Add
DateOnlyandTimeOnlysupport (by @dbrattli) - [Python] Fix
String.IndexOf/LastIndexOfwithStringComparisonargument emitting it as a start-index instead of a compile error (by @repo-assist) - [Beam] Fix
String.IndexOf/LastIndexOfwithStringComparisonargument incorrectly treating the enum value as a start index - [JS/TS/Python] Fix
Async.StartChildwith timeout always timing out even when the computation finishes before the deadline (fixes #4481) (by @MangelMaxime)
5.0.0-rc.6
Fixed
- [Dart] Enable explicit variable typing for more data types (by @ncave)
- [Dart] Fix tests for
round,sign,truncate,log,log2,log10,pow,DivRem,Min,Max,Clamp,MinMagnitude,MaxMagnitude,cosh,sinh,tanh, and floatParse(by @ncave) - [Python] Add
Math.DivRemsupport for int, int64, and bigint (by @dbrattli) - [Python] Fix modulo with negative numbers using Python floored semantics instead of .NET truncated semantics for bigint (fixes #4462) (by @dbrattli)
- [Beam] Fix
System.String.Concatwith 4+ arguments not being supported (by @dbrattli) - [TS/Python] Fix thisArg type for overloads in structs (#4453) (by @ncave)
- [TS/Python] Fix invalid
thisargument type in structs (#4453) (by @ncave) - [JS/TS] Fix
Nformat specifier (ToString("N0"),String.Format("{0:N0}", ...)) producing a trailing dot when precision is 0 (fix #2582) (by @MangelMaxime) - [JS/TS] Fix
C0andP0format specifiers producing trailing dot (e.g.,"¤1,000."→"¤1,000") (by @MangelMaxime) - [All] Fix captured side-effect-free values (e.g. empty ResizeArray) being incorrectly inlined into object expression getters in release mode, causing a new instance to be created on each getter call (fixes #3779) (by @MangelMaxime)
- [Python] Fix missing
awaiton else branch of ternary expressions in async closures (by @dbrattli) - [Beam] Fix
|> ignoreon cross-module Emit calls generating variable bindings that shadow Emit case-clause variables (by @dbrattli) - [Beam] Fix
containsIdentRefnot checkingCallThisArg (by @dbrattli) - [All] Fix CLI color not resetting after error messages (fixes #3755) (by @MangelMaxime)
- [JS/TS]
StringEnumnow respectCompiledValueandCompiledName(by @shayanhabibi) - [JS/TS] Fix invalid syntax emitted when negating negative literals (fix #4251) (by @MangelMaxime)
- [Rust] Fix negative counting in CallInfo.GenericArgs (by @ncave)
- [Rust] Fix inline bindings and captured idents tracking (by @ncave)
- [Rust] Fix
return!in async computation expressions so inner async workflows are returned and awaited correctly (by @mizzle-mo) - [JS/TS] Improve
Regex.EscapeandRegex.Unescapehandling (by @MangelMaxime) - [All] Fix allow plugins to target .NET6 target framework (by @MangelMaxime)
- [Python] Fix function references passed as arguments inside tail-call optimised functions gaining unnecessary default parameters for outer TCO variables they don't reference (fix #3877)
- [TS] Fix abstract instance methods not emitted in TypeScript when class uses
[<AttachMembers>](fixes #3506) (by @MangelMaxime) - [JS/TS] Fix
Unchecked.defaultof<'T>for struct types with fields returningundefinedinstead of zero-initialized values (by @MangelMaxime) - [JS/TS] Fixed quotation for union string cases (by @MangelMaxime)
- [Python] Fix
Unchecked.defaultof<'T>for struct types with fields returning incorrect values instead of zero-initialized instances (by @MangelMaxime) - [Python] Fix
Unchecked.defaultof<char>returning""(empty string) instead of"\u0000"(null character) (by @MangelMaxime) - [Python] Improve
Unchecked.defaultof<_>for declared entities (by @MangelMaxime)
5.0.0-rc.5
Added
[All] Add support for [<InlineIfLambda>] (by @MangelMaxime)
5.0.0-rc.4
Fixed
- [JS/TS] Fix
Array.zeroCreateproducingnullfor user-defined struct (value type) elements instead of a default-initialized instance (by @MangelMaxime) - [All] Fix interpolated string holes missing format specifiers in State.fs and Python/Replacements.fs (code scanning alerts 1144, 1145, 1512)
- [Rust] Replace unsafe
.IsSome && .Valueoption pattern withOption.existsin Fable2Rust.fs (code scanning alert 1125) - [JS/TS] Fix
Unchecked.defaultof<char>being emitted asnullinstead of'\0'(by @MangelMaxime) - [JS/TS] Fix
static val mutablefields declared with[<DefaultValue>]not being zero-initialized (fix #2739) (by @MangelMaxime) - [JS/TS/Python] Fix record/struct types augmented with
static letorstatic member valgenerating extra constructor parameters for each static field, causing constructor arguments to be assigned to wrong slots (by @MangelMaxime) - [TS] Annotate
System.Collections.Generic.IList<T>asMutableArray<T>(by @MangelMaxime) - [JS/TS] Fix
ResizeArrayindex getter/setter not throwingIndexOutOfRangeExceptionwhen index is out of bounds (fix #3812) (by @MangelMaxime) - [Beam] Fix unused term warning in try/catch when exception variable is not referenced (by @dbrattli)
- [Beam] Fix "no effect" warning for pure BIF calls (
self/0,node/0) in non-final block positions (by @dbrattli) - [Beam] Fix
reraise()generating unboundMatchValuevariable — use raw Erlang reason variable for re-throw (by @dbrattli) - [Beam] Fix
Erlang.receive<'T>()resolving to timeout overload due to F# unit argument (by @dbrattli) - [JS/TS] Generate comments for members in class decorated with
[<AttachMembers>](by @MangelMaxime) - [Beam] Fix
[<ImportAll>]generating invalidmodule:*()Erlang code when binding is used as a value (by @dbrattli) - [Beam] Fix string slicing and
Substringwith compound expressions producing wrongbinary:partlength due to missing parentheses in emitted Erlang (by @dbrattli) - [Beam] Fix non-ASCII characters in string literals being truncated to single bytes — emit
<<"..."/utf8>>instead of<<"...">>(by @dbrattli) - [Beam] Fix
Emitexpressions withcaseleaking variables into surrounding scope — auto-wrap in IIFE for scope isolation (by @dbrattli)
5.0.0-rc.3
Added
- [Beam] Auto-generate rebar3 scaffold (
rebar.config,.app.src) after compilation;.erlfiles now placed insrc/subdirectories (by @dbrattli) - [Beam] Support
[<ImportAll>]+[<Erase>]interface pattern for typed FFI bindings (by @dbrattli)
Fixed
- [Beam] Fix dropped top-level side effects — multiple
ActionDeclarationmain/0functions are now merged (by @dbrattli) - [Beam] Fix
%%escape in string interpolation producing double%instead of single (by @dbrattli) - [Beam] Fix double-quoted atoms for uppercase
CompiledNameon DU cases (e.g.''EXIT''→'EXIT') (by @dbrattli) - [Beam] Fix cross-project imports producing self-recursive calls when source files share the same name (by @dbrattli)
- [Beam] Support
Type.GetGenericArgumentsandType.GetInterfacefor reflection (by @dbrattli) - [TS] Correctly resolve type references for
TypeScriptTaggedUnion(by @MangelMaxime and @jrwone0) - [TS] Expose optional
stackproperty onException(by @MangelMaxime) - [Python] Fix
nonlocal/globaldeclarations generated insidematch/casebodies causingSyntaxError(by @dbrattli) - [Python] Fix exception variable captured in deferred closures causing
NameError(PEP 3110 scoping) (by @dbrattli) - [JS/TS] Support format specifiers and single hole in JSX string templates (by @MangelMaxime)
- [All] Fix generic parameter resolution in inline functions with static member constraints (by @Programmerino and @MangelMaxime)
5.0.0-rc.2
Added
- [Beam] Add arithmetic tests and support for DivRem, MinMagnitude, MaxMagnitude, Decimal rounding, BigInt.Log (by @dbrattli)
- [Beam] Add
fable_random.erland fix Random seeded/NextBytes tests (by @dbrattli)
Fixed
- [Python] Fix
__hash__to return nativeintinstead ofint32for Python 3.14 compatibility (by @dbrattli) - [Python] Fix PyPI publish workflow version pattern to support
rctags (by @dbrattli) - [Beam] Bundle
fable-library-beamin NuGet package sodotnet fable --lang beamworks (by @dbrattli) - [Beam] Fix optional arguments by unwrapping at call sites and padding missing trailing args (by @dbrattli)
- [Beam] Fix generic constraint interface dispatch (by @dbrattli)
- [Beam] Fix class constructor field invokes and explicit val fields (by @dbrattli)
- [Beam] Fix mutable record field mutation (by @dbrattli)
- [JS/TS] Allows compiling
fable-library-tsfor Browser environment (by @goswinr)
5.0.0-rc.1
Added
- [Beam] Add Erlang/BEAM target (
--lang beam). Compiles F# to.erlsource files. 2086 tests passing. (by @dbrattli)
Fixed
- [Python] Fix type var scoping for PEP 695 annotations: emit
Anyfor type vars outside function scope and prevent non-repeated generic params from leaking intoScopedTypeParams(by @dbrattli) - [JS/TS] Ignore extra args in FSharpType functions (by @olivercoad)
5.0.0-alpha.24
Fixed
- [Python] Fix
Array.length,.Length,Array.isEmpty, andResizeArray.Countto uselen()instead of.lengthproperty for plain Python list interop (by @dbrattli) - [Python] Fix
Task<T>pass-through returns not being awaited in if/else and try/with branches (by @dbrattli) - [Python] Fix
:? T as xtype test pattern in closures causingUnboundLocalErrordue tocast()shadowing outer variable (by @dbrattli) - [All] Prevent Fable from freezing when running a sub-process via
--run(fix #3631) (by @MangelMaxime) - [All] Improve console width detection when rewritting console output (by @MangelMaxime)
4.29.0
Fixed
- [All] Prevent Fable from freezing when running a sub-process via
--run(fix #3631) (by @MangelMaxime) - [All] Improve console width detection when rewritting console output (by @MangelMaxime)
5.0.0-alpha.23
Changed
- [Python] Changed DU representation to use separate classes for each case (by @dbrattli)
- [Python] Fable will no longer auto-generate
__str__or__hash__for custom types. Use thePy.StringableandPy.Hashablemarker interfaces to generate these methods (by @dbrattli)
Added
- [Python] Added ABC base classes for F# types and Py marker interfaces for Python interop (by @dbrattli)
- [Python] Add tuple pattern matching with guards and improve match statement generation (by @dbrattli)
- [Python] Add Python 3.10+ match statement support for pattern matching (by @dbrattli)
Fixed
- [Python] Fix curry/uncurry to handle arbitrary number of arguments (by @dbrattli)
- [Python] Fix type annotations for protocols, Option casting, and abstract classes (by @dbrattli)
- [Python] Fix type annotations for curried functions and numeric types (by @dbrattli)
- [Python] Fix type annotations for inref, IList, DateKind, and regex collections (by @dbrattli)
- [Python] Fix type annotations for protocols, ABCs, Atom, and Set module (by @dbrattli)
- [Python] Fix type annotations for async functions, date operations, and None handling (by @dbrattli)
- [Python] Fix type annotations for tuple indexing, generic defaults, and reflection (by @dbrattli)
- [All] Fix
StringBuilder.Charsgetter and setter (by @MangelMaxime)
Removed
- [All] Remove
--legacyCrackerflag, MSBuild cracker is now the default and the only cracker supported (by @MangelMaxime)