Skip to content

Commit

Permalink
Add fable-web-worker dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsogarciacaro committed Feb 12, 2019
1 parent 2ee104d commit 453d549
Show file tree
Hide file tree
Showing 169 changed files with 198 additions and 460 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public/js
public/libs
public/metadata
deploy/
temp/

Expand Down
10 changes: 9 additions & 1 deletion .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
</PropertyGroup>

<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
Expand Down Expand Up @@ -102,7 +105,11 @@
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
</PropertyGroup>

<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' ">
<!--
This value should match the version in the props generated by paket
If they differ, this means we need to do a restore in order to ensure correct dependencies
-->
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
</PropertyGroup>

Expand Down Expand Up @@ -183,6 +190,7 @@
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
<AllowExplicitVersion>true</AllowExplicitVersion>
</PackageReference>
</ItemGroup>

Expand Down
15 changes: 0 additions & 15 deletions Fable.REPL.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C8B9F97B-191
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "App", "src\App\App.fsproj", "{31BC705C-C0E8-4447-931D-A2202623833C}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Worker", "src\Worker\Worker.fsproj", "{A30A2346-3A70-4825-8C1B-522D2BACC746}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fable.Repl.Lib", "src\Lib\Fable.Repl.Lib.fsproj", "{08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}"
EndProject
Global
Expand Down Expand Up @@ -36,18 +34,6 @@ Global
{31BC705C-C0E8-4447-931D-A2202623833C}.Release|x64.Build.0 = Release|x64
{31BC705C-C0E8-4447-931D-A2202623833C}.Release|x86.ActiveCfg = Release|x86
{31BC705C-C0E8-4447-931D-A2202623833C}.Release|x86.Build.0 = Release|x86
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Debug|x64.ActiveCfg = Debug|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Debug|x64.Build.0 = Debug|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Debug|x86.ActiveCfg = Debug|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Debug|x86.Build.0 = Debug|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Release|Any CPU.Build.0 = Release|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Release|x64.ActiveCfg = Release|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Release|x64.Build.0 = Release|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Release|x86.ActiveCfg = Release|Any CPU
{A30A2346-3A70-4825-8C1B-522D2BACC746}.Release|x86.Build.0 = Release|Any CPU
{08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -63,7 +49,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{31BC705C-C0E8-4447-931D-A2202623833C} = {C8B9F97B-191C-4688-8F80-92749D53228E}
{A30A2346-3A70-4825-8C1B-522D2BACC746} = {C8B9F97B-191C-4688-8F80-92749D53228E}
{08FEB5F5-56F4-42C5-A31F-DE5C6F64B99B} = {C8B9F97B-191C-4688-8F80-92749D53228E}
EndGlobalSection
EndGlobal
52 changes: 18 additions & 34 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ open System.IO
open System.Net
open System.Text.RegularExpressions

let FABLE_BRANCH = "master"
let APPVEYOR_REPL_ARTIFACT_URL_PARAMS = "?branch=" + FABLE_BRANCH + "&pr=false"
let APPVEYOR_REPL_ARTIFACT_URL =
"https://ci.appveyor.com/api/projects/fable-compiler/Fable/artifacts/src/dotnet/Fable.Repl/repl-bundle.zip"
+ APPVEYOR_REPL_ARTIFACT_URL_PARAMS

let CWD = __SOURCE_DIRECTORY__
let NCAVE_FCS_REPO = Path.Combine(CWD, "../FSharp.Compiler.Service_fable")
let FABLE_REPO = Path.Combine(CWD, "../Fable")

let LIBS_OUTPUT = Path.Combine(CWD, "public/libs")
let REPL_OUTPUT = Path.Combine(CWD, "public/js/repl")
let METADATA_OUTPUT = Path.Combine(CWD, "public/metadata2")
let METADATA_OUTPUT = Path.Combine(CWD, "public/metadata")
let METADATA_SOURCE = Path.Combine(NCAVE_FCS_REPO, "temp/metadata2")

let METADATA_EXPORT_DIR = Path.Combine(CWD, "src/Export")
Expand Down Expand Up @@ -63,16 +57,6 @@ let runYarn dir command =
Command = Custom command
})

