Skip to content

Commit

Permalink
Remove --typescript support
Browse files Browse the repository at this point in the history
`--typescript` was introduced in Fable 3 for the beta typescript support.

However, with Fable 4 `--lang <target>` is now the official way of selecting the target language
  • Loading branch information
Maxime Mangel committed Aug 16, 2023
1 parent f73a945 commit d6f15a5
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/Fable.Cli/Entry.fs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ let knownCliArgs() = [
["--printAst"], []
["--noReflection"], []
["--noParallelTypeCheck"], []
["--typescript"], []
["--trimRootModule"], []
["--fableLib"], []
["--replace"], []
Expand Down Expand Up @@ -147,7 +146,6 @@ Arguments:

let argLanguage (args: CliArgs) =
args.Value("--lang", "--language")
|> Option.orElseWith (fun () -> if args.FlagEnabled("--typescript") then Some "ts" else None) // Compatibility with "--typescript"
|> Option.map (fun lang ->
let lang = lang.ToLower()

Expand Down
1 change: 1 addition & 0 deletions src/Fable.Cli/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Improve --help message for the --lang section
* Fix #3464: Invalidate cache when the target language changes
* Always delete the `fable_modules` folder when the cache is invalidated
* Remove `--typescript` options support, use `--lang <target>` instead

### 4.1.4

Expand Down
4 changes: 4 additions & 0 deletions src/fable-compiler-js/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Unreleased

* Remove `--typescript` options support, use `--lang <target>` instead

### 3.0.1

* Reduced package dependencies
Expand Down
2 changes: 0 additions & 2 deletions src/fable-compiler-js/src/app.fs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ let run opts projectFileName outDir =
sourceMaps = (opts |> hasFlag "--sourceMaps") || (opts |> hasFlag "-s")
typedArrays = opts |> tryFlag "--typedArrays"
language = opts |> argValue ["--language"; "--lang"]
|> Option.orElse (tryFlag "--typescript" opts
|> Option.map (fun _ -> "TypeScript"))
|> Option.defaultValue "JavaScript"
printAst = opts |> hasFlag "--printAst"
Expand All @@ -297,7 +296,6 @@ Options:
--typedArrays Compile numeric arrays as JS typed arrays (default is true for JS, false for TS)
--run Execute the script after compilation
--typescript Compile to TypeScript (experimental)
--optimize Compile with optimized F# AST (experimental)
"""

Expand Down
4 changes: 4 additions & 0 deletions src/fable-standalone/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Unreleased

* Remove `--typescript` options support, use `--lang <target>` instead

### 3.2.11

* Enable Fable.Repl.Lib
Expand Down
1 change: 0 additions & 1 deletion src/fable-standalone/src/Worker/Worker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ let private compileCode fable fileName fsharpNames fsharpCodes language otherFSh
let nonFSharpOptions = set [
"--typedArrays"
"--clampByteArrays"
"--typescript"
"--sourceMaps"
]
let fableOptions, otherFSharpOptions =
Expand Down
2 changes: 0 additions & 2 deletions src/fable-standalone/test/bench-compiler/app.fs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ let run opts projectFileName outDir =
sourceMaps = (opts |> hasFlag "--sourceMaps") || (opts |> hasFlag "-s")
typedArrays = opts |> tryFlag "--typedArrays"
language = opts |> argValue ["--language"; "--lang"]
|> Option.orElse (tryFlag "--typescript" opts
|> Option.map (fun _ -> "TypeScript"))
|> Option.defaultValue "JavaScript"
printAst = opts |> hasFlag "--printAst"
Expand All @@ -281,7 +280,6 @@ Options:
--typedArrays Compile numeric arrays as JS typed arrays (default is true for JS, false for TS)
--run Execute the script after compilation
--typescript Compile to TypeScript (experimental)
--optimize Compile with optimized F# AST (experimental)
"""

Expand Down
8 changes: 4 additions & 4 deletions src/fable-standalone/test/bench-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@
"prebuild-lib": "npm run tsc -- -p ../../../fable-library --outDir ./out-lib",
"prebuild-lib-ts": "mkdir -p out-lib-ts && cp -r ../../../fable-library/*.ts out-lib-ts && cp -r ../../../fable-library/lib out-lib-ts",
"build-lib": "dotnet run -c Release ../../../fable-library/Fable.Library.fsproj out-lib --fableLib out-lib --sourceMaps",
"build-lib-ts": "dotnet run -c Release ../../../fable-library/Fable.Library.fsproj out-lib-ts --fableLib out-lib-ts --typescript",
"build-lib-ts": "dotnet run -c Release ../../../fable-library/Fable.Library.fsproj out-lib-ts --fableLib out-lib-ts --lang typescript",
"tsc-lib-init": "npm run tsc -- --init --target es2020 --module es2020 --allowJs",
"tsc-lib": "npm run tsc -- -p ./out-lib-ts --outDir ./out-lib-js",

"prebuild-test": "npm run clean && npm run build-lib",
"prebuild-test-ts": "npm run clean && npm run build-lib-ts",
"build-test": "dotnet run -c Release ../../../../../fable-test/fable-test.fsproj out-test --fableLib out-lib --sourceMaps",
"build-test-ast": "dotnet run -c Release ../../../../../fable-test/fable-test.fsproj out-test --fableLib out-lib --printAst",
"build-test-ts": "dotnet run -c Release ../../../../../fable-test/fable-test.fsproj out-test-ts --fableLib out-lib-ts --typescript",
"build-test-ts": "dotnet run -c Release ../../../../../fable-test/fable-test.fsproj out-test-ts --fableLib out-lib-ts --lang typescript",
"build-test-opt": "npm run build-test -- --optimize",
"build-test-node": "node out-node/app.js ../../../../../fable-test/fable-test.fsproj out-test --fableLib out-lib --sourceMaps",
"build-test-node-ts": "npm run build-test-node --typescript",
"build-test-node-ts": "npm run build-test-node --lang typescript",
"postbuild-test-ts": "cp tsconfig.json out-test-ts && npm run tsc -- -p out-test-ts --outDir out-test-js",
"test": "node ./out-test/src/test.js",

"prebuild-tests": "npm run clean && npm run build-lib",
"prebuild-tests-ts": "npm run clean && npm run build-lib-ts",
"build-tests": "dotnet run -c Release ../../../../tests/Js/Main/Fable.Tests.fsproj out-tests --fableLib out-lib --sourceMaps",
"build-tests-ts": "npm run build-tests -- --fableLib out-lib-ts --typescript",
"build-tests-ts": "npm run build-tests -- --fableLib out-lib-ts --lang typescript",
"build-tests-opt": "npm run build-tests -- --optimize",
"build-tests-node": "node out-node/app.js ../../../../tests/Js/Main/Fable.Tests.fsproj out-tests --fableLib out-lib --sourceMaps",
"tests": "npm run mocha -- out-tests --colors --reporter dot",
Expand Down
1 change: 0 additions & 1 deletion src/fable-standalone/test/bench-compiler/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function main() {
commonjs: process.argv.find(v => v === "--commonjs") != null,
sourceMaps: process.argv.find(v => v === "--sourceMaps") != null,
classTypes: process.argv.find(v => v === "--classTypes") != null,
typescript: process.argv.find(v => v === "--typescript") != null,
};

const babelOptions = options.commonjs ?
Expand Down

0 comments on commit d6f15a5

Please sign in to comment.