X Tutup
Skip to content

Commit 0e5737b

Browse files
committed
2 parents d503bd3 + 1001207 commit 0e5737b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1498
-1877
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v2
32-
- name: Use Node.js 15.14.0
32+
- name: Use Node.js 16.14.0
3333
uses: actions/setup-node@v1
3434
with:
3535
node-version: 16.14.0
@@ -59,16 +59,30 @@ jobs:
5959
uses: actions/checkout@v2
6060
with:
6161
path: commit
62-
- name: Use Node.js 12.13.1
62+
- name: Use Node.js 16.14.0
6363
uses: actions/setup-node@v1
6464
with:
6565
node-version: 16.14.0
6666
# NPM
67-
- name: NPM master
68-
run: npm ci && npm run build
67+
# install and build master
68+
- name: npm ci master
69+
run: npm ci
6970
working-directory: master
70-
- name: NPM commit
71-
run: npm ci && npm run build
71+
- name: Use local tstl language extensions
72+
run: npm i lua-types@latest && npm i -D file:.
73+
working-directory: master
74+
- name: Build master
75+
run: npm run build
76+
working-directory: master
77+
# install and build commit
78+
- name: npm ci commit
79+
run: npm ci
80+
working-directory: commit
81+
- name: Use local tstl language extensions
82+
run: npm i -D file:.
83+
working-directory: commit
84+
- name: Build commit
85+
run: npm run build
7286
working-directory: commit
7387
# Benchmark directory setup
7488
- name: Ensure benchmark data dir exists

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Use Node.js 12.13.1
14+
- name: Use Node.js 16.14.0
1515
uses: actions/setup-node@v1
1616
with:
1717
node-version: 16.14.0

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ yarn.lock
99

1010
benchmark/data/*
1111
benchmark/dist/*
12+
13+
# v8 cpu profiles
14+
*-.log
15+
*.cpuprofile

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 1.7.0
4+
5+
- Added support for `LuaMap` and `LuaSet` language extensions that translate to very low level Lua table operations. See [our docs](https://typescripttolua.github.io/docs/advanced/language-extensions/#luamap-and-luaset) for more information.
6+
- Big performance improvements, speeding up TSTL translation by 2-3x. Thanks @GlassBricks!
7+
- Reduced the use of temorary variables.
8+
- Moved tsconfig-schema into main TypeScriptToLua repository.
9+
- Added support for array options in tstl CLI.
10+
- Fixed bug where promise `then` was not correctly forwarding the result value to chained promises.
11+
- Fixed a bug causing false positive errors from jsdoc documentation comments.
12+
- Fixed various calling context bugs.
13+
314
## 1.6.0
415

516
- **[Breaking]** Upgraded TypeScript to 4.7

language-extensions/index.d.ts

Lines changed: 85 additions & 76 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 26 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-to-lua",
3-
"version": "1.6.3",
3+
"version": "1.7.1",
44
"description": "A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!",
55
"repository": "https://github.com/TypeScriptToLua/TypeScriptToLua",
66
"homepage": "https://typescripttolua.github.io/",
@@ -82,7 +82,7 @@
8282
"javascript-stringify": "^2.0.1",
8383
"jest": "^27.3.0",
8484
"jest-circus": "^27.3.0",
85-
"lua-types": "2.10.1",
85+
"lua-types": "^2.11.0",
8686
"lua-wasm-bindings": "^0.2.2",
8787
"prettier": "^2.3.2",
8888
"ts-jest": "^27.1.3",

src/CompilerOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export interface TypeScriptToLuaOptions {
3737
sourceMapTraceback?: boolean;
3838
tstlVerbose?: boolean;
3939
lua51AllowTryCatchInAsyncAwait?: boolean;
40+
measurePerformance?: boolean;
4041
}
4142

4243
export type CompilerOptions = OmitIndexSignature<ts.CompilerOptions> &

src/cli/parse.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export const optionDeclarations: CommandLineOption[] = [
9999
description: "Always allow try/catch in async/await functions for Lua 5.1.",
100100
type: "boolean",
101101
},
102+
{
103+
name: "measurePerformance",
104+
description: "Measure performance of the tstl compiler.",
105+
type: "boolean",
106+
},
102107
];
103108

104109
export function updateParsedConfigFile(parsedConfigFile: ts.ParsedCommandLine): ParsedCommandLine {

src/lualib-build/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { SourceNode } from "source-map";
22
import * as ts from "typescript";
33
import * as tstl from "..";
44
import * as path from "path";
5-
import { getUsedLuaLibFeatures } from "../transformation/utils/lualib";
65
import { LuaLibFeature, LuaLibModulesInfo, luaLibModulesInfoFileName, resolveRecursiveLualibFeatures } from "../LuaLib";
76
import { EmitHost, ProcessedFile } from "../transpilation/utils";
87
import {
@@ -72,7 +71,7 @@ class LuaLibPlugin implements tstl.Plugin {
7271
// Transpile file as normal with tstl
7372
const fileResult = context.superTransformNode(file)[0] as tstl.File;
7473

75-
const usedFeatures = new Set<tstl.LuaLibFeature>(getUsedLuaLibFeatures(context));
74+
const usedFeatures = new Set<tstl.LuaLibFeature>(context.usedLuaLibFeatures);
7675

7776
// Get all imports in file
7877
const importNames = new Set<string>();

0 commit comments

Comments
 (0)
X Tutup