fix bugs with let rec in LiveUpdate

This commit is contained in:
Don Syme 2018-07-13 01:20:50 +01:00
Родитель b2b08ae252
Коммит 785bc3a32b
11 изменённых файлов: 52 добавлений и 32 удалений

Просмотреть файл

@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Elmish.XamarinForms.LiveUpdate")>]
[<assembly: AssemblyProductAttribute("Elmish.XamarinForms.LiveUpdate")>]
[<assembly: AssemblyDescriptionAttribute("F# Functional App Dev Framework Live Update")>]
[<assembly: AssemblyVersionAttribute("0.14.0")>]
[<assembly: AssemblyFileVersionAttribute("0.14.0")>]
[<assembly: AssemblyVersionAttribute("0.14.4")>]
[<assembly: AssemblyFileVersionAttribute("0.14.4")>]
do ()
module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Elmish.XamarinForms.LiveUpdate"
let [<Literal>] AssemblyProduct = "Elmish.XamarinForms.LiveUpdate"
let [<Literal>] AssemblyDescription = "F# Functional App Dev Framework Live Update"
let [<Literal>] AssemblyVersion = "0.14.0"
let [<Literal>] AssemblyFileVersion = "0.14.0"
let [<Literal>] AssemblyVersion = "0.14.4"
let [<Literal>] AssemblyFileVersion = "0.14.4"

Просмотреть файл

@ -127,8 +127,8 @@ type HttpServer(?port) =
<pre> adb -e forward tcp:PORT tcp:PORT (Emulator)</pre>
<p> then</p>
<pre> cd MyApp\MyApp</pre>
<pre> %USERPROFILE%\.nuget\packages\Elmish.XamarinForms.LiveUpdate\0.14.0\tools\fscd.exe --watch --webhook:http://localhost:PORT/update</pre>
<pre> mono ~/.nuget/packages/Elmish.XamarinForms.LiveUpdate/0.14.0/tools/fscd.exe --watch --webhook:http://localhost:PORT/update</pre>
<pre> %USERPROFILE%\.nuget\packages\Elmish.XamarinForms.LiveUpdate\0.14.4\tools\fscd.exe --watch --webhook:http://localhost:PORT/update</pre>
<pre> mono ~/.nuget/packages/Elmish.XamarinForms.LiveUpdate/0.14.4/tools/fscd.exe --watch --webhook:http://localhost:PORT/update</pre>
<p>in your project directoty</p>
</body>
</html>"""

Просмотреть файл

@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Elmish.XamarinForms")>]
[<assembly: AssemblyProductAttribute("Elmish.XamarinForms")>]
[<assembly: AssemblyDescriptionAttribute("F# Functional App Dev Framework")>]
[<assembly: AssemblyVersionAttribute("0.14.0")>]
[<assembly: AssemblyFileVersionAttribute("0.14.0")>]
[<assembly: AssemblyVersionAttribute("0.14.4")>]
[<assembly: AssemblyFileVersionAttribute("0.14.4")>]
do ()
module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Elmish.XamarinForms"
let [<Literal>] AssemblyProduct = "Elmish.XamarinForms"
let [<Literal>] AssemblyDescription = "F# Functional App Dev Framework"
let [<Literal>] AssemblyVersion = "0.14.0"
let [<Literal>] AssemblyFileVersion = "0.14.0"
let [<Literal>] AssemblyVersion = "0.14.4"
let [<Literal>] AssemblyFileVersion = "0.14.4"

Просмотреть файл

@ -1,4 +1,11 @@
#### 0.14.0
#### 0.14.4
* Add 'let rec' to code accepted by LiveUpdate
* Add local mutables to code accepted by LiveUpdate
#### 0.14.2
* Rename Xaml.* --> View.*
#### 0.13.10
* Fix compilation of template on OSX
#### 0.13.8

Просмотреть файл

@ -14,7 +14,7 @@ to see the effect of adjusting of visual options.
Some manual set-up is required. The following assumes your app is called `SqueakyApp`:
1. Check your projects have a reference to nuget package `Elmish.XamarinForms.LiveUpdate` for all projects in your app.
This is the default for apps created with templates 0.14.0 and higher. Do a clean build.
This is the default for apps created with templates 0.14.4 and higher. Do a clean build.
2. Uncomment or add the code in the `#if` section below in `SqueakyApp\SqueakyApp\SqueayApp.fs`:
@ -39,12 +39,12 @@ Some manual set-up is required. The following assumes your app is called `Squea
Windows:
cd SqueakyApp\SqueakyApp
%USERPROFILE%\.nuget\packages\Elmish.XamarinForms.LiveUpdate\0.14.0\tools\fscd.exe --watch --webhook:http://localhost:9867/update
%USERPROFILE%\.nuget\packages\Elmish.XamarinForms.LiveUpdate\0.14.4\tools\fscd.exe --watch --webhook:http://localhost:9867/update
Unix and OSX (untested):
cd SqueakyApp/SqueakyApp
mono ~/.nuget/packages/Elmish.XamarinForms.LiveUpdate/0.14.0/tools/fscd.exe --watch --webhook:http://localhost:9867/update
mono ~/.nuget/packages/Elmish.XamarinForms.LiveUpdate/0.14.4/tools/fscd.exe --watch --webhook:http://localhost:9867/update
Now, whenever you save a file in your core project directory, the `fscd.exe` daemon will attempt to recompile your changed file and
send a representation of its contents to your app via a PUT request to the given webhook. The app then deserializes this representation and

Просмотреть файл

@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Elmish.XamarinForms.Maps")>]
[<assembly: AssemblyProductAttribute("Elmish.XamarinForms.Maps")>]
[<assembly: AssemblyDescriptionAttribute("Elmish.XamarinForms extension for Xamarin.Forms.Maps")>]
[<assembly: AssemblyVersionAttribute("0.14.0")>]
[<assembly: AssemblyFileVersionAttribute("0.14.0")>]
[<assembly: AssemblyVersionAttribute("0.14.4")>]
[<assembly: AssemblyFileVersionAttribute("0.14.4")>]
do ()
module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Elmish.XamarinForms.Maps"
let [<Literal>] AssemblyProduct = "Elmish.XamarinForms.Maps"
let [<Literal>] AssemblyDescription = "Elmish.XamarinForms extension for Xamarin.Forms.Maps"
let [<Literal>] AssemblyVersion = "0.14.0"
let [<Literal>] AssemblyFileVersion = "0.14.0"
let [<Literal>] AssemblyVersion = "0.14.4"
let [<Literal>] AssemblyFileVersion = "0.14.4"

Просмотреть файл

@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Elmish.XamarinForms.OxyPlot")>]
[<assembly: AssemblyProductAttribute("Elmish.XamarinForms.OxyPlot")>]
[<assembly: AssemblyDescriptionAttribute("Elmish.XamarinForms extension for OxyPlot")>]
[<assembly: AssemblyVersionAttribute("0.14.0")>]
[<assembly: AssemblyFileVersionAttribute("0.14.0")>]
[<assembly: AssemblyVersionAttribute("0.14.4")>]
[<assembly: AssemblyFileVersionAttribute("0.14.4")>]
do ()
module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Elmish.XamarinForms.OxyPlot"
let [<Literal>] AssemblyProduct = "Elmish.XamarinForms.OxyPlot"
let [<Literal>] AssemblyDescription = "Elmish.XamarinForms extension for OxyPlot"
let [<Literal>] AssemblyVersion = "0.14.0"
let [<Literal>] AssemblyFileVersion = "0.14.0"
let [<Literal>] AssemblyVersion = "0.14.4"
let [<Literal>] AssemblyFileVersion = "0.14.4"

Просмотреть файл

@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Elmish.XamarinForms.SkiaSharp")>]
[<assembly: AssemblyProductAttribute("Elmish.XamarinForms.SkiaSharp")>]
[<assembly: AssemblyDescriptionAttribute("Elmish.XamarinForms extension for SkiaSharp")>]
[<assembly: AssemblyVersionAttribute("0.14.0")>]
[<assembly: AssemblyFileVersionAttribute("0.14.0")>]
[<assembly: AssemblyVersionAttribute("0.14.4")>]
[<assembly: AssemblyFileVersionAttribute("0.14.4")>]
do ()
module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Elmish.XamarinForms.SkiaSharp"
let [<Literal>] AssemblyProduct = "Elmish.XamarinForms.SkiaSharp"
let [<Literal>] AssemblyDescription = "Elmish.XamarinForms extension for SkiaSharp"
let [<Literal>] AssemblyVersion = "0.14.0"
let [<Literal>] AssemblyFileVersion = "0.14.0"
let [<Literal>] AssemblyVersion = "0.14.4"
let [<Literal>] AssemblyFileVersion = "0.14.4"

Просмотреть файл

@ -331,7 +331,7 @@ if c 5 <> 5 then failwith "fail fail fail!"
[<TestMethod>]
member this.DateTime() =
SimpleTestCase "GenericThing" """
SimpleTestCase "DateTime" """
let v1 = System.DateTime.Now
let v2 = v1.Date
let mutable v3 = System.DateTime.Now
@ -340,7 +340,7 @@ let v4 = v3.Date
[<TestMethod>]
member this.LocalMutation() =
SimpleTestCase "GenericThing" """
SimpleTestCase "LocalMutation" """
let f () =
let mutable x = 1
x <- x + 1
@ -350,5 +350,18 @@ if f() <> 3 then failwith "fail fail!"
"""
[<TestMethod>]
member this.LetRecSmoke() =
SimpleTestCase "LetRecSmoke" """
let even a =
let rec even x = (if x = 0 then true else odd (x-1))
and odd x = (if x = 0 then false else even (x-1))
even a
if even 11 then failwith "fail!"
if not (even 10) then failwith "fail fail!"
"""
// tests needed:
// 2D arrays

