From 76cd0a0761c48008a668476bd2b47f88d2e754e6 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Wed, 23 Apr 2025 18:19:41 +0000 Subject: [PATCH] fix(google-maps): implicitly include google.maps types instead of the triple slash workaround Previously, due to an issue with the rules_nodejs toolchain we had to include the google.maps namespace types via a triple slash comment with preserve set to true, this changes to instead include the types in the tsconfig as normal --- src/google-maps/BUILD.bazel | 10 ++++++++++ .../deprecated-map-marker-clusterer.ts | 3 --- src/google-maps/google-map/google-map.ts | 3 --- .../map-advanced-marker/map-advanced-marker.ts | 3 --- src/google-maps/map-anchor-point.ts | 3 --- src/google-maps/map-base-layer.ts | 3 --- .../map-bicycling-layer/map-bicycling-layer.ts | 3 --- src/google-maps/map-circle/map-circle.ts | 3 --- .../map-directions-renderer/map-directions-renderer.ts | 3 --- .../map-directions-renderer/map-directions-service.ts | 3 --- src/google-maps/map-geocoder/map-geocoder.ts | 3 --- .../map-ground-overlay/map-ground-overlay.ts | 3 --- src/google-maps/map-heatmap-layer/map-heatmap-layer.ts | 3 --- src/google-maps/map-info-window/map-info-window.ts | 3 --- src/google-maps/map-kml-layer/map-kml-layer.ts | 3 --- .../map-marker-clusterer/map-marker-clusterer.ts | 3 --- src/google-maps/map-marker/map-marker.ts | 3 --- src/google-maps/map-polygon/map-polygon.ts | 3 --- src/google-maps/map-polyline/map-polyline.ts | 3 --- src/google-maps/map-rectangle/map-rectangle.ts | 3 --- src/google-maps/map-traffic-layer/map-traffic-layer.ts | 3 --- src/google-maps/map-transit-layer/map-transit-layer.ts | 3 --- src/google-maps/tsconfig-build.json | 6 ++++++ src/google-maps/tsconfig.json | 2 +- 24 files changed, 17 insertions(+), 64 deletions(-) create mode 100644 src/google-maps/tsconfig-build.json diff --git a/src/google-maps/BUILD.bazel b/src/google-maps/BUILD.bazel index abb9dc8aeb32..c79130b26ced 100644 --- a/src/google-maps/BUILD.bazel +++ b/src/google-maps/BUILD.bazel @@ -15,6 +15,15 @@ rules_js_tsconfig( ], ) +rules_js_tsconfig( + name = "tsconfig", + src = "tsconfig-build.json", + deps = [ + "//:node_modules/@types/google.maps", + "//src:build-tsconfig", + ], +) + ng_project( name = "google-maps", srcs = glob( @@ -23,6 +32,7 @@ ng_project( "**/*.spec.ts", ], ), + tsconfig = ":tsconfig", deps = [ "//:node_modules/@angular/common", "//:node_modules/@angular/core", diff --git a/src/google-maps/deprecated-map-marker-clusterer/deprecated-map-marker-clusterer.ts b/src/google-maps/deprecated-map-marker-clusterer/deprecated-map-marker-clusterer.ts index 3c84386e5750..734f9b3310f7 100644 --- a/src/google-maps/deprecated-map-marker-clusterer/deprecated-map-marker-clusterer.ts +++ b/src/google-maps/deprecated-map-marker-clusterer/deprecated-map-marker-clusterer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { AfterContentInit, ChangeDetectionStrategy, diff --git a/src/google-maps/google-map/google-map.ts b/src/google-maps/google-map/google-map.ts index 94b6d2dd8b9e..4c4ae90dd48f 100644 --- a/src/google-maps/google-map/google-map.ts +++ b/src/google-maps/google-map/google-map.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { ChangeDetectionStrategy, Component, diff --git a/src/google-maps/map-advanced-marker/map-advanced-marker.ts b/src/google-maps/map-advanced-marker/map-advanced-marker.ts index 246b955b0815..b21c2401726f 100644 --- a/src/google-maps/map-advanced-marker/map-advanced-marker.ts +++ b/src/google-maps/map-advanced-marker/map-advanced-marker.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Input, OnDestroy, diff --git a/src/google-maps/map-anchor-point.ts b/src/google-maps/map-anchor-point.ts index 1d57c8c6b814..aeb0283aebdf 100644 --- a/src/google-maps/map-anchor-point.ts +++ b/src/google-maps/map-anchor-point.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - export interface MapAnchorPoint { getAnchor(): google.maps.MVCObject | google.maps.marker.AdvancedMarkerElement; } diff --git a/src/google-maps/map-base-layer.ts b/src/google-maps/map-base-layer.ts index e342d2c7cf40..4756efec1bc7 100644 --- a/src/google-maps/map-base-layer.ts +++ b/src/google-maps/map-base-layer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import {Directive, NgZone, OnDestroy, OnInit, inject} from '@angular/core'; import {GoogleMap} from './google-map/google-map'; diff --git a/src/google-maps/map-bicycling-layer/map-bicycling-layer.ts b/src/google-maps/map-bicycling-layer/map-bicycling-layer.ts index 1a647d21530e..47dc1f82915d 100644 --- a/src/google-maps/map-bicycling-layer/map-bicycling-layer.ts +++ b/src/google-maps/map-bicycling-layer/map-bicycling-layer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import {Directive, EventEmitter, NgZone, OnDestroy, OnInit, Output, inject} from '@angular/core'; import {GoogleMap} from '../google-map/google-map'; diff --git a/src/google-maps/map-circle/map-circle.ts b/src/google-maps/map-circle/map-circle.ts index 8b24fef4c73b..e5c029ace825 100644 --- a/src/google-maps/map-circle/map-circle.ts +++ b/src/google-maps/map-circle/map-circle.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, EventEmitter, diff --git a/src/google-maps/map-directions-renderer/map-directions-renderer.ts b/src/google-maps/map-directions-renderer/map-directions-renderer.ts index f2b9d05266df..892975e80232 100644 --- a/src/google-maps/map-directions-renderer/map-directions-renderer.ts +++ b/src/google-maps/map-directions-renderer/map-directions-renderer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, EventEmitter, diff --git a/src/google-maps/map-directions-renderer/map-directions-service.ts b/src/google-maps/map-directions-renderer/map-directions-service.ts index aa4912ca64c8..b9aec16cb1b0 100644 --- a/src/google-maps/map-directions-renderer/map-directions-service.ts +++ b/src/google-maps/map-directions-renderer/map-directions-service.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import {Injectable, NgZone, inject} from '@angular/core'; import {Observable} from 'rxjs'; diff --git a/src/google-maps/map-geocoder/map-geocoder.ts b/src/google-maps/map-geocoder/map-geocoder.ts index 692dbecd0885..412977d0287d 100644 --- a/src/google-maps/map-geocoder/map-geocoder.ts +++ b/src/google-maps/map-geocoder/map-geocoder.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import {Injectable, NgZone, inject} from '@angular/core'; import {Observable} from 'rxjs'; diff --git a/src/google-maps/map-ground-overlay/map-ground-overlay.ts b/src/google-maps/map-ground-overlay/map-ground-overlay.ts index 88a5c6426b61..a57ded92a032 100644 --- a/src/google-maps/map-ground-overlay/map-ground-overlay.ts +++ b/src/google-maps/map-ground-overlay/map-ground-overlay.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, EventEmitter, diff --git a/src/google-maps/map-heatmap-layer/map-heatmap-layer.ts b/src/google-maps/map-heatmap-layer/map-heatmap-layer.ts index ea73b8cffbc8..84030f8d3954 100644 --- a/src/google-maps/map-heatmap-layer/map-heatmap-layer.ts +++ b/src/google-maps/map-heatmap-layer/map-heatmap-layer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Input, OnDestroy, diff --git a/src/google-maps/map-info-window/map-info-window.ts b/src/google-maps/map-info-window/map-info-window.ts index bd6d23a2bea1..f1232e52dc8e 100644 --- a/src/google-maps/map-info-window/map-info-window.ts +++ b/src/google-maps/map-info-window/map-info-window.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, ElementRef, diff --git a/src/google-maps/map-kml-layer/map-kml-layer.ts b/src/google-maps/map-kml-layer/map-kml-layer.ts index 2e9f66f19432..b2459cd4c0e8 100644 --- a/src/google-maps/map-kml-layer/map-kml-layer.ts +++ b/src/google-maps/map-kml-layer/map-kml-layer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, EventEmitter, diff --git a/src/google-maps/map-marker-clusterer/map-marker-clusterer.ts b/src/google-maps/map-marker-clusterer/map-marker-clusterer.ts index 8113ab961e9c..6e8c43667d52 100644 --- a/src/google-maps/map-marker-clusterer/map-marker-clusterer.ts +++ b/src/google-maps/map-marker-clusterer/map-marker-clusterer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { ChangeDetectionStrategy, Component, diff --git a/src/google-maps/map-marker/map-marker.ts b/src/google-maps/map-marker/map-marker.ts index b1d1c22fc164..7eb2db3ca8a3 100644 --- a/src/google-maps/map-marker/map-marker.ts +++ b/src/google-maps/map-marker/map-marker.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Input, OnDestroy, diff --git a/src/google-maps/map-polygon/map-polygon.ts b/src/google-maps/map-polygon/map-polygon.ts index 12642d5edbbe..007e9fac1627 100644 --- a/src/google-maps/map-polygon/map-polygon.ts +++ b/src/google-maps/map-polygon/map-polygon.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, Input, diff --git a/src/google-maps/map-polyline/map-polyline.ts b/src/google-maps/map-polyline/map-polyline.ts index 373467691b59..fc5c048dcfd3 100644 --- a/src/google-maps/map-polyline/map-polyline.ts +++ b/src/google-maps/map-polyline/map-polyline.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, Input, diff --git a/src/google-maps/map-rectangle/map-rectangle.ts b/src/google-maps/map-rectangle/map-rectangle.ts index 29495a9f89ff..b8877bb21dc6 100644 --- a/src/google-maps/map-rectangle/map-rectangle.ts +++ b/src/google-maps/map-rectangle/map-rectangle.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, Input, diff --git a/src/google-maps/map-traffic-layer/map-traffic-layer.ts b/src/google-maps/map-traffic-layer/map-traffic-layer.ts index 87994a311f75..6427c763d260 100644 --- a/src/google-maps/map-traffic-layer/map-traffic-layer.ts +++ b/src/google-maps/map-traffic-layer/map-traffic-layer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import { Directive, EventEmitter, diff --git a/src/google-maps/map-transit-layer/map-transit-layer.ts b/src/google-maps/map-transit-layer/map-transit-layer.ts index bda194e657d3..b4603b9c3b4a 100644 --- a/src/google-maps/map-transit-layer/map-transit-layer.ts +++ b/src/google-maps/map-transit-layer/map-transit-layer.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265 -/// - import {Directive, EventEmitter, NgZone, OnDestroy, OnInit, Output, inject} from '@angular/core'; import {GoogleMap} from '../google-map/google-map'; diff --git a/src/google-maps/tsconfig-build.json b/src/google-maps/tsconfig-build.json new file mode 100644 index 000000000000..ff211bf03b3d --- /dev/null +++ b/src/google-maps/tsconfig-build.json @@ -0,0 +1,6 @@ +{ + "extends": "../bazel-tsconfig-build.json", + "compilerOptions": { + "types": ["google.maps"] + } +} diff --git a/src/google-maps/tsconfig.json b/src/google-maps/tsconfig.json index 10f13e87d57c..3d34fe24db16 100644 --- a/src/google-maps/tsconfig.json +++ b/src/google-maps/tsconfig.json @@ -5,7 +5,7 @@ "rootDir": "..", "baseUrl": ".", "paths": {}, - "types": ["jasmine"] + "types": ["jasmine", "google.maps"] }, "include": ["./**/*.ts", "../dev-mode-types.d.ts"] }