This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fable-compiler/fable-arch
- Loading branch information
Showing
97 changed files
with
16,913 additions
and
3,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# fable-import-virtualdom | ||
|
||
Fable bindings for virtual-dom | ||
|
||
## Installation | ||
|
||
```sh | ||
$ npm install --save virtual-dom fable-core | ||
$ npm install --save-dev fable-arch | ||
``` | ||
|
||
## Usage | ||
|
||
### In an F# project (.fsproj) | ||
|
||
```xml | ||
<ItemGroup> | ||
<Reference Include="node_modules/fable-core/Fable.Core.dll" /> | ||
</ItemGroup> | ||
<Reference Include="Fable.Arch"> | ||
<HintPath>node_modules\fable-arch\Fable.Arch.dll</HintPath> | ||
</Reference> | ||
``` | ||
|
||
### In an F# script (.fsx) | ||
|
||
```fsharp | ||
#r "node_modules/fable-core/Fable.Core.dll" | ||
#r "node_modules\fable-arch\Fable.Arch.dll" | ||
open Fable.Core | ||
open Fable.Import | ||
open Fable.Arch | ||
open Fable.Arch.App | ||
open Fable.Arch.App.AppApi | ||
open Fable.Arch.Html | ||
``` | ||
|
||
### Rollup | ||
|
||
If you are using Rollup has the bundler you need to tell it how to bundle virtual-dom. | ||
|
||
Example: | ||
|
||
```json | ||
"rollup": { | ||
"dest": "public/bundle.js", | ||
"plugins": { | ||
"commonjs": { | ||
"namedExports": { | ||
"virtual-dom": [ "h", "create", "diff", "patch" ] | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### 0.10.0 | ||
|
||
* Implements `start` and `startAndExposeMessageSink` | ||
|
||
### 0.10.0-alpha.1 | ||
|
||
* Upgrade to Fable 0.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var path = require("path"); | ||
var fs = require("fs-extra"); | ||
var fable = require("fable-compiler"); | ||
// var fable = require("../Fable/build/fable"); | ||
|
||
var version; | ||
|
||
var targets = { | ||
all() { | ||
return fable.promisify(fs.remove, "npm") | ||
.then(_ => fable.compile({projFile: "src/Fable.Arch"})) | ||
.then(_ => fable.compile({projFile: "src/Fable.Arch", target: "umd"})) | ||
.then(_ => fable.promisify(fs.copy, "package.json", "npm/package.json")) | ||
.then(_ => fable.promisify(fs.copy, "README.md", "npm/README.md")) | ||
.then(_ => fable.promisify(fs.readFile, "RELEASE_NOTES.md")) | ||
.then(line => { | ||
version = /\d[^\s]*/.exec(line)[0]; | ||
return fable.runCommand("npm", "npm version " + version); | ||
}); | ||
}, | ||
publish() { | ||
return this.all() | ||
.then(_ => { | ||
var command = version && version.indexOf("alpha") > -1 | ||
? "npm publish --tag next" | ||
: "npm publish"; | ||
fable.runCommand("npm", command) | ||
}) | ||
} | ||
} | ||
|
||
targets[process.argv[2] || "all"]().catch(err => { | ||
console.log("[ERROR] " + err); | ||
process.exit(-1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FSharpLintSettings xmlns="https://github.com/fsprojects/FSharpLint/blob/master/ConfigurationSchema.xsd"> | ||
<IgnoreFiles Update="Overwrite"><![CDATA[assemblyinfo.* | ||
]]></IgnoreFiles> | ||
<Analysers> | ||
<NameConventions> | ||
<Rules> | ||
<IdentifiersMustNotContainUnderscores> | ||
<Enabled>False</Enabled> | ||
</IdentifiersMustNotContainUnderscores> | ||
</Rules> | ||
</NameConventions> | ||
</Analysers> | ||
</FSharpLintSettings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25420.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}" | ||
ProjectSection(SolutionItems) = preProject | ||
build.js = build.js | ||
index.html = index.html | ||
package.json = package.json | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public", "public", "{BDC2CBB4-EF50-4A9A-A738-0B2A82A621A3}" | ||
ProjectSection(SolutionItems) = preProject | ||
public\css\style.css = public\css\style.css | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scss", "scss", "{DF9E3093-65E8-4EB5-8870-21D1F3B554B8}" | ||
ProjectSection(SolutionItems) = preProject | ||
scss\main.sass = scss\main.sass | ||
EndProjectSection | ||
EndProject | ||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WebApp", "src\WebApp.fsproj", "{861B39F3-785E-45AB-90B4-3CC720C1EC0B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{861B39F3-785E-45AB-90B4-3CC720C1EC0B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const fable = require('fable-compiler'); | ||
|
||
const BUILD_DIR = "public" | ||
const JS_DIR = "js" | ||
const DEST_FILE = "bundle.js" | ||
const PKG_JSON = "package.json" | ||
const README = "README.md" | ||
const RELEASE_NOTES = "RELEASE_NOTES.md" | ||
const PROJ_FILE = "src/WebApp.fsproj" | ||
|
||
const fableconfig = { | ||
"babelPlugins": [ "transform-runtime" ], | ||
"projFile": PROJ_FILE, | ||
"rollup": { | ||
"dest": path.join(BUILD_DIR, JS_DIR, DEST_FILE), | ||
"plugins": { | ||
"commonjs": { | ||
"namedExports": { | ||
"virtual-dom": [ "h", "create", "diff", "patch" ] | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
const fableconfigDev = | ||
Object.assign({ | ||
"sourceMaps": true, | ||
"watch": true, | ||
"symbols": "DEV" | ||
}, fableconfig) | ||
|
||
const targets = { | ||
clean() { | ||
return fable.promisify(fs.remove, path.join(BUILD_DIR, JS_DIR)) | ||
}, | ||
build() { | ||
return this.clean() | ||
.then(_ => fable.compile(fableconfig)) | ||
}, | ||
dev() { | ||
return this.clean() | ||
.then(_ => fable.compile(fableconfigDev)) | ||
} | ||
} | ||
|
||
// As with FAKE scripts, run a default target if no one is specified | ||
targets[process.argv[2] || "build"]().catch(err => { | ||
console.log(err); | ||
process.exit(-1); | ||
}); |
Oops, something went wrong.