let downloadArtifact path (url: string) =
let tempFile = Path.ChangeExtension(Path.GetTempFileName(), ".zip")
use client = new WebClient()
printfn "GET %s" url
client.DownloadFile(Uri url, tempFile)
CleanDir path
Unzip path tempFile
File.Delete tempFile
printfn "Artifact unzipped at %s" path

let rec waitUserResponse _ =
let userInput = Console.ReadLine()
match userInput.ToUpper() with
Expand Down Expand Up @@ -115,6 +99,7 @@ let ensureRepoSetup (info : RepoSetupInfo) =
// Ensure this is the correct branch
runSimpleGitCommand info.FolderPath ("checkout " + info.GithubBranch) |> ignore

// TODO: Get version from fable-web-worker package
let updateVersion () =
let version = File.ReadAllText(REPL_OUTPUT </> "version.txt")
let reg = Regex(@"\bVERSION\s*=\s*""(.*?)""")
Expand All @@ -137,13 +122,10 @@ Target "BuildFcsExport" (fun _ ->
|> runScript NCAVE_FCS_REPO "fcs\\build"
)

// TODO: Move this to Fable repo
Target "GenerateMetadata" (fun _ ->
CleanDir METADATA_OUTPUT
CopyDir METADATA_OUTPUT METADATA_SOURCE (fun _ -> true)
!! (METADATA_OUTPUT </> "*.dll")
|> Seq.iter(fun filename ->
Rename (filename + ".txt") filename
)
)