Просмотреть файл

@ -528,8 +528,8 @@ type EvalContext () =
| DExpr.ValueSet(DLocalRef (valToSet, _, _), valueExpr) ->
let valueExprV : obj = ctxt.EvalExpr(env, valueExpr) |> getVal
match env.Vals.TryGetValue valToSet with
| true, Value (:? ref<obj> as rv) ->
rv := valueExprV
| true, rv ->
rv.Value <- valueExprV
Value null
| _ -> failwithf "didn't find mutable value in the environment"
@ -613,7 +613,7 @@ type EvalContext () =
let valueThunks = recursiveBindings |> Array.map (fun _ -> { Value = null })
let envInner = bindMany env (Array.map fst recursiveBindings) valueThunks
(valueThunks, recursiveBindings) ||> Array.iter2 (fun valueThunk (_,recursiveBindingExpr) ->
let v = ctxt.EvalExpr(env, recursiveBindingExpr) |> getVal
let v = ctxt.EvalExpr(envInner, recursiveBindingExpr) |> getVal
valueThunk.Value <- v)
ctxt.EvalExpr (envInner, bodyExpr)

Просмотреть файл

@ -135,7 +135,7 @@
"type": "parameter",
"dataType": "string",
"replaces": "ElmishXamarinFormsPkg",
"defaultValue": "0.14.0"
"defaultValue": "0.14.4"
},
"NewtonsoftJsonPkg": {
"type": "parameter",