Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Commit d1576da

Browse files
authored
Merge pull request #1050 from glimmerjs/remove-unused
Remove unused and update eslint and prettier.
2 parents 1d8b7c7 + 494a95c commit d1576da

34 files changed

Lines changed: 2993 additions & 4471 deletions

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = {
2020
tryExtensions: ['.js', '.ts', '.d.ts'],
2121
},
2222
},
23+
ignorePatterns: ['dist', 'ts-dist', 'node_modules', 'tmp'],
2324
rules: {
2425
// disabled because we still have a few commented tests
2526
'qunit/no-commented-tests': 'off',
@@ -186,6 +187,12 @@ module.exports = {
186187
'@typescript-eslint/no-unused-vars': 'error',
187188
},
188189
overrides: [
190+
{
191+
files: ['**/*.d.ts'],
192+
rules: {
193+
'no-useless-constructor': 'off',
194+
},
195+
},
189196
// node files
190197
{
191198
files: [

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ branches:
66

77
language: node_js
88
node_js:
9-
- 8
9+
- 10
1010

1111
cache: yarn
1212

.vscode/tslint-formatters/vscodeFormatter.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

build/broccoli/build-packages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function transpileCommonJS(pkgName, esVersion, tree) {
173173
},
174174
},
175175
],
176-
'transform-es2015-modules-commonjs',
176+
'@babel/plugin-transform-modules-commonjs',
177177
],
178178
sourceMaps: 'inline',
179179
};

build/broccoli/build-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function transpileNodeTestsToCommonJS(jsTree) {
5151

5252
return babel(testTree, {
5353
sourceMaps: 'inline',
54-
plugins: ['transform-es2015-modules-commonjs'],
54+
plugins: ['@babel/plugin-transform-modules-commonjs'],
5555
});
5656
}
5757

build/broccoli/strip-glimmer-utilities.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,29 @@ function stripFlags(glimmerUtils) {
5252
},
5353
},
5454
]);
55-
5655
glimmerUtils.push([
5756
nuke,
5857
{
5958
source: '@glimmer/debug',
6059
delegate: removeLogging,
6160
},
61+
'nuke-debug-logging',
62+
]);
63+
glimmerUtils.push([nuke, { source: '@glimmer/debug' }, 'nuke-debug']);
64+
glimmerUtils.push([nuke, { source: '@glimmer/vm/lib/-debug-strip' }, 'nuke-vm-debug-strip']);
65+
glimmerUtils.push([
66+
nuke,
67+
{ source: '@glimmer/runtime/lib/compiled/opcodes/-debug-strip' },
68+
'nuke-opcodes-debug-strip',
6269
]);
63-
glimmerUtils.push([nuke, { source: '@glimmer/debug' }]);
64-
glimmerUtils.push([nuke, { source: '@glimmer/vm/lib/-debug-strip' }]);
65-
glimmerUtils.push([nuke, { source: '@glimmer/runtime/lib/compiled/opcodes/-debug-strip' }]);
66-
glimmerUtils.push([nuke, { source: './-debug-strip' }]);
70+
glimmerUtils.push([nuke, { source: './-debug-strip' }, 'nuke-debug-strip']);
6771
glimmerUtils.push([
6872
nuke,
6973
{
7074
source: '@glimmer/vm',
7175
delegate: removeMetaData,
7276
},
77+
'nuke-vm-metadata',
7378
]);
7479
}
7580

build/broccoli/transpile-to-es5.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ const PRODUCTION = process.env.EMBER_ENV === 'production';
99
* Transpiles a tree of ES2015+ JavaScript files to ES5 with Babel.
1010
*/
1111
module.exports = function transpileToES5(inputNode, modules = false) {
12-
let plugins = [
13-
// Required for tests to pass in IE <=10, which rely on inheritance of
14-
// static class methods. This doesn't work in IE 10 and below so we
15-
// statically copy properties off __proto__ at class definition time.
16-
'transform-proto-to-assign',
17-
];
12+
let plugins = [];
1813

1914
if (!PRODUCTION) {
2015
// Compile out @glimmer/env for tests
@@ -33,24 +28,32 @@ module.exports = function transpileToES5(inputNode, modules = false) {
3328
]);
3429
}
3530

