Skip to content

Commit 55e3dbd

Browse files
committed
build: update dependency to latest v13 release and fix errors
The latest v13 release of the language service removes the option to disable Ivy from the `PluginConfig`. This commit also removes it from the session configuration, but does not add a workaround to continue supporting View Engine. That will need to be done before the v13 release. In addition, the `esModuleInterop` option was enabled, which matches the angular/angular repo. This addresses another build issue due to default import/exports.
1 parent f18b5ac commit 55e3dbd

File tree

10 files changed

+44
-26
lines changed

10 files changed

+44
-26
lines changed

integration/lsp/ivy_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ describe('Angular Ivy language server', () => {
180180
}))!;
181181
expect(response).not.toBeNull();
182182
expect(response.signatures.length).toEqual(1);
183-
expect(response.signatures[0].label).toEqual('toString(): string');
183+
expect(response.signatures[0].label).toEqual('(): string');
184184
});
185185

186186
it('should show signature help with multiple arguments', async () => {
@@ -203,7 +203,7 @@ describe('Angular Ivy language server', () => {
203203
expect(response).not.toBeNull();
204204
expect(response.signatures.length).toEqual(1);
205205
expect(response.signatures[0].label)
206-
.toEqual('substr(from: number, length?: number | undefined): string');
206+
.toEqual('(from: number, length?: number | undefined): string');
207207
expect(response.signatures[0].parameters).not.toBeUndefined();
208208
expect(response.activeParameter).toBe(1);
209209

integration/lsp/viewengine_spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {APP_COMPONENT, FOO_TEMPLATE} from '../test_constants';
1313

1414
import {createConnection, initializeServer, openTextDocument} from './test_utils';
1515

16-
describe('Angular language server', () => {
16+
// TODO(atscott): re-enable when we have a solution in place to continue to support View Engine
17+
xdescribe('Angular language server', () => {
1718
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; /* 10 seconds */
1819

1920
let client: MessageConnection;

integration/tsconfig.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../dist/integration",
5-
"rootDirs": ["..", "dist"]
5+
"rootDirs": [
6+
"..",
7+
"dist"
8+
]
69
},
710
"references": [
8-
{ "path": "../server/tsconfig.json" }
11+
{
12+
"path": "../server/tsconfig.json"
13+
}
914
],
1015
"include": [
1116
"test_constants.ts",
1217
"e2e",
1318
"lsp"
1419
]
15-
}
20+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
"test:syntaxes": "yarn compile:syntaxes-test && yarn build:syntaxes && jasmine dist/syntaxes/test/driver.js"
184184
},
185185
"dependencies": {
186-
"@angular/language-service": "13.0.0-next.3",
186+
"@angular/language-service": "13.0.0-next.12",
187187
"typescript": "4.4.3",
188188
"vscode-jsonrpc": "6.0.0",
189189
"vscode-languageclient": "7.0.0",

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"ngserver": "./bin/ngserver"
1616
},
1717
"dependencies": {
18-
"@angular/language-service": "13.0.0-next.3",
18+
"@angular/language-service": "13.0.0-next.12",
1919
"vscode-jsonrpc": "6.0.0",
2020
"vscode-languageserver": "7.0.0",
2121
"vscode-uri": "3.0.2"

server/src/session.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {isNgLanguageService, NgLanguageService, PluginConfig} from '@angular/language-service/api';
10-
import * as assert from 'assert';
1110
import * as ts from 'typescript/lib/tsserverlibrary';
1211
import {promisify} from 'util';
1312
import * as lsp from 'vscode-languageserver/node';
@@ -146,12 +145,13 @@ export class Session {
146145
}
147146
});
148147

148+
// TODO(atscott): The Ivy flag was removed in v13. We need to include a legacy version (some
149+
// v12) of the language service in order to continue supporting view engine.
149150
const pluginConfig: PluginConfig = {
150151
angularOnly: true,
151-
ivy: options.ivy,
152152
};
153153
if (options.host.isG3) {
154-
assert(options.ivy === true, 'Ivy LS must be used in google3');
154+
options.ivy = true;
155155
pluginConfig.forceStrictTemplates = true;
156156
}
157157
projSvc.configurePlugin({

server/src/tests/tsconfig.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../../dist/server/tests"
4+
"outDir": "../../../dist/server/tests",
5+
"esModuleInterop": false
56
},
67
"references": [
7-
{ "path": "../../tsconfig.json" }
8+
{
9+
"path": "../../tsconfig.json"
10+
}
811
],
9-
"include": ["*.ts"]
10-
}
12+
"include": [
13+
"*.ts"
14+
]
15+
}

server/src/version_provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import * as path from 'path';
1111

1212
import {NodeModule, resolve, Version} from '../common/resolver';
1313

14-
const MIN_TS_VERSION = '4.2';
15-
const MIN_NG_VERSION = '12.0';
14+
const MIN_TS_VERSION = '4.3';
15+
const MIN_NG_VERSION = '13.0';
1616
const TSSERVERLIB = 'typescript/lib/tsserverlibrary';
1717

1818
/**

tsconfig.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
"module": "commonjs",
55
"moduleResolution": "node",
66
"sourceMap": true,
7-
"strict": true
7+
"strict": true,
8+
"esModuleInterop": true
89
},
910
"files": [],
1011
"references": [
11-
{ "path": "./client" },
12-
{ "path": "./server" },
13-
{ "path": "./syntaxes" }
12+
{
13+
"path": "./client"
14+
},
15+
{
16+
"path": "./server"
17+
},
18+
{
19+
"path": "./syntaxes"
20+
}
1421
]
15-
}
22+
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
yaml "^1.10.0"
5353
yargs "^17.0.0"
5454

55-
"@angular/[email protected].3":
56-
version "13.0.0-next.3"
57-
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-13.0.0-next.3.tgz#80aa3c0f0c1bfeabb04b11ba1a889461f0979cfc"
58-
integrity sha512-etqLlMX0twVI2lZZhS4Kt3gEOmqq4FiAXEMSmpklJaXqKa4qVUrOqjgkNeAXr3vw/d/Knb4DVn7AQiIUoNNLgg==
55+
"@angular/[email protected].12":
56+
version "13.0.0-next.12"
57+
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-13.0.0-next.12.tgz#e080fc9e58af9267d9c97abad15dbef4b8c0ea18"
58+
integrity sha512-YUF/XsQ192tycaOzhYuTWwMx299zIGxENqQ1AVf8rp1TNnfr6csh+7LJ42j60MN44FmYXnIrVRV2+fp3jfhyBA==
5959

6060
"@babel/code-frame@^7.0.0":
6161
version "7.12.13"

0 commit comments

Comments
 (0)