Skip to content

Commit 36c8449

Browse files
authored
Revert "Upgrade to TypeScript 4.8.4. (#6082)" (#6087)
This reverts commit abb4dfc. It breaks the sync to the internal repo.
1 parent abb4dfc commit 36c8449

File tree

7 files changed

+32
-20
lines changed

7 files changed

+32
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"prettier-plugin-organize-imports": "2.3.4",
6262
"requirejs": "^2.3.6",
6363
"tslib": "^2.3.0",
64-
"typescript": "4.8.4",
64+
"typescript": "4.7.4",
6565
"yarn-deduplicate": "^5.0.0"
6666
},
6767
"dependencies": {

tensorboard/components/tf_paginated_view/tf-category-paginated-view.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import {
2828
import {TfDomRepeat} from './tf-dom-repeat';
2929

3030
@customElement('tf-category-paginated-view')
31-
class TfCategoryPaginatedView<
32-
CategoryItem extends {}
33-
> extends TfDomRepeat<CategoryItem> {
31+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
32+
// TS2344: Type 'CategoryItem' does not satisfy the constraint '{}'.
33+
class TfCategoryPaginatedView<CategoryItem> extends TfDomRepeat<CategoryItem> {
3434
static readonly template = html`
3535
<template is="dom-if" if="[[_paneRendered]]" id="ifRendered">
3636
<button class="heading" on-tap="_togglePane" open-button$="[[opened]]">

tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,12 @@ class TfGraphControls extends LegacyElementMixin(
12711271
_deviceCheckboxClicked(event: Event) {
12721272
// Update the device map.
12731273
const input = event.target as HTMLInputElement;
1274+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
1275+
// TS2322: Type 'object' is not assignable to type 'DeviceForStats'.
12741276
const devicesForStats: DeviceForStats = Object.assign(
12751277
{},
12761278
this.devicesForStats
1277-
) as DeviceForStats;
1279+
);
12781280
const device = input.value;
12791281
if (input.checked) {
12801282
devicesForStats[device] = true;

tensorboard/webapp/persistent_settings/_data_source/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export declare interface BackendSettings {
3737
notificationLastReadTimeInMs?: number;
3838
sideBarWidthInPercent?: number;
3939
timeSeriesSettingsPaneOpened?: boolean;
40-
timeSeriesCardMinWidth?: number | null;
40+
timeSeriesCardMinWidth?: number;
4141
stepSelectorEnabled?: boolean;
4242
rangeSelectionEnabled?: boolean;
4343
linkedTimeEnabled?: boolean;
@@ -59,7 +59,7 @@ export interface PersistableSettings {
5959
notificationLastReadTimeInMs?: number;
6060
sideBarWidthInPercent?: number;
6161
timeSeriesSettingsPaneOpened?: boolean;
62-
timeSeriesCardMinWidth?: number | null;
62+
timeSeriesCardMinWidth?: number;
6363
stepSelectorEnabled?: boolean;
6464
rangeSelectionEnabled?: boolean;
6565
linkedTimeEnabled?: boolean;

tensorboard/webapp/persistent_settings/persistent_settings_config_module.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ import {
1717
GLOBAL_PERSISTENT_SETTINGS_TOKEN,
1818
SettingSelector,
1919
} from './persistent_settings_config_types';
20-
import {PersistableSettings} from './_data_source/types';
2120

2221
@NgModule()
23-
export class PersistentSettingsConfigModule<
24-
State,
25-
Settings extends PersistableSettings
26-
> {
22+
export class PersistentSettingsConfigModule<State, Settings> {
23+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
24+
// TS2344: Type 'Settings' does not satisfy the constraint
25+
// 'PersistableSettings'.
2726
private readonly globalSettingSelectors: SettingSelector<State, Settings>[] =
2827
[];
2928

3029
constructor(
3130
@Optional()
3231
@Inject(GLOBAL_PERSISTENT_SETTINGS_TOKEN)
3332
globalSettingSelectorFactories: Array<
33+
// @ts-ignore(go/ts48upgrade) Fix code and remove this
34+
// comment. Error: TS2344: Type 'Settings' does not satisfy
35+
// the constraint 'PersistableSettings'.
3436
() => SettingSelector<State, Settings>
3537
> | null
3638
) {
@@ -45,6 +47,9 @@ export class PersistentSettingsConfigModule<
4547
/**
4648
* Returns Ngrx selectors for getting global setting values.
4749
*/
50+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
51+
// TS2344: Type 'Settings' does not satisfy the constraint
52+
// 'PersistableSettings'.
4853
getGlobalSettingSelectors(): SettingSelector<State, Settings>[] {
4954
return this.globalSettingSelectors ?? [];
5055
}
@@ -72,7 +77,10 @@ export class PersistentSettingsConfigModule<
7277
* })
7378
* export class MyModule {}
7479
*/
75-
static defineGlobalSetting<State, Settings extends PersistableSettings>(
80+
static defineGlobalSetting<State, Settings>(
81+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
82+
// TS2344: Type 'Settings' does not satisfy the constraint
83+
// 'PersistableSettings'.
7684
selectorFactory: () => SettingSelector<State, Settings>
7785
): ModuleWithProviders<PersistentSettingsConfigModule<any, {}>> {
7886
return {

tensorboard/webapp/testing/lang.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ limitations under the License.
1616
* Recursively freezes an object and all of its fields. The given object is
1717
* assumed not to have reference loops.
1818
*/
19-
export function deepFreeze<T extends {}>(obj: T): T {
19+
export function deepFreeze<T>(obj: T): T {
20+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
21+
// TS2769: No overload matches this call.
2022
for (const val of Object.values(obj)) {
2123
if (val && typeof val === 'object') {
2224
deepFreeze(val);

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9843,16 +9843,16 @@ typed-assert@^1.0.8:
98439843
resolved "https://registry.yarnpkg.com/typed-assert/-/typed-assert-1.0.9.tgz#8af9d4f93432c4970ec717e3006f33f135b06213"
98449844
integrity sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==
98459845

9846-
[email protected], typescript@^4.6.2, typescript@~4.8.0:
9847-
version "4.8.4"
9848-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
9849-
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
9850-
9851-
typescript@~4.7.4:
9846+
[email protected], typescript@~4.7.4:
98529847
version "4.7.4"
98539848
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
98549849
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
98559850

9851+
typescript@^4.6.2, typescript@~4.8.0:
9852+
version "4.8.4"
9853+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
9854+
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
9855+
98569856
98579857
version "4.1.0"
98589858
resolved "https://registry.yarnpkg.com/typesettable/-/typesettable-4.1.0.tgz#9dc4f539fabad7db4de2c3b08e286ff72a60f038"

0 commit comments

Comments
 (0)