Target "InstallDotNetCore" (fun _ ->
Expand All @@ -156,6 +138,7 @@ Target "InstallDotNetCore" (fun _ ->
Target "Clean" (fun _ ->
!! "public/js"
++ LIBS_OUTPUT
++ METADATA_OUTPUT
++ "deploy"
|> CleanDirs
)
Expand All @@ -181,7 +164,20 @@ Target "CopyModules" (fun _ ->
CopyFile LIBS_OUTPUT "node_modules/react-dom/umd/react-dom.production.min.js"
CopyFile cssOutput "node_modules/bulma/css/bulma.min.css"
CopyFile cssOutput "node_modules/font-awesome/css/font-awesome.min.css"
CopyDir (LIBS_OUTPUT </> "fonts") "node_modules/font-awesome/fonts" (fun _ -> true)
CopyDir (LIBS_OUTPUT </> "fonts") "node_modules/font-awesome/fonts" (fun _ -> true)

// Metadata
CopyDir METADATA_OUTPUT "node_modules/fable-metadata/lib" (fun _ -> true)
!! "public/metadata-extra" |> Seq.iter(fun filename ->
CopyFile METADATA_OUTPUT filename)
CopyDir METADATA_OUTPUT "public/metadata-extra" (fun _ -> true)
// Change extension to .txt so Github pages compress the files when being served
!! (METADATA_OUTPUT </> "*.dll") |> Seq.iter(fun filename ->
Rename (filename + ".txt") filename)

// Fable WebWorker
CopyDir (REPL_OUTPUT </> "fable-library") "node_modules/fable-web-worker/dist/fable-library" (fun _ -> true)
CopyFile REPL_OUTPUT "node_modules/fable-web-worker/dist/fable-web-worker.min.js"
)

Target "WatchApp" (fun _ ->
Expand All @@ -196,17 +192,6 @@ Target "PublishGithubPages" (fun _->
runYarn CWD "gh-pages -d deploy"
)

Target "GetBundleFromAppveyor" (fun _ ->
downloadArtifact REPL_OUTPUT APPVEYOR_REPL_ARTIFACT_URL
updateVersion ()
)

// Assume the bundle has been built in a sibling Fable repo
Target "GetBundleLocally" (fun _ ->
FileUtils.cp_r (FABLE_REPO </> "src/dotnet/Fable.Repl/bundle") REPL_OUTPUT
updateVersion ()
)

Target "BuildLib" (fun _ ->
runYarn CWD "fable-splitter -c src/Lib/splitter.config.js"

Expand Down Expand Up @@ -242,7 +227,6 @@ Target "All" DoNothing
==> "Restore"
==> "YarnInstall"
==> "CopyModules"
==> "GetBundleFromAppveyor"
==> "BuildLib"
==> "BuildApp"
==> "All"
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
"author": "",
"license": "MIT",
"scripts": {},
"devDependencies": {
"dependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.2.1",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0",
"@babel/standalone": "^7.2.2",
"@babel/template": "^7.2.2",
"@types/lz-string": "^1.3.32",
"autoprefixer": "^9.4.2",
"babel-loader": "^8.0.4",
Expand All @@ -22,9 +20,12 @@
"bulma-switch": "^2.0.0",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^2.0.1",
"fable-babel-plugins": "^2.1.0",
"fable-compiler": "^2.1.11",
"fable-loader": "^2.1.2",
"fable-metadata": "^1.0.0-beta-002",
"fable-splitter": "^2.1.2",
"fable-web-worker": "^1.0.0-beta-001",
"file-loader": "^2.0.0",
"font-awesome": "^4.7.0",
"gh-pages": "^2.0.1",
Expand All @@ -45,11 +46,8 @@
"style-loader": "^0.23.1",
"webpack": "^4.27.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10",
"webpack-dev-server": "^3.1.14",
"workbox-webpack-plugin": "^3.6.3",
"worker-loader": "^2.0.0"
},
"dependencies": {
"fable-babel-plugins": "^2.1.0"
}
}
3 changes: 0 additions & 3 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ nuget Thoth.Json
nuget Thoth.Elmish.Toast
nuget Fable.PowerPack

github fable-compiler/Fable:master src/dotnet/Fable.Repl/Interfaces.fs
github fable-compiler/Fable:master src/dotnet/Fable.Repl/Metadata.fs

# REPL Lib
github fable-compiler/fable-import:browser-min Browser.Minimal/Fable.Import.Browser.fs

Expand Down
File renamed without changes.
Binary file removed public/metadata2/Dotnet.ProjInfo.Matthid.dll.txt
Binary file not shown.
Binary file removed public/metadata2/FSharp.Core.dll.txt
Binary file not shown.
Binary file removed public/metadata2/Fable.Core.dll.txt
Binary file not shown.
Binary file removed public/metadata2/Microsoft.CSharp.dll.txt
Binary file not shown.
Binary file removed public/metadata2/Microsoft.VisualBasic.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.AppContext.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Buffers.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Collections.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.ComponentModel.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Configuration.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Console.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Core.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Data.Common.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Data.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Diagnostics.Debug.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Diagnostics.Tools.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Drawing.Primitives.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Drawing.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Dynamic.Runtime.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Globalization.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.IO.Compression.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.IO.FileSystem.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.IO.IsolatedStorage.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.IO.Pipes.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.IO.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Linq.Expressions.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Linq.Parallel.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Linq.Queryable.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Linq.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.Http.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.HttpListener.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.Mail.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Net.Ping.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.Primitives.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.Requests.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.Security.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.ServicePoint.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.Sockets.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.WebClient.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Net.WebProxy.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Net.WebSockets.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Net.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Numerics.Vectors.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Numerics.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.ObjectModel.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Reflection.Emit.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Reflection.Metadata.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Reflection.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Resources.Reader.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Resources.Writer.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Runtime.Extensions.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Runtime.Handles.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Runtime.Loader.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Runtime.Numerics.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Runtime.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Security.Claims.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Security.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.ServiceModel.Web.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.ServiceProcess.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Text.Encoding.dll.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Threading.Tasks.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Threading.Thread.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Threading.Timer.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Threading.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Transactions.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.ValueTuple.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Web.HttpUtility.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Web.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Windows.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.Linq.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.ReaderWriter.dll.txt
Binary file not shown.
Binary file not shown.
Binary file removed public/metadata2/System.Xml.XDocument.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.XPath.XDocument.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.XPath.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.XmlDocument.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.XmlSerializer.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.Xml.dll.txt
Binary file not shown.
Binary file removed public/metadata2/System.dll.txt
Binary file not shown.
Binary file removed public/metadata2/WindowsBase.dll.txt
Binary file not shown.
Binary file removed public/metadata2/mscorlib.dll.txt
Binary file not shown.
Binary file removed public/metadata2/netstandard.dll.txt
Binary file not shown.
File renamed without changes.
8 changes: 3 additions & 5 deletions src/App/App.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\paket-files\fable-compiler\Fable\src\dotnet\Fable.Repl\Interfaces.fs">
<Paket>True</Paket>
<Link>paket-files/Interfaces.fs</Link>
</Compile>
<Compile Include="..\..\node_modules\fable-web-worker\src\Interfaces.fs" />
<Compile Include="..\..\node_modules\fable-web-worker\src\Shared.fs" />
<Compile Include="Libs/ReactDeviceDetect.fs" />
<Compile Include="Monaco.fs" />
<Compile Include="Shared.fs" />
<Compile Include="Prelude.fs" />
<Compile Include="Helpers.fs" />
<Compile Include="Editor.fs" />
<Compile Include="Generator.fs" />
Expand Down
6 changes: 3 additions & 3 deletions src/App/Editor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ open Fable.Core
open Fable.Core.JsInterop
open Fable.Import
open Fable.PowerPack
open Fable.Repl
open Fable.Standalone

//---------------------------------------------------
// Features providers
//---------------------------------------------------

/// **Description**
/// Convert `Fable.Repl.Glyph` type into the `Monaco.Languages.CompletionItemKind`
/// Convert `Fable.Standalone.Glyph` type into the `Monaco.Languages.CompletionItemKind`
/// **Parameters**
/// * `glyph` - parameter of type `Glyph`
///
Expand Down Expand Up @@ -49,7 +49,7 @@ let createCompletionProvider getCompletions =
let! completions = getCompletions position.lineNumber position.column lineText
return
completions
|> Array.map (fun (c: Fable.Repl.Completion) ->
|> Array.map (fun (c: Fable.Standalone.Completion) ->
jsOptions<Monaco.Languages.CompletionItem>(fun ci ->
ci.label <- c.Name
ci.kind <- convertGlyph c.Glyph
Expand Down
2 changes: 1 addition & 1 deletion src/App/Generator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Fable.Repl.Generator
open System.Text.RegularExpressions
open Fable.Core.JsInterop
open Fable.Import.Browser
open Shared
open Prelude

let defaultHtmlCode =
"""
Expand Down
18 changes: 12 additions & 6 deletions src/App/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ open Fulma.FontAwesome
open Fulma.Extensions
open Elmish
open Thoth.Elmish
open Shared
open Prelude
open Editor
open Mouse
open Thoth.Json
open Fable.PowerPack
open Fable.PowerPack.Fetch.Fetch_types
open Fable.WebWorker

type ISavedState =
abstract code: string
abstract html: string
abstract css: string

let private Worker(): Browser.Worker = importDefault "worker-loader!../Worker/Worker.fsproj"
let private Worker(): Browser.Worker =
// importDefault "worker-loader!../../../Fable/src/fable-web-worker/src/Worker.fsproj"
Browser.Worker.Create(Literals.WORKER_BUNDLE_URL)

let private loadState(_key: string): ISavedState = importMember "./js/util.js"
let private saveState(_key: string, _code: string, _html: string, _cssCode : string): unit = importMember "./js/util.js"
let private updateQuery(_fsharpCode : string, _htmlCode : string, _cssCode : string): unit = importMember "./js/util.js"
Expand Down Expand Up @@ -71,7 +75,7 @@ type Model =
IsProblemsPanelExpanded : bool
Logs : ConsolePanel.Log list }

type EndCompileStatus = Result<string * Fable.Repl.Error[], string>
type EndCompileStatus = Result<string * Fable.Standalone.Error[], string>

type Msg =
| SetFSharpEditor of IEditor
Expand All @@ -82,7 +86,7 @@ type Msg =
| GistLoaded of string*string*string
| LoadGistError of exn
| LoadGist of string
| MarkEditorErrors of Fable.Repl.Error[]
| MarkEditorErrors of Fable.Standalone.Error[]
| StartCompile of string option
| EndCompile of EndCompileStatus
| UpdateStats of CompileStats
Expand Down Expand Up @@ -450,8 +454,10 @@ let workerCmd (worker : ObservableWorker<_>)=
[ handler ]

let init () =
let worker = ObservableWorker(Worker(), WorkerAnswer.Decoder)

let worker = ObservableWorker(Worker() |> unbox, WorkerAnswer.Decoder, "MAIN APP")
CreateChecker(Literals.METADATA_DIR, Literals.EXTRA_REFS,
Some ".txt", Some Literals.REPL_LIB_MAP_JSON_URL)
|> worker.Post
let saved = loadState(Literals.STORAGE_KEY)
let sidebarModel, sidebarCmd = Sidebar.init ()
let cmd = Cmd.batch [
Expand Down
Loading

0 comments on commit 453d549

Please sign in to comment.