Skip to content

Commit 2d85ec3

Browse files
committed
build: resolve type bundling issues
Updating `@angular/bazel` to `14.0.0-next.15` reveals some issues with type bundling. These changes aim to resolve the issues by moving some code around.
1 parent fb9ff16 commit 2d85ec3

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@angular-devkit/build-angular": "14.0.0-next.12",
7272
"@angular-devkit/core": "14.0.0-next.12",
7373
"@angular-devkit/schematics": "14.0.0-next.12",
74-
"@angular/bazel": "14.0.0-next.14",
74+
"@angular/bazel": "14.0.0-next.15",
7575
"@angular/cli": "14.0.0-next.12",
7676
"@angular/compiler-cli": "14.0.0-next.15",
7777
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#335aad1b04b3d95cd4cb1d719e73b93d4e90cce3",

src/components-examples/material/chips/chips-harness/chips-harness-example.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ import {Component} from '@angular/core';
99
})
1010
export class ChipsHarnessExample {
1111
isDisabled = false;
12-
remove = jasmine.createSpy('remove spy');
13-
add = jasmine.createSpy('add spy');
12+
remove: () => void = jasmine.createSpy('remove spy');
13+
add: () => void = jasmine.createSpy('add spy');
1414
}

src/google-maps/map-marker-clusterer/map-marker-clusterer.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265
1010
/// <reference types="google.maps" />
11-
/// <reference path="marker-clusterer-types.ts" />
1211

1312
import {
1413
AfterContentInit,
@@ -31,6 +30,14 @@ import {takeUntil} from 'rxjs/operators';
3130
import {GoogleMap} from '../google-map/google-map';
3231
import {MapEventManager} from '../map-event-manager';
3332
import {MapMarker} from '../map-marker/map-marker';
33+
import {
34+
AriaLabelFn,
35+
Calculator,
36+
Cluster,
37+
ClusterIconStyle,
38+
MarkerClusterer,
39+
MarkerClustererOptions,
40+
} from './marker-clusterer-types';
3441

3542
/** Default options for a clusterer. */
3643
const DEFAULT_CLUSTERER_OPTIONS: MarkerClustererOptions = {};
@@ -199,7 +206,7 @@ export class MapMarkerClusterer implements OnInit, AfterContentInit, OnChanges,
199206
ngOnInit() {
200207
if (this._canInitialize) {
201208
const clustererWindow = window as unknown as typeof globalThis & {
202-
MarkerClusterer?: MarkerClusterer;
209+
MarkerClusterer?: typeof MarkerClusterer;
203210
};
204211

205212
if (!clustererWindow.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
@@ -214,7 +221,7 @@ export class MapMarkerClusterer implements OnInit, AfterContentInit, OnChanges,
214221
// We'll bring it back in inside the `MapEventManager` only for the events that the
215222
// user has subscribed to.
216223
this._ngZone.runOutsideAngular(() => {
217-
this.markerClusterer = new MarkerClusterer(
224+
this.markerClusterer = new clustererWindow.MarkerClusterer!(
218225
this._googleMap.googleMap!,
219226
[],
220227
this._combineOptions(),

src/google-maps/map-marker-clusterer/marker-clusterer-types.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See
1515
* googlemaps.github.io/v3-utility-library/classes/_google_markerclustererplus.markerclusterer.html
1616
*/
17-
declare class MarkerClusterer {
17+
export declare class MarkerClusterer {
1818
constructor(
1919
map: google.maps.Map,
2020
markers?: google.maps.Marker[],
@@ -93,7 +93,7 @@ declare class MarkerClusterer {
9393
*
9494
* See googlemaps.github.io/v3-utility-library/classes/_google_markerclustererplus.cluster.html
9595
*/
96-
declare class Cluster {
96+
export declare class Cluster {
9797
constructor(markerClusterer: MarkerClusterer);
9898
getCenter(): google.maps.LatLng;
9999
getMarkers(): google.maps.Marker[];
@@ -108,7 +108,7 @@ declare class Cluster {
108108
* googlemaps.github.io/v3-utility-library/classes/
109109
* _google_markerclustererplus.markerclustereroptions.html
110110
*/
111-
declare interface MarkerClustererOptions {
111+
export declare interface MarkerClustererOptions {
112112
ariaLabelFn?: AriaLabelFn;
113113
averageCenter?: boolean;
114114
batchSize?: number;
@@ -136,7 +136,7 @@ declare interface MarkerClustererOptions {
136136
* googlemaps.github.io/v3-utility-library/interfaces/
137137
* _google_markerclustererplus.clustericonstyle.html
138138
*/
139-
declare interface ClusterIconStyle {
139+
export declare interface ClusterIconStyle {
140140
anchorIcon?: [number, number];
141141
anchorText?: [number, number];
142142
backgroundPosition?: string;
@@ -160,7 +160,7 @@ declare interface ClusterIconStyle {
160160
* googlemaps.github.io/v3-utility-library/interfaces/
161161
* _google_markerclustererplus.clustericoninfo.html
162162
*/
163-
declare interface ClusterIconInfo {
163+
export declare interface ClusterIconInfo {
164164
index: number;
165165
text: string;
166166
title: string;
@@ -171,14 +171,14 @@ declare interface ClusterIconInfo {
171171
*
172172
* See googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#arialabelfn
173173
*/
174-
declare type AriaLabelFn = (text: string) => string;
174+
export declare type AriaLabelFn = (text: string) => string;
175175

176176
/**
177177
* Function type alias for calculating how a marker cluster is displayed.
178178
*
179179
* See googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#calculator
180180
*/
181-
declare type Calculator = (
181+
export declare type Calculator = (
182182
markers: google.maps.Marker[],
183183
clusterIconStylesCount: number,
184184
) => ClusterIconInfo;

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@
124124
dependencies:
125125
tslib "^2.3.0"
126126

127-
"@angular/[email protected].14":
128-
version "14.0.0-next.14"
129-
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-14.0.0-next.14.tgz#9ce0649af3c9aa05fd5896b99aa325e3ec078da2"
130-
integrity sha512-eSNX7aRUBNplRxJaZh5WlZp81vlbgx9oO4qSbrv3D7wmftq1sdimycjrpg7gC8vh/zkDid29gZ5m5UI6m0n4AA==
127+
"@angular/[email protected].15":
128+
version "14.0.0-next.15"
129+
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-14.0.0-next.15.tgz#bfaf42c8009e9767879fb8e4775327e449718302"
130+
integrity sha512-IMkqtdYnjspEgkNk5PnoQY5Y5fiQLjuT4C2F3bPWdIVdGRGMXR13AegIF4PtOEFjEFPPOflnY2ocAzaD1wVHKg==
131131
dependencies:
132132
"@microsoft/api-extractor" "7.22.2"
133133
shelljs "^0.8.5"

0 commit comments

Comments
 (0)