36-
return babel(inputNode, {
31+
const options = {
3732
annotation: 'Babel - ES5',
3833
sourceMaps: 'inline',
39-
moduleIds: true,
4034
presets: [
4135
[
42-
'env',
36+
'@babel/preset-env',
4337
{
4438
loose: true,
4539
modules,
4640
exclude: [
4741
// Transforms all `typeof` checks to account for Symbol, which we don't
4842
// rely on, so can safely skip.
49-
'transform-es2015-typeof-symbol',
43+
'@babel/plugin-transform-typeof-symbol',
5044
],
5145
},
5246
],
5347
],
5448
plugins,
55-
});
49+
};
50+
51+
if (modules === 'amd') {
52+
const ensurePosix = require('ensure-posix-path');
53+
const path = require('path');
54+
options.moduleIds = true;
55+
options.getModuleId = modulePath => ensurePosix(path.relative(process.cwd(), modulePath));
56+
}
57+
58+
return babel(inputNode, options);
5659
};

package.json

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@
33
"version": "0.47.9",
44
"private": true,
55
"description": "Glimmer compiles Handlebars templates into document fragments rather than string buffers",
6-
"license": "MIT",
7-
"author": "Tilde, Inc.",
86
"repository": {
97
"type": "git",
108
"url": "https://github.com/glimmerjs/glimmer-vm.git"
119
},
10+
"license": "MIT",
11+
"author": "Tilde, Inc.",
12+
"workspaces": [
13+
"packages/*/*"
14+
],
1215
"scripts": {
16+
"browserstack:connect": "ember browserstack:connect",
17+
"browserstack:disconnect": "ember browserstack:disconnect",
18+
"browserstack:results": "ember browserstack:results",
1319
"build": "ember build --env production --suppress-sizes",
1420
"build:flags": "RETAIN_FLAGS=true ember build --env production --suppress-sizes",
1521
"build:typecheck": "tsc -p tsconfig.json --noEmit --pretty false",
1622
"changelog": "lerna-changelog",
17-
"browserstack:connect": "ember browserstack:connect",
18-
"browserstack:disconnect": "ember browserstack:disconnect",
19-
"browserstack:results": "ember browserstack:results",
23+
"eslint": "eslint . --cache --ext .js,.ts",
24+
"link:local": "node bin/yarn-link-local",
25+
"problems": "tsc -p tsconfig.json --noEmit --pretty false",
2026
"start": "ember serve --port=7357",
2127
"test": "ember test",
2228
"test:browserstack": "ember test --test-port=7774 --host 127.0.0.1 --config-file=testem-browserstack.js",
2329
"test:node": "node bin/run-qunit.js",
24-
"test:types": "node bin/run-types-tests.js",
2530
"test:smoke": "SMOKE_TESTS=true ember test",
26-
"eslint": "eslint . --cache --ext .js,.ts",
27-
"problems": "tsc -p tsconfig.json --noEmit --pretty false",
31+
"test:types": "node bin/run-types-tests.js",
2832
"yarn:link": "node bin/yarn-link-all",
29-
"yarn:unlink": "node bin/yarn-link-all --unlink",
30-
"link:local": "node bin/yarn-link-local"
33+
"yarn:unlink": "node bin/yarn-link-all --unlink"
3134
},
3235
"dependencies": {
3336
"@simple-dom/document": "^1.4.0",
@@ -39,56 +42,56 @@
3942
"simple-html-tokenizer": "^0.5.9"
4043
},
4144
"devDependencies": {
45+
"@babel/core": "^7.8.4",
46+
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
47+
"@babel/preset-env": "^7.8.4",
4248
"@glimmer/env": "0.1.7",
49+
"@types/node": "^13.7.4",
4350
"@types/qunit": "^2.0.31",
44-
"@typescript-eslint/eslint-plugin": "^2.2.0",
45-
"@typescript-eslint/parser": "^2.2.0",
51+
"@typescript-eslint/eslint-plugin": "^2.20.0",
52+
"@typescript-eslint/parser": "^2.20.0",
4653
"amd-name-resolver": "^1.3.1",
4754
"auto-dist-tag": "^1.0.0",
4855
"babel-plugin-nukable-import": "^0.4.2",
4956
"babel-plugin-strip-glimmer-utils": "^0.1.1",
50-
"babel-plugin-transform-proto-to-assign": "^6.23.0",
51-
"babel-preset-env": "^1.6.0",
52-
"benchmark": "^1.0.0",
53-
"broccoli-babel-transpiler": "^6.1.2",
54-
"broccoli-concat": "^2.1.0",
57+
"broccoli-babel-transpiler": "^7.4.0",
58+
"broccoli-concat": "^3.7.5",
5559
"broccoli-debug": "^0.6.5",
56-
"broccoli-file-creator": "^1.1.1",
57-
"broccoli-funnel": "^2.0.1",
60+
"broccoli-file-creator": "^2.1.1",
61+
"broccoli-funnel": "^2.0.2",
5862
"broccoli-merge-trees": "^3.0.2",
59-
"broccoli-persistent-filter": "^2.1.1",
63+
"broccoli-persistent-filter": "^2.3.1",
6064
"broccoli-plugin": "^3.1.0",
61-
"broccoli-rollup": "^2.0.0",
62-
"broccoli-source": "^1.1.0",
65+
"broccoli-rollup": "^4.1.1",
66+
"broccoli-source": "^3.0.0",
6367
"broccoli-typescript-compiler": "^4.2.0",
6468
"chalk": "^3.0.0",
6569
"dag-map": "^2.0.2",
66-
"ember-cli": "~3.6.1",
70+
"ember-cli": "~3.16.0",
6771
"ember-cli-browserstack": "^1.0.1",
68-
"ember-cli-release": "^1.0.0-beta.2",
69-
"eslint": "^5.10.0",
70-
"eslint-config-prettier": "^6.3.0",
72+
"ensure-posix-path": "^1.1.1",
73+
"eslint": "^6.8.0",
74+
"eslint-config-prettier": "^6.10.0",
7175
"eslint-plugin-node": "^11.0.0",
72-
"eslint-plugin-prettier": "^3.1.0",
76+
"eslint-plugin-prettier": "^3.1.2",
7377
"eslint-plugin-qunit": "^4.0.0",
74-
"execa": "^3.4.0",
78+
"execa": "^1.0.0",
7579
"glob": "^7.0.5",
7680
"js-yaml": "^3.10.0",
7781
"lerna-changelog": "^0.8.2",
7882
"loader.js": "^4.0.10",
7983
"mkdirp": "^0.5.1",
80-
"prettier": "^1.18.2",
81-
"qunit": "^2.9.1",
84+
"prettier": "^1.19.1",
85+
"qunit": "^2.9.3",
8286
"qunit-tap": "^1.5.1",
83-
"rimraf": "^2.6.1",
84-
"rollup-plugin-sourcemaps": "^0.4.2",
85-
"semver": "^5.3.0",
87+
"rimraf": "^2.7.1",
88+
"rollup": "^1.31.1",
89+
"rollup-plugin-sourcemaps": "^0.5.0",
90+
"semver": "^6.3.0",
8691
"testem-failure-only-reporter": "^0.0.1",
87-
"toml": "^2.3.3"
92+
"toml": "^3.0.0",
93+
"typescript": "3.5.3"
8894
},
89-
"workspaces": [
90-
"packages/*/*"
91-
],
9295
"changelog": {
9396
"repo": "glimmerjs/glimmer-vm",
9497
"labels": {

packages/@glimmer/compiler/lib/javascript-compiler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ export default class JavaScriptCompiler implements Processor<JavaScriptCompilerO
276276
} else if (inverse === null) {
277277
namedBlocks = [['default'], [blocks[template]]];
278278
} else {
279-
namedBlocks = [['default', 'else'], [blocks[template], blocks[inverse]]];
279+
namedBlocks = [
280+
['default', 'else'],
281+
[blocks[template], blocks[inverse]],
282+
];
280283
}
281284

282285
// assert(head[]);

packages/@glimmer/compiler/test/compiler-test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ test('HTML text content', 'content', s`content`);
5959

6060
test('Text curlies', '<div>{{title}}<span>{{title}}</span></div>', [
6161
'<div>',
62-
[[Append, '^title'], ['<span>', [[Append, '^title']]]],
62+
[
63+
[Append, '^title'],
64+
['<span>', [[Append, '^title']]],
65+
],
6366
]);
6467

6568
test(

0 commit comments

Comments
 (0)